From: Alyssa Rosenzweig Date: Thu, 7 Nov 2019 14:31:02 +0000 (-0500) Subject: pan/midgard: Pass shader stage to disassembler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac14facf7a181a2221ab5626c8628bd833ceea8e;p=mesa.git pan/midgard: Pass shader stage to disassembler Vertex texturing behaves differently from fragment texturing on some GPUs. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index 5a1b67a8ff9..718eb9b71a5 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -1464,7 +1464,7 @@ print_texture_word(uint32_t *word, unsigned tabs) } struct midgard_disasm_stats -disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id) +disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id, gl_shader_stage stage) { uint32_t *words = (uint32_t *) code; unsigned num_words = size / 4; diff --git a/src/panfrost/midgard/disassemble.h b/src/panfrost/midgard/disassemble.h index 4d685323bae..8f1f52e1f84 100644 --- a/src/panfrost/midgard/disassemble.h +++ b/src/panfrost/midgard/disassemble.h @@ -1,4 +1,5 @@ #include +#include "compiler/shader_enums.h" struct midgard_disasm_stats { /* Counts gleaned from disassembly, or negative if the field cannot be @@ -23,4 +24,4 @@ struct midgard_disasm_stats { }; struct midgard_disasm_stats -disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id); +disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id, gl_shader_stage stage); diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 5f369f9a2ef..1183d11f349 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2697,7 +2697,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga program->tls_size = ctx->tls_size; if (midgard_debug & MIDGARD_DBG_SHADERS) - disassemble_midgard(program->compiled.data, program->compiled.size, gpu_id); + disassemble_midgard(program->compiled.data, program->compiled.size, gpu_id, ctx->stage); if (midgard_debug & MIDGARD_DBG_SHADERDB) { unsigned nr_bundles = 0, nr_ins = 0; diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 0de1f7c7043..6b5ae422ef8 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -1860,7 +1860,9 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type, stats.quadword_count = 0; stats.helper_invocations = false; } else { - stats = disassemble_midgard(code, sz, gpu_id); + stats = disassemble_midgard(code, sz, gpu_id, + type == JOB_TYPE_TILER ? + MESA_SHADER_FRAGMENT : MESA_SHADER_VERTEX); } /* Print shader-db stats */