mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
mesa: Fix PopAttrib not restoring states that changed on deeper stack level
Currently on each pop we reset the PopAttribState to the value from the
last push. But if we assume a sequence "push(X), push(Y), changeX(),
pop(), pop()": the first pop will remove X from PopAttribState, so the
second pop will not even try to restore X, leaving a wrong value forever.
Fix this by "bubbling up" the changed states that were not restored by pop.
Fixes: 68030bbf ("mesa: only pop states in glPopAttrib that have been changed since glPushAttrib")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11417
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30038>
This commit is contained in:
parent
e9f63df2f2
commit
b0b1907fa5
1 changed files with 5 additions and 1 deletions
|
|
@ -1124,7 +1124,11 @@ _mesa_PopAttrib(void)
|
|||
AlphaToCoverageDitherControlNV);
|
||||
}
|
||||
|
||||
ctx->PopAttribState = attr->OldPopAttribStateMask;
|
||||
/* Restore the previous PopAttribStateMask as well as any modified state
|
||||
* that was not restored in the current pop.
|
||||
*/
|
||||
ctx->PopAttribState = attr->OldPopAttribStateMask |
|
||||
(ctx->PopAttribState & ~attr->Mask);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue