diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index e120c37f19c..af4652b30f4 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -564,6 +564,8 @@ nir_builder PRINTFLIKE(2, 3) radv_meta_init_shader(gl_shader_stage stage, const va_end(args); } + b.shader->info.internal = true; + return b; } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 368586b466a..00731ea074f 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -103,6 +103,12 @@ radv_get_nir_options(struct radv_physical_device *device) }; } +static bool +is_meta_shader(nir_shader *nir) +{ + return nir && nir->info.internal; +} + bool radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module, bool meta_shader) @@ -110,7 +116,8 @@ radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS)) return false; if (module) - return !module->nir || (device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS); + return !is_meta_shader(module->nir) || + (device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS); return meta_shader; } @@ -119,7 +126,8 @@ bool radv_can_dump_shader_stats(struct radv_device *device, struct vk_shader_module *module) { /* Only dump non-meta shader stats. */ - return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS && module && !module->nir; + return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS && module && + !is_meta_shader(module->nir); } void @@ -898,7 +906,7 @@ radv_consider_culling(struct radv_device *device, struct nir_shader *nir, uint64 unsigned num_vertices_per_primitive, const struct radv_shader_info *info) { /* Culling doesn't make sense for meta shaders. */ - if (!!nir->info.name) + if (is_meta_shader(nir)) return false; /* We don't support culling with multiple viewports yet. */ @@ -1787,7 +1795,7 @@ shader_compile(struct radv_device *device, struct vk_shader_module *module, options->address32_hi = device->physical_device->rad_info.address32_hi; options->has_ls_vgpr_init_bug = device->physical_device->rad_info.has_ls_vgpr_init_bug; options->enable_mrt_output_nan_fixup = - module && !module->nir && options->key.ps.enable_mrt_output_nan_fixup; + module && !is_meta_shader(module->nir) && options->key.ps.enable_mrt_output_nan_fixup; options->adjust_frag_coord_z = device->adjust_frag_coord_z; options->has_image_load_dcc_bug = device->physical_device->rad_info.has_image_load_dcc_bug; options->debug.func = radv_compiler_debug;