remove count from managed GraphicsPipelineAttachmentInfo

main
cosmonaut 2022-02-25 11:10:35 -08:00
parent 2469cf530a
commit edd21ec573
2 changed files with 3 additions and 4 deletions

View File

@ -59,10 +59,10 @@ namespace MoonWorks.Graphics
} }
var colorAttachmentDescriptions = stackalloc Refresh.ColorAttachmentDescription[ 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].format = (Refresh.TextureFormat) attachmentInfo.ColorAttachmentDescriptions[i].Format;
colorAttachmentDescriptions[i].sampleCount = (Refresh.SampleCount) attachmentInfo.ColorAttachmentDescriptions[i].SampleCount; colorAttachmentDescriptions[i].sampleCount = (Refresh.SampleCount) attachmentInfo.ColorAttachmentDescriptions[i].SampleCount;
@ -125,7 +125,7 @@ namespace MoonWorks.Graphics
refreshGraphicsPipelineCreateInfo.primitiveType = (Refresh.PrimitiveType) primitiveType; refreshGraphicsPipelineCreateInfo.primitiveType = (Refresh.PrimitiveType) primitiveType;
refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = attachmentInfo.ColorAttachmentCount; refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = (uint) attachmentInfo.ColorAttachmentDescriptions.Length;
refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentDescriptions = (IntPtr) colorAttachmentDescriptions; refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentDescriptions = (IntPtr) colorAttachmentDescriptions;
refreshGraphicsPipelineCreateInfo.attachmentInfo.depthStencilFormat = (Refresh.TextureFormat) attachmentInfo.DepthStencilFormat; refreshGraphicsPipelineCreateInfo.attachmentInfo.depthStencilFormat = (Refresh.TextureFormat) attachmentInfo.DepthStencilFormat;
refreshGraphicsPipelineCreateInfo.attachmentInfo.hasDepthStencilAttachment = Conversions.BoolToByte(attachmentInfo.HasDepthStencilAttachment); refreshGraphicsPipelineCreateInfo.attachmentInfo.hasDepthStencilAttachment = Conversions.BoolToByte(attachmentInfo.HasDepthStencilAttachment);

View File

@ -6,7 +6,6 @@ namespace MoonWorks.Graphics
public struct GraphicsPipelineAttachmentInfo public struct GraphicsPipelineAttachmentInfo
{ {
public ColorAttachmentDescription[] ColorAttachmentDescriptions; public ColorAttachmentDescription[] ColorAttachmentDescriptions;
public uint ColorAttachmentCount;
public bool HasDepthStencilAttachment; public bool HasDepthStencilAttachment;
public TextureFormat DepthStencilFormat; public TextureFormat DepthStencilFormat;
} }