summaryrefslogtreecommitdiff
path: root/src/gallium/tests
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2021-03-21 02:25:09 -0400
committerMarge Bot <eric+marge@anholt.net>2021-03-21 18:29:50 +0000
commit3e68e7f90debb8999a62433084a096195f416a4b (patch)
tree30bce30fa2344fcd26106cc559f03066bd550783 /src/gallium/tests
parentbefd9fbbba1985b38a4a2a43cb3be08d268e9956 (diff)
gallium,st: add missing viewport swizzles
Viewports must be initialized with the appropriate swizzles (for hardware that supports this feature). Fixes: 90fcb3fef28 (st/mesa: add NV_viewport_swizzle support) Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9732>
Diffstat (limited to 'src/gallium/tests')
-rw-r--r--src/gallium/tests/graw/fs-test.c5
-rw-r--r--src/gallium/tests/graw/graw_util.h5
-rw-r--r--src/gallium/tests/graw/gs-test.c5
-rw-r--r--src/gallium/tests/graw/quad-sample.c5
-rw-r--r--src/gallium/tests/graw/shader-leak.c5
-rw-r--r--src/gallium/tests/graw/tri-gs.c5
-rw-r--r--src/gallium/tests/graw/tri-instanced.c5
-rw-r--r--src/gallium/tests/graw/vs-test.c5
-rw-r--r--src/gallium/tests/trivial/quad-tex.c5
-rw-r--r--src/gallium/tests/trivial/tri.c5
10 files changed, 50 insertions, 0 deletions
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index 46afc911823..f9bddccdaf7 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -148,6 +148,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h
index b8c79361c23..ca813b6b87c 100644
--- a/src/gallium/tests/graw/graw_util.h
+++ b/src/gallium/tests/graw/graw_util.h
@@ -201,6 +201,11 @@ graw_util_viewport(struct graw_info *info,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
info->ctx->set_viewport_states(info->ctx, 0, 1, &vp);
}
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 479ede26115..4d8f5c31f15 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -206,6 +206,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index dd86b51587e..912df7e7aac 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -76,6 +76,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index 71ddd33263c..0e121a7d0d6 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -66,6 +66,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index 6f577323ff5..8d5ad205860 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -67,6 +67,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index c1bf6396926..8ddd266792e 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -96,6 +96,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 04bcb4f72fb..23e642b47bd 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -128,6 +128,11 @@ static void set_viewport( float x, float y,
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
+ vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
+
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 563e4f35a7f..79e9c39cab1 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -250,6 +250,11 @@ static void init_prog(struct program *p)
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
+
+ p->viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ p->viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ p->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ p->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
}
/* vertex elements state */
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 254a10ac863..0bc09a983a2 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -193,6 +193,11 @@ static void init_prog(struct program *p)
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
+
+ p->viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ p->viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ p->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ p->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
}
/* vertex elements state */