mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-28 11:50:50 +01:00
do memory barriers
This commit is contained in:
parent
17334b2131
commit
1a0b928c35
@ -73,6 +73,9 @@ namespace Ryujinx.Graphics.Metal
|
||||
_pipeline.SaveState();
|
||||
|
||||
_pipeline.SetProgram(_programColorBlit);
|
||||
// Viewport and scissor needs to be set before render pass begin so as not to bind the old ones
|
||||
//_pipeline.SetViewports([]);
|
||||
//_pipeline.SetScissors([]);
|
||||
_pipeline.SetRenderTargets([destination], null);
|
||||
_pipeline.SetTextureAndSampler(ShaderStage.Fragment, 0, source, new Sampler(sampler));
|
||||
_pipeline.SetPrimitiveTopology(PrimitiveTopology.Triangles);
|
||||
|
@ -191,7 +191,22 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
public void Barrier()
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
||||
|
||||
if (_currentEncoderType == EncoderType.Render)
|
||||
{
|
||||
var renderCommandEncoder = GetOrCreateRenderEncoder();
|
||||
|
||||
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets;
|
||||
MTLRenderStages stages = MTLRenderStages.RenderStageVertex | MTLRenderStages.RenderStageFragment;
|
||||
renderCommandEncoder.MemoryBarrier(scope, stages, stages);
|
||||
} else if (_currentEncoderType == EncoderType.Compute)
|
||||
{
|
||||
var computeCommandEncoder = GetOrCreateComputeEncoder();
|
||||
|
||||
// TODO: Should there be a barrier on render targets?
|
||||
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures;
|
||||
computeCommandEncoder.MemoryBarrier(scope);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearBuffer(BufferHandle destination, int offset, int size, uint value)
|
||||
|
Loading…
Reference in New Issue
Block a user