I would like to update a 3d texture by rendering one slice at a time. However, at each step I would also like to access the previous slice to read its values. Setting up each slice as a render target works fine, but is it also possible to use such a slice as an input in my shader? (I’m trying to avoid explicitly copying the previously written slice to a separate texture.)
I believe it is undefined to use a sampler3D that is bound to the same 3d texture that is being written to. But is it still undefined if the shader is gauranteed to never read/write texels in the same slice at the same time?
Or, as a different option, if I have a sampler2D (or sampler2DArray), can I somehow bind it to the same data as the 3d texture to avoid a copy?