summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-02-15 06:45:07 +0000
committerAlyssa Rosenzweig <[email protected]>2019-02-18 05:13:03 +0000
commit49985cebeaadc571e8807d0b046615692a0dd227 (patch)
treeed50536498a7c7974d3ecfa6bd155ccc6311ac7c /src/gallium/drivers/panfrost
parenta94463732af9e483045abe8b48555fd9211b827e (diff)
panfrost: Cleanup mali_viewport (clipping) code
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/include/panfrost-job.h13
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c23
2 files changed, 19 insertions, 17 deletions
diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index e11f4395e57..82b3cfb2a4f 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -1186,10 +1186,15 @@ struct mali_sampler_descriptor {
*/
struct mali_viewport {
- float floats[4];
-
- float depth_range_n;
- float depth_range_f;
+ /* XY clipping planes */
+ float clip_minx;
+ float clip_miny;
+ float clip_maxx;
+ float clip_maxy;
+
+ /* Depth clipping planes */
+ float clip_minz;
+ float clip_maxz;
u16 viewport0[2];
u16 viewport1[2];
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index ff4f2907c2d..cfed9f6ff90 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -548,25 +548,22 @@ panfrost_attach_vt_framebuffer(struct panfrost_context *ctx)
static void
panfrost_viewport(struct panfrost_context *ctx,
- float depth_range_n,
- float depth_range_f,
+ float depth_clip_near,
+ float depth_clip_far,
int viewport_x0, int viewport_y0,
int viewport_x1, int viewport_y1)
{
- /* Viewport encoding is asymmetric. Purpose of the floats is unknown? */
+ /* Clip bounds are encoded as floats. The viewport itself is encoded as
+ * (somewhat) asymmetric ints. */
struct mali_viewport ret = {
- .floats = {
-#if 0
- -inff, -inff,
- inff, inff,
-#endif
- 0.0, 0.0,
- 2048.0, 1600.0,
- },
+ .clip_minx = viewport_x0,
+ .clip_miny = viewport_y0,
+ .clip_maxx = viewport_x1,
+ .clip_maxy = viewport_x1,
- .depth_range_n = depth_range_n,
- .depth_range_f = depth_range_f,
+ .clip_minz = depth_clip_near,
+ .clip_maxz = depth_clip_far,
.viewport0 = { viewport_x0, viewport_y0 },
.viewport1 = { MALI_POSITIVE(viewport_x1), MALI_POSITIVE(viewport_y1) },