mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 08:50:09 +01:00
v3d: Fix Z clipping when viewport.scale[2] is negative.
Fixes: dEQP-GLES3.functional.shaders.builtin_variable.depth_range_fragment dEQP-GLES3.functional.shaders.builtin_variable.depth_range_vertex
This commit is contained in:
parent
9f80bcc2bc
commit
ad1a4cb563
1 changed files with 6 additions and 4 deletions
|
|
@ -465,10 +465,12 @@ v3dX(emit_state)(struct pipe_context *pctx)
|
|||
v3d->viewport.scale[2];
|
||||
}
|
||||
cl_emit(&job->bcl, CLIPPER_Z_MIN_MAX_CLIPPING_PLANES, clip) {
|
||||
clip.minimum_zw = (v3d->viewport.translate[2] -
|
||||
v3d->viewport.scale[2]);
|
||||
clip.maximum_zw = (v3d->viewport.translate[2] +
|
||||
v3d->viewport.scale[2]);
|
||||
float z1 = (v3d->viewport.translate[2] -
|
||||
v3d->viewport.scale[2]);
|
||||
float z2 = (v3d->viewport.translate[2] +
|
||||
v3d->viewport.scale[2]);
|
||||
clip.minimum_zw = MIN2(z1, z2);
|
||||
clip.maximum_zw = MAX2(z1, z2);
|
||||
}
|
||||
|
||||
cl_emit(&job->bcl, VIEWPORT_OFFSET, vp) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue