diff --git a/src/intel/dev/intel_debug.c b/src/intel/dev/intel_debug.c index 5a437428ea1..41c36e3b52d 100644 --- a/src/intel/dev/intel_debug.c +++ b/src/intel/dev/intel_debug.c @@ -117,6 +117,7 @@ static const struct debug_control debug_control[] = { { "shader-print", DEBUG_SHADER_PRINT }, { "cl-quiet", DEBUG_CL_QUIET }, { "no-send-gather", DEBUG_NO_SEND_GATHER }, + { "shaders-lineno", DEBUG_SHADERS_LINENO }, { NULL, 0 } }; diff --git a/src/intel/dev/intel_debug.h b/src/intel/dev/intel_debug.h index 7625c4bda1a..bc97b71498e 100644 --- a/src/intel/dev/intel_debug.h +++ b/src/intel/dev/intel_debug.h @@ -108,6 +108,7 @@ extern uint64_t intel_debug; #define DEBUG_BVH_NO_BUILD (1ull << 60) #define DEBUG_NO_SEND_GATHER (1ull << 61) #define DEBUG_RT_NO_TRACE (1ull << 62) +#define DEBUG_SHADERS_LINENO (1ull << 63) #define DEBUG_ANY (~0ull) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 461cb3e5b21..dc0e6799cfb 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -22,6 +22,7 @@ */ #include "anv_private.h" +#include "compiler/brw_disasm.h" #include "genxml/gen80_pack.h" static bool @@ -85,6 +86,12 @@ upload_blorp_shader(struct blorp_batch *batch, uint32_t stage, */ anv_shader_bin_unref(device, bin); + if (INTEL_DEBUG(DEBUG_SHADERS_LINENO)) { + brw_disassemble_with_lineno(&device->physical->compiler->isa, + stage, -1, 0, kernel, 0, + bin->kernel.offset, stderr); + } + *kernel_out = bin->kernel.offset; *(const struct brw_stage_prog_data **)prog_data_out = bin->prog_data; diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index f1d16b0583b..78204082d72 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -1695,6 +1695,13 @@ anv_pipeline_add_executable(struct anv_pipeline *pipeline, free(stream_data); } + if (INTEL_DEBUG(DEBUG_SHADERS_LINENO) && stage->code) { + brw_disassemble_with_lineno(&pipeline->device->physical->compiler->isa, + stage->stage, (int)stats->dispatch_width, + stage->source_hash, stage->code, code_offset, + stage->bin->kernel.offset, stderr); + } + const struct anv_pipeline_executable exe = { .stage = stage->stage, .stats = *stats,