[PATCH 2/5] d3d9: Add depth clamp tests.

Stefan Dösinger stefandoesinger at gmx.at
Tue Jan 26 11:56:36 CST 2010

Am 26.01.2010 um 18:31 schrieb Henri Verbeet:
> +/* This test tests depth clamping / clipping behaviour:
> + *   - When D3DRS_CLIPPING is disabled depth values are *clamped* to the

> + *   minimum/maximum z value.+    hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
> +    ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr);
It would be interesting to see how D3DCMP_GREATER behaves with clipping off. Does the clamping occur before the depth test, or after the test but before writing the values into the depth buffer. (ie, is 3.0 > 1.0 or is 3.0 == 1.0)

A floating point depth buffer might be interesting as well to see if the clamping is done explicitly, or if just happens due to the limited value range in the depth buffer. I'm fine with postponing this until we get serious about float depth buffers though. (fwiw, ARB_depth_buffer_float suggests that the app will be able to use depths outside 0;1, but doesn't expose this yet, and is left open for future extensions)

More information about the wine-devel mailing list