-
Notifications
You must be signed in to change notification settings - Fork 755
[SPIR-V]Raytracing shader no longer compiles with latest releast compiler #7164
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
Comments
Here the reported error message: fatal error : generated SPIR-V is invalid: [VUID-StandaloneSpirv-OpTypeImage-06924] Cannot store to OpTypeImage, OpTypeSampler, OpTypeSampledImage, or OpTypeAccelerationStructureKHR objects note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible |
@Clothoid1 I am unable to reproduce the problem. The latest works: https://godbolt.org/z/5djK138dM. Compiler explorer does not have v1.8.2502 yet, but I built it myself on Linux. I cannot reproduce the problem. I'll try reproducing on Windows. |
I can reproduce the issue if I use the prebuilt |
@pow2clk Can you help out with this? If I
I am not able to reproduce the problem. However, if I download the prebuilt binaries from https://github.com/microsoft/DirectXShaderCompiler/releases/tag/v1.8.2502, I can. Looking at the code produced by the two, it seems to me that some spirv-opt optimizations are not running. I'm guessing this is because an older version of spirv-tools was used to build the prebuilt one. That version may not know about some extensions that DXC started using. How can we check which commit was used for the prebuilt version? |
I was able to repro on a Windows machine by running the below:
The release branch, at this point, has the SPIRV-Tools submodule checked out on @s-perron , would you be able to double check the commit that the SPIRV-Tools submodule is "HEAD DETACHED" on, and describe how exactly you checked out the v1.8.2502 tag? |
I must have had something that case stopping the submodule from getting updated properly last time. I can reproduce the problem. This is a duplicate of #7063. The solution would be to update SPIRV-Tools in the release branch. A work around is to add The cause of the problem is the validator is now checking for stores of these opaque types. The SPIR-V generated with previous release was also invalid. |
I opened a draft pr with a minimal fix. I update spirv-tools to just the commits needed to fix this issue. Note that this will not fix all of the issues related to this new validation check. See #7181. The lit tests will fail because new validation check were added. This could lead to other issues like this. I think we should close this issue for these reasons:
If you need a release of DXC for SPIR-V, you can also try to Vulkan SDK. It is released more often, and the latest one will include a fix for this issue. |
Agree with @s-perron. |
Description
When installing the latest DXC compiler release for February 2025, we noticed that our raytracing shaders no longer compile. Below you find a simpl,e reprocuder for this issue.
The rootcause seems to be that in a raytracing shader it is no longer possible to pass a RaytracingAccelerationStructure to a method and then use this structure in a TraceRay() call.
Interestingly passing such a structure is not a problem at all when using it in a compute shader, it only ssems to be problematic in a raytracing shader.
Steps to Reproduce
Actual Behavior
when compiling the reproducer with
dxc.exe -HV 2021 -O0 -Zi -spirv -T lib_6_4 -fvk-use-scalar-layout -enable-16bit-types -fspv-target-env=vulkan1.2
the compiler reports an error message that the generated spir-v code is invalid and asks for a reproducer.
Environment
The text was updated successfully, but these errors were encountered: