1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 13:54:16 +01:00

[d3d11] Reset dirty tracking when re-applying context state

This commit is contained in:
Philip Rebohle 2025-02-19 15:40:47 +01:00 committed by Philip Rebohle
parent 9d890c75ac
commit 3e6dfcfb15
3 changed files with 18 additions and 1 deletions

View File

@ -4746,6 +4746,15 @@ namespace dxvk {
} }
template<typename ContextType>
void D3D11CommonContext<ContextType>::ResetDirtyTracking() {
// Must only be called when all bindings are guaranteed to get applied
// to the DXVK context before the next draw or dispatch command.
m_state.lazy.bindingsDirty.reset();
m_state.lazy.shadersDirty = 0u;
}
template<typename ContextType> template<typename ContextType>
void D3D11CommonContext<ContextType>::ResetStagingBuffer() { void D3D11CommonContext<ContextType>::ResetStagingBuffer() {
m_staging.reset(); m_staging.reset();
@ -4880,6 +4889,8 @@ namespace dxvk {
for (uint32_t i = 0; i < m_state.so.targets.size(); i++) for (uint32_t i = 0; i < m_state.so.targets.size(); i++)
BindXfbBuffer(i, m_state.so.targets[i].buffer.ptr(), ~0u); BindXfbBuffer(i, m_state.so.targets[i].buffer.ptr(), ~0u);
ResetDirtyTracking();
for (uint32_t i = 0; i < uint32_t(DxbcProgramType::Count); i++) { for (uint32_t i = 0; i < uint32_t(DxbcProgramType::Count); i++) {
auto stage = DxbcProgramType(i); auto stage = DxbcProgramType(i);

View File

@ -992,6 +992,8 @@ namespace dxvk {
void ResetContextState(); void ResetContextState();
void ResetDirtyTracking();
void ResetStagingBuffer(); void ResetStagingBuffer();
template<DxbcProgramType ShaderStage, typename T> template<DxbcProgramType ShaderStage, typename T>

View File

@ -754,7 +754,11 @@ namespace dxvk {
if (!pState) if (!pState)
return; return;
// Reset all state affected by the current context state // Clear dirty tracking here since all context state will be
// re-applied anyway when the context state is swapped in again.
ResetDirtyTracking();
// Reset all state affected by the current context state.
ResetCommandListState(); ResetCommandListState();
Com<D3D11DeviceContextState, false> oldState = std::move(m_stateObject); Com<D3D11DeviceContextState, false> oldState = std::move(m_stateObject);