radv: drop the module reference in radv_can_dump_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
This commit is contained in:
@@ -4410,8 +4410,10 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout
|
||||
}
|
||||
|
||||
for (int i = 0; i < MESA_VULKAN_SHADER_STAGES; ++i) {
|
||||
if (radv_can_dump_shader(device, modules[i], false))
|
||||
nir_print_shader(nir[i], stderr);
|
||||
if (nir[i]) {
|
||||
if (radv_can_dump_shader(device, nir[i], false))
|
||||
nir_print_shader(nir[i], stderr);
|
||||
}
|
||||
}
|
||||
|
||||
if (modules[MESA_SHADER_GEOMETRY] && !pipeline_has_ngg) {
|
||||
|
@@ -123,16 +123,16 @@ is_meta_shader(nir_shader *nir)
|
||||
}
|
||||
|
||||
bool
|
||||
radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module,
|
||||
bool meta_shader)
|
||||
radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shader)
|
||||
{
|
||||
if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
|
||||
return false;
|
||||
if (module)
|
||||
return !is_meta_shader(module->nir) ||
|
||||
(device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS);
|
||||
|
||||
return meta_shader;
|
||||
if ((is_meta_shader(nir) || meta_shader) &&
|
||||
!(device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -1956,7 +1956,7 @@ shader_compile(struct radv_device *device, struct vk_shader_module *module,
|
||||
options->family = chip_family;
|
||||
options->chip_class = device->physical_device->rad_info.chip_class;
|
||||
options->info = &device->physical_device->rad_info;
|
||||
options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader || trap_handler_shader);
|
||||
options->dump_shader = radv_can_dump_shader(device, shaders[0], gs_copy_shader || trap_handler_shader);
|
||||
options->dump_preoptir =
|
||||
options->dump_shader && device->instance->debug_flags & RADV_DEBUG_PREOPTIR;
|
||||
options->record_ir = keep_shader_info;
|
||||
|
@@ -579,8 +579,7 @@ const char *radv_get_shader_name(const struct radv_shader_info *info, gl_shader_
|
||||
unsigned radv_compute_spi_ps_input(const struct radv_device *device,
|
||||
const struct radv_shader_info *info);
|
||||
|
||||
bool radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module,
|
||||
bool meta_shader);
|
||||
bool radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shader);
|
||||
|
||||
bool radv_can_dump_shader_stats(struct radv_device *device, struct vk_shader_module *module);
|
||||
|
||||
|
Reference in New Issue
Block a user