diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-02-08 10:34:22 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 14:34:22 +0100 |
commit | f6d5499a16a45347c08d444d76b1355c74194301 (patch) | |
tree | eb8678e76fcf749ff7aed0ac9cc29f6453d4d40a /Ryujinx.Graphics.Vulkan/PipelineConverter.cs | |
parent | 26bf13a65d6689601593a8050970d6835fd9dfe2 (diff) |
Fix some Vulkan validation errors (#4357)1.1.607
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/PipelineConverter.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/PipelineConverter.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index 26d34e54..5c9193fa 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -27,6 +27,7 @@ namespace Ryujinx.Graphics.Vulkan int attachmentCount = 0; int colorCount = 0; + int maxColorAttachmentIndex = -1; for (int i = 0; i < state.AttachmentEnable.Length; i++) { @@ -36,6 +37,7 @@ namespace Ryujinx.Graphics.Vulkan attachmentIndices[attachmentCount++] = i; colorCount++; + maxColorAttachmentIndex = i; } } @@ -73,12 +75,11 @@ namespace Ryujinx.Graphics.Vulkan if (colorAttachmentsCount != 0) { - int maxAttachmentIndex = Constants.MaxRenderTargets - 1; - subpass.ColorAttachmentCount = (uint)maxAttachmentIndex + 1; + subpass.ColorAttachmentCount = (uint)maxColorAttachmentIndex + 1; subpass.PColorAttachments = &attachmentReferences[0]; // Fill with VK_ATTACHMENT_UNUSED to cover any gaps. - for (int i = 0; i <= maxAttachmentIndex; i++) + for (int i = 0; i <= maxColorAttachmentIndex; i++) { subpass.PColorAttachments[i] = new AttachmentReference(Vk.AttachmentUnused, ImageLayout.Undefined); } |