-
Notifications
You must be signed in to change notification settings - Fork 984
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
RenderPass.setPushConstant broken on Dx12 #6558
Comments
I think this is because HLSL doesn't support arrays for root constants. I would have thought we'd get an error but it seems the shader is being miscompiled and we are indexing the internal vec4s and getting the first element? |
I changed the code so that `let count = 8, and modified the shaders to be:
and
Everything worked fine on all platforms. I'm not sure what to do with this bug. Is it a validator bug, and arrays shouldn't be allowed in push constants? Can we have platform-specific validator bugs, where arrays are just not allowed in DX12 push constants? In any case, it's good to have a better understanding of what's going on. |
I think this is actually a bug in our HLSL backend, we should work around the HLSL limitation. |
Aha! This is an FXC bug. I was wondering how our CI wasn't broken and how WARP wasn't broken, but locally it was and that is one major differences between the environments. Setting |
from Microsoft docs in previous comment #6558 (comment) Maybe this was just talking about an FXC limitation then? |
set_push_constant
seems to be broken on Dx12. I have a small test that runs fine on GL, Vulkan, and Metal, but breaks on Dx12.The test is simple. My push constants are an array of sixteen i32s, (the squares from 0 to 255). In either the vertex shader or the fragment shader I copy the constants to a buffer. I then read the contents of the buffer and compare with the values that were originally pushed.
It seems strange that I'm seeing every fourth constant. And I'm only seeing this on Dx12.
bug_report.zip contains a single file bug_report.rs, which is a wgpu test.
bug_report.zip
The text was updated successfully, but these errors were encountered: