-
Notifications
You must be signed in to change notification settings - Fork 149
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
Feature request: reflect referenced members of a ByteAddressBuffer #234
Comments
So looking into this a few things
the slang offsets makes sense
but for dxc I was only able to figure out there was some implicit padding from looking at the early IR (byte_address_hlsl_passes.txt) ... I don't know how to determine why it decided on adding the 2 bytes of padding here
|
Providing the offsets would be sufficient. The reason for the buffer offset differences is that I think by default DXC is using scalar block layout and slang is using std430. So it is correct that the offsets would be different. We have some compile option to use std430 layout for SSBOs on DXC so don't worry about those differences, it means it is doing the right thing. If you can report back the offset information I think I can work it out from there. Thanks!! |
@danginsburg do you find the use of |
The current need is for Ray Tracing stages, but ultimately it would be nice if it worked in all stages. |
prototype #236 ok so spending more time into this, I realize the way
the other issue is if there are ever 2 I will look into what it would take to add Non-semantic decorations we could put on the |
If the client side code knows what the corresponding binding / register are up to, it should be sufficient. If the use case is full reflection where the client code is building out descriptor set layouts, then you are correct - the information that SPIRV-Reflect provides will be underconstrained. |
The issue is even if the client knows which binding/register, @chaoticbob mentioned to me how some non-semantic info is optimized out (and experienced similar issue and hence why SPV_GOOGLE_user_type was created), but looking more, the the biggest issue I am finding and I am not sure how to make sure this info can be set down with both the |
DXC already writes out the decorations for I would favor the Example shader:
Output:
|
Given the following HLSL shader:
I would like to be able to use spirv-reflect to determine which members of g_MaterialData are statically referenced (the same as I would want to do for a cbuffer). Currently that is not possible.
This shader can be lowered to spir-v using slang with:
Or with DXC:
I've attached the HLSL and slang and dxc-generated SPIR-V to the bug. Ideally spirv-reflect would work with shaders from either backend (DXC or slang).
byte_address_buffer_reflection.zip
The text was updated successfully, but these errors were encountered: