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
default uniform block layout packing not work in HLSL. #3475
base: main
Are you sure you want to change the base?
Conversation
As additional information:
In the std140 layout, member _4 should be aligned in base 8 bytes, so the offset should be 88; but the rendering result is incorrect; After debugging with nsight, I found that this ubo was marked as scalar alignment, and the real offset is 84; |
Sorry…I think I messed something up… I looked at a few failed test results and it seems like the test cases themselves need to be updated? Please confirm, thank you |
I think you need to see whether the changes caused to the tests are reasonable and if so, update them. Are you sure your code is correct though? It seems like the merge was written that way for a specific reason, though I would have to dig into it a bit more to tell you whether it really works right. |
6118821
to
2b9374b
Compare
I'm using glslang to convert hlsl code to spir-v, but I found that some of the ubo members have incorrect offsets. I read part of the source code and found that ubo should use std140 layout by default, but it doesn't seem to take effect.
I made some modifications based on my understanding, and the rendering results alone are correct.