mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Vulkan: Fix barriers on macOS (#5700)
* Use old method on macOS * gdk suggestions * Update src/Ryujinx.Graphics.Vulkan/TextureStorage.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Update src/Ryujinx.Graphics.Vulkan/TextureStorage.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> --------- Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
parent
fe9e19d8cc
commit
d9f9bbfaa6
|
@ -454,13 +454,36 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (lastReadStage != PipelineStageFlags.None)
|
if (lastReadStage != PipelineStageFlags.None)
|
||||||
{
|
{
|
||||||
TextureView.InsertMemoryBarrier(
|
// This would result in a validation error, but is
|
||||||
_gd.Api,
|
// required on MoltenVK as the generic barrier results in
|
||||||
cbs.CommandBuffer,
|
// severe texture flickering in some scenarios.
|
||||||
_lastReadAccess,
|
if (_gd.IsMoltenVk)
|
||||||
dstAccessFlags,
|
{
|
||||||
lastReadStage,
|
ImageAspectFlags aspectFlags = Info.Format.ConvertAspectFlags();
|
||||||
dstStageFlags);
|
TextureView.InsertImageBarrier(
|
||||||
|
_gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
_imageAuto.Get(cbs).Value,
|
||||||
|
_lastReadAccess,
|
||||||
|
dstAccessFlags,
|
||||||
|
_lastReadStage,
|
||||||
|
dstStageFlags,
|
||||||
|
aspectFlags,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
_info.GetLayers(),
|
||||||
|
_info.Levels);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextureView.InsertMemoryBarrier(
|
||||||
|
_gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
_lastReadAccess,
|
||||||
|
dstAccessFlags,
|
||||||
|
lastReadStage,
|
||||||
|
dstStageFlags);
|
||||||
|
}
|
||||||
|
|
||||||
_lastReadAccess = AccessFlags.None;
|
_lastReadAccess = AccessFlags.None;
|
||||||
_lastReadStage = PipelineStageFlags.None;
|
_lastReadStage = PipelineStageFlags.None;
|
||||||
|
@ -474,13 +497,36 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (_lastModificationAccess != AccessFlags.None)
|
if (_lastModificationAccess != AccessFlags.None)
|
||||||
{
|
{
|
||||||
TextureView.InsertMemoryBarrier(
|
// This would result in a validation error, but is
|
||||||
_gd.Api,
|
// required on MoltenVK as the generic barrier results in
|
||||||
cbs.CommandBuffer,
|
// severe texture flickering in some scenarios.
|
||||||
_lastModificationAccess,
|
if (_gd.IsMoltenVk)
|
||||||
dstAccessFlags,
|
{
|
||||||
_lastModificationStage,
|
ImageAspectFlags aspectFlags = Info.Format.ConvertAspectFlags();
|
||||||
dstStageFlags);
|
TextureView.InsertImageBarrier(
|
||||||
|
_gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
_imageAuto.Get(cbs).Value,
|
||||||
|
_lastModificationAccess,
|
||||||
|
dstAccessFlags,
|
||||||
|
_lastModificationStage,
|
||||||
|
dstStageFlags,
|
||||||
|
aspectFlags,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
_info.GetLayers(),
|
||||||
|
_info.Levels);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextureView.InsertMemoryBarrier(
|
||||||
|
_gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
_lastModificationAccess,
|
||||||
|
dstAccessFlags,
|
||||||
|
_lastModificationStage,
|
||||||
|
dstStageFlags);
|
||||||
|
}
|
||||||
|
|
||||||
_lastModificationAccess = AccessFlags.None;
|
_lastModificationAccess = AccessFlags.None;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue