Module: Mesa
Branch: master
Commit: b0af66bb172c803c08b73e705822c3d53f5191f5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0af66bb172c803c08b73e705822c3d53f5191f5

Author: Neil Roberts <[email protected]>
Date:   Tue Jan 16 19:47:07 2018 +0100

spirv/nir: Fix the stream ID when emitting a primitive or vertex

It looks like it was previously taking the SPIR-V instruction number
directly instead of looking up the constant value.

v2: use vtn_constant_value helper (Jason)

Reviewed-by: Jason Ekstrand <[email protected]>

---

 src/compiler/spirv/spirv_to_nir.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/compiler/spirv/spirv_to_nir.c 
b/src/compiler/spirv/spirv_to_nir.c
index 7e3a6d6e88..f0a5fae4a6 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3218,9 +3218,12 @@ vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode,
 
       switch (opcode) {
       case SpvOpEmitStreamVertex:
-      case SpvOpEndStreamPrimitive:
-         nir_intrinsic_set_stream_id(intrin, w[1]);
+      case SpvOpEndStreamPrimitive: {
+         unsigned stream = vtn_constant_value(b, w[1])->values[0].u32[0];
+         nir_intrinsic_set_stream_id(intrin, stream);
          break;
+      }
+
       default:
          break;
       }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to