Sign in to follow this  

Texture Types

This topic is 2167 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if there is any reason to use Texture1D instead of Texture2D with height = 1 or Texture3D instead of Texture2DArray performance wise?

Because using only Texture2D the complexity of my Resource Manager decreases a lot...

Thanks.

Share this post


Link to post
Share on other sites
I don't know of any compelling reason to use 1D textures, other than the fact that you don't have to specify a Y/V coordinate when sampling them. However there is definitely a difference between 2D texture arrays and 3D textures. With a texture array, each array slice is completely independent of each other with regards to sampling and mipmaps. So you can use normal trilinear/anisotropic filtering when sampling a slice, and it will be like you sampled a normal 2D texture. With 3D textures however, linear filtering filters in 3 dimensions instead of two. This means that unless you use point filtering or are careful to align your sample positions, nearby W slices will get mixed into your texture fetch. Filtering will also be more expensive, due to more texels being fetched. Another key difference is that with a texture array, each slice is a separate subresource. This means that you can use CopySubresourceRegion to copy a single array slice from one texture to another. Another difference is that texture arrays can be used in conjunction with SV_RenderTargetArrayIndex which lets you control which render target a primitive gets rendered to from the geometry shader.

Share this post


Link to post
Share on other sites
Thanks for your answer. I just wanted to add that you can also use SV_RenderTargetArrayIndex when rendering to 3D texture and it will behave like when rendering to a 2D texture array.

Share this post


Link to post
Share on other sites
Sign in to follow this