mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 02:53:04 +00:00
Cleanup
This commit is contained in:
parent
b0ba5d5da1
commit
aae9dc0c2e
2 changed files with 20 additions and 22 deletions
|
@ -54,11 +54,6 @@ namespace Ryujinx.Graphics.Metal
|
||||||
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferHandle CreateBuffer(int size, BufferAccess access, BufferHandle storageHint)
|
|
||||||
{
|
|
||||||
return CreateBuffer(size, access);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BufferHandle CreateBuffer(IntPtr pointer, int size)
|
public BufferHandle CreateBuffer(IntPtr pointer, int size)
|
||||||
{
|
{
|
||||||
var buffer = _device.NewBuffer(pointer, (ulong)size, MTLResourceOptions.ResourceStorageModeShared);
|
var buffer = _device.NewBuffer(pointer, (ulong)size, MTLResourceOptions.ResourceStorageModeShared);
|
||||||
|
|
|
@ -205,26 +205,29 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
public void Barrier()
|
public void Barrier()
|
||||||
{
|
{
|
||||||
|
switch (_currentEncoderType)
|
||||||
if (_currentEncoderType == EncoderType.Render)
|
|
||||||
{
|
{
|
||||||
var renderCommandEncoder = GetOrCreateRenderEncoder();
|
case EncoderType.Render:
|
||||||
|
{
|
||||||
|
var renderCommandEncoder = GetOrCreateRenderEncoder();
|
||||||
|
|
||||||
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets;
|
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets;
|
||||||
MTLRenderStages stages = MTLRenderStages.RenderStageVertex | MTLRenderStages.RenderStageFragment;
|
MTLRenderStages stages = MTLRenderStages.RenderStageVertex | MTLRenderStages.RenderStageFragment;
|
||||||
renderCommandEncoder.MemoryBarrier(scope, stages, stages);
|
renderCommandEncoder.MemoryBarrier(scope, stages, stages);
|
||||||
}
|
break;
|
||||||
else if (_currentEncoderType == EncoderType.Compute)
|
}
|
||||||
{
|
case EncoderType.Compute:
|
||||||
var computeCommandEncoder = GetOrCreateComputeEncoder();
|
{
|
||||||
|
var computeCommandEncoder = GetOrCreateComputeEncoder();
|
||||||
|
|
||||||
// TODO: Should there be a barrier on render targets?
|
// TODO: Should there be a barrier on render targets?
|
||||||
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures;
|
var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures;
|
||||||
computeCommandEncoder.MemoryBarrier(scope);
|
computeCommandEncoder.MemoryBarrier(scope);
|
||||||
}
|
break;
|
||||||
else
|
}
|
||||||
{
|
default:
|
||||||
Logger.Warning?.Print(LogClass.Gpu, "Barrier called outside of a render or compute pass");
|
Logger.Warning?.Print(LogClass.Gpu, "Barrier called outside of a render or compute pass");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue