[Mesa-dev] [PATCH 06/15] spirv/nir: allow Stream decoration for structs too

Jason Ekstrand jason at jlekstrand.net
Fri Jul 20 16:34:57 UTC 2018


I think it would be better to squash 5 and 6.  With that,

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Fri, Jul 20, 2018 at 8:08 AM Alejandro PiƱeiro <apinheiro at igalia.com>
wrote:

> From SPIR-V 1.0 spec, section 3.20, "Decoration":
>
>    "Stream
>     Apply to an object or a member of a structure type. Indicates the
>     stream number to put an output on."
>
> Note the "or", so that means that it is allowed for both a full struct
> or a membef or a struct (although the wording is not really ideal, and
> somewhat error-prone, imho).
>
> We found this with some Geometry Streams tests for ARB_gl_spirv, where
> the full gl_PerVertex is assigned Stream 0 (default value on OpenGL
> for gl_PerVertex).
> ---
>  src/compiler/spirv/spirv_to_nir.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index f9abd48261e..238298a8340 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -847,7 +847,6 @@ type_decoration_cb(struct vtn_builder *b,
>     case SpvDecorationNonWritable:
>     case SpvDecorationNonReadable:
>     case SpvDecorationUniform:
> -   case SpvDecorationStream:
>     case SpvDecorationLocation:
>     case SpvDecorationComponent:
>     case SpvDecorationOffset:
> @@ -857,6 +856,14 @@ type_decoration_cb(struct vtn_builder *b,
>                 spirv_decoration_to_string(dec->decoration));
>        break;
>
> +   case SpvDecorationStream:
> +      /* We don't need to do anything here, as stream is filled up when
> +       * aplying the decoration to a variable, just check that if it is
> not a
> +       * struct member, it should be a struct.
> +       */
> +      vtn_assert(type->base_type == vtn_base_type_struct);
> +      break;
> +
>     case SpvDecorationRelaxedPrecision:
>     case SpvDecorationSpecId:
>     case SpvDecorationInvariant:
> --
> 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/fb1d7b87/attachment.html>


More information about the mesa-dev mailing list