0
\$\begingroup\$

If my game will use say 100mb of raw memory for textures, would it be a good idea to put all of them in srv array, bind once and leave it for the rest of the program so that I won't have to bind them ever again and thus save some processing power? I'm targeting gpus with at least 2gb of vram.

\$\endgroup\$
0
\$\begingroup\$

It is usually a good idea to avoid most graphics state setup. The term texture array however, can be somewhat confusing, because it might mean this:

Texture2D myTextures[12] : register(t0)

Which means, that each texture consumes a texture slot, so t0, t1, ... t11 are consumed. But it can also mean this:

Texture2DArray myTextures : register(t0)

This consumes a single texture slot t0. But all textures in the array must share the same properties (resolution, format, etc.).

An other option is that you can pack all your textures into a texture atlas. This somewhat complicates updating the textures and sampling mip levels.

In DirectX 12, Vulkan and console specific graphics APIs, you can use bindless textures which decouples texture bind slots from the resources and allows dynamically selecting the texture from a global set in the shader.

That said, we don't know if any of this would be a benefit to you without further profiling data for your application. Maybe the more complicated resource management won't pay off for your specific case.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.