Capitalized attachment info struct member names

pull/15/head
Caleb Cornett 2022-02-25 11:15:48 -05:00
parent e5213da686
commit 2469cf530a
4 changed files with 38 additions and 38 deletions

View File

@ -58,7 +58,7 @@ namespace MoonWorks.Graphics
Refresh.Refresh_BeginRenderPass( Refresh.Refresh_BeginRenderPass(
Device.Handle, Device.Handle,
Handle, Handle,
colorAttachmentInfos[0].renderTarget.TextureSlice.Rectangle.ToRefresh(), colorAttachmentInfos[0].RenderTarget.TextureSlice.Rectangle.ToRefresh(),
(IntPtr) pColorAttachmentInfos, (IntPtr) pColorAttachmentInfos,
(uint) colorAttachmentInfos.Length, (uint) colorAttachmentInfos.Length,
IntPtr.Zero IntPtr.Zero
@ -106,7 +106,7 @@ namespace MoonWorks.Graphics
Refresh.Refresh_BeginRenderPass( Refresh.Refresh_BeginRenderPass(
Device.Handle, Device.Handle,
Handle, Handle,
colorAttachmentInfos[0].renderTarget.TextureSlice.Rectangle.ToRefresh(), colorAttachmentInfos[0].RenderTarget.TextureSlice.Rectangle.ToRefresh(),
pColorAttachmentInfos, pColorAttachmentInfos,
(uint) colorAttachmentInfos.Length, (uint) colorAttachmentInfos.Length,
&refreshDepthStencilAttachmentInfo &refreshDepthStencilAttachmentInfo

View File

@ -102,25 +102,25 @@ namespace MoonWorks.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct ColorAttachmentInfo public struct ColorAttachmentInfo
{ {
public RenderTarget renderTarget; public RenderTarget RenderTarget;
public Color clearColor; public Color ClearColor;
public LoadOp loadOp; public LoadOp LoadOp;
public StoreOp storeOp; public StoreOp StoreOp;
public Refresh.ColorAttachmentInfo ToRefresh() public Refresh.ColorAttachmentInfo ToRefresh()
{ {
return new Refresh.ColorAttachmentInfo return new Refresh.ColorAttachmentInfo
{ {
renderTarget = renderTarget.Handle, renderTarget = RenderTarget.Handle,
clearColor = new Refresh.Vec4 clearColor = new Refresh.Vec4
{ {
x = clearColor.R / 255f, x = ClearColor.R / 255f,
y = clearColor.G / 255f, y = ClearColor.G / 255f,
z = clearColor.B / 255f, z = ClearColor.B / 255f,
w = clearColor.A / 255f w = ClearColor.A / 255f
}, },
loadOp = (Refresh.LoadOp) loadOp, loadOp = (Refresh.LoadOp) LoadOp,
storeOp = (Refresh.StoreOp) storeOp storeOp = (Refresh.StoreOp) StoreOp
}; };
} }
} }
@ -128,23 +128,23 @@ namespace MoonWorks.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct DepthStencilAttachmentInfo public struct DepthStencilAttachmentInfo
{ {
public RenderTarget depthStencilTarget; public RenderTarget DepthStencilTarget;
public DepthStencilValue depthStencilValue; public DepthStencilValue DepthStencilValue;
public LoadOp loadOp; public LoadOp LoadOp;
public StoreOp storeOp; public StoreOp StoreOp;
public LoadOp stencilLoadOp; public LoadOp StencilLoadOp;
public StoreOp stencilStoreOp; public StoreOp StencilStoreOp;
public Refresh.DepthStencilAttachmentInfo ToRefresh() public Refresh.DepthStencilAttachmentInfo ToRefresh()
{ {
return new Refresh.DepthStencilAttachmentInfo return new Refresh.DepthStencilAttachmentInfo
{ {
depthStencilTarget = depthStencilTarget.Handle, depthStencilTarget = DepthStencilTarget.Handle,
depthStencilValue = depthStencilValue.ToRefresh(), depthStencilValue = DepthStencilValue.ToRefresh(),
loadOp = (Refresh.LoadOp) loadOp, loadOp = (Refresh.LoadOp) LoadOp,
storeOp = (Refresh.StoreOp) storeOp, storeOp = (Refresh.StoreOp) StoreOp,
stencilLoadOp = (Refresh.LoadOp) stencilLoadOp, stencilLoadOp = (Refresh.LoadOp) StencilLoadOp,
stencilStoreOp = (Refresh.StoreOp) stencilStoreOp stencilStoreOp = (Refresh.StoreOp) StencilStoreOp
}; };
} }
} }
@ -152,7 +152,7 @@ namespace MoonWorks.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct ColorAttachmentDescription public struct ColorAttachmentDescription
{ {
public TextureFormat format; public TextureFormat Format;
public SampleCount sampleCount; public SampleCount SampleCount;
} }
} }

View File

@ -59,13 +59,13 @@ namespace MoonWorks.Graphics
} }
var colorAttachmentDescriptions = stackalloc Refresh.ColorAttachmentDescription[ var colorAttachmentDescriptions = stackalloc Refresh.ColorAttachmentDescription[
(int) attachmentInfo.colorAttachmentCount (int) attachmentInfo.ColorAttachmentCount
]; ];
for (var i = 0; i < attachmentInfo.colorAttachmentCount; i += 1) for (var i = 0; i < attachmentInfo.ColorAttachmentCount; 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;
} }
Refresh.GraphicsPipelineCreateInfo refreshGraphicsPipelineCreateInfo; Refresh.GraphicsPipelineCreateInfo refreshGraphicsPipelineCreateInfo;
@ -125,10 +125,10 @@ namespace MoonWorks.Graphics
refreshGraphicsPipelineCreateInfo.primitiveType = (Refresh.PrimitiveType) primitiveType; refreshGraphicsPipelineCreateInfo.primitiveType = (Refresh.PrimitiveType) primitiveType;
refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = attachmentInfo.colorAttachmentCount; refreshGraphicsPipelineCreateInfo.attachmentInfo.colorAttachmentCount = attachmentInfo.ColorAttachmentCount;
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);
Handle = Refresh.Refresh_CreateGraphicsPipeline(device.Handle, refreshGraphicsPipelineCreateInfo); Handle = Refresh.Refresh_CreateGraphicsPipeline(device.Handle, refreshGraphicsPipelineCreateInfo);

View File

@ -5,9 +5,9 @@ namespace MoonWorks.Graphics
/// </summary> /// </summary>
public struct GraphicsPipelineAttachmentInfo public struct GraphicsPipelineAttachmentInfo
{ {
public ColorAttachmentDescription[] colorAttachmentDescriptions; public ColorAttachmentDescription[] ColorAttachmentDescriptions;
public uint colorAttachmentCount; public uint ColorAttachmentCount;
public bool hasDepthStencilAttachment; public bool HasDepthStencilAttachment;
public TextureFormat depthStencilFormat; public TextureFormat DepthStencilFormat;
} }
} }