-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
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
WGSL: Nested structures are not allowed for entry point IO #5226
Comments
@csyonghe The GLSL output seems to get rid of this kind of nesting. Does a similar restriction apply to GLSL? |
I think I found he passage that forbids nesting of input structures "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. |
@csyonghe If this exists as a common pass somewhere, could you point me at the code for that? |
I think we either need to run The issue I am seeing is that there may be things in legalizeEntryPointForGLSL that is not necessary for wgsl. So the TLDR is there may not be a directly reusable pass, but what is in slang-ir-glsl-legalize.cpp should be something close to what we want. |
I think there is one more problem for this test.
I think |
After debugging a bit, I found that this comment is exactly what the issue is. |
I like to share a bit of update. |
In this case, the logic we want is probably closer to the legalization for metal than for glsl. |
Although the failing test is under There are two reasons why the test is failing, but both of them comes down to the fact that we are not properly handling "varying input" yet.
I created a separate issue for the first problem, For the second problem, WGSL prevents any varying inputs from being nested.
The problem is limited to the case where a varying input is included as a nesting. Since compute shader cannot take "varying input", I don't think this test is for compute shader. |
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: