summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-11-07 09:31:02 -0500
committerTomeu Vizoso <[email protected]>2019-11-08 06:45:03 +0000
commitac14facf7a181a2221ab5626c8628bd833ceea8e (patch)
tree6434f602d196d17676a4164c41e58a365b221526 /src
parent515941202d13898b99c4a08b2d0df119a0e1d05e (diff)
pan/midgard: Pass shader stage to disassembler
Vertex texturing behaves differently from fragment texturing on some GPUs. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/disassemble.c2
-rw-r--r--src/panfrost/midgard/disassemble.h3
-rw-r--r--src/panfrost/midgard/midgard_compile.c2
-rw-r--r--src/panfrost/pandecode/decode.c4
4 files changed, 7 insertions, 4 deletions
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 <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);
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 */