From 095bd118f99bbbd2956bc3fdc57154725a5c7e31 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 13 Mar 2019 16:31:10 +0100 Subject: [PATCH] vrend: Force setting viewport state when the sub context is new Fixes: KHR-GL41.viewport_array.dynamic_viewport_index KHR-GL41.viewport_array.draw_mulitple_viewports_with_single_invocation when run in a batch as KHR-GL41.viewport_array.* Signed-off-by: Gert Wollny Signed-off-by: Dave Airlie --- src/vrend_renderer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index df29d45..8c860a1 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -525,6 +525,7 @@ struct vrend_sub_context { /* viewport is negative */ uint32_t scissor_state_dirty; uint32_t viewport_state_dirty; + uint32_t viewport_state_initialized; uint32_t fb_height; @@ -2281,12 +2282,13 @@ void vrend_set_viewport_states(struct vrend_context *ctx, if (ctx->sub->vps[idx].cur_x != x || ctx->sub->vps[idx].cur_y != y || ctx->sub->vps[idx].width != width || - ctx->sub->vps[idx].height != height) { - ctx->sub->viewport_state_dirty |= (1 << idx); + ctx->sub->vps[idx].height != height || + (!(ctx->sub->viewport_state_initialized &= (1 << idx)))) { ctx->sub->vps[idx].cur_x = x; ctx->sub->vps[idx].cur_y = y; ctx->sub->vps[idx].width = width; ctx->sub->vps[idx].height = height; + ctx->sub->viewport_state_dirty |= (1 << idx); } if (idx == 0) {