gpu: implement Device.nativeCreateSwapChain, SwapChain
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
738e9da8ee
commit
e9ac31f264
6 changed files with 112 additions and 143 deletions
139
gpu/src/TODO
139
gpu/src/TODO
|
|
@ -24,7 +24,6 @@ typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder;
|
|||
typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder;
|
||||
typedef struct WGPURenderPipelineImpl* WGPURenderPipeline;
|
||||
typedef struct WGPUSamplerImpl* WGPUSampler;
|
||||
typedef struct WGPUSwapChainImpl* WGPUSwapChain;
|
||||
typedef struct WGPUTextureImpl* WGPUTexture;
|
||||
typedef struct WGPUTextureViewImpl* WGPUTextureView;
|
||||
|
||||
|
|
@ -230,13 +229,6 @@ typedef enum WGPUPredefinedColorSpace {
|
|||
WGPUPredefinedColorSpace_Force32 = 0x7FFFFFFF
|
||||
} WGPUPredefinedColorSpace;
|
||||
|
||||
typedef enum WGPUPresentMode {
|
||||
WGPUPresentMode_Immediate = 0x00000000,
|
||||
WGPUPresentMode_Mailbox = 0x00000001,
|
||||
WGPUPresentMode_Fifo = 0x00000002,
|
||||
WGPUPresentMode_Force32 = 0x7FFFFFFF
|
||||
} WGPUPresentMode;
|
||||
|
||||
typedef enum WGPUPrimitiveTopology {
|
||||
WGPUPrimitiveTopology_PointList = 0x00000000,
|
||||
WGPUPrimitiveTopology_LineList = 0x00000001,
|
||||
|
|
@ -329,107 +321,6 @@ typedef enum WGPUTextureDimension {
|
|||
WGPUTextureDimension_Force32 = 0x7FFFFFFF
|
||||
} WGPUTextureDimension;
|
||||
|
||||
typedef enum WGPUTextureFormat {
|
||||
WGPUTextureFormat_Undefined = 0x00000000,
|
||||
WGPUTextureFormat_R8Unorm = 0x00000001,
|
||||
WGPUTextureFormat_R8Snorm = 0x00000002,
|
||||
WGPUTextureFormat_R8Uint = 0x00000003,
|
||||
WGPUTextureFormat_R8Sint = 0x00000004,
|
||||
WGPUTextureFormat_R16Uint = 0x00000005,
|
||||
WGPUTextureFormat_R16Sint = 0x00000006,
|
||||
WGPUTextureFormat_R16Float = 0x00000007,
|
||||
WGPUTextureFormat_RG8Unorm = 0x00000008,
|
||||
WGPUTextureFormat_RG8Snorm = 0x00000009,
|
||||
WGPUTextureFormat_RG8Uint = 0x0000000A,
|
||||
WGPUTextureFormat_RG8Sint = 0x0000000B,
|
||||
WGPUTextureFormat_R32Float = 0x0000000C,
|
||||
WGPUTextureFormat_R32Uint = 0x0000000D,
|
||||
WGPUTextureFormat_R32Sint = 0x0000000E,
|
||||
WGPUTextureFormat_RG16Uint = 0x0000000F,
|
||||
WGPUTextureFormat_RG16Sint = 0x00000010,
|
||||
WGPUTextureFormat_RG16Float = 0x00000011,
|
||||
WGPUTextureFormat_RGBA8Unorm = 0x00000012,
|
||||
WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013,
|
||||
WGPUTextureFormat_RGBA8Snorm = 0x00000014,
|
||||
WGPUTextureFormat_RGBA8Uint = 0x00000015,
|
||||
WGPUTextureFormat_RGBA8Sint = 0x00000016,
|
||||
WGPUTextureFormat_BGRA8Unorm = 0x00000017,
|
||||
WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018,
|
||||
WGPUTextureFormat_RGB10A2Unorm = 0x00000019,
|
||||
WGPUTextureFormat_RG11B10Ufloat = 0x0000001A,
|
||||
WGPUTextureFormat_RGB9E5Ufloat = 0x0000001B,
|
||||
WGPUTextureFormat_RG32Float = 0x0000001C,
|
||||
WGPUTextureFormat_RG32Uint = 0x0000001D,
|
||||
WGPUTextureFormat_RG32Sint = 0x0000001E,
|
||||
WGPUTextureFormat_RGBA16Uint = 0x0000001F,
|
||||
WGPUTextureFormat_RGBA16Sint = 0x00000020,
|
||||
WGPUTextureFormat_RGBA16Float = 0x00000021,
|
||||
WGPUTextureFormat_RGBA32Float = 0x00000022,
|
||||
WGPUTextureFormat_RGBA32Uint = 0x00000023,
|
||||
WGPUTextureFormat_RGBA32Sint = 0x00000024,
|
||||
WGPUTextureFormat_Stencil8 = 0x00000025,
|
||||
WGPUTextureFormat_Depth16Unorm = 0x00000026,
|
||||
WGPUTextureFormat_Depth24Plus = 0x00000027,
|
||||
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028,
|
||||
WGPUTextureFormat_Depth24UnormStencil8 = 0x00000029,
|
||||
WGPUTextureFormat_Depth32Float = 0x0000002A,
|
||||
WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B,
|
||||
WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C,
|
||||
WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D,
|
||||
WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E,
|
||||
WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F,
|
||||
WGPUTextureFormat_BC3RGBAUnorm = 0x00000030,
|
||||
WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031,
|
||||
WGPUTextureFormat_BC4RUnorm = 0x00000032,
|
||||
WGPUTextureFormat_BC4RSnorm = 0x00000033,
|
||||
WGPUTextureFormat_BC5RGUnorm = 0x00000034,
|
||||
WGPUTextureFormat_BC5RGSnorm = 0x00000035,
|
||||
WGPUTextureFormat_BC6HRGBUfloat = 0x00000036,
|
||||
WGPUTextureFormat_BC6HRGBFloat = 0x00000037,
|
||||
WGPUTextureFormat_BC7RGBAUnorm = 0x00000038,
|
||||
WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039,
|
||||
WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A,
|
||||
WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B,
|
||||
WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C,
|
||||
WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D,
|
||||
WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E,
|
||||
WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F,
|
||||
WGPUTextureFormat_EACR11Unorm = 0x00000040,
|
||||
WGPUTextureFormat_EACR11Snorm = 0x00000041,
|
||||
WGPUTextureFormat_EACRG11Unorm = 0x00000042,
|
||||
WGPUTextureFormat_EACRG11Snorm = 0x00000043,
|
||||
WGPUTextureFormat_ASTC4x4Unorm = 0x00000044,
|
||||
WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045,
|
||||
WGPUTextureFormat_ASTC5x4Unorm = 0x00000046,
|
||||
WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047,
|
||||
WGPUTextureFormat_ASTC5x5Unorm = 0x00000048,
|
||||
WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049,
|
||||
WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A,
|
||||
WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B,
|
||||
WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C,
|
||||
WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D,
|
||||
WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E,
|
||||
WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F,
|
||||
WGPUTextureFormat_ASTC8x6Unorm = 0x00000050,
|
||||
WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051,
|
||||
WGPUTextureFormat_ASTC8x8Unorm = 0x00000052,
|
||||
WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053,
|
||||
WGPUTextureFormat_ASTC10x5Unorm = 0x00000054,
|
||||
WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055,
|
||||
WGPUTextureFormat_ASTC10x6Unorm = 0x00000056,
|
||||
WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057,
|
||||
WGPUTextureFormat_ASTC10x8Unorm = 0x00000058,
|
||||
WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059,
|
||||
WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A,
|
||||
WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B,
|
||||
WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C,
|
||||
WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D,
|
||||
WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E,
|
||||
WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F,
|
||||
WGPUTextureFormat_R8BG8Biplanar420Unorm = 0x00000060,
|
||||
WGPUTextureFormat_Force32 = 0x7FFFFFFF
|
||||
} WGPUTextureFormat;
|
||||
|
||||
typedef enum WGPUTextureSampleType {
|
||||
WGPUTextureSampleType_Undefined = 0x00000000,
|
||||
WGPUTextureSampleType_Float = 0x00000001,
|
||||
|
|
@ -536,18 +427,6 @@ typedef enum WGPUShaderStage {
|
|||
} WGPUShaderStage;
|
||||
typedef WGPUFlags WGPUShaderStageFlags;
|
||||
|
||||
typedef enum WGPUTextureUsage {
|
||||
WGPUTextureUsage_None = 0x00000000,
|
||||
WGPUTextureUsage_CopySrc = 0x00000001,
|
||||
WGPUTextureUsage_CopyDst = 0x00000002,
|
||||
WGPUTextureUsage_TextureBinding = 0x00000004,
|
||||
WGPUTextureUsage_StorageBinding = 0x00000008,
|
||||
WGPUTextureUsage_RenderAttachment = 0x00000010,
|
||||
WGPUTextureUsage_Present = 0x00000020,
|
||||
WGPUTextureUsage_Force32 = 0x7FFFFFFF
|
||||
} WGPUTextureUsage;
|
||||
typedef WGPUFlags WGPUTextureUsageFlags;
|
||||
|
||||
typedef struct WGPUChainedStruct {
|
||||
struct WGPUChainedStruct const * next;
|
||||
WGPUSType sType;
|
||||
|
|
@ -803,17 +682,6 @@ typedef struct WGPUStorageTextureBindingLayout {
|
|||
WGPUTextureViewDimension viewDimension;
|
||||
} WGPUStorageTextureBindingLayout;
|
||||
|
||||
typedef struct WGPUSwapChainDescriptor {
|
||||
WGPUChainedStruct const * nextInChain;
|
||||
char const * label;
|
||||
WGPUTextureUsageFlags usage;
|
||||
WGPUTextureFormat format;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
WGPUPresentMode presentMode;
|
||||
uint64_t implementation;
|
||||
} WGPUSwapChainDescriptor;
|
||||
|
||||
typedef struct WGPUTextureBindingLayout {
|
||||
WGPUChainedStruct const * nextInChain;
|
||||
WGPUTextureSampleType sampleType;
|
||||
|
|
@ -1186,13 +1054,6 @@ WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label);
|
|||
WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler);
|
||||
WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler);
|
||||
|
||||
// Methods of SwapChain
|
||||
WGPU_EXPORT void wgpuSwapChainConfigure(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height);
|
||||
WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain);
|
||||
WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain);
|
||||
WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain);
|
||||
WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain);
|
||||
|
||||
// Methods of Texture
|
||||
WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor);
|
||||
WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue