Optimize gbuffer and eliminate state changes