radeonsi: fix assertion failure by using the correct type
authorMarek Olšák <marek.olsak@amd.com>
Wed, 27 Feb 2019 23:31:54 +0000 (18:31 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 1 Apr 2019 16:21:20 +0000 (12:21 -0400)
src/gallium/drivers/radeonsi/si_state_viewport.c:196: si_emit_guardband:
Assertion `vp_as_scissor.maxx <= max_viewport_size[vp_as_scissor.quant_mode]
&& vp_as_scissor.maxy <= max_viewport_size[vp_as_scissor.quant_mode]' failed.

The comparison was unsigned, so negative maxx or maxy would fail.

Fixes: 3c540e0a7488 "radeonsi: Fix guardband computation for large render targets"
src/gallium/drivers/radeonsi/si_state_viewport.c

index 64bb956b200eb1a023d66008851f3543ec7d2fa9..a9a1be73ba42f103bfb5461abd59eb02dd235659 100644 (file)
@@ -186,7 +186,7 @@ static void si_emit_guardband(struct si_context *ctx)
                ctx->chip_class >= VI ? 16 : MAX2(ctx->screen->se_tile_repeat, 16);
 
        /* Indexed by quantization modes */
-       static unsigned max_viewport_size[] = {65535, 16383, 4095};
+       static int max_viewport_size[] = {65535, 16383, 4095};
 
        /* Ensure that the whole viewport stays representable in
         * absolute coordinates.