[reader] Fix implicit flat for structs
The spir-v parser currently adds the flat decoration to vertex shader
outputs that are integer scalar or vector. It does the same with struct
members that have a location decoration on the member.
However, it does not handle the case where the location decoration is on
the variable, and there is an integer inside the struct. This is fixed
by adding the flat decoration to members of the variable's type when the
variable has a location decoration.
We do not handle the case of nested structs:
```glsl
struct T { int i; };
struct S { T t; };
layout(location = 0) in T in_var;
This is rejected by glslang, even if the straightforward translation to
spir-v is valid. See
https://github.com/KhronosGroup/Vulkan-Docs/issues/2770. In DXC, the
members of the structs are separated into individual variables, so that
case will not come up either.
Fixes: 525572465
Change-Id: Id62f89ca5fa5253cad85a582efac52bdb6acadc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/324015
Auto-Submit: Steven Perron <stevenperron@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Steven Perron <stevenperron@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.