The problem is similar to annotating that a BDA aliases, this is why AliasedPointer and RestrictPointer exists in SPIR-V.
They tell us that its not the pointer given out by OpVariable which may alias memory locations when used, but the pointer stored at the location pointed to by OpVariable can aliasmemory locations when used (because there will be two OpLoad or one OpLoad and one OpStore instructions chained together and its about the second one).
So with regards to NonWritable and NonReadable we need a similar solution to let the compiler know a BDA won't be used in certain ways.
Right now I can let the compiler know that an SSBO will be readonly, but not BDA.
Another and cleaner way would be to bake this into the declared BDA pointer type, like a const decoration on a pointer in C or C++.
Could be done either via decoration of the OpType or simply by allowing one more operand to OpType when its a PhysicalStorageBuffer pointer.
The problem is similar to annotating that a BDA aliases, this is why
AliasedPointerandRestrictPointerexists in SPIR-V.They tell us that its not the pointer given out by
OpVariablewhich may alias memory locations when used, but the pointer stored at the location pointed to byOpVariablecan aliasmemory locations when used (because there will be twoOpLoador oneOpLoadand oneOpStoreinstructions chained together and its about the second one).So with regards to
NonWritableandNonReadablewe need a similar solution to let the compiler know a BDA won't be used in certain ways.Right now I can let the compiler know that an SSBO will be readonly, but not BDA.
Another and cleaner way would be to bake this into the declared BDA pointer type, like a
constdecoration on a pointer in C or C++.Could be done either via decoration of the
OpTypeor simply by allowing one more operand toOpTypewhen its aPhysicalStorageBufferpointer.