Validation: Unexpected varying type Array in GLSL vertex shaders using gl builtin output #2168
Labels
area: validation
Issues related to validation, diagnostics, and error handling
needs information
Further information is requested
Description
When creating a vertex shader module from GLSL -> SpirV (using shaderc) causes warning (before #1983 was an error which did not affect program execution), when shader accesss (r/w/rw) any of the builtin
gl_Position
,gl_PointSize
,gl_ClipDistance
,gl_CullDistance
.wgpu_core::validation: Unexpected varying type: Array { base: [1], size: Constant([n]), stride: 4 }
This may be related to #1427. The reason I am opening a new issue is because I am hoping with the additional information this may be able to be fixed on the validation side.
Repro steps
Additional notes
OpTypeArray
when using GL builtingl_PerVertex
interface block This warning can be circumvented by a redeclaration ofgl_PerVertex
before compiling to SpirV. Specifically, the effect this has on SpirV is removing the following blockgl_ClipDistance
andgl_CullDistance
. This is how I am resolving the warning in my own projects:Minimal reproducible code:
Minimal workaround code:
Platform
Win 11/Linux, Dx12/Vulkan/Gl, wgpu 0.8~0.11
The text was updated successfully, but these errors were encountered: