Skip to content

d3d12: Support clip halfz

Jesse Natalie requested to merge jenatali/mesa:clip-halfz into main

I'd started this patch a long time ago when trying to get DOOM 2016 running with the d3d12 driver. They require GL4.3, but after using an environment variable to work around that, there's a handful of extensions they need, and this was one of them.

Essentially, supporting this means turning off a bunch of stuff we do to emulate GL's depth clip range of -1 to 1. Specifically:

  • Stop messing with the viewport that we get from Gallium
  • Stop running nir_lower_clip_halfz
  • When we invert the depth range, we have to invert in the 0 to 1 range instead of the -1 to 1 range, i.e. new_depth = (1.0f - depth) instead of new_depth = -old_depth.

Merge request reports