[Mesa-dev] [PATCH 2/7] nir/spirv: propagate constants of GroupNonUniformQuad instructions and eliminate warning

Daniel Schürmann daniel.schuermann at campus.tu-berlin.de
Thu Mar 8 17:10:39 UTC 2018


---
 src/compiler/spirv/vtn_subgroup.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/compiler/spirv/vtn_subgroup.c b/src/compiler/spirv/vtn_subgroup.c
index bd3143962b..73420b7e43 100644
--- a/src/compiler/spirv/vtn_subgroup.c
+++ b/src/compiler/spirv/vtn_subgroup.c
@@ -261,7 +261,9 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
    case SpvOpGroupNonUniformQuadBroadcast:
       vtn_build_subgroup_instr(b, nir_intrinsic_quad_broadcast,
                                val->ssa, vtn_ssa_value(b, w[4]),
-                               vtn_ssa_value(b, w[5])->def, 0, 0);
+                               vtn_ssa_value(b, w[5])->def,
+                               vtn_constant_value(b, w[5])->values[0].u32[0],
+                               0);
       break;
 
    case SpvOpGroupNonUniformQuadSwap: {
@@ -277,9 +279,11 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
       case 2:
          op = nir_intrinsic_quad_swap_diagonal;
          break;
+      default:
+         vtn_fail("Invalid constant value in OpGroupNonUniformQuadSwap");
       }
       vtn_build_subgroup_instr(b, op, val->ssa, vtn_ssa_value(b, w[4]),
-                               NULL, 0, 0);
+                               NULL, direction, 0);
       break;
    }
 
-- 
2.14.1



More information about the mesa-dev mailing list