radv: Separate option to dump NIR.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Acked-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32079>
This commit is contained in:
@@ -1432,6 +1432,8 @@ RADV driver environment variables
|
||||
Dump mesh shaders.
|
||||
``cs``
|
||||
Dump compute (and ray tracing) shaders.
|
||||
``nir``
|
||||
Dump NIR for selected shader stages.
|
||||
|
||||
.. envvar:: RADV_FORCE_FAMILY
|
||||
|
||||
|
@@ -69,6 +69,7 @@ enum {
|
||||
RADV_DEBUG_DUMP_TASK = 1ull << 53,
|
||||
RADV_DEBUG_DUMP_MESH = 1ull << 54,
|
||||
RADV_DEBUG_DUMP_CS = 1ull << 55,
|
||||
RADV_DEBUG_DUMP_NIR = 1ull << 56,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@@ -82,6 +82,7 @@ static const struct debug_control radv_debug_options[] = {{"nofastclears", RADV_
|
||||
{"task", RADV_DEBUG_DUMP_TASK},
|
||||
{"mesh", RADV_DEBUG_DUMP_MESH},
|
||||
{"cs", RADV_DEBUG_DUMP_CS},
|
||||
{"nir", RADV_DEBUG_DUMP_NIR},
|
||||
{NULL, 0}};
|
||||
|
||||
const char *
|
||||
|
@@ -119,10 +119,14 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str
|
||||
radv_postprocess_nir(device, NULL, cs_stage);
|
||||
|
||||
bool dump_shader = radv_can_dump_shader(device, cs_stage->nir);
|
||||
bool dump_nir = dump_shader && (instance->debug_flags & (RADV_DEBUG_DUMP_NIR | RADV_DEBUG_DUMP_SHADERS));
|
||||
|
||||
if (dump_shader) {
|
||||
simple_mtx_lock(&instance->shader_dump_mtx);
|
||||
nir_print_shader(cs_stage->nir, stderr);
|
||||
|
||||
if (dump_nir) {
|
||||
nir_print_shader(cs_stage->nir, stderr);
|
||||
}
|
||||
}
|
||||
|
||||
char *nir_string = NULL;
|
||||
|
@@ -2340,10 +2340,15 @@ radv_graphics_shaders_nir_to_asm(struct radv_device *device, struct vk_pipeline_
|
||||
for (unsigned i = 0; i < shader_count; ++i)
|
||||
dump_shader |= radv_can_dump_shader(device, nir_shaders[i]);
|
||||
|
||||
bool dump_nir = dump_shader && (instance->debug_flags & (RADV_DEBUG_DUMP_NIR | RADV_DEBUG_DUMP_SHADERS));
|
||||
|
||||
if (dump_shader) {
|
||||
simple_mtx_lock(&instance->shader_dump_mtx);
|
||||
for (uint32_t i = 0; i < shader_count; i++)
|
||||
nir_print_shader(nir_shaders[i], stderr);
|
||||
|
||||
if (dump_nir) {
|
||||
for (uint32_t i = 0; i < shader_count; i++)
|
||||
nir_print_shader(nir_shaders[i], stderr);
|
||||
}
|
||||
}
|
||||
|
||||
char *nir_string = NULL;
|
||||
|
@@ -435,13 +435,17 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache,
|
||||
}
|
||||
|
||||
bool dump_shader = radv_can_dump_shader(device, shaders[0]);
|
||||
bool dump_nir = dump_shader && (instance->debug_flags & (RADV_DEBUG_DUMP_NIR | RADV_DEBUG_DUMP_SHADERS));
|
||||
bool replayable =
|
||||
pipeline->base.base.create_flags & VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR;
|
||||
|
||||
if (dump_shader) {
|
||||
simple_mtx_lock(&instance->shader_dump_mtx);
|
||||
for (uint32_t i = 0; i < num_shaders; i++)
|
||||
nir_print_shader(shaders[i], stderr);
|
||||
|
||||
if (dump_nir) {
|
||||
for (uint32_t i = 0; i < num_shaders; i++)
|
||||
nir_print_shader(shaders[i], stderr);
|
||||
}
|
||||
}
|
||||
|
||||
char *nir_string = NULL;
|
||||
|
Reference in New Issue
Block a user