[Mesa-dev] [PATCH 08/15] spirv/nir: Fix the stream ID when emitting a primitive or vertex
Jason Ekstrand
jason at jlekstrand.net
Fri Jul 20 16:38:31 UTC 2018
On Fri, Jul 20, 2018 at 8:09 AM Alejandro PiƱeiro <apinheiro at igalia.com>
wrote:
> 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];
>
There's a vtn_constant_value helper now which would make this a bit
shorter. It may not have existed when Neil first drafted this patch. With
that update,
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
> + nir_intrinsic_set_stream_id(intrin, stream);
> break;
> + }
> +
> default:
> break;
> }
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180720/72523703/attachment-0001.html>
More information about the mesa-dev
mailing list