-
Notifications
You must be signed in to change notification settings - Fork 713
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
SPIRV validation error when using min16 types get d #6914
Comments
You can add the |
To generate a reproducer, you could also try -fcgl. This will turn off all optimizations. If this passes validation, you can run the optimizations from the command line and use spirv-reduce to get a small reproducer. I'll give more details on Monday. |
Hi Steven. This is very useful, thanks! I can tell exactly what statement is introducing the error now, but it's a bit of a mystery why this is happening, because it's present in all variants of the same shader and not all of them have this issue.
The duplicate decoration appears conspicuously out of place:
I tried with
However, I've also confirmed that the problem still exists in the latest dxc release: dxcompiler.dll: 1.8 - 1.8.2407.7 (416fab6); dxil.dll: 1.8(101.8.2407.12) Digging a bit more, it seems the problem is caused by that statement being in an unrolled loop where the iteration count depends on an expression that's known at compile time.
Removing the I've got a workaround that avoid the issue, but I'd be happy to dig more in order to get to the root of the problem. |
Here are the step I would take to reduce the tests case:
You can look at the last line of the form
The final reduced.spv, should be a much smaller test case that hopefully you can provide me. I should be able to get a fix from that. |
Here's a reduced repro: bugreport.zip Let me know if you need anything else! |
This is a bug in the spirv-opt unroller, so it should be fixed. There is a workaround in most cases (do not mark the loop as unroll), so we will probably not get to it this release. I'll move to the next right away. |
What's the status of this issue? I recently noticed that similar problems also occur on all spirv-opt versions distributed with recent Vulkan SDKs. The most recent Vulkan SDK that doesn't have this problem is version 1.3.280, although in this case it seems to occur in other scenarios that do not involve loop unrolling. Some of my clients have also run into the same problem independently, although I don't think they have reported it. |
Description
Compiling one of our HLSL shaders with the following command line:
Produces this error:
Which seems to be caused by the following spirv validation code:
https://github.com/KhronosGroup/SPIRV-Tools/blob/4451f6ab13dda98bf255a7cd7b4d120132dc0dfd/source/val/validate_decorations.cpp#L1562
I know this report would be much more useful with source code to reproduce the problem, but I'm not able to publish this shader openly and I haven't been able to produce a minimal repro yet.
Before I start debugging this myself, it would be helpful to know if there's any command line option to have DXC output the spv file even though validation failed. Inspecting the spv file may be helpful to understand what part of the code is causing the issue and possibly build a simplified repro.
Environment
The text was updated successfully, but these errors were encountered: