-
Notifications
You must be signed in to change notification settings - Fork 709
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] ByteAddressBuffer Load should get vectorized #3372
Comments
It looks like this issue is significantly worse then expected, since non-templated loads exhibit the same bad behavior: http://shader-playground.timjones.io/1ff2f9b80ad8cb73d7cc64f60edb2804 The expected output would be to have one OpTypeVector of 4 elements, and one OpLoad on that. As an example, see the following RDNA ISA as outputted from the RGA tool:
Which also emits 4 |
@Jasper-Bekkers Thank you for reporting this issue. I will take a look and get back to you. |
This is a limitation of SPIR-V. If the variable is typed to be a runtime array of uints (as it is here), then only a single uint can loaded at a time. There is a potential optimization of representing the variable as a runtime array of uint4s (or an aggregate of larger values), but that complicates the logic to calculate the addresses. |
I agree with @alan-baker . It works correctly but inefficient, which is a limitation of SPIR-V. Since the given ByteAddressBuffer is a buffer of "bytes" (it generates |
Might be better to close this issue then, and follow up directly within Khronos instead what do you think? |
Yes, we can close it and open another one when we have some solutions for this. |
Output:
Compared to:
Run with
dxc -spirv -Tps_6_5 -EPSMain test.hlsl
The text was updated successfully, but these errors were encountered: