Version
4.0-126
Branch
DX9-Final
Date
11 years, 1 month ago
Windows x64 Windows x86
Commit
844fe52f0ac9cfd7bc7e2a6f4f2004743f91d987
Change author
Rodolfo Bogado
Change description
Try a more correct approach to early z. early z works by doing the depth test before texturing to reduce work, dx9 poses early z but it works different, it is only applicable when z write is disables or when no write to depth buffer is done in the pixel shader and discard is not used. sorry to say but we are doing that exactly so no early z for us. well no early z in theory, we can do tricks to use the performance boost of early z and at the same time do a more correct implementation of the wee/gc early z. The trick goes like this: the wii/gc early z poses the particularity that when is enabled, the depth buffer content is updated if z test pass even if the pixel is discarded by the alpha test. so to emulate this do a first depth only pass (color write disabled and as simple as possible pixel shader to output depth only) to setup the depth buffer and write the correct depth values. after this comes the trick to boost the performance. the pass to update the color buffer is done with depth update disabled, because we already setup the depth buffer, causing d3d early z to work and reducing the pixel shader processing a lot. so what to spec with this commit? first most of the issues caused by missing early z should be fixed. second ;) performance increase in system with limited gpu, in my system at hi resolution (full hd 4x ssaa) I get a 10% boost in frame rate. please test and let me know the result