pan/midgard: Pass shader stage to disassembler
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 7 Nov 2019 14:31:02 +0000 (09:31 -0500)
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>
Fri, 8 Nov 2019 06:45:03 +0000 (06:45 +0000)
Vertex texturing behaves differently from fragment texturing on some
GPUs.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/disassemble.c
src/panfrost/midgard/disassemble.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/pandecode/decode.c

index 5a1b67a8ff914b51b98036118cd5d1a19e2813b7..718eb9b71a582e9bae6fd68c3f3ecc73c610bd96 100644 (file)
@@ -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;
index 4d685323bae9de2afe8ecf43c9be062d88b9be0b..8f1f52e1f848f8058bdc847cea671f027a924ecd 100644 (file)
@@ -1,4 +1,5 @@
 #include <stddef.h>
+#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);
index 5f369f9a2ef3f7916f1281d124403053e14a2713..1183d11f34926321a69166b08d4f78ef2075593f 100644 (file)
@@ -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;
index 0de1f7c7043da68cc1946399f1d5f92b75d6c3df..6b5ae422ef818d232bb175bd4c3633dee0c48995 100644 (file)
@@ -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 */