Fix some Vulkan validation errors (#4357)
This commit is contained in:
parent
26bf13a65d
commit
f6d5499a16
4 changed files with 26 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue