From fbed91bfd6f09ae7864193ae620363547382f2fc Mon Sep 17 00:00:00 2001
From: cosmonaut <evan@moonside.games>
Date: Fri, 15 Jan 2021 19:05:28 -0800
Subject: [PATCH] fix some oversights

---
 src/Refresh.cs | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/Refresh.cs b/src/Refresh.cs
index 6917d49..6beba39 100644
--- a/src/Refresh.cs
+++ b/src/Refresh.cs
@@ -66,11 +66,14 @@ namespace RefreshCS
             DontCare
         }
 
-        public enum ClearOptionsBits
+        [Flags]
+        public enum ClearOptionsFlags : uint
         {
             Color = 1,
             Depth = 2,
-            Stencil = 4
+            Stencil = 4,
+            DepthStencil = Depth | Stencil,
+            All = Color | Depth | Stencil
         }
 
         public enum IndexElementSize
@@ -585,8 +588,8 @@ namespace RefreshCS
         [StructLayout(LayoutKind.Sequential)]
         public struct ComputePipelineCreateInfo
         {
-            ShaderStageState computeShaderState;
-            ComputePipelineLayoutCreateInfo pipelineLayoutCreateInfo;
+            public ShaderStageState computeShaderState;
+            public ComputePipelineLayoutCreateInfo pipelineLayoutCreateInfo;
         }
 
         [StructLayout(LayoutKind.Sequential)]
@@ -646,7 +649,7 @@ namespace RefreshCS
             IntPtr device,
             IntPtr commandBuffer,
             ref Rect clearRect,
-            uint clearOptions,
+            Refresh.ClearOptionsFlags clearOptions,
             ref Color[] colors,
             uint colorCount,
             float depth,
@@ -803,13 +806,21 @@ namespace RefreshCS
             IntPtr buffer
         );
 
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void Refresh_GetBufferData(
+            IntPtr device,
+            IntPtr buffer,
+            IntPtr data,
+            uint dataLengthInBytes
+        );
+
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void Refresh_SetBufferData(
             IntPtr device,
             IntPtr buffer,
             uint offsetInBytes,
             IntPtr data,
-            uint dataLength
+            uint dataLengthInBytes
         );
 
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]