Let's say I have nbFramesAnimation * 3 float4 Texture2D that I want to pass to my GPU, and:
- I don't need to interpolate between the textures;
- The textures have all the same size;
- I don't know if it's relevant, but I don't have any mip-maps;
I use those textures as G-buffer on which I apply some post-effect. As such, I may have to access them with a non-literal expression for the index. Furthermore, because I use them as G-Buffers I have to load them very often. They give me positions and normals Infos, that need to be precise, and UV+IndexObject (so effectively only 3 out of the 4 floats are used).
As for now, at each frame render, I load the three textures individually with SetResource. It is very slow and far from real-time.
I wanted to know if:
- It is more efficient to have an array of Texture2DArrays, each Texture2dArray having three textures (in my case), and to pass one Texture2DArray at each frame;
- Or is it the same as passing 3 individual Texture2D ?;
- Would it be more efficient to do several Texture2DArrays of nbFramesAnimation / X * 3 textures, and to load one of them each X frames?
I would also appreciate any insight on how I could further optimize this transfer.