Advertisement Jump to content
Sign in to follow this  

reading from texture performance

This topic is 2240 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

directx losses performance when in one draw call, I render to the same texel.(like having various vertices pointing to the same texel)

Do I lose performance if in 1 draw call i read from the same texel?(example:when rendering to a texture, all its texels, need to read from the same texel of a shader resource texture ) Edited by lomateron

Share this post

Link to post
Share on other sites

Reading from the same address in texture memory, won’t be as bad as writing to the same address.
But, for the reading from one address rather use constant buffers instead of a texture, because of two reasons (cf. Montes):

  1. Constant memory is optimized for broadcasts. This means, if all threads (i.e., pixel shader threads) in a warp (i.e., group of 16 or 32 threads dependent on the hardware) read from the same constant buffer address, only one memory access is requested and its result is “broadcasted” (send) to all threads. This saves 15 or 31 memory accesses and therefore memory bandwidth.
  2. Each multiprocessor has its own constant memory cache (8 KB), thus only the first warp will read from memory, all others directly find the constant in the cache.

Best regards!

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!