From 61a1983092e27df123ff885f9fe7eb799d233dc2 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 14 Jan 2021 01:57:26 -0800 Subject: [PATCH] CreateTexture changes --- src/Refresh.cs | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index b748e4a..a5cf10e 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -490,6 +490,19 @@ namespace RefreshCS public IntPtr byteCode; } + [StructLayout(LayoutKind.Sequential)] + public struct TextureCreateInfo + { + uint width; + uint height; + uint depth; + byte isCube; + SampleCount sampleCount; + uint levelCount; + ColorFormat format; + uint usageFlags; /* Refresh_TextureUsageFlags */ + } + [StructLayout(LayoutKind.Sequential)] public struct ShaderStageState { @@ -706,33 +719,9 @@ namespace RefreshCS ); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr Refresh_CreateTexture2D( + public static extern IntPtr Refresh_CreateTexture( IntPtr device, - ColorFormat format, - uint width, - uint height, - uint levelCount, - uint usageFlags /* TextureUsageFlagBits */ - ); - - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr Refresh_CreateTexture3D( - IntPtr device, - ColorFormat format, - uint width, - uint height, - uint depth, - uint levelCount, - uint usageFlags /* TextureUsageFlagBits */ - ); - - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr Refresh_CreateTextureCube( - IntPtr device, - ColorFormat format, - uint size, - uint levelCount, - uint usageFlags /* TextureUsageFlagBits */ + ref TextureCreateInfo textureCreateInfo ); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]