};
}
+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)
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;
}
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
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. */
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;