Compare commits
	
		
			15 Commits 
		
	
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | b92ecb60e3 | |
|  | 995a54fa2d | |
|  | 1bf28f4397 | |
|  | 8f42783fd1 | |
|  | 029f19196a | |
|  | 22b6a83aea | |
|  | 55acf6ee18 | |
|  | 859675dbab | |
|  | 7465d4d4de | |
|  | 86cc5fa142 | |
|  | 4268db4616 | |
|  | 020e76782a | |
|  | 031ad4c047 | |
|  | 2e346d8401 | |
|  | ad0b168c47 | 
|  | @ -4,7 +4,6 @@ | |||
|     <TargetFramework>netstandard2.0</TargetFramework> | ||||
|     <RootNamespace>RefreshCS</RootNamespace> | ||||
|     <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||||
|     <Platforms>x64</Platforms> | ||||
|   </PropertyGroup> | ||||
| 
 | ||||
| 	<ItemGroup> | ||||
|  |  | |||
							
								
								
									
										492
									
								
								src/Refresh.cs
								
								
								
								
							
							
						
						
									
										492
									
								
								src/Refresh.cs
								
								
								
								
							|  | @ -35,8 +35,8 @@ namespace RefreshCS | |||
| 
 | ||||
| 		/* Version */ | ||||
| 
 | ||||
| 		public const uint REFRESH_MAJOR_VERSION = 1; | ||||
| 		public const uint REFRESH_MINOR_VERSION = 15; | ||||
| 		public const uint REFRESH_MAJOR_VERSION = 2; | ||||
| 		public const uint REFRESH_MINOR_VERSION = 0; | ||||
| 		public const uint REFRESH_PATCH_VERSION = 0; | ||||
| 
 | ||||
| 		public const uint REFRESH_COMPILED_VERSION = ( | ||||
|  | @ -308,10 +308,29 @@ namespace RefreshCS | |||
| 			IntOpaqueWhite | ||||
| 		} | ||||
| 
 | ||||
| 		public enum TransferUsage | ||||
| 		{ | ||||
| 			Buffer, | ||||
| 			Texture | ||||
| 		} | ||||
| 
 | ||||
| 		public enum TransferOptions | ||||
| 		{ | ||||
| 			Cycle, | ||||
| 			Unsafe | ||||
| 		} | ||||
| 
 | ||||
| 		public enum WriteOptions | ||||
| 		{ | ||||
| 			Cycle, | ||||
| 			Unsafe, | ||||
| 			Safe | ||||
| 		} | ||||
| 
 | ||||
