summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyunjun Ko <[email protected]>2018-08-30 11:58:54 +0900
committerRob Clark <[email protected]>2018-09-05 13:38:43 -0400
commit2454742a8447ef021bfbb17f1e87e59bc8cbfcb6 (patch)
tree80632b80bebf5a30014f1af605ddb1cfbb802fef
parentb4da2f6667e8fcdd4f8fdd45f3859e036a3b855c (diff)
freedreno/ir3: insert mov if same instruction in the outputs.
For example, result0 = texture(sampler[indexBase + 5], coords); result1 = texture(sampler[indexBase + 0], coords); result2 = texture(sampler[indexBase + 0], coords); out_result0 = result0; out_result1 = result1; out_result2 = result2; In this kind of case we need to insert an extra mov to the outputs so that the result could be assigned to each register respectively. Signed-off-by: Rob Clark <[email protected]>
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 21b2a8b6d22..79314140d87 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -3679,6 +3679,20 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
ir3_cp(ir, so);
+ /* Insert mov if there's same instruction for each output.
+ * eg. dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_expression.vertex.sampler2dshadow
+ */
+ for (int i = ir->noutputs - 1; i >= 0; i--) {
+ if (!ir->outputs[i])
+ continue;
+ for (unsigned j = 0; j < i; j++) {
+ if (ir->outputs[i] == ir->outputs[j]) {
+ ir->outputs[i] =
+ ir3_MOV(ir->outputs[i]->block, ir->outputs[i], TYPE_F32);
+ }
+ }
+ }
+
if (fd_mesa_debug & FD_DBG_OPTMSGS) {
printf("BEFORE GROUPING:\n");
ir3_print(ir);