From eaed76f4dcc60022b3f10997fb34eb8ead9ae7d7 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 28 Sep 2022 16:51:52 -0700 Subject: [PATCH 1/3] initial refresh backend selection API support --- src/Refresh.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Refresh.cs b/src/Refresh.cs index ef0a9e2..ae93551 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -315,6 +315,14 @@ namespace RefreshCS IntOpaqueWhite } + public enum Backend + { + DontCare, + Vulkan, + PS5, + Invalid + } + /* Native Structures */ [StructLayout(LayoutKind.Sequential)] @@ -585,6 +593,12 @@ namespace RefreshCS /* Init/Quit */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern Backend Refresh_SelectBackend( + Backend preferredBackend, + out uint flags + ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_CreateDevice( in PresentationParameters presentationParameters, -- 2.25.1 From 7c31601ab48ca0ccf3f475193643ca5f652bd509 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 29 Sep 2022 13:55:02 -0700 Subject: [PATCH 2/3] swapchain API revision --- src/Refresh.cs | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index ae93551..796ee56 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -371,13 +371,6 @@ namespace RefreshCS public uint level; } - [StructLayout(LayoutKind.Sequential)] - public struct PresentationParameters - { - public IntPtr deviceWindowHandle; - public PresentMode presentMode; - } - [StructLayout(LayoutKind.Sequential)] public struct SamplerStateCreateInfo { @@ -601,7 +594,6 @@ namespace RefreshCS [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_CreateDevice( - in PresentationParameters presentationParameters, byte debugMode ); @@ -954,6 +946,32 @@ namespace RefreshCS /* Submission/Presentation */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern byte Refresh_ClaimWindow( + IntPtr device, + IntPtr windowHandle, + PresentMode presentMode + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_UnclaimWindow( + IntPtr device, + IntPtr windowHandle + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_SetSwapchainPresentMode( + IntPtr device, + IntPtr windowHandle, + PresentMode presentMode + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern TextureFormat Refresh_GetSwapchainFormat( + IntPtr device, + IntPtr windowHandle + ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_AcquireCommandBuffer( IntPtr device, @@ -969,12 +987,6 @@ namespace RefreshCS out uint height ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern TextureFormat Refresh_GetSwapchainFormat( - IntPtr device, - IntPtr windowHandle - ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Refresh_Submit( IntPtr device, -- 2.25.1 From d757d69009078e1ccade66e672b435736326dd7e Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 29 Sep 2022 14:17:57 -0700 Subject: [PATCH 3/3] 1.8.0 --- src/Refresh.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index 796ee56..850b75a 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -36,7 +36,7 @@ namespace RefreshCS /* Version */ public const uint REFRESH_MAJOR_VERSION = 1; - public const uint REFRESH_MINOR_VERSION = 7; + public const uint REFRESH_MINOR_VERSION = 8; public const uint REFRESH_PATCH_VERSION = 0; public const uint REFRESH_COMPILED_VERSION = ( -- 2.25.1