aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-05-28 19:38:04 -0300
committerGitHub <noreply@github.com>2023-05-29 00:38:04 +0200
commit832a5e885281f6063f7855e92c3cf85eac82e715 (patch)
tree027efa0005b63097f7824cb7c91c3c7278f69372 /src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
parent96d1f0da2d10545600d83a88e63cfef9b2785e25 (diff)
Make sure blend is disabled if render target has integer format (#5122)
* Make sure blend is disabled if render target has integer format * Change approach to avoid permanently mutating state
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs')
-rw-r--r--src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs b/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
index cde99202..0437a402 100644
--- a/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
+++ b/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
@@ -21,6 +21,7 @@ namespace Ryujinx.Graphics.Vulkan
public uint[] AttachmentSamples { get; }
public VkFormat[] AttachmentFormats { get; }
public int[] AttachmentIndices { get; }
+ public uint AttachmentIntegerFormatMask { get; }
public int AttachmentsCount { get; }
public int MaxColorAttachmentIndex => AttachmentIndices.Length > 0 ? AttachmentIndices[AttachmentIndices.Length - 1] : -1;
@@ -74,6 +75,7 @@ namespace Ryujinx.Graphics.Vulkan
int index = 0;
int bindIndex = 0;
+ uint attachmentIntegerFormatMask = 0;
foreach (ITexture color in colors)
{
@@ -89,6 +91,11 @@ namespace Ryujinx.Graphics.Vulkan
AttachmentFormats[index] = texture.VkFormat;
AttachmentIndices[index] = bindIndex;
+ if (texture.Info.Format.IsInteger())
+ {
+ attachmentIntegerFormatMask |= 1u << bindIndex;
+ }
+
width = Math.Min(width, (uint)texture.Width);
height = Math.Min(height, (uint)texture.Height);
layers = Math.Min(layers, (uint)texture.Layers);
@@ -102,6 +109,8 @@ namespace Ryujinx.Graphics.Vulkan
bindIndex++;
}
+ AttachmentIntegerFormatMask = attachmentIntegerFormatMask;
+
if (depthStencil is TextureView dsTexture && dsTexture.Valid)
{
_attachments[count - 1] = dsTexture.GetImageViewForAttachment();