freedreno/a2xx: fix scissors clamp bounds
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 4 Feb 2021 16:52:59 +0000 (18:52 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 4 Feb 2021 19:47:11 +0000 (19:47 +0000)
a2xx has maximum viewport dimensions of 4096

Fixes: 6ae726b79988addc50c1ed149151a351d0343d9d ("freedreno: clamp scissor bounds")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8866>

src/gallium/drivers/freedreno/freedreno_state.c

index 54471cb..b58e97a 100644 (file)
@@ -331,7 +331,7 @@ fd_set_viewport_states(struct pipe_context *pctx,
                swap(miny, maxy);
        }
 
-       const float max_dims = is_a3xx(ctx->screen) ? 4096.f : 16384.f;
+       const float max_dims = ctx->screen->gpu_id >= 400 ? 16384.f : 4096.f;
 
        /* Clamp, convert to integer and round up the max bounds. */
        scissor->minx = CLAMP(minx, 0.f, max_dims);