summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-21 14:04:05 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-22 12:54:16 -0700
commit139708bbabdc1897579b40a83d559cea28946290 (patch)
tree0a0f260201432a4f41c2a1c581f6a4ea8eb45041
parentded9a68d8f3c38f2aa951f45bd0a2335bcd53c8a (diff)
pan/decode: Validate blend shaders don't access I/O
We could do better by forcing the checks to *equal* zero (right now, an indeterminate answer will pass the checks), but this is a start to guard against some egregious cases. Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/panfrost/pandecode/decode.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 7c8c5ca95c0..1b88bbb12e8 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -2114,8 +2114,27 @@ pandecode_vertex_tiler_postfix_pre(
else
shader = pandecode_midgard_blend_mrt(blend_base, job_no, i);
- if (shader & ~0xF)
- pandecode_shader_disassemble(shader, job_no, job_type, false, 0);
+ if (shader & ~0xF) {
+ struct midgard_disasm_stats stats =
+ pandecode_shader_disassemble(shader, job_no, job_type, false, 0);
+
+ bool has_texture = (stats.texture_count > 0);
+ bool has_sampler = (stats.sampler_count > 0);
+ bool has_attribute = (stats.attribute_count > 0);
+ bool has_varying = (stats.varying_count > 0);
+ bool has_uniform = (stats.uniform_count > 0);
+ bool has_ubo = (stats.uniform_buffer_count > 0);
+
+ if (has_texture || has_sampler)
+ pandecode_msg("XXX: blend shader accessing textures\n");
+
+ if (has_attribute || has_varying)
+ pandecode_msg("XXX: blend shader accessing interstage\n");
+
+ if (has_uniform || has_ubo)
+ pandecode_msg("XXX: blend shader accessing uniforms\n");
+ }
+
}
}