[Mesa-dev] [PATCH 08/15] spirv/nir: Fix the stream ID when emitting a primitive or vertex
Alejandro PiƱeiro
apinheiro at igalia.com
Fri Jul 20 15:08:37 UTC 2018
From: Neil Roberts <nroberts at igalia.com>
It looks like it was previously taking the SPIR-V instruction number
directly instead of looking up the constant value.
---
src/compiler/spirv/spirv_to_nir.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 4d297e60b60..2fef6b0bf15 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3219,9 +3219,14 @@ 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: {
+ struct vtn_value *stream_value =
+ vtn_value(b, w[1], vtn_value_type_constant);
+ unsigned stream = stream_value->constant->values[0].u32[0];
+ nir_intrinsic_set_stream_id(intrin, stream);
break;
+ }
+
default:
break;
}
--
2.14.1
More information about the mesa-dev
mailing list