mesa/st: disable unrestricted fragment depth values for GL/GLES

GLES always clamps for 32-bit float buffers, GL doesn't require
it but setting this per API causes virgl to fail some tests.

To fix is properly we'd need to introduce a CAP to expose
this between host/guest.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
This commit is contained in:
Dave Airlie 2022-07-19 15:15:03 +10:00
parent 0e38db0146
commit 171e35de91
1 changed files with 3 additions and 0 deletions

View File

@ -299,6 +299,9 @@ st_update_rasterizer(struct st_context *st)
raster->depth_clip_near = !ctx->Transform.DepthClampNear;
raster->depth_clip_far = !ctx->Transform.DepthClampFar;
raster->depth_clamp = !raster->depth_clip_far;
/* this should be different for GL vs GLES but without NV_depth_buffer_float
it doesn't matter, and likely virgl would need fixes to deal with it. */
raster->unclamped_fragment_depth_values = false;
raster->clip_plane_enable = ctx->Transform.ClipPlanesEnabled;
raster->clip_halfz = (ctx->Transform.ClipDepthMode == GL_ZERO_TO_ONE);