View Full Version : Color vs. DepthStencil clear

10-06-2009, 09:04 AM
Is color buffer clear faster then clear only the depth component of paired depth-stencil? would think that of course since color buffer can be cleared with a whole block transfer (ala STOSD) and depth has to be extracted or written to from 32bit to 24bit depth-stencil and has to be processed one by one fragment. seems like clearing depth-stencil together is the faster way? glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)

Ilian Dinev
10-06-2009, 09:31 AM
GDDR3+ has read/write masks afaik. Plus, thanks to Hi-Z and stuff, depth/stencil clears generally don't fill the buffer.
Anyway you should clear them together if you have stencil.

10-06-2009, 09:33 AM
I had the impression that all clears were very well optimized.
Juste benchmark and compare if there is any difference.