summaryrefslogtreecommitdiffstats
path: root/src/gallium/tests
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2018-02-28 19:40:48 -0500
committerIlia Mirkin <[email protected]>2018-04-21 23:31:48 -0400
commit3f1cad48b812a33403d960093801261900c51708 (patch)
treea685976c73e22d97e4b3ea403934a7b5f10903ea /src/gallium/tests
parentfe8b6d7e1ff55ad0f2e7d798ce7c03a429f58762 (diff)
gallium/tests/trivial: fix viewport depth transform
These were getting mapped off into outer space, which would cause nv50 and nvc0 to clip the primitives (as depth_clip was enabled). These drivers are configured to clip everything outside the [0, 1] range, even though the hardware supports other view settings. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/tests')
-rw-r--r--src/gallium/tests/trivial/quad-tex.c7
-rw-r--r--src/gallium/tests/trivial/tri.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index df0e1301f5e..1f29306ec04 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -27,8 +27,8 @@
#define USE_TRACE 0
#define WIDTH 300
#define HEIGHT 300
-#define NEAR 30
-#define FAR 1000
+#define NEAR 0
+#define FAR 1
#define FLIP 0
/* pipe_*_state structs */
@@ -174,6 +174,7 @@ static void init_prog(struct program *p)
memset(&box, 0, sizeof(box));
box.width = 2;
box.height = 2;
+ box.depth = 1;
ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_TRANSFER_WRITE, &box, &t);
ptr[0] = 0xffff0000;
@@ -226,7 +227,7 @@ static void init_prog(struct program *p)
{
float x = 0;
float y = 0;
- float z = FAR;
+ float z = NEAR;
float half_width = (float)WIDTH / 2.0f;
float half_height = (float)HEIGHT / 2.0f;
float half_depth = ((float)FAR - (float)NEAR) / 2.0f;
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 71e97022752..87a335fba1e 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -27,8 +27,8 @@
#define USE_TRACE 0
#define WIDTH 300
#define HEIGHT 300
-#define NEAR 30
-#define FAR 1000
+#define NEAR 0
+#define FAR 1
#define FLIP 0
/* pipe_*_state structs */
@@ -171,7 +171,7 @@ static void init_prog(struct program *p)
{
float x = 0;
float y = 0;
- float z = FAR;
+ float z = NEAR;
float half_width = (float)WIDTH / 2.0f;
float half_height = (float)HEIGHT / 2.0f;
float half_depth = ((float)FAR - (float)NEAR) / 2.0f;