You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since indexing a BufferArray never produces a pointer, it's impossible to write to the contents of buffers accessed through a buffer array.
Permitting pointers to buffer arrays seems like a bad idea. Perhaps indexing a BufferArray whose base type is not Image or Sampler should just always produce a pointer to the buffer's value, as if it were an ordinary var<storage> or var<uniform>, even when the base operand to Access or AccessIndex is not a pointer.
Yeah I agree with the "just pointerize the result" solution. I was intentionally trying to avoid funky pointer stuff (like a pointer to an image in a binding array might lead to some funky consequences I don't understand).
I agree we want to avoid introducing pointers to new things. I think you'd say, for binding_array<texture> and binding_array<sampler>, indirection doesn't produce a pointer, but for everything else, it does.
But since all buffer_array<Data> variables must go in the handle address space, there's no syntactic opportunity to say whether the variable is writable or not. (There's also no such opportunity in the IR.)
Note that this problem doesn't exist today because you can't actually use uniform/storage buffers in binding arrays. #2282 makes it possible, and it uses the same address spaces as you'd use for non-arrays. So the problem is solved.
Since indexing a
BufferArray
never produces a pointer, it's impossible to write to the contents of buffers accessed through a buffer array.Permitting pointers to buffer arrays seems like a bad idea. Perhaps indexing a
BufferArray
whose base type is notImage
orSampler
should just always produce a pointer to the buffer's value, as if it were an ordinaryvar<storage>
orvar<uniform>
, even when thebase
operand toAccess
orAccessIndex
is not a pointer.cc @cwfitzgerald
The text was updated successfully, but these errors were encountered: