We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue was split from #5173.
Affected tests under tests/compute (currently excluded):
tests/compute
compile-time-loop
Output from slang-test, for compile-time-loop:
... WGPU error: Error while parsing WGSL: :38:6 error: nested structures cannot be used for entry point IO assembledVertex_0 : AssembledVertex_0, ^^^^^^^^^^^^^^^^^ :42:1 note: while analyzing entry point 'vertexMain' fn vertexMain( input_0 : VertexStageInput_0) -> VertexStageOutput_0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ { ^ var output_0 : VertexStageOutput_0; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ output_0.coarseVertex_0.color_0 = input_0.assembledVertex_0.color_1; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ var _S2 : vec4<f32> = (((vec4<f32>(input_0.assembledVertex_0.position_0, 1.0f)) * (unpackStorage_0(Uniforms_0.modelViewProjection_0)))); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ output_0.sv_position_0 = _S2; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ output_0.coarseVertex_0.uv_0 = input_0.assembledVertex_0.uv_1; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return output_0; ^^^^^^^^^^^^^^^^^^^^ } ^ - While validating [ShaderModuleDescriptor] - While calling [Device].CreateShaderModule([ShaderModuleDescriptor]). ...
Generated WGSL for slangc -o test.wgsl -target wgsl -stage vertex -entry vertexMain %SLANG_SRC%\tests\compute\compile-time-loop.slang:
slangc -o test.wgsl -target wgsl -stage vertex -entry vertexMain %SLANG_SRC%\tests\compute\compile-time-loop.slang
... struct AssembledVertex_0 { position_0 : vec3<f32>, color_1 : vec3<f32>, uv_1 : vec2<f32>, }; struct VertexStageInput_0 { assembledVertex_0 : AssembledVertex_0, }; @vertex fn vertexMain( input_0 : VertexStageInput_0) -> VertexStageOutput_0 { var output_0 : VertexStageOutput_0; output_0.coarseVertex_0.color_0 = input_0.assembledVertex_0.color_1; output_0.sv_position_0 = (((vec4<f32>(input_0.assembledVertex_0.position_0, 1.0f)) * (unpackStorage_0(Uniforms_0.modelViewProjection_0)))); output_0.coarseVertex_0.uv_0 = input_0.assembledVertex_0.uv_1; return output_0; } ...
The text was updated successfully, but these errors were encountered:
@csyonghe The GLSL output seems to get rid of this kind of nesting. Does a similar restriction apply to GLSL?
Sorry, something went wrong.
I think I found he passage that forbids nesting of input structures in the section on entry point declarations (https://www.w3.org/TR/WGSL/#entry-point-decl):
"The type of each formal parameter, and the entry point’s return type, must be one of: ... a structure whose member types are any of bool, numeric scalar, or numeric vector. ..."
Maybe we can re-use the same legalization pass that's used for GLSL to fix this WGSL issue.
aleino-nv
No branches or pull requests
This issue was split from #5173.
Affected tests under
tests/compute
(currently excluded):compile-time-loop
Output from slang-test, for
compile-time-loop
:Generated WGSL for
slangc -o test.wgsl -target wgsl -stage vertex -entry vertexMain %SLANG_SRC%\tests\compute\compile-time-loop.slang
:The text was updated successfully, but these errors were encountered: