Preload command speedup, Texture/buffer data flush, blit shader fix (#30)

* Move encoder state to be tied to command buffer, so preload and background cbs have their own encoder state

* Texture buffer/data flush, blit shader fix
This commit is contained in:
riperiperi
2024-06-30 17:23:53 +01:00
committed by Evan Husted
parent 7d5b4c5d1d
commit 879c93cf73
13 changed files with 414 additions and 204 deletions

View File

@@ -277,7 +277,7 @@ namespace Ryujinx.Graphics.Metal
DirtyFlags clearFlags = DirtyFlags.All & (~DirtyFlags.Scissors);
// Save current state
EncoderState originalState = _pipeline.SwapState(_helperShaderState, clearFlags);
EncoderState originalState = _pipeline.SwapState(_helperShaderState, clearFlags, false);
// Inherit some state without fully recreating render pipeline.
RenderTargetCopy save = _helperShaderState.InheritForClear(originalState, false, index);
@@ -312,7 +312,7 @@ namespace Ryujinx.Graphics.Metal
_pipeline.Draw(4, 1, 0, 0);
// Restore previous state
_pipeline.SwapState(null, clearFlags);
_pipeline.SwapState(null, clearFlags, false);
_helperShaderState.Restore(save);
}
@@ -330,7 +330,7 @@ namespace Ryujinx.Graphics.Metal
var helperScissors = _helperShaderState.Scissors;
// Save current state
EncoderState originalState = _pipeline.SwapState(_helperShaderState, clearFlags);
EncoderState originalState = _pipeline.SwapState(_helperShaderState, clearFlags, false);
// Inherit some state without fully recreating render pipeline.
RenderTargetCopy save = _helperShaderState.InheritForClear(originalState, true);
@@ -365,7 +365,7 @@ namespace Ryujinx.Graphics.Metal
_pipeline.SetStencilTest(CreateStencilTestDescriptor(false));
// Restore previous state
_pipeline.SwapState(null, clearFlags);
_pipeline.SwapState(null, clearFlags, false);
_helperShaderState.Restore(save);
}