radv does a lot of this, so having a central dispatch point will be useful in
case changes are made to this struct in the future
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
VK_DEFINE_NONDISP_HANDLE_CASTS(vk_shader_module, base, VkShaderModule,
VK_OBJECT_TYPE_SHADER_MODULE)
+
+/* this should only be used for stack-allocated, temporary objects */
+#define vk_shader_module_handle_from_nir(_nir) \
+ vk_shader_module_to_handle(&(struct vk_shader_module) { \
+ .base.type = VK_OBJECT_TYPE_SHADER_MODULE, \
+ .nir = _nir, \
+ })
+#define vk_shader_module_from_nir(_nir) \
+ (struct vk_shader_module) { \
+ .base.type = VK_OBJECT_TYPE_SHADER_MODULE, \
+ .nir = _nir, \
+ }
+
#ifdef __cplusplus
}
#endif