Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My immediate thought is that you are stalling the GPU pipeline. The GPU can have a pipeline that lags several frames behind the commands that you are issuing.</p> <p>So if you issue a command to set data on a texture, and the GPU is currently using that texture to render an old frame, it must finish all of its rendering before it can accept the new texture data. So it waits, killing your performance.</p> <p>The workaround for this might be to use several textures in a double- (or even triple- or quad-) buffer arrangement. Don't attempt to write to a texture that you have just used for rendering.</p> <p>Also - you can write to textures from a thread other than your rendering thread. This might come in handy, particularly for clearing textures.</p> <p>As you seem to have discovered, it's actually quicker to <code>SetData</code> in large chunks, rather than issue many, small <code>SetData</code> calls. Determining the ideal size for a "chunk" differs between GPUs - but it is a fair bit bigger than a single pixel.</p> <p>Also, creating a texture is much slower than reusing one, in raw performance terms (if you ignore the pipeline effect I just described); so reuse that texture.</p> <p>It's worth mentioning that a "pixel sprite" requires sending maybe 30 times as much data per-pixel to the GPU than a texture.</p> <p>See also <a href="https://gamedev.stackexchange.com/a/37794/288">this answer</a>, which has a few more details and some in-depth links if you want to go deeper.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload