mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-20 04:26:33 +00:00
Vulkan: Fix indirect buffer barrier (#3798)
This commit is contained in:
parent
9719b6a112
commit
28ba55598d
2 changed files with 22 additions and 7 deletions
|
@ -12,13 +12,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
private const int MaxUpdateBufferSize = 0x10000;
|
private const int MaxUpdateBufferSize = 0x10000;
|
||||||
|
|
||||||
public const AccessFlags DefaultAccessFlags =
|
public const AccessFlags DefaultAccessFlags =
|
||||||
|
AccessFlags.AccessIndirectCommandReadBit |
|
||||||
AccessFlags.AccessShaderReadBit |
|
AccessFlags.AccessShaderReadBit |
|
||||||
AccessFlags.AccessShaderWriteBit |
|
AccessFlags.AccessShaderWriteBit |
|
||||||
AccessFlags.AccessTransferReadBit |
|
AccessFlags.AccessTransferReadBit |
|
||||||
AccessFlags.AccessTransferWriteBit |
|
AccessFlags.AccessTransferWriteBit |
|
||||||
AccessFlags.AccessUniformReadBit |
|
AccessFlags.AccessUniformReadBit;
|
||||||
AccessFlags.AccessShaderReadBit |
|
|
||||||
AccessFlags.AccessShaderWriteBit;
|
|
||||||
|
|
||||||
private readonly VulkanRenderer _gd;
|
private readonly VulkanRenderer _gd;
|
||||||
private readonly Device _device;
|
private readonly Device _device;
|
||||||
|
|
|
@ -228,10 +228,26 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CommandBufferBarrier()
|
public unsafe void CommandBufferBarrier()
|
||||||
{
|
{
|
||||||
// TODO: More specific barrier?
|
MemoryBarrier memoryBarrier = new MemoryBarrier()
|
||||||
Barrier();
|
{
|
||||||
|
SType = StructureType.MemoryBarrier,
|
||||||
|
SrcAccessMask = BufferHolder.DefaultAccessFlags,
|
||||||
|
DstAccessMask = AccessFlags.AccessIndirectCommandReadBit
|
||||||
|
};
|
||||||
|
|
||||||
|
Gd.Api.CmdPipelineBarrier(
|
||||||
|
CommandBuffer,
|
||||||
|
PipelineStageFlags.PipelineStageAllCommandsBit,
|
||||||
|
PipelineStageFlags.PipelineStageDrawIndirectBit,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
memoryBarrier,
|
||||||
|
0,
|
||||||
|
null,
|
||||||
|
0,
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyBuffer(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size)
|
public void CopyBuffer(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size)
|
||||||
|
@ -824,7 +840,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (range.Handle != BufferHandle.Null)
|
if (range.Handle != BufferHandle.Null)
|
||||||
{
|
{
|
||||||
_transformFeedbackBuffers[i] =
|
_transformFeedbackBuffers[i] =
|
||||||
new BufferState(Gd.BufferManager.GetBuffer(CommandBuffer, range.Handle, range.Offset, range.Size, true), range.Offset, range.Size);
|
new BufferState(Gd.BufferManager.GetBuffer(CommandBuffer, range.Handle, range.Offset, range.Size, true), range.Offset, range.Size);
|
||||||
_transformFeedbackBuffers[i].BindTransformFeedbackBuffer(Gd, Cbs, (uint)i);
|
_transformFeedbackBuffers[i].BindTransformFeedbackBuffer(Gd, Cbs, (uint)i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue