From d844fe56ee16e7e0e0ae4f4ff1814292e499dff7 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 1 Mar 2022 22:56:46 -0800 Subject: [PATCH] presentation ABI break --- src/Refresh.cs | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index e4991af..7d6c738 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -85,6 +85,7 @@ namespace RefreshCS public enum TextureFormat { R8G8B8A8, + B8G8R8A8, R5G6B5, A1R5G5B5, B4G4R4A4, @@ -586,7 +587,11 @@ namespace RefreshCS public struct ColorAttachmentInfo { - public IntPtr renderTarget; + public IntPtr texture; + public uint depth; + public uint layer; + public uint level; + public SampleCount sampleCount; public Vec4 clearColor; public LoadOp loadOp; public StoreOp storeOp; @@ -594,8 +599,11 @@ namespace RefreshCS public struct DepthStencilAttachmentInfo { - public IntPtr depthStencilTarget; - public DepthStencilValue depthStencilValue; + public IntPtr texture; + public uint depth; + public uint layer; + public uint level; + public DepthStencilValue depthStencilClearValue; public LoadOp loadOp; public StoreOp storeOp; public LoadOp stencilLoadOp; @@ -713,13 +721,6 @@ namespace RefreshCS in TextureCreateInfo textureCreateInfo ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr Refresh_CreateRenderTarget( - IntPtr device, - in TextureSlice textureSlice, - SampleCount multisampleCount - ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_CreateBuffer( IntPtr device, @@ -835,13 +836,6 @@ namespace RefreshCS IntPtr buffer ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void Refresh_QueueDestroyRenderTarget( - IntPtr device, - IntPtr commandBuffer, - IntPtr renderTarget - ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Refresh_QueueDestroyShaderModule( IntPtr device, @@ -963,22 +957,15 @@ namespace RefreshCS ); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void Refresh_QueuePresent( + public static extern IntPtr Refresh_AcquireSwapchainTexture( IntPtr device, IntPtr commandBuffer, - in TextureSlice textureSlice, - in Rect destinationRectangle, - Filter filter, IntPtr windowHandle ); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void Refresh_QueuePresent( + public static extern TextureFormat Refresh_GetSwapchainFormat( IntPtr device, - IntPtr commandBuffer, - in TextureSlice textureSlice, - IntPtr destinationRectangle, /* null Rect */ - Filter filter, IntPtr windowHandle ); @@ -1012,6 +999,7 @@ namespace RefreshCS [MarshalAs(UnmanagedType.LPStr)] string filename, int w, int h, + byte bgra, IntPtr data ); }