mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-16 10:04:42 +03:00
fix(gx): correct off-by-one error when popping render states
This commit is contained in:
parent
dfb7fb0270
commit
eddc6f7f4a
@ -734,8 +734,11 @@ void CGxDevice::RsPop() {
|
|||||||
auto topOfStack = this->m_stackOffsets[this->m_stackOffsets.Count() - 1];
|
auto topOfStack = this->m_stackOffsets[this->m_stackOffsets.Count() - 1];
|
||||||
|
|
||||||
if (this->m_pushedStates.Count() > topOfStack) {
|
if (this->m_pushedStates.Count() > topOfStack) {
|
||||||
for (int32_t i = this->m_pushedStates.Count() - 1; i > topOfStack; i--) {
|
auto bottomOfStack = this->m_pushedStates.Count() - 1;
|
||||||
auto ps = &this->m_pushedStates[i];
|
auto stackSize = this->m_pushedStates.Count() - topOfStack;
|
||||||
|
|
||||||
|
for (uint32_t stackOffset = 0; stackOffset < stackSize; stackOffset++) {
|
||||||
|
auto ps = &this->m_pushedStates[bottomOfStack - stackOffset];
|
||||||
auto rs = &this->m_appRenderStates[ps->m_which];
|
auto rs = &this->m_appRenderStates[ps->m_which];
|
||||||
|
|
||||||
if (!rs->m_dirty) {
|
if (!rs->m_dirty) {
|
||||||
|
Loading…
Reference in New Issue
Block a user