-
Notifications
You must be signed in to change notification settings - Fork 715
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
[SPIR-V] "-fvk-use-dx-layout" alignment error #3945
Comments
@galibzon Thank you for reporting this issue. We will take a look. |
Basically, when we use If you see what FXC (or DXC/DXIL) generates for its memory layout it is the following memory layout for float2x2_case.txt:
what SPIR-V backend generates is the same. I used See
It can be illegal based on spirv-val's validation rule, but it exactly follows the memory layout rule of FXC or DXC/DXIL that is the expected behavior of This is not a bug, but it is actually correct. |
Thanks for looking into this @jaebaek, I suppose the right thing to do is simply disable the spirv-validation in this case? |
Since it violates the SPIR-V validation rule, we should keep the behavior. If you want to turn off validation errors, you can use |
For the attached hlsl files:
float2x2_case.txt
float2x3_case.txt
float3x2_case.txt
float3x3_case.txt
float4x2_case.txt
float4x3_case.txt
They compile as usual for dx12, but when compiling for vulkan using the following command:
dxc.exe -E MainPS -T ps_6_2 -O3 -Zpr -spirv -DAZ_USE_SUBPASSINPUT -fvk-use-dx-position-w -fvk-use-dx-layout -Fo my_vulkan.spirv.bin -Fh float2x2_case.txt
I get this error:
fatal error: generated SPIR-V is invalid: Structure id 5 decorated as Block for variable in Uniform storage class must follow scalar uniform buffer layout rules: member 1 at offset 24 overlaps previous member ending at offset 31 %type_ConstantBuffer_MyData = OpTypeStruct %mat2v2float %float %v4float
Similar errors are produced when using any of the attached floatRxC_case.txt files.
I tried both 'master' branch at commit 29a5af5
And tag 'v1.6.2106' at commit dad1cfc
Which apparently had the fix mentioned in this PR:
#3672
The text was updated successfully, but these errors were encountered: