-
Notifications
You must be signed in to change notification settings - Fork 76
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
SPV_EXT_physical_storage_buffer aliasing decorations #93
Comments
Edit: I got that bit wrong, see later posts I see the issue you're getting at though, and it's pretty bad: the memory models available to shaders do not allow expressing potential aliasing outside of global inputs without having to go through an unnecessary OpVariable store/load.
What about just having the With physical storage buffers we can effectively reach arbitrary memory regions beyond simply the shader inputs, so the whole concept of "memory object declaration" falls apart. The issue seems to extend to OpenCL flavours too, this seems to me like a very messy part of the spec. |
The OpVariable is for the push constant or UBO, not for the pointer member. You need to do a Function Variable, copy AccessChain and load the pointer into that, and mark that Function Variable with Restrict. But the goal of M2R is to reduce all Function Variables. This is worse when casting longs to pointers, because there is no Variable in that picture. |
I was confused - see later post |
But we can't decorate pointer types to encode this information. I wish we could! We can only decorate Variables. That's weird. |
Ah you're right - I misread your post In the issue I linked, glslang decorates struct type members with |
Why are the aliasing/restrict decorations supposed to go on OpVariable, and how does that work? You can eliminate all your local OpVariables through mem2reg. My pointers are loaded from a PushConstant, and don't even have an OpVariable. What is their aliasing behavior?
It makes more sense to make aliasing a storage class: PhysicalStorageRestrict and PhysicalStorageAliased. This way it won't fall off under CFG transformations.
The text was updated successfully, but these errors were encountered: