mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 20:25:10 +01:00
Stash new register value before executing deferred draws/updates
Since the register writes technically happen after the draw, issues can occur if they happen before: e.g. skyrim updates ctSelect and disables all RTs after a draw, but this would happen before it previously and crash the driver.
This commit is contained in:
parent
c50852e546
commit
133f08ed14
@ -93,6 +93,7 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
|
|||||||
|
|
||||||
|
|
||||||
bool redundant{registers.raw[method] == argument};
|
bool redundant{registers.raw[method] == argument};
|
||||||
|
u32 origRegisterValue{registers.raw[method]};
|
||||||
registers.raw[method] = argument;
|
registers.raw[method] = argument;
|
||||||
|
|
||||||
if (batchEnableState.raw) {
|
if (batchEnableState.raw) {
|
||||||
@ -111,10 +112,12 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
|
|||||||
#undef LOAD_CONSTANT_BUFFER_CALLBACKS
|
#undef LOAD_CONSTANT_BUFFER_CALLBACKS
|
||||||
default:
|
default:
|
||||||
// When a method other than constant buffer update is called submit our submit the previously built-up update as a batch
|
// When a method other than constant buffer update is called submit our submit the previously built-up update as a batch
|
||||||
|
registers.raw[method] = origRegisterValue;
|
||||||
interconnect.DisableQuickConstantBufferBind();
|
interconnect.DisableQuickConstantBufferBind();
|
||||||
interconnect.LoadConstantBuffer(batchLoadConstantBuffer.buffer, batchLoadConstantBuffer.startOffset);
|
interconnect.LoadConstantBuffer(batchLoadConstantBuffer.buffer, batchLoadConstantBuffer.startOffset);
|
||||||
batchEnableState.constantBufferActive = false;
|
batchEnableState.constantBufferActive = false;
|
||||||
batchLoadConstantBuffer.Reset();
|
batchLoadConstantBuffer.Reset();
|
||||||
|
registers.raw[method] = argument;
|
||||||
break; // Continue on here to handle the actual method
|
break; // Continue on here to handle the actual method
|
||||||
}
|
}
|
||||||
} else if (batchEnableState.drawActive) { // See DeferredDrawState comment for full details
|
} else if (batchEnableState.drawActive) { // See DeferredDrawState comment for full details
|
||||||
@ -171,7 +174,9 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
|
|||||||
|
|
||||||
// Once we stop calling draw methods flush the current draw since drawing is dependent on the register state not changing
|
// Once we stop calling draw methods flush the current draw since drawing is dependent on the register state not changing
|
||||||
default:
|
default:
|
||||||
|
registers.raw[method] = origRegisterValue;
|
||||||
FlushDeferredDraw();
|
FlushDeferredDraw();
|
||||||
|
registers.raw[method] = argument;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user