-
Notifications
You must be signed in to change notification settings - Fork 570
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
spriv-cross no longer generates "vertex void" calls for vertex shaders with no outputs. #2261
Comments
My workaround for now, is to use new glslc and new spriv-opt, and the old spirv-cross for MSL codegen. But I'd like to use a spirv-cross newer than 6/20. |
I'm trying to isolate all this, bug we also have this. This isn't referenced in the code, and the old spriv-cross detected this wasn't used, and kept the "vertex void". The new one adds this in, and then produces an uninitialized gl_Position. So I'm going to add a define to strip this code, but seems like this should be detected as unused and not change the VS signature.
Indeed that fixed the issue. So we have a workaround for this. But this and other outputs may be unreferenced and not stripped from the output and cause issue. |
Do you have a concrete SPIR-V reproducer? I tried compiling that GLSL (added #version 450 and replaced DescriptorSet to 0), got
|
I will try to isolate this code and send a repro. But it may be a few weeks. We did have code setting point size, that that was in the same struct. But #ifdef'ing out the struct fixed our return values. |
This is a spirv-cross issue. The older version (6/20) did the correct transpile to "vertex void". The new version always generats "vertex vsmain_out". vsmain_out contains a gl_Position, but that is never initialized, and then just return from the vertex shader. Then that's enough to freak out Metal trying to run this with rasterization disabled. We have a VS with no PS, and set Metal's RasterizationEnabled to false.
This is the error returned by Metal.
I'd reported this here, but then found this thread. Is there something we can set to get this behavior back like in the old spriv-cross.
KhronosGroup/SPIRV-Tools#5525
The correct test for this is a shader that never uses gl_Position in the GLSL body, and so should not generate any output. We write directly into the SSBO buffer. The code above is not the correct test case, since it has a VS and PS and is using gl_Position. Hopefully this is enough to demonstrate a shader without using rasterization and gl_position.
Test.vert.glsl, we're using 450core as the source version type.
The text was updated successfully, but these errors were encountered: