TextureSlice and TextureRegion API

refresh2
cosmonaut 2024-02-29 23:47:49 -08:00
parent 031ad4c047
commit 020e76782a
1 changed files with 21 additions and 18 deletions

View File

@ -371,8 +371,13 @@ namespace RefreshCS
{ {
public IntPtr texture; public IntPtr texture;
public uint mipLevel; public uint mipLevel;
public uint baseLayer; public uint layer;
public uint layerCount; }
[StructLayout(LayoutKind.Sequential)]
public struct TextureRegion
{
public TextureSlice textureSlice;
public uint x; public uint x;
public uint y; public uint y;
public uint z; public uint z;
@ -490,6 +495,7 @@ namespace RefreshCS
public uint height; public uint height;
public uint depth; public uint depth;
public byte isCube; public byte isCube;
public uint layerCount;
public uint levelCount; public uint levelCount;
public SampleCount sampleCount; public SampleCount sampleCount;
public TextureFormat format; public TextureFormat format;
@ -579,28 +585,26 @@ namespace RefreshCS
public fixed float blendConstants[4]; public fixed float blendConstants[4];
} }
[StructLayout(LayoutKind.Sequential)]
public struct ColorAttachmentInfo public struct ColorAttachmentInfo
{ {
public IntPtr texture; public TextureSlice textureSlice;
public uint depth;
public uint layer;
public uint level;
public Vec4 clearColor; public Vec4 clearColor;
public LoadOp loadOp; public LoadOp loadOp;
public StoreOp storeOp; public StoreOp storeOp;
public byte safeDiscard;
} }
[StructLayout(LayoutKind.Sequential)]
public struct DepthStencilAttachmentInfo public struct DepthStencilAttachmentInfo
{ {
public IntPtr texture; public TextureSlice textureSlice;
public uint depth;
public uint layer;
public uint level;
public DepthStencilValue depthStencilClearValue; public DepthStencilValue depthStencilClearValue;
public LoadOp loadOp; public LoadOp loadOp;
public StoreOp storeOp; public StoreOp storeOp;
public LoadOp stencilLoadOp; public LoadOp stencilLoadOp;
public StoreOp stencilStoreOp; public StoreOp stencilStoreOp;
public byte safeDiscard;
} }
/* Logging */ /* Logging */
@ -881,8 +885,7 @@ namespace RefreshCS
public static extern void Refresh_BindComputeTextures( public static extern void Refresh_BindComputeTextures(
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
IntPtr pTextures, IntPtr pTextureSlices
IntPtr pLevels
); );
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@ -940,7 +943,7 @@ namespace RefreshCS
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
IntPtr transferBuffer, IntPtr transferBuffer,
in TextureSlice textureSlice, in TextureRegion textureSlice,
in BufferImageCopy copyParams, in BufferImageCopy copyParams,
CopyOptions option CopyOptions option
); );
@ -959,7 +962,7 @@ namespace RefreshCS
public static extern void Refresh_DownloadFromTexture( public static extern void Refresh_DownloadFromTexture(
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
in TextureSlice textureSlice, in TextureRegion textureSlice,
IntPtr transferBuffer, IntPtr transferBuffer,
in BufferImageCopy copyParams, in BufferImageCopy copyParams,
TransferOptions option TransferOptions option
@ -979,8 +982,8 @@ namespace RefreshCS
public static extern void Refresh_CopyTextureToTexture( public static extern void Refresh_CopyTextureToTexture(
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
in TextureSlice source, in TextureRegion source,
in TextureSlice destination, in TextureRegion destination,
CopyOptions option CopyOptions option
); );
@ -988,7 +991,7 @@ namespace RefreshCS
public static extern void Refresh_CopyTextureToBuffer( public static extern void Refresh_CopyTextureToBuffer(
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
in TextureSlice textureSlice, in TextureRegion textureSlice,
IntPtr gpuBuffer, IntPtr gpuBuffer,
in BufferImageCopy copyParams, in BufferImageCopy copyParams,
CopyOptions option CopyOptions option
@ -999,7 +1002,7 @@ namespace RefreshCS
IntPtr device, IntPtr device,
IntPtr commandBuffer, IntPtr commandBuffer,
IntPtr gpuBuffer, IntPtr gpuBuffer,
in TextureSlice textureSlice, in TextureRegion textureSlice,
in BufferImageCopy bufferImageCopy, in BufferImageCopy bufferImageCopy,
CopyOptions option CopyOptions option
); );