st/nine: Catch redundant scissor and viewport settings

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 <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
Axel Davy 2021-03-12 15:57:13 +01:00 committed by Marge Bot
parent e0caa05d42
commit a1bb1b9b07
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}