Optimization of depth buffer creation