Add missing barriers around CmdFillBuffer (fixes Monster Hunter Rise flickering on NVIDIA)

This commit is contained in:
gdk 2022-04-09 20:19:49 -03:00 committed by riperiperi
parent 80d72504d4
commit 7c32e4a3fe
2 changed files with 23 additions and 1 deletions

View file

@ -140,7 +140,29 @@ namespace Ryujinx.Graphics.Vulkan
var dst = Gd.BufferManager.GetBuffer(CommandBuffer, destination, true).Get(Cbs, offset, size).Value;
BufferHolder.InsertBufferBarrier(
Gd,
Cbs.CommandBuffer,
dst,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
offset,
size);
Gd.Api.CmdFillBuffer(CommandBuffer, dst, (ulong)offset, (ulong)size, value);
BufferHolder.InsertBufferBarrier(
Gd,
Cbs.CommandBuffer,
dst,
AccessFlags.AccessTransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
offset,
size);
}
public unsafe void ClearRenderTargetColor(int index, ColorF color)

View file

@ -192,7 +192,7 @@ namespace Ryujinx.Graphics.Vulkan
if (componentMask != 0xf)
{
// We can't use CmdClearAttachments if the clear has a custom scissor or is not writing all components,
// We can't use CmdClearAttachments if not writing all components,
// because on Vulkan, the pipeline state does not affect clears.
var dstTexture = FramebufferParams.GetAttachment(index);
if (dstTexture == null)