From a1bb1b9b07f4091f95fc1368cb2b3039ebfe0c50 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Fri, 12 Mar 2021 15:57:13 +0100 Subject: [PATCH] st/nine: Catch redundant scissor and viewport settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The redundancy check is done in the nine_context function, rather than the device function, in order to also filter calls from SetRenderTarget and Reset*. Signed-off-by: Axel Davy Acked-by: Timur Kristóf Part-of: --- src/gallium/frontends/nine/nine_state.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/frontends/nine/nine_state.c b/src/gallium/frontends/nine/nine_state.c index d3b57862a6d..9cc4ba289e4 100644 --- a/src/gallium/frontends/nine/nine_state.c +++ b/src/gallium/frontends/nine/nine_state.c @@ -1892,6 +1892,9 @@ CSMT_ITEM_NO_WAIT(nine_context_set_viewport, { struct nine_context *context = &device->context; + if (!memcmp(viewport, &context->viewport, sizeof(context->viewport))) + return; + context->viewport = *viewport; context->changed.group |= NINE_STATE_VIEWPORT; } @@ -1901,6 +1904,9 @@ CSMT_ITEM_NO_WAIT(nine_context_set_scissor, { struct nine_context *context = &device->context; + if (!memcmp(scissor, &context->scissor, sizeof(context->scissor))) + return; + context->scissor = *scissor; context->changed.group |= NINE_STATE_SCISSOR; }