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
This commit is contained in:
parent
96d1f0da2d
commit
832a5e8852
5 changed files with 49 additions and 0 deletions
|
@ -294,6 +294,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
int attachmentCount = 0;
|
||||
int maxColorAttachmentIndex = -1;
|
||||
uint attachmentIntegerFormatMask = 0;
|
||||
|
||||
for (int i = 0; i < Constants.MaxRenderTargets; i++)
|
||||
{
|
||||
|
@ -301,6 +302,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
pipeline.Internal.AttachmentFormats[attachmentCount++] = gd.FormatCapabilities.ConvertToVkFormat(state.AttachmentFormats[i]);
|
||||
maxColorAttachmentIndex = i;
|
||||
|
||||
if (state.AttachmentFormats[i].IsInteger())
|
||||
{
|
||||
attachmentIntegerFormatMask |= 1u << i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,6 +317,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
pipeline.ColorBlendAttachmentStateCount = (uint)(maxColorAttachmentIndex + 1);
|
||||
pipeline.VertexAttributeDescriptionsCount = (uint)Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount);
|
||||
pipeline.Internal.AttachmentIntegerFormatMask = attachmentIntegerFormatMask;
|
||||
|
||||
return pipeline;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue