From edd21ec573bd129300069cfc0bb9be979c0c0d30 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 25 Feb 2022 11:10:35 -0800 Subject: [PATCH] remove count from managed GraphicsPipelineAttachmentInfo --- src/Graphics/Resources/GraphicsPipeline.cs | 6 +++--- src/Graphics/State/GraphicsPipelineAttachmentInfo.cs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Graphics/Resources/GraphicsPipeline.cs b/src/Graphics/Resources/GraphicsPipeline.cs index cb5458f3..14b9c125 100644 --- a/src/Graphics/Resources/GraphicsPipeline.cs +++ b/src/Graphics/Resources/GraphicsPipeline.cs @@ -59,10 +59,10 @@ namespace MoonWorks.Graphics } var colorAttachmentDescriptions = stackalloc Refresh.ColorAttachmentDescription[ - (int) attachmentInfo.ColorAttachmentCount + (int) attachmentInfo.ColorAttachmentDescriptions.Length ]; - for (var i = 0; i < attachmentInfo.ColorAttachmentCount; i += 1) + for (var i = 0; i < attachmentInfo.ColorAttachmentDescriptions.Length; i += 1) { colorAttachmentDescriptions[i].format = (Refresh.TextureFormat) attachmentInfo.ColorAttachmentDescriptions[i].Format; colorAttachmentDescriptions[i].sampleCount = (Refresh.SampleCount) attachmentInfo.ColorAttachmentDescriptions[i].SampleCount; @@ -125,7 +125,7 @@ namespace MoonWorks.Graphics refreshGraphicsPipelineCreateInfo.primitiveType = (Refresh.PrimitiveType) primitiveType; - refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = attachmentInfo.ColorAttachmentCount; + refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = (uint) attachmentInfo.ColorAttachmentDescriptions.Length; refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentDescriptions = (IntPtr) colorAttachmentDescriptions; refreshGraphicsPipelineCreateInfo.attachmentInfo.depthStencilFormat = (Refresh.TextureFormat) attachmentInfo.DepthStencilFormat; refreshGraphicsPipelineCreateInfo.attachmentInfo.hasDepthStencilAttachment = Conversions.BoolToByte(attachmentInfo.HasDepthStencilAttachment); diff --git a/src/Graphics/State/GraphicsPipelineAttachmentInfo.cs b/src/Graphics/State/GraphicsPipelineAttachmentInfo.cs index a0789270..349d441b 100644 --- a/src/Graphics/State/GraphicsPipelineAttachmentInfo.cs +++ b/src/Graphics/State/GraphicsPipelineAttachmentInfo.cs @@ -6,7 +6,6 @@ namespace MoonWorks.Graphics public struct GraphicsPipelineAttachmentInfo { public ColorAttachmentDescription[] ColorAttachmentDescriptions; - public uint ColorAttachmentCount; public bool HasDepthStencilAttachment; public TextureFormat DepthStencilFormat; }