radv: fix multi-viewport emission
authorDave Airlie <airlied@redhat.com>
Tue, 10 Jan 2017 04:50:34 +0000 (14:50 +1000)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 11 Jan 2017 08:08:51 +0000 (09:08 +0100)
This set context req seq was in the wrong place.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/si_cmd_buffer.c

index a483ad9fd39d0bd15039d0b6f8832ef812ad92c4..e59d52e82afb8e7d996d524992a422c8302de14d 100644 (file)
@@ -480,11 +480,11 @@ si_write_viewport(struct radeon_winsys_cs *cs, int first_vp,
                radeon_emit(cs, fui(translate[2]));
        }
 
+       radeon_set_context_reg_seq(cs, R_0282D0_PA_SC_VPORT_ZMIN_0 +
+                                  first_vp * 4 * 2, count * 2);
        for (i = 0; i < count; i++) {
                float zmin = MIN2(viewports[i].minDepth, viewports[i].maxDepth);
                float zmax = MAX2(viewports[i].minDepth, viewports[i].maxDepth);
-               radeon_set_context_reg_seq(cs, R_0282D0_PA_SC_VPORT_ZMIN_0 +
-                                          first_vp * 4 * 2, count * 2);
                radeon_emit(cs, fui(zmin));
                radeon_emit(cs, fui(zmax));
        }