| 		public enum Backend | ||||
| 		{ | ||||
| 			DontCare, | ||||
| 			Vulkan, | ||||
| 			D3D11, | ||||
| 			PS5, | ||||
| 			Invalid | ||||
| 		} | ||||
|  | @ -358,10 +377,36 @@ namespace RefreshCS | |||
| 		public struct TextureSlice | ||||
| 		{ | ||||
| 			public IntPtr texture; | ||||
| 			public Rect rectangle; | ||||
| 			public uint depth; | ||||
| 			public uint mipLevel; | ||||
| 			public uint layer; | ||||
| 			public uint level; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct TextureRegion | ||||
| 		{ | ||||
| 			public TextureSlice textureSlice; | ||||
| 			public uint x; | ||||
| 			public uint y; | ||||
| 			public uint z; | ||||
| 			public uint w; | ||||
| 			public uint h; | ||||
| 			public uint d; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct BufferImageCopy | ||||
| 		{ | ||||
| 			public uint bufferOffset; | ||||
| 			public uint bufferStride; | ||||
| 			public uint bufferImageHeight; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct BufferCopy | ||||
| 		{ | ||||
| 			public uint srcOffset; | ||||
| 			public uint dstOffset; | ||||
| 			public uint size; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
|  | @ -425,9 +470,6 @@ namespace RefreshCS | |||
| 			public StencilOp passOp; | ||||
| 			public StencilOp depthFailOp; | ||||
| 			public CompareOp compareOp; | ||||
| 			public uint compareMask; | ||||
| 			public uint writeMask; | ||||
| 			public uint reference; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
|  | @ -457,6 +499,7 @@ namespace RefreshCS | |||
| 			public uint height; | ||||
| 			public uint depth; | ||||
| 			public byte isCube; | ||||
| 			public uint layerCount; | ||||
| 			public uint levelCount; | ||||
| 			public SampleCount sampleCount; | ||||
| 			public TextureFormat format; | ||||
|  | @ -469,7 +512,7 @@ namespace RefreshCS | |||
| 			public IntPtr shaderModule; | ||||
| 			[MarshalAs(UnmanagedType.LPStr)] | ||||
| 			public string entryPointName; | ||||
| 			public ulong uniformBufferSize; | ||||
| 			public uint uniformBufferSize; | ||||
| 			public uint samplerBindingCount; | ||||
| 		} | ||||
| 
 | ||||
|  | @ -479,7 +522,7 @@ namespace RefreshCS | |||
| 			public IntPtr shaderModule; | ||||
| 			[MarshalAs(UnmanagedType.LPStr)] | ||||
| 			public string entryPointName; | ||||
| 			public ulong uniformBufferSize; | ||||
| 			public uint uniformBufferSize; | ||||
| 			public uint bufferBindingCount; | ||||
| 			public uint imageBindingCount; | ||||
| 		} | ||||
|  | @ -511,8 +554,11 @@ namespace RefreshCS | |||
| 			public CompareOp compareOp; | ||||
| 			public byte depthBoundsTestEnable; | ||||
| 			public byte stencilTestEnable; | ||||
| 			public StencilOpState frontStencilState; | ||||
| 			public StencilOpState backStencilState; | ||||
| 			public StencilOpState frontStencilState; | ||||
| 			public uint compareMask; | ||||
| 			public uint writeMask; | ||||
| 			public uint reference; | ||||
| 			public float minDepthBounds; | ||||
| 			public float maxDepthBounds; | ||||
| 		} | ||||
|  | @ -547,28 +593,54 @@ namespace RefreshCS | |||
| 			public fixed float blendConstants[4]; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct ColorAttachmentInfo | ||||
| 		{ | ||||
| 			public IntPtr texture; | ||||
| 			public uint depth; | ||||
| 			public uint layer; | ||||
| 			public uint level; | ||||
| 			public TextureSlice textureSlice; | ||||
| 			public Vec4 clearColor; | ||||
| 			public LoadOp loadOp; | ||||
| 			public StoreOp storeOp; | ||||
| 			public WriteOptions writeOption; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct DepthStencilAttachmentInfo | ||||
| 		{ | ||||
| 			public IntPtr texture; | ||||
| 			public uint depth; | ||||
| 			public uint layer; | ||||
| 			public uint level; | ||||
| 			public TextureSlice textureSlice; | ||||
| 			public DepthStencilValue depthStencilClearValue; | ||||
| 			public LoadOp loadOp; | ||||
| 			public StoreOp storeOp; | ||||
| 			public LoadOp stencilLoadOp; | ||||
| 			public StoreOp stencilStoreOp; | ||||
| 			public WriteOptions writeOption; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct BufferBinding | ||||
| 		{ | ||||
| 			public IntPtr gpuBuffer; | ||||
| 			public uint offset; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct TextureSamplerBinding | ||||
| 		{ | ||||
| 			public IntPtr texture; | ||||
| 			public IntPtr sampler; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct ComputeBufferBinding | ||||
| 		{ | ||||
| 			public IntPtr gpuBuffer; | ||||
| 			public WriteOptions writeOption; | ||||
| 		} | ||||
| 
 | ||||
| 		[StructLayout(LayoutKind.Sequential)] | ||||
| 		public struct ComputeTextureBinding | ||||
| 		{ | ||||
| 			public TextureSlice textureSlice; | ||||
| 			public WriteOptions writeOption; | ||||
| 		} | ||||
| 
 | ||||
| 		/* Logging */ | ||||
|  | @ -586,8 +658,9 @@ namespace RefreshCS | |||
| 		/* Init/Quit */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern Backend Refresh_SelectBackend( | ||||
| 			Backend preferredBackend, | ||||
| 		public static unsafe extern Backend Refresh_SelectBackend( | ||||
| 			Backend* preferredBackends, | ||||
| 			uint preferredBackendCount, | ||||
| 			out uint flags | ||||
| 		); | ||||
| 
 | ||||
|  | @ -599,64 +672,7 @@ namespace RefreshCS | |||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DestroyDevice(IntPtr device); | ||||
| 
 | ||||
| 		/* Drawing */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawInstancedPrimitives( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint baseVertex, | ||||
| 			uint startIndex, | ||||
| 			uint primitiveCount, | ||||
| 			uint instanceCount, | ||||
| 			uint vertexParamOffset, | ||||
| 			uint fragmentParamOffset | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawIndexedPrimitives( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint baseVertex, | ||||
| 			uint startIndex, | ||||
| 			uint primitiveCount, | ||||
| 			uint vertexParamOffset, | ||||
| 			uint fragmentParamOffset | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawPrimitives( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint vertexStart, | ||||
| 			uint primitiveCount, | ||||
| 			uint vertexParamOffset, | ||||
| 			uint fragmentParamOffset | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawPrimitivesIndirect( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr buffer, | ||||
| 			uint offsetInBytes, | ||||
| 			uint drawCount, | ||||
| 			uint stride, | ||||
| 			uint vertexParamOffset, | ||||
| 			uint fragmentParamOffset | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DispatchCompute( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint groupCountX, | ||||
| 			uint groupCountY, | ||||
| 			uint groupCountZ, | ||||
| 			uint computeParamOffset | ||||
| 		); | ||||
| 
 | ||||
| 		/* Creates */ | ||||
| 		/* State Creation */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern IntPtr Refresh_CreateComputePipeline( | ||||
|  | @ -689,100 +705,33 @@ namespace RefreshCS | |||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern IntPtr Refresh_CreateBuffer( | ||||
| 		public static extern IntPtr Refresh_CreateGpuBuffer( | ||||
| 			IntPtr device, | ||||
| 			BufferUsageFlags usageFlags, | ||||
| 			uint sizeInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		/* Setters */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_SetTextureData( | ||||
| 		public static extern IntPtr Refresh_CreateTransferBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			in TextureSlice textureSlice, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 			TransferUsage usage, | ||||
| 			uint sizeInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_SetTextureDataYUV( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr y, | ||||
| 			IntPtr u, | ||||
| 			IntPtr v, | ||||
| 			uint yWidth, | ||||
| 			uint yHeight, | ||||
| 			uint uvWidth, | ||||
| 			uint uvHeight, | ||||
| 			IntPtr yDataPtr, | ||||
| 			IntPtr uDataPtr, | ||||
| 			IntPtr vDataPtr, | ||||
| 			uint yDataLength, | ||||
| 			uint uvDataLength, | ||||
| 			uint yStride, | ||||
| 			uint uvStride | ||||
| 		); | ||||
| 		/* Debug Naming */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_CopyTextureToTexture( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			in TextureSlice sourceTextureSlice, | ||||
| 			in TextureSlice destinationTextureSlice, | ||||
| 			Filter filter | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_CopyTextureToBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			in TextureSlice textureSlice, | ||||
| 			IntPtr buffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_GetBufferData( | ||||
| 		public static extern void Refresh_SetGpuBufferName( | ||||
| 			IntPtr device, | ||||
| 			IntPtr buffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 			[MarshalAs(UnmanagedType.LPUTF8Str)] string text | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_SetBufferData( | ||||
| 		public static extern void Refresh_SetTextureName( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr buffer, | ||||
| 			uint offsetInBytes, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern uint Refresh_PushVertexShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern uint Refresh_PushFragmentShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern uint Refresh_PushComputeShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 			IntPtr texture, | ||||
| 			[MarshalAs(UnmanagedType.LPUTF8Str)] string text | ||||
| 		); | ||||
| 
 | ||||
| 		/* Disposal */ | ||||
|  | @ -800,9 +749,15 @@ namespace RefreshCS | |||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_QueueDestroyBuffer( | ||||
| 		public static extern void Refresh_QueueDestroyGpuBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr buffer | ||||
| 			IntPtr gpuBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_QueueDestroyTransferBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr transferBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
|  | @ -843,12 +798,6 @@ namespace RefreshCS | |||
| 			DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */ | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_EndRenderPass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindGraphicsPipeline( | ||||
| 			IntPtr device, | ||||
|  | @ -871,38 +820,92 @@ namespace RefreshCS | |||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindVertexBuffers( | ||||
| 		public static extern unsafe void Refresh_BindVertexBuffers( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint firstBinding, | ||||
| 			uint bindingCount, | ||||
| 			IntPtr pBuffers, | ||||
| 			IntPtr pOffsets | ||||
| 			BufferBinding* pBindings | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindIndexBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr buffer, | ||||
| 			uint offset, | ||||
| 			in BufferBinding pBinding, | ||||
| 			IndexElementSize indexElementSize | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindVertexSamplers( | ||||
| 		public static extern unsafe void Refresh_BindVertexSamplers( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr pTextures, | ||||
| 			IntPtr pSamplers | ||||
| 			TextureSamplerBinding* pBindings | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindFragmentSamplers( | ||||
| 		public static extern unsafe void Refresh_BindFragmentSamplers( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr pTextures, | ||||
| 			IntPtr pSamplers | ||||
| 			TextureSamplerBinding* pBindings | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_PushVertexShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_PushFragmentShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawInstancedPrimitives( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint baseVertex, | ||||
| 			uint startIndex, | ||||
| 			uint primitiveCount, | ||||
| 			uint instanceCount | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawPrimitives( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint vertexStart, | ||||
| 			uint primitiveCount | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DrawPrimitivesIndirect( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr gpuBuffer, | ||||
| 			uint offsetInBytes, | ||||
| 			uint drawCount, | ||||
| 			uint stride | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_EndRenderPass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		/* Compute Pass */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BeginComputePass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
|  | @ -913,17 +916,119 @@ namespace RefreshCS | |||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindComputeBuffers( | ||||
| 		public static extern unsafe void Refresh_BindComputeBuffers( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr pBuffers | ||||
| 			ComputeBufferBinding* pBindings | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BindComputeTextures( | ||||
| 		public static extern unsafe void Refresh_BindComputeTextures( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr pTextures | ||||
| 			ComputeTextureBinding* pBindings | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_PushComputeShaderUniforms( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr data, | ||||
| 			uint dataLengthInBytes | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DispatchCompute( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			uint groupCountX, | ||||
| 			uint groupCountY, | ||||
| 			uint groupCountZ | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_EndComputePass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		/* TransferBuffer Set/Get */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern IntPtr Refresh_SetTransferData( | ||||
| 			IntPtr device, | ||||
| 			IntPtr data, | ||||
| 			IntPtr transferBuffer, | ||||
| 			in BufferCopy copyParams, | ||||
| 			TransferOptions option | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_GetTransferData( | ||||
| 			IntPtr device, | ||||
| 			IntPtr transferBuffer, | ||||
| 			IntPtr data, | ||||
| 			in BufferCopy copyParams | ||||
| 		); | ||||
| 
 | ||||
| 		/* Copy Pass */ | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_BeginCopyPass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_UploadToTexture( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr transferBuffer, | ||||
| 			in TextureRegion textureRegion, | ||||
| 			in BufferImageCopy copyParams, | ||||
| 			WriteOptions writeOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_UploadToBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr transferBuffer, | ||||
| 			IntPtr gpuBuffer, | ||||
| 			in BufferCopy copyParams, | ||||
| 			WriteOptions writeOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_CopyTextureToTexture( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			in TextureRegion source, | ||||
| 			in TextureRegion destination, | ||||
| 			WriteOptions writeOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_CopyBufferToBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr source, | ||||
| 			IntPtr destination, | ||||
| 			in BufferCopy copyParams, | ||||
| 			WriteOptions writeOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_GenerateMipmaps( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer, | ||||
| 			IntPtr texture | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_EndCopyPass( | ||||
| 			IntPtr device, | ||||
| 			IntPtr commandBuffer | ||||
| 		); | ||||
| 
 | ||||
| 		/* Submission/Presentation */ | ||||
|  | @ -1005,6 +1110,24 @@ namespace RefreshCS | |||
| 			IntPtr fence | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DownloadFromTexture( | ||||
| 			IntPtr device, | ||||
| 			in TextureRegion textureRegion, | ||||
| 			IntPtr transferBuffer, | ||||
| 			in BufferImageCopy copyParams, | ||||
| 			TransferOptions transferOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_DownloadFromBuffer( | ||||
| 			IntPtr device, | ||||
| 			IntPtr gpuBuffer, | ||||
| 			IntPtr transferBuffer, | ||||
| 			in BufferCopy copyParams, | ||||
| 			TransferOptions transferOption | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern IntPtr Refresh_Image_Load( | ||||
| 			IntPtr bufferPtr, | ||||
|  | @ -1014,6 +1137,15 @@ namespace RefreshCS | |||
| 			out int len | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern byte Refresh_Image_Info( | ||||
| 			IntPtr bufferPtr, | ||||
| 			int bufferLength, | ||||
| 			out int w, | ||||
| 			out int h, | ||||
| 			out int len | ||||
| 		); | ||||
| 
 | ||||
| 		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] | ||||
| 		public static extern void Refresh_Image_Free(IntPtr mem); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue