1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-20 10:12:02 +00:00

CommandBufferBarrier

This commit is contained in:
Isaac Marovitz 2024-06-27 22:51:12 +01:00 committed by Isaac Marovitz
parent e27ade5aee
commit c8c4fd730d

View file

@ -285,14 +285,10 @@ namespace Ryujinx.Graphics.Metal
{ {
var computeCommandEncoder = GetOrCreateComputeEncoder(); var computeCommandEncoder = GetOrCreateComputeEncoder();
// TODO: Should there be a barrier on render targets? var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets;;
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures;
computeCommandEncoder.MemoryBarrier(scope); computeCommandEncoder.MemoryBarrier(scope);
break; break;
} }
default:
Logger.Warning?.Print(LogClass.Gpu, "Barrier called outside of a render or compute pass");
break;
} }
} }
@ -344,7 +340,7 @@ namespace Ryujinx.Graphics.Metal
public void CommandBufferBarrier() public void CommandBufferBarrier()
{ {
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!"); Barrier();
} }
public void CopyBuffer(BufferHandle src, BufferHandle dst, int srcOffset, int dstOffset, int size) public void CopyBuffer(BufferHandle src, BufferHandle dst, int srcOffset, int dstOffset, int size)
@ -700,11 +696,14 @@ namespace Ryujinx.Graphics.Metal
} }
public void TextureBarrier() public void TextureBarrier()
{
if (CurrentEncoderType == EncoderType.Render)
{ {
var renderCommandEncoder = GetOrCreateRenderEncoder(); var renderCommandEncoder = GetOrCreateRenderEncoder();
renderCommandEncoder.MemoryBarrier(MTLBarrierScope.Textures, MTLRenderStages.RenderStageFragment, MTLRenderStages.RenderStageFragment); renderCommandEncoder.MemoryBarrier(MTLBarrierScope.Textures, MTLRenderStages.RenderStageFragment, MTLRenderStages.RenderStageFragment);
} }
}
public void TextureBarrierTiled() public void TextureBarrierTiled()
{ {