summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-08-12 21:40:52 -0400
committerIlia Mirkin <[email protected]>2016-08-14 17:41:49 -0400
commit5c1ccd8053412b6a42098481d2fde3d483208c33 (patch)
tree7a654b2b061d38b555fdecfa60ba5fa144c7ef2d /src/gallium/drivers/nouveau/nv50
parentc85b7f0e873518c332d23d1492332941355cb600 (diff)
nv50,nvc0: fix depth range when halfz is enabled
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97231 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.2 12.0" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_state_validate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
index 19181a9f496..5a3bb3e719a 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
@@ -1,5 +1,6 @@
#include "util/u_format.h"
+#include "util/u_viewport.h"
#include "nv50/nv50_context.h"
@@ -265,8 +266,12 @@ nv50_validate_viewport(struct nv50_context *nv50)
PUSH_DATAf(push, vpt->scale[1]);
PUSH_DATAf(push, vpt->scale[2]);
- zmin = vpt->translate[2] - fabsf(vpt->scale[2]);
- zmax = vpt->translate[2] + fabsf(vpt->scale[2]);
+ /* If the halfz setting ever changes, the viewports will also get
+ * updated. The rast will get updated before the validate function has a
+ * chance to hit, so we can just use it directly without an atom
+ * dependency.
+ */
+ util_viewport_zmin_zmax(vpt, nv50->rast->pipe.clip_halfz, &zmin, &zmax);
#ifdef NV50_SCISSORS_CLIPPING
BEGIN_NV04(push, NV50_3D(DEPTH_RANGE_NEAR(i)), 2);