Skip to main content
GameDev.net gamedev.net
🔒 Locked

reading from texture performance

Started by lomateron Dec 1, 2012 at 2:51 AM 0 replies 900+ views
Original Post
lomateron
lomateron
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 )
Tsus
Tsus
Hi!

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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.