Bump to latest wagyu port (build 69) (#10977) d0b67890c8

Bump to latest wagyu port (build 69) to get access to wgpuWagyuStringArrayFreeMembers

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: Sam Magnuson <smagnuso@gmail.com>
This commit is contained in:
csmartdalton
2025-11-05 21:20:56 +00:00
parent b90846fb66
commit defee8ff44
25 changed files with 807 additions and 8390 deletions

View File

@@ -1 +1 @@
0049d6e21e363c9c779cdaaf3b91386b384fc4eb
d0b67890c8f7f4e67a32aa09b3030de2cb3e2537

View File

@@ -75,12 +75,13 @@ newoption({
description = 'compile in support for wagyu webgpu extensions',
})
if _OPTIONS['with_wagyu'] then
if _OPTIONS['webgpu-version'] < '2' then
error('\nWagyu does not support webgpu-version < 2\n ')
end
defines({ 'RIVE_WAGYU' })
RIVE_WAGYU_PORT = '--use-port='
.. RIVE_RUNTIME_DIR
.. '/renderer/src/webgpu/wagyu-port/'
.. (_OPTIONS['webgpu-version'] == '2' and 'new' or 'old')
.. '/webgpu-port.py:wagyu=true'
.. '/renderer/src/webgpu/wagyu-port/webgpu-port.py:wagyu=true'
end
newoption({

View File

@@ -109,7 +109,11 @@ static wgpu::ShaderModule compile_shader_module_spirv(wgpu::Device device,
const uint32_t* code,
uint32_t codeSize)
{
#if RIVE_WEBGPU == 1
wgpu::ShaderModuleSPIRVDescriptor spirvDesc;
#else
wgpu::ShaderSourceSPIRV spirvDesc;
#endif
spirvDesc.code = code;
spirvDesc.codeSize = codeSize;
wgpu::ShaderModuleDescriptor descriptor;
@@ -1043,6 +1047,7 @@ RenderContextWebGPUImpl::RenderContextWebGPUImpl(
// if the hardware doesn't support this.
m_capabilities.polyfillVertexStorageBuffers = true;
}
wgpuWagyuStringArrayFreeMembers(extensions);
#endif
}

View File

@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: false

View File

@@ -1,3 +0,0 @@
new/include/webgpu/*
old/include/webgpu/*
old/src/*

View File

@@ -2,8 +2,7 @@
This is an implementation of WebGPU bindings for Emscripten.
This package provides the legacy (old) webgpu.h header used by Emscripten, and
a copy of the current standard (new) webgpu.h provided by emdawnwgpu.
This package provides webgpu.h header provided by emdawnwgpu.
This package optionally provides Wagyu extensions to the WebGPU API, which
are available from the webgpu_wagyu.h header. These extensions are not part of
@@ -17,13 +16,15 @@ port indirectly.
To use the remote port file, pass it as an option like this to your
emscripten build commands:
```
```bash
--use-port=[your_path]/webgpu-remoteport.py
```
You can also directly use the local port file `webgpu-port.py` from the
webgpu-port repository (or a copy of it).
```
```bash
--use-port=[your_path]/webgpu-port.py
```
@@ -34,7 +35,7 @@ pairs delimited by colons.
For example:
```
```bash
--use-port=webgpu-remoteport.py:wagyu=true
```

View File

@@ -31,12 +31,6 @@
#ifndef WEBGPU_H_
#define WEBGPU_H_
#define WGPU_BREAKING_CHANGE_STRING_VIEW_LABELS
#define WGPU_BREAKING_CHANGE_STRING_VIEW_OUTPUT_STRUCTS
#define WGPU_BREAKING_CHANGE_STRING_VIEW_CALLBACKS
#define WGPU_BREAKING_CHANGE_QUEUE_WORK_DONE_CALLBACK_MESSAGE
#define WGPU_BREAKING_CHANGE_COMPATIBILITY_MODE_LIMITS
#if defined(WGPU_SHARED_LIBRARY)
# if defined(_WIN32)
# if defined(WGPU_IMPLEMENTATION)
@@ -108,10 +102,6 @@
#define WGPU_WHOLE_MAP_SIZE (SIZE_MAX)
#define WGPU_WHOLE_SIZE (UINT64_MAX)
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
namespace wagyu2 {
#endif
typedef struct WGPUStringView {
WGPU_NULLABLE char const * data;
size_t length;
@@ -163,7 +153,7 @@ struct WGPUDawnCompilationMessageUtf16;
struct WGPUEmscriptenSurfaceSourceCanvasHTMLSelector;
struct WGPUExtent3D;
struct WGPUFuture;
struct WGPUInstanceCapabilities;
struct WGPUInstanceLimits;
struct WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER;
struct WGPUMultisampleState;
struct WGPUOrigin3D;
@@ -184,6 +174,7 @@ struct WGPUShaderSourceWGSL;
struct WGPUStencilFaceState;
struct WGPUStorageTextureBindingLayout;
struct WGPUSupportedFeatures;
struct WGPUSupportedInstanceFeatures;
struct WGPUSupportedWGSLLanguageFeatures;
struct WGPUSurfaceCapabilities;
struct WGPUSurfaceColorManagement;
@@ -192,7 +183,7 @@ struct WGPUSurfaceTexture;
struct WGPUTexelCopyBufferLayout;
struct WGPUTextureBindingLayout;
struct WGPUTextureBindingViewDimensionDescriptor;
struct WGPUTextureViewDescriptor;
struct WGPUTextureComponentSwizzle;
struct WGPUVertexAttribute;
struct WGPUBindGroupDescriptor;
struct WGPUBindGroupLayoutEntry;
@@ -210,6 +201,7 @@ struct WGPUShaderModuleDescriptor;
struct WGPUSurfaceDescriptor;
struct WGPUTexelCopyBufferInfo;
struct WGPUTexelCopyTextureInfo;
struct WGPUTextureComponentSwizzleDescriptor;
struct WGPUTextureDescriptor;
struct WGPUVertexBufferLayout;
struct WGPUBindGroupLayoutDescriptor;
@@ -218,6 +210,7 @@ struct WGPUCompilationInfo;
struct WGPUComputePipelineDescriptor;
struct WGPUDeviceDescriptor;
struct WGPURenderPassDescriptor;
struct WGPUTextureViewDescriptor;
struct WGPUVertexState;
struct WGPUFragmentState;
struct WGPURenderPipelineDescriptor;
@@ -344,6 +337,17 @@ typedef enum WGPUCompilationMessageType {
WGPUCompilationMessageType_Force32 = 0x7FFFFFFF
} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUComponentSwizzle {
WGPUComponentSwizzle_Undefined = 0x00000000,
WGPUComponentSwizzle_Zero = 0x00000001,
WGPUComponentSwizzle_One = 0x00000002,
WGPUComponentSwizzle_R = 0x00000003,
WGPUComponentSwizzle_G = 0x00000004,
WGPUComponentSwizzle_B = 0x00000005,
WGPUComponentSwizzle_A = 0x00000006,
WGPUComponentSwizzle_Force32 = 0x7FFFFFFF
} WGPUComponentSwizzle WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCompositeAlphaMode {
WGPUCompositeAlphaMode_Auto = 0x00000000,
WGPUCompositeAlphaMode_Opaque = 0x00000001,
@@ -401,24 +405,28 @@ typedef enum WGPUFeatureLevel {
} WGPUFeatureLevel WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUFeatureName {
WGPUFeatureName_DepthClipControl = 0x00000001,
WGPUFeatureName_Depth32FloatStencil8 = 0x00000002,
WGPUFeatureName_TimestampQuery = 0x00000003,
WGPUFeatureName_CoreFeaturesAndLimits = 0x00000001,
WGPUFeatureName_DepthClipControl = 0x00000002,
WGPUFeatureName_Depth32FloatStencil8 = 0x00000003,
WGPUFeatureName_TextureCompressionBC = 0x00000004,
WGPUFeatureName_TextureCompressionBCSliced3D = 0x00000005,
WGPUFeatureName_TextureCompressionETC2 = 0x00000006,
WGPUFeatureName_TextureCompressionASTC = 0x00000007,
WGPUFeatureName_TextureCompressionASTCSliced3D = 0x00000008,
WGPUFeatureName_IndirectFirstInstance = 0x00000009,
WGPUFeatureName_ShaderF16 = 0x0000000A,
WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000B,
WGPUFeatureName_BGRA8UnormStorage = 0x0000000C,
WGPUFeatureName_Float32Filterable = 0x0000000D,
WGPUFeatureName_Float32Blendable = 0x0000000E,
WGPUFeatureName_ClipDistances = 0x0000000F,
WGPUFeatureName_DualSourceBlending = 0x00000010,
WGPUFeatureName_Subgroups = 0x00000011,
WGPUFeatureName_CoreFeaturesAndLimits = 0x00000012,
WGPUFeatureName_TimestampQuery = 0x00000009,
WGPUFeatureName_IndirectFirstInstance = 0x0000000A,
WGPUFeatureName_ShaderF16 = 0x0000000B,
WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000C,
WGPUFeatureName_BGRA8UnormStorage = 0x0000000D,
WGPUFeatureName_Float32Filterable = 0x0000000E,
WGPUFeatureName_Float32Blendable = 0x0000000F,
WGPUFeatureName_ClipDistances = 0x00000010,
WGPUFeatureName_DualSourceBlending = 0x00000011,
WGPUFeatureName_Subgroups = 0x00000012,
WGPUFeatureName_TextureFormatsTier1 = 0x00000013,
WGPUFeatureName_TextureFormatsTier2 = 0x00000014,
WGPUFeatureName_PrimitiveIndex = 0x00000015,
WGPUFeatureName_TextureComponentSwizzle = 0x00000016,
WGPUFeatureName_Unorm16TextureFormats = 0x0005000C,
WGPUFeatureName_Snorm16TextureFormats = 0x0005000D,
WGPUFeatureName_MultiDrawIndirect = 0x00050034,
@@ -446,6 +454,13 @@ typedef enum WGPUIndexFormat {
WGPUIndexFormat_Force32 = 0x7FFFFFFF
} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUInstanceFeatureName {
WGPUInstanceFeatureName_TimedWaitAny = 0x00000001,
WGPUInstanceFeatureName_ShaderSourceSPIRV = 0x00000002,
WGPUInstanceFeatureName_MultipleDevicesPerAdapter = 0x00000003,
WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF
} WGPUInstanceFeatureName WGPU_ENUM_ATTRIBUTE;
typedef enum WGPULoadOp {
WGPULoadOp_Undefined = 0x00000000,
WGPULoadOp_Load = 0x00000001,
@@ -598,6 +613,7 @@ typedef enum WGPUSType {
WGPUSType_SurfaceSourceXCBWindow = 0x00000009,
WGPUSType_SurfaceColorManagement = 0x0000000A,
WGPUSType_RequestAdapterWebXROptions = 0x0000000B,
WGPUSType_TextureComponentSwizzleDescriptor = 0x0000000C,
WGPUSType_CompatibilityModeLimits = 0x00020000,
WGPUSType_TextureBindingViewDimensionDescriptor = 0x00020001,
WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector = 0x00040000,
@@ -605,14 +621,6 @@ typedef enum WGPUSType {
WGPUSType_Force32 = 0x7FFFFFFF
} WGPUSType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUSubgroupMatrixComponentType {
WGPUSubgroupMatrixComponentType_F32 = 0x00000001,
WGPUSubgroupMatrixComponentType_F16 = 0x00000002,
WGPUSubgroupMatrixComponentType_U32 = 0x00000003,
WGPUSubgroupMatrixComponentType_I32 = 0x00000004,
WGPUSubgroupMatrixComponentType_Force32 = 0x7FFFFFFF
} WGPUSubgroupMatrixComponentType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUSurfaceGetCurrentTextureStatus {
WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal = 0x00000001,
WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal = 0x00000002,
@@ -645,97 +653,103 @@ typedef enum WGPUTextureFormat {
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_RGB10A2Uint = 0x00000019,
WGPUTextureFormat_RGB10A2Unorm = 0x0000001A,
WGPUTextureFormat_RG11B10Ufloat = 0x0000001B,
WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C,
WGPUTextureFormat_RG32Float = 0x0000001D,
WGPUTextureFormat_RG32Uint = 0x0000001E,
WGPUTextureFormat_RG32Sint = 0x0000001F,
WGPUTextureFormat_RGBA16Uint = 0x00000020,
WGPUTextureFormat_RGBA16Sint = 0x00000021,
WGPUTextureFormat_RGBA16Float = 0x00000022,
WGPUTextureFormat_RGBA32Float = 0x00000023,
WGPUTextureFormat_RGBA32Uint = 0x00000024,
WGPUTextureFormat_RGBA32Sint = 0x00000025,
WGPUTextureFormat_Stencil8 = 0x00000026,
WGPUTextureFormat_Depth16Unorm = 0x00000027,
WGPUTextureFormat_Depth24Plus = 0x00000028,
WGPUTextureFormat_Depth24PlusStencil8 = 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_R16Unorm = 0x00000005,
WGPUTextureFormat_R16Snorm = 0x00000006,
WGPUTextureFormat_R16Uint = 0x00000007,
WGPUTextureFormat_R16Sint = 0x00000008,
WGPUTextureFormat_R16Float = 0x00000009,
WGPUTextureFormat_RG8Unorm = 0x0000000A,
WGPUTextureFormat_RG8Snorm = 0x0000000B,
WGPUTextureFormat_RG8Uint = 0x0000000C,
WGPUTextureFormat_RG8Sint = 0x0000000D,
WGPUTextureFormat_R32Float = 0x0000000E,
WGPUTextureFormat_R32Uint = 0x0000000F,
WGPUTextureFormat_R32Sint = 0x00000010,
WGPUTextureFormat_RG16Unorm = 0x00000011,
WGPUTextureFormat_RG16Snorm = 0x00000012,
WGPUTextureFormat_RG16Uint = 0x00000013,
WGPUTextureFormat_RG16Sint = 0x00000014,
WGPUTextureFormat_RG16Float = 0x00000015,
WGPUTextureFormat_RGBA8Unorm = 0x00000016,
WGPUTextureFormat_RGBA8UnormSrgb = 0x00000017,
WGPUTextureFormat_RGBA8Snorm = 0x00000018,
WGPUTextureFormat_RGBA8Uint = 0x00000019,
WGPUTextureFormat_RGBA8Sint = 0x0000001A,
WGPUTextureFormat_BGRA8Unorm = 0x0000001B,
WGPUTextureFormat_BGRA8UnormSrgb = 0x0000001C,
WGPUTextureFormat_RGB10A2Uint = 0x0000001D,
WGPUTextureFormat_RGB10A2Unorm = 0x0000001E,
WGPUTextureFormat_RG11B10Ufloat = 0x0000001F,
WGPUTextureFormat_RGB9E5Ufloat = 0x00000020,
WGPUTextureFormat_RG32Float = 0x00000021,
WGPUTextureFormat_RG32Uint = 0x00000022,
WGPUTextureFormat_RG32Sint = 0x00000023,
WGPUTextureFormat_RGBA16Unorm = 0x00000024,
WGPUTextureFormat_RGBA16Snorm = 0x00000025,
WGPUTextureFormat_RGBA16Uint = 0x00000026,
WGPUTextureFormat_RGBA16Sint = 0x00000027,
WGPUTextureFormat_RGBA16Float = 0x00000028,
WGPUTextureFormat_RGBA32Float = 0x00000029,
WGPUTextureFormat_RGBA32Uint = 0x0000002A,
WGPUTextureFormat_RGBA32Sint = 0x0000002B,
WGPUTextureFormat_Stencil8 = 0x0000002C,
WGPUTextureFormat_Depth16Unorm = 0x0000002D,
WGPUTextureFormat_Depth24Plus = 0x0000002E,
WGPUTextureFormat_Depth24PlusStencil8 = 0x0000002F,
WGPUTextureFormat_Depth32Float = 0x00000030,
WGPUTextureFormat_Depth32FloatStencil8 = 0x00000031,
WGPUTextureFormat_BC1RGBAUnorm = 0x00000032,
WGPUTextureFormat_BC1RGBAUnormSrgb = 0x00000033,
WGPUTextureFormat_BC2RGBAUnorm = 0x00000034,
WGPUTextureFormat_BC2RGBAUnormSrgb = 0x00000035,
WGPUTextureFormat_BC3RGBAUnorm = 0x00000036,
WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000037,
WGPUTextureFormat_BC4RUnorm = 0x00000038,
WGPUTextureFormat_BC4RSnorm = 0x00000039,
WGPUTextureFormat_BC5RGUnorm = 0x0000003A,
WGPUTextureFormat_BC5RGSnorm = 0x0000003B,
WGPUTextureFormat_BC6HRGBUfloat = 0x0000003C,
WGPUTextureFormat_BC6HRGBFloat = 0x0000003D,
WGPUTextureFormat_BC7RGBAUnorm = 0x0000003E,
WGPUTextureFormat_BC7RGBAUnormSrgb = 0x0000003F,
WGPUTextureFormat_ETC2RGB8Unorm = 0x00000040,
WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x00000041,
WGPUTextureFormat_ETC2RGB8A1Unorm = 0x00000042,
WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x00000043,
WGPUTextureFormat_ETC2RGBA8Unorm = 0x00000044,
WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x00000045,
WGPUTextureFormat_EACR11Unorm = 0x00000046,
WGPUTextureFormat_EACR11Snorm = 0x00000047,
WGPUTextureFormat_EACRG11Unorm = 0x00000048,
WGPUTextureFormat_EACRG11Snorm = 0x00000049,
WGPUTextureFormat_ASTC4x4Unorm = 0x0000004A,
WGPUTextureFormat_ASTC4x4UnormSrgb = 0x0000004B,
WGPUTextureFormat_ASTC5x4Unorm = 0x0000004C,
WGPUTextureFormat_ASTC5x4UnormSrgb = 0x0000004D,
WGPUTextureFormat_ASTC5x5Unorm = 0x0000004E,
WGPUTextureFormat_ASTC5x5UnormSrgb = 0x0000004F,
WGPUTextureFormat_ASTC6x5Unorm = 0x00000050,
WGPUTextureFormat_ASTC6x5UnormSrgb = 0x00000051,
WGPUTextureFormat_ASTC6x6Unorm = 0x00000052,
WGPUTextureFormat_ASTC6x6UnormSrgb = 0x00000053,
WGPUTextureFormat_ASTC8x5Unorm = 0x00000054,
WGPUTextureFormat_ASTC8x5UnormSrgb = 0x00000055,
WGPUTextureFormat_ASTC8x6Unorm = 0x00000056,
WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000057,
WGPUTextureFormat_ASTC8x8Unorm = 0x00000058,
WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000059,
WGPUTextureFormat_ASTC10x5Unorm = 0x0000005A,
WGPUTextureFormat_ASTC10x5UnormSrgb = 0x0000005B,
WGPUTextureFormat_ASTC10x6Unorm = 0x0000005C,
WGPUTextureFormat_ASTC10x6UnormSrgb = 0x0000005D,
WGPUTextureFormat_ASTC10x8Unorm = 0x0000005E,
WGPUTextureFormat_ASTC10x8UnormSrgb = 0x0000005F,
WGPUTextureFormat_ASTC10x10Unorm = 0x00000060,
WGPUTextureFormat_ASTC10x10UnormSrgb = 0x00000061,
WGPUTextureFormat_ASTC12x10Unorm = 0x00000062,
WGPUTextureFormat_ASTC12x10UnormSrgb = 0x00000063,
WGPUTextureFormat_ASTC12x12Unorm = 0x00000064,
WGPUTextureFormat_ASTC12x12UnormSrgb = 0x00000065,
WGPUTextureFormat_Force32 = 0x7FFFFFFF
} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE;
@@ -831,8 +845,6 @@ typedef enum WGPUWGSLLanguageFeatureName {
WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct = 0x00000002,
WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters = 0x00000003,
WGPUWGSLLanguageFeatureName_PointerCompositeAccess = 0x00000004,
WGPUWGSLLanguageFeatureName_SizedBindingArray = 0x00000005,
WGPUWGSLLanguageFeatureName_TexelBuffers = 0x00000006,
WGPUWGSLLanguageFeatureName_Force32 = 0x7FFFFFFF
} WGPUWGSLLanguageFeatureName WGPU_ENUM_ATTRIBUTE;
@@ -1270,15 +1282,13 @@ typedef struct WGPUFuture {
/*.id=*/0 _wgpu_COMMA \
})
typedef struct WGPUInstanceCapabilities {
typedef struct WGPUInstanceLimits {
WGPUChainedStruct * nextInChain;
WGPUBool timedWaitAnyEnable;
size_t timedWaitAnyMaxCount;
} WGPUInstanceCapabilities WGPU_STRUCTURE_ATTRIBUTE;
} WGPUInstanceLimits WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_INSTANCE_CAPABILITIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUInstanceCapabilities, { \
#define WGPU_INSTANCE_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUInstanceLimits, { \
/*.nextInChain=*/NULL _wgpu_COMMA \
/*.timedWaitAnyEnable=*/WGPU_FALSE _wgpu_COMMA \
/*.timedWaitAnyMaxCount=*/0 _wgpu_COMMA \
})
@@ -1334,7 +1344,7 @@ typedef struct WGPUPipelineLayoutDescriptor {
WGPUChainedStruct * nextInChain;
WGPUStringView label;
size_t bindGroupLayoutCount;
WGPU_NULLABLE WGPUBindGroupLayout const * bindGroupLayouts;
WGPUBindGroupLayout const * bindGroupLayouts;
uint32_t immediateSize;
} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE;
@@ -1582,6 +1592,16 @@ typedef struct WGPUSupportedFeatures {
/*.features=*/NULL _wgpu_COMMA \
})
typedef struct WGPUSupportedInstanceFeatures {
size_t featureCount;
WGPUInstanceFeatureName const * features;
} WGPUSupportedInstanceFeatures WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_SUPPORTED_INSTANCE_FEATURES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSupportedInstanceFeatures, { \
/*.featureCount=*/0 _wgpu_COMMA \
/*.features=*/NULL _wgpu_COMMA \
})
typedef struct WGPUSupportedWGSLLanguageFeatures {
size_t featureCount;
WGPUWGSLLanguageFeatureName const * features;
@@ -1708,30 +1728,18 @@ typedef struct WGPUTextureBindingViewDimensionDescriptor {
/*.textureBindingViewDimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \
})
typedef struct WGPUTextureViewDescriptor {
WGPUChainedStruct * nextInChain;
WGPUStringView label;
WGPUTextureFormat format;
WGPUTextureViewDimension dimension;
uint32_t baseMipLevel;
uint32_t mipLevelCount;
uint32_t baseArrayLayer;
uint32_t arrayLayerCount;
WGPUTextureAspect aspect;
WGPUTextureUsage usage;
} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUTextureComponentSwizzle {
WGPUComponentSwizzle r;
WGPUComponentSwizzle g;
WGPUComponentSwizzle b;
WGPUComponentSwizzle a;
} WGPUTextureComponentSwizzle WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureViewDescriptor, { \
/*.nextInChain=*/NULL _wgpu_COMMA \
/*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \
/*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \
/*.dimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \
/*.baseMipLevel=*/0 _wgpu_COMMA \
/*.mipLevelCount=*/WGPU_MIP_LEVEL_COUNT_UNDEFINED _wgpu_COMMA \
/*.baseArrayLayer=*/0 _wgpu_COMMA \
/*.arrayLayerCount=*/WGPU_ARRAY_LAYER_COUNT_UNDEFINED _wgpu_COMMA \
/*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \
/*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \
#define WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureComponentSwizzle, { \
/*.r=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
/*.g=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
/*.b=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
/*.a=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
})
typedef struct WGPUVertexAttribute {
@@ -1884,12 +1892,16 @@ typedef struct WGPUFutureWaitInfo {
typedef struct WGPUInstanceDescriptor {
WGPUChainedStruct * nextInChain;
WGPUInstanceCapabilities capabilities;
size_t requiredFeatureCount;
WGPUInstanceFeatureName const * requiredFeatures;
WGPU_NULLABLE WGPUInstanceLimits const * requiredLimits;
} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_INSTANCE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUInstanceDescriptor, { \
/*.nextInChain=*/NULL _wgpu_COMMA \
/*.capabilities=*/WGPU_INSTANCE_CAPABILITIES_INIT _wgpu_COMMA \
/*.requiredFeatureCount=*/0 _wgpu_COMMA \
/*.requiredFeatures=*/NULL _wgpu_COMMA \
/*.requiredLimits=*/NULL _wgpu_COMMA \
})
typedef struct WGPULimits {
@@ -2046,6 +2058,20 @@ typedef struct WGPUTexelCopyTextureInfo {
/*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \
})
// Can be chained in WGPUTextureViewDescriptor
typedef struct WGPUTextureComponentSwizzleDescriptor {
WGPUChainedStruct chain;
WGPUTextureComponentSwizzle swizzle;
} WGPUTextureComponentSwizzleDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_TEXTURE_COMPONENT_SWIZZLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureComponentSwizzleDescriptor, { \
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
/*.next=*/NULL _wgpu_COMMA \
/*.sType=*/WGPUSType_TextureComponentSwizzleDescriptor _wgpu_COMMA \
}) _wgpu_COMMA \
/*.swizzle=*/WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT _wgpu_COMMA \
})
typedef struct WGPUTextureDescriptor {
WGPUChainedStruct * nextInChain;
WGPUStringView label;
@@ -2184,6 +2210,32 @@ typedef struct WGPURenderPassDescriptor {
/*.timestampWrites=*/NULL _wgpu_COMMA \
})
typedef struct WGPUTextureViewDescriptor {
WGPUChainedStruct * nextInChain;
WGPUStringView label;
WGPUTextureFormat format;
WGPUTextureViewDimension dimension;
uint32_t baseMipLevel;
uint32_t mipLevelCount;
uint32_t baseArrayLayer;
uint32_t arrayLayerCount;
WGPUTextureAspect aspect;
WGPUTextureUsage usage;
} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureViewDescriptor, { \
/*.nextInChain=*/NULL _wgpu_COMMA \
/*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \
/*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \
/*.dimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \
/*.baseMipLevel=*/0 _wgpu_COMMA \
/*.mipLevelCount=*/WGPU_MIP_LEVEL_COUNT_UNDEFINED _wgpu_COMMA \
/*.baseArrayLayer=*/0 _wgpu_COMMA \
/*.arrayLayerCount=*/WGPU_ARRAY_LAYER_COUNT_UNDEFINED _wgpu_COMMA \
/*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \
/*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \
})
typedef struct WGPUVertexState {
WGPUChainedStruct * nextInChain;
WGPUShaderModule module;
@@ -2246,34 +2298,22 @@ typedef struct WGPURenderPipelineDescriptor {
/*.fragment=*/NULL _wgpu_COMMA \
})
// WGPURenderPassDescriptorMaxDrawCount is deprecated.
// Use WGPURenderPassMaxDrawCount instead.
typedef WGPURenderPassMaxDrawCount WGPURenderPassDescriptorMaxDrawCount;
// WGPUShaderModuleSPIRVDescriptor is deprecated.
// Use WGPUShaderSourceSPIRV instead.
typedef WGPUShaderSourceSPIRV WGPUShaderModuleSPIRVDescriptor;
// WGPUShaderModuleWGSLDescriptor is deprecated.
// Use WGPUShaderSourceWGSL instead.
typedef WGPUShaderSourceWGSL WGPUShaderModuleWGSLDescriptor;
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(WGPU_SKIP_PROCS)
// TODO(374150686): Remove these Emscripten specific declarations from the
// header once they are fully deprecated.
#ifdef __EMSCRIPTEN__
WGPU_EXPORT WGPUDevice emscripten_webgpu_get_device(void);
#endif
// Global procs
typedef WGPUInstance (*WGPUProcCreateInstance)(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcGetInstanceCapabilities)(WGPUInstanceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcGetInstanceFeatures)(WGPUSupportedInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcGetInstanceLimits)(WGPUInstanceLimits * limits) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUBool (*WGPUProcHasInstanceFeature)(WGPUInstanceFeatureName feature) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE;
// Procs of Adapter
typedef void (*WGPUProcAdapterGetFeatures)(WGPUAdapter adapter, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcAdapterGetInfo)(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE;
@@ -2357,7 +2397,7 @@ typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeli
// Procs of Device
typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPU_NULLABLE WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUFuture (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
@@ -2384,11 +2424,11 @@ typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE
// Procs of Instance
typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcInstanceGetWGSLLanguageFeatures)(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcInstanceGetWGSLLanguageFeatures)(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUBool (*WGPUProcInstanceHasWGSLLanguageFeature)(WGPUInstance instance, WGPUWGSLLanguageFeatureName feature) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUFuture (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUWaitStatus (*WGPUProcInstanceWaitAny)(WGPUInstance instance, size_t futureCount, WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUWaitStatus (*WGPUProcInstanceWaitAny)(WGPUInstance instance, size_t futureCount, WGPU_NULLABLE WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcInstanceAddRef)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
@@ -2480,17 +2520,20 @@ typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, WGPU
typedef void (*WGPUProcShaderModuleAddRef)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
// Procs of SupportedWGSLLanguageFeatures
typedef void (*WGPUProcSupportedWGSLLanguageFeaturesFreeMembers)(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Procs of SupportedFeatures
typedef void (*WGPUProcSupportedFeaturesFreeMembers)(WGPUSupportedFeatures supportedFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Procs of SupportedInstanceFeatures
typedef void (*WGPUProcSupportedInstanceFeaturesFreeMembers)(WGPUSupportedInstanceFeatures supportedInstanceFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Procs of SupportedWGSLLanguageFeatures
typedef void (*WGPUProcSupportedWGSLLanguageFeaturesFreeMembers)(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Procs of Surface
typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
typedef WGPUStatus (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcSurfaceAddRef)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
@@ -2519,13 +2562,13 @@ typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, WGPUStr
typedef void (*WGPUProcTextureViewAddRef)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE;
#endif // !defined(WGPU_SKIP_PROCS)
#if !defined(WGPU_SKIP_DECLARATIONS)
WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUStatus wgpuGetInstanceCapabilities(WGPUInstanceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuGetInstanceFeatures(WGPUSupportedInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUStatus wgpuGetInstanceLimits(WGPUInstanceLimits * limits) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuHasInstanceFeature(WGPUInstanceFeatureName feature) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE;
// Methods of Adapter
@@ -2611,7 +2654,7 @@ WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline)
// Methods of Device
WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPU_NULLABLE WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUFuture wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
@@ -2638,11 +2681,11 @@ WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE;
// Methods of Instance
WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUStatus wgpuInstanceGetWGSLLanguageFeatures(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuInstanceGetWGSLLanguageFeatures(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLLanguageFeatureName feature) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUFuture wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWaitStatus wgpuInstanceWaitAny(WGPUInstance instance, size_t futureCount, WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWaitStatus wgpuInstanceWaitAny(WGPUInstance instance, size_t futureCount, WGPU_NULLABLE WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuInstanceAddRef(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
@@ -2734,17 +2777,20 @@ WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, WGPUStr
WGPU_EXPORT void wgpuShaderModuleAddRef(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
// Methods of SupportedWGSLLanguageFeatures
WGPU_EXPORT void wgpuSupportedWGSLLanguageFeaturesFreeMembers(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Methods of SupportedFeatures
WGPU_EXPORT void wgpuSupportedFeaturesFreeMembers(WGPUSupportedFeatures supportedFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Methods of SupportedInstanceFeatures
WGPU_EXPORT void wgpuSupportedInstanceFeaturesFreeMembers(WGPUSupportedInstanceFeatures supportedInstanceFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Methods of SupportedWGSLLanguageFeatures
WGPU_EXPORT void wgpuSupportedWGSLLanguageFeaturesFreeMembers(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE;
// Methods of Surface
WGPU_EXPORT void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUStatus wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUStatus wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuSurfaceSetLabel(WGPUSurface surface, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuSurfaceUnconfigure(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuSurfaceAddRef(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
@@ -2773,15 +2819,10 @@ WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, WGPUString
WGPU_EXPORT void wgpuTextureViewAddRef(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE;
#endif // !defined(WGPU_SKIP_DECLARATIONS)
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
#ifdef __cplusplus
} // extern "C"
#endif
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
} // namespace wagyu2
#endif
#endif // WEBGPU_H_

View File

@@ -180,6 +180,18 @@ enum class CompilationMessageType : uint32_t {
static_assert(sizeof(CompilationMessageType) == sizeof(WGPUCompilationMessageType), "sizeof mismatch for CompilationMessageType");
static_assert(alignof(CompilationMessageType) == alignof(WGPUCompilationMessageType), "alignof mismatch for CompilationMessageType");
enum class ComponentSwizzle : uint32_t {
Undefined = WGPUComponentSwizzle_Undefined,
Zero = WGPUComponentSwizzle_Zero,
One = WGPUComponentSwizzle_One,
R = WGPUComponentSwizzle_R,
G = WGPUComponentSwizzle_G,
B = WGPUComponentSwizzle_B,
A = WGPUComponentSwizzle_A,
};
static_assert(sizeof(ComponentSwizzle) == sizeof(WGPUComponentSwizzle), "sizeof mismatch for ComponentSwizzle");
static_assert(alignof(ComponentSwizzle) == alignof(WGPUComponentSwizzle), "alignof mismatch for ComponentSwizzle");
enum class CompositeAlphaMode : uint32_t {
Auto = WGPUCompositeAlphaMode_Auto,
Opaque = WGPUCompositeAlphaMode_Opaque,
@@ -244,14 +256,15 @@ static_assert(sizeof(FeatureLevel) == sizeof(WGPUFeatureLevel), "sizeof mismatch
static_assert(alignof(FeatureLevel) == alignof(WGPUFeatureLevel), "alignof mismatch for FeatureLevel");
enum class FeatureName : uint32_t {
CoreFeaturesAndLimits = WGPUFeatureName_CoreFeaturesAndLimits,
DepthClipControl = WGPUFeatureName_DepthClipControl,
Depth32FloatStencil8 = WGPUFeatureName_Depth32FloatStencil8,
TimestampQuery = WGPUFeatureName_TimestampQuery,
TextureCompressionBC = WGPUFeatureName_TextureCompressionBC,
TextureCompressionBCSliced3D = WGPUFeatureName_TextureCompressionBCSliced3D,
TextureCompressionETC2 = WGPUFeatureName_TextureCompressionETC2,
TextureCompressionASTC = WGPUFeatureName_TextureCompressionASTC,
TextureCompressionASTCSliced3D = WGPUFeatureName_TextureCompressionASTCSliced3D,
TimestampQuery = WGPUFeatureName_TimestampQuery,
IndirectFirstInstance = WGPUFeatureName_IndirectFirstInstance,
ShaderF16 = WGPUFeatureName_ShaderF16,
RG11B10UfloatRenderable = WGPUFeatureName_RG11B10UfloatRenderable,
@@ -261,7 +274,10 @@ enum class FeatureName : uint32_t {
ClipDistances = WGPUFeatureName_ClipDistances,
DualSourceBlending = WGPUFeatureName_DualSourceBlending,
Subgroups = WGPUFeatureName_Subgroups,
CoreFeaturesAndLimits = WGPUFeatureName_CoreFeaturesAndLimits,
TextureFormatsTier1 = WGPUFeatureName_TextureFormatsTier1,
TextureFormatsTier2 = WGPUFeatureName_TextureFormatsTier2,
PrimitiveIndex = WGPUFeatureName_PrimitiveIndex,
TextureComponentSwizzle = WGPUFeatureName_TextureComponentSwizzle,
Unorm16TextureFormats = WGPUFeatureName_Unorm16TextureFormats,
Snorm16TextureFormats = WGPUFeatureName_Snorm16TextureFormats,
MultiDrawIndirect = WGPUFeatureName_MultiDrawIndirect,
@@ -293,6 +309,14 @@ enum class IndexFormat : uint32_t {
static_assert(sizeof(IndexFormat) == sizeof(WGPUIndexFormat), "sizeof mismatch for IndexFormat");
static_assert(alignof(IndexFormat) == alignof(WGPUIndexFormat), "alignof mismatch for IndexFormat");
enum class InstanceFeatureName : uint32_t {
TimedWaitAny = WGPUInstanceFeatureName_TimedWaitAny,
ShaderSourceSPIRV = WGPUInstanceFeatureName_ShaderSourceSPIRV,
MultipleDevicesPerAdapter = WGPUInstanceFeatureName_MultipleDevicesPerAdapter,
};
static_assert(sizeof(InstanceFeatureName) == sizeof(WGPUInstanceFeatureName), "sizeof mismatch for InstanceFeatureName");
static_assert(alignof(InstanceFeatureName) == alignof(WGPUInstanceFeatureName), "alignof mismatch for InstanceFeatureName");
enum class LoadOp : uint32_t {
Undefined = WGPULoadOp_Undefined,
Load = WGPULoadOp_Load,
@@ -455,6 +479,7 @@ enum class SType : uint32_t {
SurfaceSourceXCBWindow = WGPUSType_SurfaceSourceXCBWindow,
SurfaceColorManagement = WGPUSType_SurfaceColorManagement,
RequestAdapterWebXROptions = WGPUSType_RequestAdapterWebXROptions,
TextureComponentSwizzleDescriptor = WGPUSType_TextureComponentSwizzleDescriptor,
CompatibilityModeLimits = WGPUSType_CompatibilityModeLimits,
TextureBindingViewDimensionDescriptor = WGPUSType_TextureBindingViewDimensionDescriptor,
EmscriptenSurfaceSourceCanvasHTMLSelector = WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector,
@@ -463,15 +488,6 @@ enum class SType : uint32_t {
static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType");
static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType");
enum class SubgroupMatrixComponentType : uint32_t {
F32 = WGPUSubgroupMatrixComponentType_F32,
F16 = WGPUSubgroupMatrixComponentType_F16,
U32 = WGPUSubgroupMatrixComponentType_U32,
I32 = WGPUSubgroupMatrixComponentType_I32,
};
static_assert(sizeof(SubgroupMatrixComponentType) == sizeof(WGPUSubgroupMatrixComponentType), "sizeof mismatch for SubgroupMatrixComponentType");
static_assert(alignof(SubgroupMatrixComponentType) == alignof(WGPUSubgroupMatrixComponentType), "alignof mismatch for SubgroupMatrixComponentType");
enum class SurfaceGetCurrentTextureStatus : uint32_t {
SuccessOptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal,
SuccessSuboptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal,
@@ -507,6 +523,8 @@ enum class TextureFormat : uint32_t {
R8Snorm = WGPUTextureFormat_R8Snorm,
R8Uint = WGPUTextureFormat_R8Uint,
R8Sint = WGPUTextureFormat_R8Sint,
R16Unorm = WGPUTextureFormat_R16Unorm,
R16Snorm = WGPUTextureFormat_R16Snorm,
R16Uint = WGPUTextureFormat_R16Uint,
R16Sint = WGPUTextureFormat_R16Sint,
R16Float = WGPUTextureFormat_R16Float,
@@ -517,6 +535,8 @@ enum class TextureFormat : uint32_t {
R32Float = WGPUTextureFormat_R32Float,
R32Uint = WGPUTextureFormat_R32Uint,
R32Sint = WGPUTextureFormat_R32Sint,
RG16Unorm = WGPUTextureFormat_RG16Unorm,
RG16Snorm = WGPUTextureFormat_RG16Snorm,
RG16Uint = WGPUTextureFormat_RG16Uint,
RG16Sint = WGPUTextureFormat_RG16Sint,
RG16Float = WGPUTextureFormat_RG16Float,
@@ -534,6 +554,8 @@ enum class TextureFormat : uint32_t {
RG32Float = WGPUTextureFormat_RG32Float,
RG32Uint = WGPUTextureFormat_RG32Uint,
RG32Sint = WGPUTextureFormat_RG32Sint,
RGBA16Unorm = WGPUTextureFormat_RGBA16Unorm,
RGBA16Snorm = WGPUTextureFormat_RGBA16Snorm,
RGBA16Uint = WGPUTextureFormat_RGBA16Uint,
RGBA16Sint = WGPUTextureFormat_RGBA16Sint,
RGBA16Float = WGPUTextureFormat_RGBA16Float,
@@ -700,8 +722,6 @@ enum class WGSLLanguageFeatureName : uint32_t {
Packed4x8IntegerDotProduct = WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct,
UnrestrictedPointerParameters = WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters,
PointerCompositeAccess = WGPUWGSLLanguageFeatureName_PointerCompositeAccess,
SizedBindingArray = WGPUWGSLLanguageFeatureName_SizedBindingArray,
TexelBuffers = WGPUWGSLLanguageFeatureName_TexelBuffers,
};
static_assert(sizeof(WGSLLanguageFeatureName) == sizeof(WGPUWGSLLanguageFeatureName), "sizeof mismatch for WGSLLanguageFeatureName");
static_assert(alignof(WGSLLanguageFeatureName) == alignof(WGPUWGSLLanguageFeatureName), "alignof mismatch for WGSLLanguageFeatureName");
@@ -935,11 +955,6 @@ class ObjectBase {
CType mHandle = nullptr;
};
class Adapter;
class BindGroup;
class BindGroupLayout;
@@ -978,7 +993,7 @@ struct DawnCompilationMessageUtf16;
struct EmscriptenSurfaceSourceCanvasHTMLSelector;
struct Extent3D;
struct Future;
struct InstanceCapabilities;
struct InstanceLimits;
struct INTERNAL_HAVE_EMDAWNWEBGPU_HEADER;
struct MultisampleState;
struct Origin3D;
@@ -999,6 +1014,7 @@ struct ShaderSourceWGSL;
struct StencilFaceState;
struct StorageTextureBindingLayout;
struct SupportedFeatures;
struct SupportedInstanceFeatures;
struct SupportedWGSLLanguageFeatures;
struct SurfaceCapabilities;
struct SurfaceColorManagement;
@@ -1007,7 +1023,7 @@ struct SurfaceTexture;
struct TexelCopyBufferLayout;
struct TextureBindingLayout;
struct TextureBindingViewDimensionDescriptor;
struct TextureViewDescriptor;
struct TextureComponentSwizzle;
struct VertexAttribute;
struct BindGroupDescriptor;
struct BindGroupLayoutEntry;
@@ -1025,6 +1041,7 @@ struct ShaderModuleDescriptor;
struct SurfaceDescriptor;
struct TexelCopyBufferInfo;
struct TexelCopyTextureInfo;
struct TextureComponentSwizzleDescriptor;
struct TextureDescriptor;
struct VertexBufferLayout;
struct BindGroupLayoutDescriptor;
@@ -1033,6 +1050,7 @@ struct CompilationInfo;
struct ComputePipelineDescriptor;
struct DeviceDescriptor;
struct RenderPassDescriptor;
struct TextureViewDescriptor;
struct VertexState;
struct FragmentState;
struct RenderPipelineDescriptor;
@@ -1174,21 +1192,21 @@ struct CallbackTypeBase<std::tuple<Args...>, T> {
template <typename... T>
using BufferMapCallback = typename detail::CallbackTypeBase<std::tuple<MapAsyncStatus , StringView >, T...>::Callback;
using BufferMapCallback = typename detail::CallbackTypeBase<std::tuple<MapAsyncStatus, StringView>, T...>::Callback;
template <typename... T>
using CompilationInfoCallback = typename detail::CallbackTypeBase<std::tuple<CompilationInfoRequestStatus , CompilationInfo const * >, T...>::Callback;
using CompilationInfoCallback = typename detail::CallbackTypeBase<std::tuple<CompilationInfoRequestStatus, CompilationInfo const *>, T...>::Callback;
template <typename... T>
using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase<std::tuple<CreatePipelineAsyncStatus , ComputePipeline , StringView >, T...>::Callback;
using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase<std::tuple<CreatePipelineAsyncStatus, ComputePipeline, StringView>, T...>::Callback;
template <typename... T>
using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase<std::tuple<CreatePipelineAsyncStatus , RenderPipeline , StringView >, T...>::Callback;
using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase<std::tuple<CreatePipelineAsyncStatus, RenderPipeline, StringView>, T...>::Callback;
template <typename... T>
using PopErrorScopeCallback = typename detail::CallbackTypeBase<std::tuple<PopErrorScopeStatus , ErrorType , StringView >, T...>::Callback;
using PopErrorScopeCallback = typename detail::CallbackTypeBase<std::tuple<PopErrorScopeStatus, ErrorType, StringView>, T...>::Callback;
template <typename... T>
using QueueWorkDoneCallback = typename detail::CallbackTypeBase<std::tuple<QueueWorkDoneStatus , StringView >, T...>::Callback;
using QueueWorkDoneCallback = typename detail::CallbackTypeBase<std::tuple<QueueWorkDoneStatus, StringView>, T...>::Callback;
template <typename... T>
using RequestAdapterCallback = typename detail::CallbackTypeBase<std::tuple<RequestAdapterStatus , Adapter , StringView >, T...>::Callback;
using RequestAdapterCallback = typename detail::CallbackTypeBase<std::tuple<RequestAdapterStatus, Adapter, StringView>, T...>::Callback;
template <typename... T>
using RequestDeviceCallback = typename detail::CallbackTypeBase<std::tuple<RequestDeviceStatus , Device , StringView >, T...>::Callback;
using RequestDeviceCallback = typename detail::CallbackTypeBase<std::tuple<RequestDeviceStatus, Device, StringView>, T...>::Callback;
template <typename... T>
using DeviceLostCallback = typename detail::CallbackTypeBase<std::tuple<const Device&, DeviceLostReason, StringView>, T...>::Callback;
template <typename... T>
@@ -1434,7 +1452,7 @@ class Instance : public ObjectBase<Instance, WGPUInstance> {
using ObjectBase::operator=;
inline Surface CreateSurface(SurfaceDescriptor const * descriptor) const;
inline ConvertibleStatus GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const;
inline void GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const;
inline Bool HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const;
inline void ProcessEvents() const;
template <typename F, typename T,
@@ -1652,7 +1670,7 @@ class Surface : public ObjectBase<Surface, WGPUSurface> {
inline void Configure(SurfaceConfiguration const * config) const;
inline ConvertibleStatus GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const;
inline void GetCurrentTexture(SurfaceTexture * surfaceTexture) const;
inline void Present() const;
inline ConvertibleStatus Present() const;
inline void SetLabel(StringView label) const;
inline void Unconfigure() const;
@@ -1809,7 +1827,7 @@ struct CompatibilityModeLimits : ChainedStructOut {
inline CompatibilityModeLimits(Init&& init);
inline operator const WGPUCompatibilityModeLimits&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t));
alignas(kFirstMemberAlignment) uint32_t maxStorageBuffersInVertexStage = kLimitU32Undefined;
uint32_t maxStorageTexturesInVertexStage = kLimitU32Undefined;
uint32_t maxStorageBuffersInFragmentStage = kLimitU32Undefined;
@@ -1832,7 +1850,7 @@ struct DawnCompilationMessageUtf16 : ChainedStruct {
inline DawnCompilationMessageUtf16(Init&& init);
inline operator const WGPUDawnCompilationMessageUtf16&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t));
alignas(kFirstMemberAlignment) uint64_t linePos;
uint64_t offset;
uint64_t length;
@@ -1846,7 +1864,7 @@ struct EmscriptenSurfaceSourceCanvasHTMLSelector : ChainedStruct {
inline EmscriptenSurfaceSourceCanvasHTMLSelector(Init&& init);
inline operator const WGPUEmscriptenSurfaceSourceCanvasHTMLSelector&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView));
alignas(kFirstMemberAlignment) StringView selector = {};
};
@@ -1864,11 +1882,10 @@ struct Future {
uint64_t id;
};
struct InstanceCapabilities {
inline operator const WGPUInstanceCapabilities&() const noexcept;
struct InstanceLimits {
inline operator const WGPUInstanceLimits&() const noexcept;
ChainedStructOut * nextInChain = nullptr;
Bool timedWaitAnyEnable = false;
size_t timedWaitAnyMaxCount = 0;
};
@@ -1984,7 +2001,7 @@ struct RenderPassMaxDrawCount : ChainedStruct {
inline RenderPassMaxDrawCount(Init&& init);
inline operator const WGPURenderPassMaxDrawCount&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t));
alignas(kFirstMemberAlignment) uint64_t maxDrawCount = 50000000;
};
@@ -1996,7 +2013,7 @@ struct RequestAdapterWebXROptions : ChainedStruct {
inline RequestAdapterWebXROptions(Init&& init);
inline operator const WGPURequestAdapterWebXROptions&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool));
alignas(kFirstMemberAlignment) Bool xrCompatible;
};
@@ -2032,7 +2049,7 @@ struct ShaderSourceSPIRV : ChainedStruct {
inline ShaderSourceSPIRV(Init&& init);
inline operator const WGPUShaderSourceSPIRV&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t));
alignas(kFirstMemberAlignment) uint32_t codeSize;
uint32_t const * code = nullptr;
};
@@ -2045,7 +2062,7 @@ struct ShaderSourceWGSL : ChainedStruct {
inline ShaderSourceWGSL(Init&& init);
inline operator const WGPUShaderSourceWGSL&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView));
alignas(kFirstMemberAlignment) StringView code = {};
};
@@ -2084,6 +2101,23 @@ struct SupportedFeatures {
static inline void Reset(SupportedFeatures& value);
};
struct SupportedInstanceFeatures {
inline SupportedInstanceFeatures();
inline ~SupportedInstanceFeatures();
SupportedInstanceFeatures(const SupportedInstanceFeatures&) = delete;
SupportedInstanceFeatures& operator=(const SupportedInstanceFeatures&) = delete;
inline SupportedInstanceFeatures(SupportedInstanceFeatures&&);
inline SupportedInstanceFeatures& operator=(SupportedInstanceFeatures&&);
inline operator const WGPUSupportedInstanceFeatures&() const noexcept;
size_t const featureCount = {};
InstanceFeatureName const * const features = nullptr;
private:
inline void FreeMembers();
static inline void Reset(SupportedInstanceFeatures& value);
};
struct SupportedWGSLLanguageFeatures {
inline SupportedWGSLLanguageFeatures();
inline ~SupportedWGSLLanguageFeatures();
@@ -2132,7 +2166,7 @@ struct SurfaceColorManagement : ChainedStruct {
inline SurfaceColorManagement(Init&& init);
inline operator const WGPUSurfaceColorManagement&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(PredefinedColorSpace ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(PredefinedColorSpace));
alignas(kFirstMemberAlignment) PredefinedColorSpace colorSpace = {};
ToneMappingMode toneMappingMode = {};
};
@@ -2185,23 +2219,17 @@ struct TextureBindingViewDimensionDescriptor : ChainedStruct {
inline TextureBindingViewDimensionDescriptor(Init&& init);
inline operator const WGPUTextureBindingViewDimensionDescriptor&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension ));
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension));
alignas(kFirstMemberAlignment) TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined;
};
struct TextureViewDescriptor {
inline operator const WGPUTextureViewDescriptor&() const noexcept;
struct TextureComponentSwizzle {
inline operator const WGPUTextureComponentSwizzle&() const noexcept;
ChainedStruct const * nextInChain = nullptr;
StringView label = {};
TextureFormat format = TextureFormat::Undefined;
TextureViewDimension dimension = TextureViewDimension::Undefined;
uint32_t baseMipLevel = 0;
uint32_t mipLevelCount = kMipLevelCountUndefined;
uint32_t baseArrayLayer = 0;
uint32_t arrayLayerCount = kArrayLayerCountUndefined;
TextureAspect aspect = TextureAspect::Undefined;
TextureUsage usage = TextureUsage::None;
ComponentSwizzle r = ComponentSwizzle::Undefined;
ComponentSwizzle g = ComponentSwizzle::Undefined;
ComponentSwizzle b = ComponentSwizzle::Undefined;
ComponentSwizzle a = ComponentSwizzle::Undefined;
};
struct VertexAttribute {
@@ -2219,7 +2247,7 @@ struct BindGroupDescriptor {
ChainedStruct const * nextInChain = nullptr;
StringView label = {};
BindGroupLayout layout = nullptr;
size_t entryCount;
size_t entryCount = 0;
BindGroupEntry const * entries = nullptr;
};
@@ -2300,7 +2328,9 @@ struct InstanceDescriptor {
inline operator const WGPUInstanceDescriptor&() const noexcept;
ChainedStruct const * nextInChain = nullptr;
InstanceCapabilities capabilities = {};
size_t requiredFeatureCount = 0;
InstanceFeatureName const * requiredFeatures = nullptr;
InstanceLimits const * requiredLimits = nullptr;
};
struct Limits {
@@ -2394,6 +2424,18 @@ struct TexelCopyTextureInfo {
TextureAspect aspect = TextureAspect::Undefined;
};
// Can be chained in TextureViewDescriptor
struct TextureComponentSwizzleDescriptor : ChainedStruct {
inline TextureComponentSwizzleDescriptor();
struct Init;
inline TextureComponentSwizzleDescriptor(Init&& init);
inline operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept;
static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureComponentSwizzle));
alignas(kFirstMemberAlignment) TextureComponentSwizzle swizzle = {};
};
struct TextureDescriptor {
inline operator const WGPUTextureDescriptor&() const noexcept;
@@ -2424,7 +2466,7 @@ struct BindGroupLayoutDescriptor {
ChainedStruct const * nextInChain = nullptr;
StringView label = {};
size_t entryCount;
size_t entryCount = 0;
BindGroupLayoutEntry const * entries = nullptr;
};
@@ -2466,6 +2508,21 @@ struct RenderPassDescriptor {
PassTimestampWrites const * timestampWrites = nullptr;
};
struct TextureViewDescriptor {
inline operator const WGPUTextureViewDescriptor&() const noexcept;
ChainedStruct const * nextInChain = nullptr;
StringView label = {};
TextureFormat format = TextureFormat::Undefined;
TextureViewDimension dimension = TextureViewDimension::Undefined;
uint32_t baseMipLevel = 0;
uint32_t mipLevelCount = kMipLevelCountUndefined;
uint32_t baseArrayLayer = 0;
uint32_t arrayLayerCount = kArrayLayerCountUndefined;
TextureAspect aspect = TextureAspect::Undefined;
TextureUsage usage = TextureUsage::None;
};
struct VertexState {
inline operator const WGPUVertexState&() const noexcept;
@@ -2883,20 +2940,18 @@ static_assert(alignof(Future) == alignof(WGPUFuture), "alignof mismatch for Futu
static_assert(offsetof(Future, id) == offsetof(WGPUFuture, id),
"offsetof mismatch for Future::id");
// InstanceCapabilities implementation
// InstanceLimits implementation
InstanceCapabilities::operator const WGPUInstanceCapabilities&() const noexcept {
return *reinterpret_cast<const WGPUInstanceCapabilities*>(this);
InstanceLimits::operator const WGPUInstanceLimits&() const noexcept {
return *reinterpret_cast<const WGPUInstanceLimits*>(this);
}
static_assert(sizeof(InstanceCapabilities) == sizeof(WGPUInstanceCapabilities), "sizeof mismatch for InstanceCapabilities");
static_assert(alignof(InstanceCapabilities) == alignof(WGPUInstanceCapabilities), "alignof mismatch for InstanceCapabilities");
static_assert(offsetof(InstanceCapabilities, nextInChain) == offsetof(WGPUInstanceCapabilities, nextInChain),
"offsetof mismatch for InstanceCapabilities::nextInChain");
static_assert(offsetof(InstanceCapabilities, timedWaitAnyEnable) == offsetof(WGPUInstanceCapabilities, timedWaitAnyEnable),
"offsetof mismatch for InstanceCapabilities::timedWaitAnyEnable");
static_assert(offsetof(InstanceCapabilities, timedWaitAnyMaxCount) == offsetof(WGPUInstanceCapabilities, timedWaitAnyMaxCount),
"offsetof mismatch for InstanceCapabilities::timedWaitAnyMaxCount");
static_assert(sizeof(InstanceLimits) == sizeof(WGPUInstanceLimits), "sizeof mismatch for InstanceLimits");
static_assert(alignof(InstanceLimits) == alignof(WGPUInstanceLimits), "alignof mismatch for InstanceLimits");
static_assert(offsetof(InstanceLimits, nextInChain) == offsetof(WGPUInstanceLimits, nextInChain),
"offsetof mismatch for InstanceLimits::nextInChain");
static_assert(offsetof(InstanceLimits, timedWaitAnyMaxCount) == offsetof(WGPUInstanceLimits, timedWaitAnyMaxCount),
"offsetof mismatch for InstanceLimits::timedWaitAnyMaxCount");
// INTERNAL_HAVE_EMDAWNWEBGPU_HEADER implementation
@@ -3307,6 +3362,54 @@ static_assert(offsetof(SupportedFeatures, featureCount) == offsetof(WGPUSupporte
static_assert(offsetof(SupportedFeatures, features) == offsetof(WGPUSupportedFeatures, features),
"offsetof mismatch for SupportedFeatures::features");
// SupportedInstanceFeatures implementation
SupportedInstanceFeatures::SupportedInstanceFeatures() = default;
SupportedInstanceFeatures::~SupportedInstanceFeatures() {
FreeMembers();
}
SupportedInstanceFeatures::SupportedInstanceFeatures(SupportedInstanceFeatures&& rhs)
: featureCount(rhs.featureCount),
features(rhs.features){
Reset(rhs);
}
SupportedInstanceFeatures& SupportedInstanceFeatures::operator=(SupportedInstanceFeatures&& rhs) {
if (&rhs == this) {
return *this;
}
FreeMembers();
detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount);
detail::AsNonConstReference(this->features) = std::move(rhs.features);
Reset(rhs);
return *this;
}
void SupportedInstanceFeatures::FreeMembers() {
bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) {
wgpuSupportedInstanceFeaturesFreeMembers(
*reinterpret_cast<WGPUSupportedInstanceFeatures*>(this));
}
}
// static
void SupportedInstanceFeatures::Reset(SupportedInstanceFeatures& value) {
SupportedInstanceFeatures defaultValue{};
detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount;
detail::AsNonConstReference(value.features) = defaultValue.features;
}
SupportedInstanceFeatures::operator const WGPUSupportedInstanceFeatures&() const noexcept {
return *reinterpret_cast<const WGPUSupportedInstanceFeatures*>(this);
}
static_assert(sizeof(SupportedInstanceFeatures) == sizeof(WGPUSupportedInstanceFeatures), "sizeof mismatch for SupportedInstanceFeatures");
static_assert(alignof(SupportedInstanceFeatures) == alignof(WGPUSupportedInstanceFeatures), "alignof mismatch for SupportedInstanceFeatures");
static_assert(offsetof(SupportedInstanceFeatures, featureCount) == offsetof(WGPUSupportedInstanceFeatures, featureCount),
"offsetof mismatch for SupportedInstanceFeatures::featureCount");
static_assert(offsetof(SupportedInstanceFeatures, features) == offsetof(WGPUSupportedInstanceFeatures, features),
"offsetof mismatch for SupportedInstanceFeatures::features");
// SupportedWGSLLanguageFeatures implementation
SupportedWGSLLanguageFeatures::SupportedWGSLLanguageFeatures() = default;
SupportedWGSLLanguageFeatures::~SupportedWGSLLanguageFeatures() {
@@ -3550,34 +3653,22 @@ static_assert(alignof(TextureBindingViewDimensionDescriptor) == alignof(WGPUText
static_assert(offsetof(TextureBindingViewDimensionDescriptor, textureBindingViewDimension) == offsetof(WGPUTextureBindingViewDimensionDescriptor, textureBindingViewDimension),
"offsetof mismatch for TextureBindingViewDimensionDescriptor::textureBindingViewDimension");
// TextureViewDescriptor implementation
// TextureComponentSwizzle implementation
TextureViewDescriptor::operator const WGPUTextureViewDescriptor&() const noexcept {
return *reinterpret_cast<const WGPUTextureViewDescriptor*>(this);
TextureComponentSwizzle::operator const WGPUTextureComponentSwizzle&() const noexcept {
return *reinterpret_cast<const WGPUTextureComponentSwizzle*>(this);
}
static_assert(sizeof(TextureViewDescriptor) == sizeof(WGPUTextureViewDescriptor), "sizeof mismatch for TextureViewDescriptor");
static_assert(alignof(TextureViewDescriptor) == alignof(WGPUTextureViewDescriptor), "alignof mismatch for TextureViewDescriptor");
static_assert(offsetof(TextureViewDescriptor, nextInChain) == offsetof(WGPUTextureViewDescriptor, nextInChain),
"offsetof mismatch for TextureViewDescriptor::nextInChain");
static_assert(offsetof(TextureViewDescriptor, label) == offsetof(WGPUTextureViewDescriptor, label),
"offsetof mismatch for TextureViewDescriptor::label");
static_assert(offsetof(TextureViewDescriptor, format) == offsetof(WGPUTextureViewDescriptor, format),
"offsetof mismatch for TextureViewDescriptor::format");
static_assert(offsetof(TextureViewDescriptor, dimension) == offsetof(WGPUTextureViewDescriptor, dimension),
"offsetof mismatch for TextureViewDescriptor::dimension");
static_assert(offsetof(TextureViewDescriptor, baseMipLevel) == offsetof(WGPUTextureViewDescriptor, baseMipLevel),
"offsetof mismatch for TextureViewDescriptor::baseMipLevel");
static_assert(offsetof(TextureViewDescriptor, mipLevelCount) == offsetof(WGPUTextureViewDescriptor, mipLevelCount),
"offsetof mismatch for TextureViewDescriptor::mipLevelCount");
static_assert(offsetof(TextureViewDescriptor, baseArrayLayer) == offsetof(WGPUTextureViewDescriptor, baseArrayLayer),
"offsetof mismatch for TextureViewDescriptor::baseArrayLayer");
static_assert(offsetof(TextureViewDescriptor, arrayLayerCount) == offsetof(WGPUTextureViewDescriptor, arrayLayerCount),
"offsetof mismatch for TextureViewDescriptor::arrayLayerCount");
static_assert(offsetof(TextureViewDescriptor, aspect) == offsetof(WGPUTextureViewDescriptor, aspect),
"offsetof mismatch for TextureViewDescriptor::aspect");
static_assert(offsetof(TextureViewDescriptor, usage) == offsetof(WGPUTextureViewDescriptor, usage),
"offsetof mismatch for TextureViewDescriptor::usage");
static_assert(sizeof(TextureComponentSwizzle) == sizeof(WGPUTextureComponentSwizzle), "sizeof mismatch for TextureComponentSwizzle");
static_assert(alignof(TextureComponentSwizzle) == alignof(WGPUTextureComponentSwizzle), "alignof mismatch for TextureComponentSwizzle");
static_assert(offsetof(TextureComponentSwizzle, r) == offsetof(WGPUTextureComponentSwizzle, r),
"offsetof mismatch for TextureComponentSwizzle::r");
static_assert(offsetof(TextureComponentSwizzle, g) == offsetof(WGPUTextureComponentSwizzle, g),
"offsetof mismatch for TextureComponentSwizzle::g");
static_assert(offsetof(TextureComponentSwizzle, b) == offsetof(WGPUTextureComponentSwizzle, b),
"offsetof mismatch for TextureComponentSwizzle::b");
static_assert(offsetof(TextureComponentSwizzle, a) == offsetof(WGPUTextureComponentSwizzle, a),
"offsetof mismatch for TextureComponentSwizzle::a");
// VertexAttribute implementation
@@ -3764,8 +3855,12 @@ static_assert(sizeof(InstanceDescriptor) == sizeof(WGPUInstanceDescriptor), "siz
static_assert(alignof(InstanceDescriptor) == alignof(WGPUInstanceDescriptor), "alignof mismatch for InstanceDescriptor");
static_assert(offsetof(InstanceDescriptor, nextInChain) == offsetof(WGPUInstanceDescriptor, nextInChain),
"offsetof mismatch for InstanceDescriptor::nextInChain");
static_assert(offsetof(InstanceDescriptor, capabilities) == offsetof(WGPUInstanceDescriptor, capabilities),
"offsetof mismatch for InstanceDescriptor::capabilities");
static_assert(offsetof(InstanceDescriptor, requiredFeatureCount) == offsetof(WGPUInstanceDescriptor, requiredFeatureCount),
"offsetof mismatch for InstanceDescriptor::requiredFeatureCount");
static_assert(offsetof(InstanceDescriptor, requiredFeatures) == offsetof(WGPUInstanceDescriptor, requiredFeatures),
"offsetof mismatch for InstanceDescriptor::requiredFeatures");
static_assert(offsetof(InstanceDescriptor, requiredLimits) == offsetof(WGPUInstanceDescriptor, requiredLimits),
"offsetof mismatch for InstanceDescriptor::requiredLimits");
// Limits implementation
@@ -3942,6 +4037,26 @@ static_assert(offsetof(TexelCopyTextureInfo, origin) == offsetof(WGPUTexelCopyTe
static_assert(offsetof(TexelCopyTextureInfo, aspect) == offsetof(WGPUTexelCopyTextureInfo, aspect),
"offsetof mismatch for TexelCopyTextureInfo::aspect");
// TextureComponentSwizzleDescriptor implementation
TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor()
: ChainedStruct { nullptr, SType::TextureComponentSwizzleDescriptor } {}
struct TextureComponentSwizzleDescriptor::Init {
ChainedStruct * const nextInChain;
TextureComponentSwizzle swizzle = {};
};
TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor(TextureComponentSwizzleDescriptor::Init&& init)
: ChainedStruct { init.nextInChain, SType::TextureComponentSwizzleDescriptor },
swizzle(std::move(init.swizzle)){}
TextureComponentSwizzleDescriptor::operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept {
return *reinterpret_cast<const WGPUTextureComponentSwizzleDescriptor*>(this);
}
static_assert(sizeof(TextureComponentSwizzleDescriptor) == sizeof(WGPUTextureComponentSwizzleDescriptor), "sizeof mismatch for TextureComponentSwizzleDescriptor");
static_assert(alignof(TextureComponentSwizzleDescriptor) == alignof(WGPUTextureComponentSwizzleDescriptor), "alignof mismatch for TextureComponentSwizzleDescriptor");
static_assert(offsetof(TextureComponentSwizzleDescriptor, swizzle) == offsetof(WGPUTextureComponentSwizzleDescriptor, swizzle),
"offsetof mismatch for TextureComponentSwizzleDescriptor::swizzle");
// TextureDescriptor implementation
TextureDescriptor::operator const WGPUTextureDescriptor&() const noexcept {
@@ -4079,6 +4194,35 @@ static_assert(offsetof(RenderPassDescriptor, occlusionQuerySet) == offsetof(WGPU
static_assert(offsetof(RenderPassDescriptor, timestampWrites) == offsetof(WGPURenderPassDescriptor, timestampWrites),
"offsetof mismatch for RenderPassDescriptor::timestampWrites");
// TextureViewDescriptor implementation
TextureViewDescriptor::operator const WGPUTextureViewDescriptor&() const noexcept {
return *reinterpret_cast<const WGPUTextureViewDescriptor*>(this);
}
static_assert(sizeof(TextureViewDescriptor) == sizeof(WGPUTextureViewDescriptor), "sizeof mismatch for TextureViewDescriptor");
static_assert(alignof(TextureViewDescriptor) == alignof(WGPUTextureViewDescriptor), "alignof mismatch for TextureViewDescriptor");
static_assert(offsetof(TextureViewDescriptor, nextInChain) == offsetof(WGPUTextureViewDescriptor, nextInChain),
"offsetof mismatch for TextureViewDescriptor::nextInChain");
static_assert(offsetof(TextureViewDescriptor, label) == offsetof(WGPUTextureViewDescriptor, label),
"offsetof mismatch for TextureViewDescriptor::label");
static_assert(offsetof(TextureViewDescriptor, format) == offsetof(WGPUTextureViewDescriptor, format),
"offsetof mismatch for TextureViewDescriptor::format");
static_assert(offsetof(TextureViewDescriptor, dimension) == offsetof(WGPUTextureViewDescriptor, dimension),
"offsetof mismatch for TextureViewDescriptor::dimension");
static_assert(offsetof(TextureViewDescriptor, baseMipLevel) == offsetof(WGPUTextureViewDescriptor, baseMipLevel),
"offsetof mismatch for TextureViewDescriptor::baseMipLevel");
static_assert(offsetof(TextureViewDescriptor, mipLevelCount) == offsetof(WGPUTextureViewDescriptor, mipLevelCount),
"offsetof mismatch for TextureViewDescriptor::mipLevelCount");
static_assert(offsetof(TextureViewDescriptor, baseArrayLayer) == offsetof(WGPUTextureViewDescriptor, baseArrayLayer),
"offsetof mismatch for TextureViewDescriptor::baseArrayLayer");
static_assert(offsetof(TextureViewDescriptor, arrayLayerCount) == offsetof(WGPUTextureViewDescriptor, arrayLayerCount),
"offsetof mismatch for TextureViewDescriptor::arrayLayerCount");
static_assert(offsetof(TextureViewDescriptor, aspect) == offsetof(WGPUTextureViewDescriptor, aspect),
"offsetof mismatch for TextureViewDescriptor::aspect");
static_assert(offsetof(TextureViewDescriptor, usage) == offsetof(WGPUTextureViewDescriptor, usage),
"offsetof mismatch for TextureViewDescriptor::usage");
// VertexState implementation
VertexState::operator const WGPUVertexState&() const noexcept {
@@ -4281,15 +4425,15 @@ void DeviceDescriptor::SetUncapturedErrorCallback(L callback) {
void Adapter::GetFeatures(SupportedFeatures * features) const {
*features = SupportedFeatures();
wgpuAdapterGetFeatures(Get(), reinterpret_cast<WGPUSupportedFeatures * >(features));
wgpuAdapterGetFeatures(Get(), reinterpret_cast<WGPUSupportedFeatures *>(features));
}
ConvertibleStatus Adapter::GetInfo(AdapterInfo * info) const {
*info = AdapterInfo();
auto result = wgpuAdapterGetInfo(Get(), reinterpret_cast<WGPUAdapterInfo * >(info));
auto result = wgpuAdapterGetInfo(Get(), reinterpret_cast<WGPUAdapterInfo *>(info));
return static_cast<Status>(result);
}
ConvertibleStatus Adapter::GetLimits(Limits * limits) const {
auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast<WGPULimits * >(limits));
auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast<WGPULimits *>(limits));
return static_cast<Status>(result);
}
Bool Adapter::HasFeature(FeatureName feature) const {
@@ -4319,7 +4463,7 @@ Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode
}
callbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
callbackInfo.userdata2 = reinterpret_cast<void*>(userdata);
auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast<WGPUDeviceDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast<WGPUDeviceDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
@@ -4352,7 +4496,7 @@ Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode
callbackInfo.userdata1 = reinterpret_cast<void*>(lambda);
callbackInfo.userdata2 = nullptr;
}
auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast<WGPUDeviceDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast<WGPUDeviceDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
@@ -4499,7 +4643,7 @@ Future Buffer::MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode c
};
}
ConvertibleStatus Buffer::ReadMappedRange(size_t offset, void * data, size_t size) const {
auto result = wgpuBufferReadMappedRange(Get(), offset, reinterpret_cast<void * >(data), size);
auto result = wgpuBufferReadMappedRange(Get(), offset, reinterpret_cast<void *>(data), size);
return static_cast<Status>(result);
}
void Buffer::SetLabel(StringView label) const {
@@ -4509,7 +4653,7 @@ void Buffer::Unmap() const {
wgpuBufferUnmap(Get());
}
ConvertibleStatus Buffer::WriteMappedRange(size_t offset, void const * data, size_t size) const {
auto result = wgpuBufferWriteMappedRange(Get(), offset, reinterpret_cast<void const * >(data), size);
auto result = wgpuBufferWriteMappedRange(Get(), offset, reinterpret_cast<void const *>(data), size);
return static_cast<Status>(result);
}
@@ -4550,11 +4694,11 @@ static_assert(alignof(CommandBuffer) == alignof(WGPUCommandBuffer), "alignof mis
// CommandEncoder implementation
ComputePassEncoder CommandEncoder::BeginComputePass(ComputePassDescriptor const * descriptor) const {
auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast<WGPUComputePassDescriptor const * >(descriptor));
auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast<WGPUComputePassDescriptor const *>(descriptor));
return ComputePassEncoder::Acquire(result);
}
RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const {
auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast<WGPURenderPassDescriptor const * >(descriptor));
auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast<WGPURenderPassDescriptor const *>(descriptor));
return RenderPassEncoder::Acquire(result);
}
void CommandEncoder::ClearBuffer(Buffer const& buffer, uint64_t offset, uint64_t size) const {
@@ -4564,16 +4708,16 @@ void CommandEncoder::CopyBufferToBuffer(Buffer const& source, uint64_t sourceOff
wgpuCommandEncoderCopyBufferToBuffer(Get(), source.Get(), sourceOffset, destination.Get(), destinationOffset, size);
}
void CommandEncoder::CopyBufferToTexture(TexelCopyBufferInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const {
wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast<WGPUTexelCopyBufferInfo const * >(source), reinterpret_cast<WGPUTexelCopyTextureInfo const * >(destination), reinterpret_cast<WGPUExtent3D const * >(copySize));
wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast<WGPUTexelCopyBufferInfo const *>(source), reinterpret_cast<WGPUTexelCopyTextureInfo const *>(destination), reinterpret_cast<WGPUExtent3D const *>(copySize));
}
void CommandEncoder::CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const {
wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const * >(source), reinterpret_cast<WGPUTexelCopyBufferInfo const * >(destination), reinterpret_cast<WGPUExtent3D const * >(copySize));
wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const *>(source), reinterpret_cast<WGPUTexelCopyBufferInfo const *>(destination), reinterpret_cast<WGPUExtent3D const *>(copySize));
}
void CommandEncoder::CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const {
wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const * >(source), reinterpret_cast<WGPUTexelCopyTextureInfo const * >(destination), reinterpret_cast<WGPUExtent3D const * >(copySize));
wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const *>(source), reinterpret_cast<WGPUTexelCopyTextureInfo const *>(destination), reinterpret_cast<WGPUExtent3D const *>(copySize));
}
CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const {
auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast<WGPUCommandBufferDescriptor const * >(descriptor));
auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast<WGPUCommandBufferDescriptor const *>(descriptor));
return CommandBuffer::Acquire(result);
}
void CommandEncoder::InsertDebugMarker(StringView markerLabel) const {
@@ -4630,7 +4774,7 @@ void ComputePassEncoder::PushDebugGroup(StringView groupLabel) const {
wgpuComputePassEncoderPushDebugGroup(Get(), *reinterpret_cast<WGPUStringView const*>(&groupLabel));
}
void ComputePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const {
wgpuComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const * >(dynamicOffsets));
wgpuComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const *>(dynamicOffsets));
}
void ComputePassEncoder::SetLabel(StringView label) const {
wgpuComputePassEncoderSetLabel(Get(), *reinterpret_cast<WGPUStringView const*>(&label));
@@ -4683,23 +4827,23 @@ static_assert(alignof(ComputePipeline) == alignof(WGPUComputePipeline), "alignof
// Device implementation
BindGroup Device::CreateBindGroup(BindGroupDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast<WGPUBindGroupDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast<WGPUBindGroupDescriptor const *>(descriptor));
return BindGroup::Acquire(result);
}
BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast<WGPUBindGroupLayoutDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast<WGPUBindGroupLayoutDescriptor const *>(descriptor));
return BindGroupLayout::Acquire(result);
}
Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast<WGPUBufferDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast<WGPUBufferDescriptor const *>(descriptor));
return Buffer::Acquire(result);
}
CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast<WGPUCommandEncoderDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast<WGPUCommandEncoderDescriptor const *>(descriptor));
return CommandEncoder::Acquire(result);
}
ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const *>(descriptor));
return ComputePipeline::Acquire(result);
}
template <typename F, typename T,
@@ -4725,7 +4869,7 @@ Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * desc
}
callbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
callbackInfo.userdata2 = reinterpret_cast<void*>(userdata);
auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
@@ -4758,25 +4902,25 @@ Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * desc
callbackInfo.userdata1 = reinterpret_cast<void*>(lambda);
callbackInfo.userdata2 = nullptr;
}
auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast<WGPUComputePipelineDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
}
PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const {
auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast<WGPUPipelineLayoutDescriptor const * >(descriptor));
auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast<WGPUPipelineLayoutDescriptor const *>(descriptor));
return PipelineLayout::Acquire(result);
}
QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast<WGPUQuerySetDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast<WGPUQuerySetDescriptor const *>(descriptor));
return QuerySet::Acquire(result);
}
RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast<WGPURenderBundleEncoderDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast<WGPURenderBundleEncoderDescriptor const *>(descriptor));
return RenderBundleEncoder::Acquire(result);
}
RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const *>(descriptor));
return RenderPipeline::Acquire(result);
}
template <typename F, typename T,
@@ -4802,7 +4946,7 @@ Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descri
}
callbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
callbackInfo.userdata2 = reinterpret_cast<void*>(userdata);
auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
@@ -4835,21 +4979,21 @@ Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descri
callbackInfo.userdata1 = reinterpret_cast<void*>(lambda);
callbackInfo.userdata2 = nullptr;
}
auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const * >(descriptor), callbackInfo);
auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast<WGPURenderPipelineDescriptor const *>(descriptor), callbackInfo);
return Future {
result.id
};
}
Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast<WGPUSamplerDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast<WGPUSamplerDescriptor const *>(descriptor));
return Sampler::Acquire(result);
}
ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast<WGPUShaderModuleDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast<WGPUShaderModuleDescriptor const *>(descriptor));
return ShaderModule::Acquire(result);
}
Texture Device::CreateTexture(TextureDescriptor const * descriptor) const {
auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast<WGPUTextureDescriptor const * >(descriptor));
auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast<WGPUTextureDescriptor const *>(descriptor));
return Texture::Acquire(result);
}
void Device::Destroy() const {
@@ -4857,15 +5001,15 @@ void Device::Destroy() const {
}
ConvertibleStatus Device::GetAdapterInfo(AdapterInfo * adapterInfo) const {
*adapterInfo = AdapterInfo();
auto result = wgpuDeviceGetAdapterInfo(Get(), reinterpret_cast<WGPUAdapterInfo * >(adapterInfo));
auto result = wgpuDeviceGetAdapterInfo(Get(), reinterpret_cast<WGPUAdapterInfo *>(adapterInfo));
return static_cast<Status>(result);
}
void Device::GetFeatures(SupportedFeatures * features) const {
*features = SupportedFeatures();
wgpuDeviceGetFeatures(Get(), reinterpret_cast<WGPUSupportedFeatures * >(features));
wgpuDeviceGetFeatures(Get(), reinterpret_cast<WGPUSupportedFeatures *>(features));
}
ConvertibleStatus Device::GetLimits(Limits * limits) const {
auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast<WGPULimits * >(limits));
auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast<WGPULimits *>(limits));
return static_cast<Status>(result);
}
Future Device::GetLostFuture() const {
@@ -4967,13 +5111,12 @@ static_assert(alignof(Device) == alignof(WGPUDevice), "alignof mismatch for Devi
// Instance implementation
Surface Instance::CreateSurface(SurfaceDescriptor const * descriptor) const {
auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast<WGPUSurfaceDescriptor const * >(descriptor));
auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast<WGPUSurfaceDescriptor const *>(descriptor));
return Surface::Acquire(result);
}
ConvertibleStatus Instance::GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const {
void Instance::GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const {
*features = SupportedWGSLLanguageFeatures();
auto result = wgpuInstanceGetWGSLLanguageFeatures(Get(), reinterpret_cast<WGPUSupportedWGSLLanguageFeatures * >(features));
return static_cast<Status>(result);
wgpuInstanceGetWGSLLanguageFeatures(Get(), reinterpret_cast<WGPUSupportedWGSLLanguageFeatures *>(features));
}
Bool Instance::HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const {
auto result = wgpuInstanceHasWGSLLanguageFeature(Get(), static_cast<WGPUWGSLLanguageFeatureName>(feature));
@@ -5005,7 +5148,7 @@ Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackM
}
callbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
callbackInfo.userdata2 = reinterpret_cast<void*>(userdata);
auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast<WGPURequestAdapterOptions const * >(options), callbackInfo);
auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast<WGPURequestAdapterOptions const *>(options), callbackInfo);
return Future {
result.id
};
@@ -5038,13 +5181,13 @@ Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackM
callbackInfo.userdata1 = reinterpret_cast<void*>(lambda);
callbackInfo.userdata2 = nullptr;
}
auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast<WGPURequestAdapterOptions const * >(options), callbackInfo);
auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast<WGPURequestAdapterOptions const *>(options), callbackInfo);
return Future {
result.id
};
}
WaitStatus Instance::WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const {
auto result = wgpuInstanceWaitAny(Get(), futureCount, reinterpret_cast<WGPUFutureWaitInfo * >(futures), timeoutNS);
auto result = wgpuInstanceWaitAny(Get(), futureCount, reinterpret_cast<WGPUFutureWaitInfo *>(futures), timeoutNS);
return static_cast<WaitStatus>(result);
}
@@ -5184,13 +5327,13 @@ void Queue::SetLabel(StringView label) const {
wgpuQueueSetLabel(Get(), *reinterpret_cast<WGPUStringView const*>(&label));
}
void Queue::Submit(size_t commandCount, CommandBuffer const * commands) const {
wgpuQueueSubmit(Get(), commandCount, reinterpret_cast<WGPUCommandBuffer const * >(commands));
wgpuQueueSubmit(Get(), commandCount, reinterpret_cast<WGPUCommandBuffer const *>(commands));
}
void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const {
wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast<void const * >(data), size);
wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast<void const *>(data), size);
}
void Queue::WriteTexture(TexelCopyTextureInfo const * destination, void const * data, size_t dataSize, TexelCopyBufferLayout const * dataLayout, Extent3D const * writeSize) const {
wgpuQueueWriteTexture(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const * >(destination), reinterpret_cast<void const * >(data), dataSize, reinterpret_cast<WGPUTexelCopyBufferLayout const * >(dataLayout), reinterpret_cast<WGPUExtent3D const * >(writeSize));
wgpuQueueWriteTexture(Get(), reinterpret_cast<WGPUTexelCopyTextureInfo const *>(destination), reinterpret_cast<void const *>(data), dataSize, reinterpret_cast<WGPUTexelCopyBufferLayout const *>(dataLayout), reinterpret_cast<WGPUExtent3D const *>(writeSize));
}
@@ -5242,7 +5385,7 @@ void RenderBundleEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t in
wgpuRenderBundleEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset);
}
RenderBundle RenderBundleEncoder::Finish(RenderBundleDescriptor const * descriptor) const {
auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast<WGPURenderBundleDescriptor const * >(descriptor));
auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast<WGPURenderBundleDescriptor const *>(descriptor));
return RenderBundle::Acquire(result);
}
void RenderBundleEncoder::InsertDebugMarker(StringView markerLabel) const {
@@ -5255,7 +5398,7 @@ void RenderBundleEncoder::PushDebugGroup(StringView groupLabel) const {
wgpuRenderBundleEncoderPushDebugGroup(Get(), *reinterpret_cast<WGPUStringView const*>(&groupLabel));
}
void RenderBundleEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const {
wgpuRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const * >(dynamicOffsets));
wgpuRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const *>(dynamicOffsets));
}
void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const {
wgpuRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast<WGPUIndexFormat>(format), offset, size);
@@ -5308,7 +5451,7 @@ void RenderPassEncoder::EndOcclusionQuery() const {
wgpuRenderPassEncoderEndOcclusionQuery(Get());
}
void RenderPassEncoder::ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const {
wgpuRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast<WGPURenderBundle const * >(bundles));
wgpuRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast<WGPURenderBundle const *>(bundles));
}
void RenderPassEncoder::InsertDebugMarker(StringView markerLabel) const {
wgpuRenderPassEncoderInsertDebugMarker(Get(), *reinterpret_cast<WGPUStringView const*>(&markerLabel));
@@ -5326,10 +5469,10 @@ void RenderPassEncoder::PushDebugGroup(StringView groupLabel) const {
wgpuRenderPassEncoderPushDebugGroup(Get(), *reinterpret_cast<WGPUStringView const*>(&groupLabel));
}
void RenderPassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const {
wgpuRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const * >(dynamicOffsets));
wgpuRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast<uint32_t const *>(dynamicOffsets));
}
void RenderPassEncoder::SetBlendConstant(Color const * color) const {
wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast<WGPUColor const * >(color));
wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast<WGPUColor const *>(color));
}
void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const {
wgpuRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast<WGPUIndexFormat>(format), offset, size);
@@ -5492,18 +5635,19 @@ static_assert(alignof(ShaderModule) == alignof(WGPUShaderModule), "alignof misma
// Surface implementation
void Surface::Configure(SurfaceConfiguration const * config) const {
wgpuSurfaceConfigure(Get(), reinterpret_cast<WGPUSurfaceConfiguration const * >(config));
wgpuSurfaceConfigure(Get(), reinterpret_cast<WGPUSurfaceConfiguration const *>(config));
}
ConvertibleStatus Surface::GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const {
*capabilities = SurfaceCapabilities();
auto result = wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast<WGPUSurfaceCapabilities * >(capabilities));
auto result = wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast<WGPUSurfaceCapabilities *>(capabilities));
return static_cast<Status>(result);
}
void Surface::GetCurrentTexture(SurfaceTexture * surfaceTexture) const {
wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast<WGPUSurfaceTexture * >(surfaceTexture));
wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast<WGPUSurfaceTexture *>(surfaceTexture));
}
void Surface::Present() const {
wgpuSurfacePresent(Get());
ConvertibleStatus Surface::Present() const {
auto result = wgpuSurfacePresent(Get());
return static_cast<Status>(result);
}
void Surface::SetLabel(StringView label) const {
wgpuSurfaceSetLabel(Get(), *reinterpret_cast<WGPUStringView const*>(&label));
@@ -5529,7 +5673,7 @@ static_assert(alignof(Surface) == alignof(WGPUSurface), "alignof mismatch for Su
// Texture implementation
TextureView Texture::CreateView(TextureViewDescriptor const * descriptor) const {
auto result = wgpuTextureCreateView(Get(), reinterpret_cast<WGPUTextureViewDescriptor const * >(descriptor));
auto result = wgpuTextureCreateView(Get(), reinterpret_cast<WGPUTextureViewDescriptor const *>(descriptor));
return TextureView::Acquire(result);
}
void Texture::Destroy() const {
@@ -5607,25 +5751,23 @@ static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatc
// RenderPassDescriptorMaxDrawCount is deprecated.
// Use RenderPassMaxDrawCount instead.
using RenderPassDescriptorMaxDrawCount = RenderPassMaxDrawCount;
// ShaderModuleSPIRVDescriptor is deprecated.
// Use ShaderSourceSPIRV instead.
using ShaderModuleSPIRVDescriptor = ShaderSourceSPIRV;
// ShaderModuleWGSLDescriptor is deprecated.
// Use ShaderSourceWGSL instead.
using ShaderModuleWGSLDescriptor = ShaderSourceWGSL;
// Free Functions
static inline Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr) {
auto result = wgpuCreateInstance(reinterpret_cast<WGPUInstanceDescriptor const * >(descriptor));
auto result = wgpuCreateInstance(reinterpret_cast<WGPUInstanceDescriptor const *>(descriptor));
return Instance::Acquire(result);
}
static inline Status GetInstanceCapabilities(InstanceCapabilities * capabilities) {
auto result = wgpuGetInstanceCapabilities(reinterpret_cast<WGPUInstanceCapabilities * >(capabilities));
static inline void GetInstanceFeatures(SupportedInstanceFeatures * features) {
wgpuGetInstanceFeatures(reinterpret_cast<WGPUSupportedInstanceFeatures *>(features));
}
static inline Status GetInstanceLimits(InstanceLimits * limits) {
auto result = wgpuGetInstanceLimits(reinterpret_cast<WGPUInstanceLimits *>(limits));
return static_cast<Status>(result);
}
static inline Bool HasInstanceFeature(InstanceFeatureName feature) {
auto result = wgpuHasInstanceFeature(static_cast<WGPUInstanceFeatureName>(feature));
return result;
}
static inline Proc GetProcAddress(StringView procName) {
auto result = wgpuGetProcAddress(*reinterpret_cast<WGPUStringView const*>(&procName));
return reinterpret_cast<Proc>(result);
@@ -5634,6 +5776,7 @@ static inline Proc GetProcAddress(StringView procName) {
} // namespace wgpu
namespace wgpu {
template<>
struct IsWGPUBitmask<wgpu::BufferUsage> {
static constexpr bool enable = true;
@@ -5659,6 +5802,14 @@ struct IsWGPUBitmask<wgpu::TextureUsage> {
static constexpr bool enable = true;
};
inline bool operator==(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) {
return s1.r == s2.r && s1.g == s2.g && s1.b == s2.b && s1.a == s2.a;
}
inline bool operator!=(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) {
return !(s1 == s2);
}
} // namespace wgpu
namespace std {

View File

@@ -17,20 +17,8 @@
#define WGPU_WAGYU_STRLEN SIZE_MAX
#define WGPU_WAGYU_PIXEL_LOCAL_STORAGE_SIZE_UNDEFINED UINT32_MAX
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
namespace wagyu2 {
#endif
typedef struct WGPUWagyuRelaxedComplianceImpl *WGPUWagyuRelaxedCompliance WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUWagyuExternalTextureImpl *WGPUWagyuExternalTexture WGPU_OBJECT_ATTRIBUTE;
typedef enum WGPUWagyuDeviceFlushStatus
{
WGPUWagyuDeviceFlushStatus_Success = 0x00000000,
WGPUWagyuDeviceFlushStatus_Error = 0x00000001,
WGPUWagyuDeviceFlushStatus_Force32 = 0x7FFFFFFF
} WGPUWagyuDeviceFlushStatus WGPU_ENUM_ATTRIBUTE;
// These values extend the WGPUSType enum set from webgpu.h
typedef enum WGPUSType_Wagyu
{
@@ -51,6 +39,22 @@ typedef enum WGPUSType_Wagyu
WGPUSType_WagyuForce32 = 0x7FFFFFFF
} WGPUSType_Wagyu WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuDeviceFlushStatus
{
WGPUWagyuDeviceFlushStatus_Success = 0x00000000,
WGPUWagyuDeviceFlushStatus_Error = 0x00000001,
WGPUWagyuDeviceFlushStatus_Force32 = 0x7FFFFFFF
} WGPUWagyuDeviceFlushStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuDevicePipelineBinaryCacheError
{
WGPUWagyuDevicePipelineBinaryCacheError_Version = 0x00000000,
WGPUWagyuDevicePipelineBinaryCacheError_Corrupt = 0x00000001,
WGPUWagyuDevicePipelineBinaryCacheError_Link = 0x00000002,
WGPUWagyuDevicePipelineBinaryCacheError_Create = 0x00000003,
WGPUWagyuDevicePipelineBinaryCacheError_Force32 = 0x7FFFFFFF
} WGPUWagyuDevicePipelineBinaryCacheError WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuShaderLanguage
{
WGPUWagyuShaderLanguage_Detect = 0x00000000,
@@ -78,7 +82,17 @@ static const WGPUWagyuFragmentStateFeaturesFlags WGPUWagyuFragmentStateFeaturesF
static const WGPUTextureUsage WGPUTextureUsage_WagyuInputAttachment = (WGPUTextureUsage)(0x0000000040000000);
static const WGPUTextureUsage WGPUTextureUsage_WagyuTransientAttachment = (WGPUTextureUsage)(0x0000000020000000);
// Forward declarations for callbacks
struct WGPUWagyuDevicePipelineBinaryCacheStatistics;
struct WGPUWagyuDevicePipelineBinaryEvent;
struct WGPUWagyuShaderEntryPointArray;
typedef void (*WGPUWagyuDeviceFlushCallback)(WGPUDevice device, WGPUWagyuDeviceFlushStatus status, void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUWagyuExecuteCallback)(void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUWagyuPipelineBinaryCacheStatisticsCallback)(WGPUDevice device, WGPUWagyuDeviceFlushStatus status, const struct WGPUWagyuDevicePipelineBinaryCacheStatistics *statistics, void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUWagyuPipelineBinaryCallback)(WGPUDevice device, const struct WGPUWagyuDevicePipelineBinaryEvent *event, void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUWagyuPipelineBinaryErrorCallback)(WGPUDevice device, WGPUStringView reason, WGPUStringView message, void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUWagyuShaderModuleEntryPointsCallback)(WGPUShaderModule shaderModule, WGPUWagyuDeviceFlushStatus status, const struct WGPUWagyuShaderEntryPointArray *entryPoints, void *userdata1, void *userdata2) WGPU_FUNCTION_ATTRIBUTE;
typedef struct WGPUWagyuNrdpVersion
{
@@ -129,15 +143,49 @@ typedef struct WGPUWagyuComputePipelineDescriptor
#define WGPU_WAGYU_COMPUTE_PIPELINE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuComputePipelineDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuComputePipelineDescriptor) _wgpu_COMMA /*.cacheKey*/ WGPU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuOrigin2D
{
uint32_t x;
uint32_t y;
} WGPUWagyuOrigin2D WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_ORIGIN_2D_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuOrigin2D, { /* .x */ 0 _wgpu_COMMA /* .y */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuCopyExternalImageSourceInfo
{
WGPUStringView source;
WGPUWagyuOrigin2D origin;
WGPUBool flipY;
} WGPUWagyuCopyExternalImageSourceInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_COPY_EXTERNAL_IMAGE_SOURCE_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuCopyExternalImageSourceInfo, { /* .source */ WGPU_STRING_VIEW_INIT _wgpu_COMMA /* .origin */ WGPU_WAGYU_ORIGIN_2D_INIT _wgpu_COMMA /* .flipY */ WGPU_FALSE _wgpu_COMMA })
typedef struct WGPUWagyuCopyExternalImageDestInfo
{
WGPUTexture texture;
uint32_t mipLevel;
WGPUOrigin3D origin;
WGPUTextureAspect aspect;
WGPUPredefinedColorSpace colorSpace;
WGPUBool premultipliedAlpha;
} WGPUWagyuCopyExternalImageDestInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_COPY_EXTERNAL_IMAGE_DEST_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuCopyExternalImageDestInfo, { /* .texture */ NULL _wgpu_COMMA /* .mipLevel */ 0 _wgpu_COMMA /* .origin */ WGPU_ORIGIN_3D_INIT _wgpu_COMMA /* .aspect */ WGPUTextureAspect_All _wgpu_COMMA /* .colorSpace */ WGPUPredefinedColorSpace_SRGB _wgpu_COMMA /* .premultipliedAlpha */ WGPU_FALSE _wgpu_COMMA })
typedef struct WGPUWagyuDeviceDescriptor
{
WGPUChainedStruct chain;
WGPUBool dataBufferNeedsDetach;
WGPUBool wantsIndirectRendering;
WGPUOptionalBool dataBufferNeedsDetach;
WGPUOptionalBool wantsIndirectRendering;
WGPUOptionalBool wantsBufferClear;
WGPUOptionalBool wantsTextureClear;
} WGPUWagyuDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDeviceDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuDeviceDescriptor) _wgpu_COMMA /*.dataBufferNeedsDetach*/ WGPU_TRUE _wgpu_COMMA /*.wantsIndirectRendering*/ WGPU_FALSE _wgpu_COMMA })
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDeviceDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuDeviceDescriptor) _wgpu_COMMA /*.dataBufferNeedsDetach*/ WGPUOptionalBool_Undefined _wgpu_COMMA /*.wantsIndirectRendering*/ WGPUOptionalBool_Undefined _wgpu_COMMA /*.wantsBufferClear*/ WGPUOptionalBool_Undefined _wgpu_COMMA /*.wantsTextureClear*/ WGPUOptionalBool_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuDeviceFlushCallbackInfo
{
@@ -148,9 +196,21 @@ typedef struct WGPUWagyuDeviceFlushCallbackInfo
void *userdata2;
} WGPUWagyuDeviceFlushCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_FLUSHCALLBACK_INFO_INIT \
#define WGPU_WAGYU_DEVICE_FLUSH_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDeviceFlushCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuExecuteCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuExecuteCallback callback;
void *userdata1;
void *userdata2;
} WGPUWagyuExecuteCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_EXECUTE_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExecuteCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinary
{
size_t binarySize;
@@ -179,7 +239,32 @@ typedef struct WGPUWagyuDevicePipelineBinaryCacheKey
} WGPUWagyuDevicePipelineBinaryCacheKey WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_CACHE_KEY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryCacheKey, { /*.cacheKey*/ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*.blobKeysLength*/ 0 _wgpu_COMMA })
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryCacheKey, { /*.cacheKey*/ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*.blobKeysLength*/ 0 _wgpu_COMMA /*.blobKeys*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryCacheStatistics
{
uint32_t hits;
uint32_t misses;
size_t entryCount;
WGPUStringView *entries;
size_t errorCount;
WGPUWagyuDevicePipelineBinaryCacheError *errors;
} WGPUWagyuDevicePipelineBinaryCacheStatistics WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_CACHE_STATISTICS_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryCacheStatistics, { /*.hits*/ 0 _wgpu_COMMA /*.misses*/ 0 _wgpu_COMMA /*.entryCount*/ 0 _wgpu_COMMA /*.entries*/ NULL _wgpu_COMMA /*.errorCount*/ 0 _wgpu_COMMA /*.errors*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuPipelineBinaryCacheStatisticsCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuPipelineBinaryCacheStatisticsCallback callback;
void *userdata1;
void *userdata2;
} WGPUWagyuPipelineBinaryCacheStatisticsCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_PIPELINE_BINARY_CACHE_STATISTICS_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuPipelineBinaryCacheStatisticsCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryData
{
@@ -192,6 +277,17 @@ typedef struct WGPUWagyuDevicePipelineBinaryData
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_DATA_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryData, { /*.binariesLength*/ 0 _wgpu_COMMA /*.binaries*/ NULL _wgpu_COMMA /*.cacheKeysLength*/ 0 _wgpu_COMMA /*.cacheKeys*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryEvent
{
WGPUStringView cacheKey;
WGPUStringView pipelineLabel;
size_t binariesLength;
const WGPUWagyuDevicePipelineBinary *binaries;
} WGPUWagyuDevicePipelineBinaryEvent WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_EVENT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryEvent, { /*.cacheKey*/ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*.pipelineLabel*/ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*.binariesLength*/ 0 _wgpu_COMMA /*.binaries*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureDescriptor
{
const WGPUChainedStruct *nextInChain;
@@ -203,6 +299,18 @@ typedef struct WGPUWagyuExternalTextureDescriptor
#define WGPU_WAGYU_EXTERNAL_TEXTURE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExternalTextureDescriptor, { /*nextInChain = */ NULL _wgpu_COMMA /*label = */ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*source = */ WGPU_STRING_VIEW_INIT _wgpu_COMMA /*colorSpace = */ WGPUPredefinedColorSpace_SRGB _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureInfo
{
uint32_t visibleWidth;
uint32_t visibleHeight;
uint32_t textureWidth;
uint32_t textureHeight;
int64_t pts;
} WGPUWagyuExternalTextureInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_EXTERNAL_TEXTURE_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExternalTextureInfo, { /*.visibleWidth*/ 0 _wgpu_COMMA /*.visibleHeight*/ 0 _wgpu_COMMA /*.textureWidth*/ 0 _wgpu_COMMA /*.textureHeight*/ 0 _wgpu_COMMA /*.pts*/ 0 _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureBindingEntry
{
WGPUChainedStruct chain;
@@ -251,6 +359,30 @@ typedef struct WGPUWagyuInputTextureBindingLayout
#define WGPU_WAGYU_INPUT_TEXTURE_BINDING_LAYOUT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuInputTextureBindingLayout, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuInputTextureBindingLayout) _wgpu_COMMA /*.viewDimension*/ WGPUTextureViewDimension_2D _wgpu_COMMA })
typedef struct WGPUWagyuPipelineBinaryCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuPipelineBinaryCallback callback;
void *userdata1;
void *userdata2;
} WGPUWagyuPipelineBinaryCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_PIPELINE_BINARY_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuPipelineBinaryCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuPipelineBinaryErrorCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuPipelineBinaryErrorCallback callback;
void *userdata1;
void *userdata2;
} WGPUWagyuPipelineBinaryErrorCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_PIPELINE_BINARY_ERROR_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuPipelineBinaryErrorCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuRect
{
int32_t x;
@@ -294,6 +426,18 @@ typedef struct WGPUWagyuRenderPipelineDescriptor
#define WGPU_WAGYU_RENDER_PIPELINE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPipelineDescriptor, { /* .chain */ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuRenderPipelineDescriptor) _wgpu_COMMA /* .cacheKey */ WGPU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuShaderModuleEntryPointsCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuShaderModuleEntryPointsCallback callback;
void *userdata1;
void *userdata2;
} WGPUWagyuShaderModuleEntryPointsCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_MODULE_ENTRY_POINTS_CALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderModuleEntryPointsCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionStructMember
{
WGPUStringView name;
@@ -382,17 +526,6 @@ typedef struct WGPUWagyuShaderEntryPointArray
#define WGPU_WAGYU_SHADER_ENTRY_POINT_ARRAY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderEntryPointArray, { /* .entryPointCount */ 0 _wgpu_COMMA /* .entryPoints */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuRenderPassEncoderClearPixelLocalStorage
{
uint32_t offset;
size_t valueCount;
WGPU_NULLABLE uint32_t *values;
uint32_t size;
} WGPUWagyuRenderPassEncoderClearPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RENDER_PASS_ENCODER_CLEAR_PIXEL_LOCAL_STORAGE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPassEncoderClearPixelLocalStorage, { /* .offset */ 0 _wgpu_COMMA /* .valueCount */ 0 _wgpu_COMMA /* .values */ NULL _wgpu_COMMA /* .size */ WGPU_WAGYU_PIXEL_LOCAL_STORAGE_SIZE_UNDEFINED _wgpu_COMMA })
typedef struct WGPUWagyuShaderModuleCompilationHint
{
WGPUChainedStruct *nextInChain;
@@ -432,10 +565,12 @@ typedef struct WGPUWagyuSurfaceConfiguration
{
WGPUChainedStruct chain;
int32_t *indirectRenderTargets;
WGPUPredefinedColorSpace colorSpace;
WGPUToneMappingMode toneMappingMode;
} WGPUWagyuSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SURFACE_CONFIGURATION_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuSurfaceConfiguration, { /*.chain=*/WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuSurfaceConfiguration) _wgpu_COMMA /*.indirectRenderTargets*/ NULL _wgpu_COMMA })
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuSurfaceConfiguration, { /*.chain=*/WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuSurfaceConfiguration) _wgpu_COMMA /*.indirectRenderTargets*/ NULL _wgpu_COMMA /*.colorSpace*/ WGPUPredefinedColorSpace_SRGB _wgpu_COMMA /*.toneMappingMode*/ WGPUToneMappingMode_Standard _wgpu_COMMA })
typedef struct WGPUWagyuTextureDescriptor
{
@@ -455,7 +590,7 @@ typedef struct WGPUWagyuWGSLFeatureTypeArray
#define WGPU_WAGYU_WGSL_FEATURE_TYPE_ARRAY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuWGSLFeatureTypeArray, { /* .featureCount */ 0 _wgpu_COMMA /* .features */ NULL _wgpu_COMMA })
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
#if defined(__cplusplus) && !defined(__cppcheck)
extern "C" {
#endif
@@ -466,47 +601,49 @@ WGPU_EXPORT void wgpuWagyuAdapterGetName(WGPUAdapter adapter, WGPUStringView *na
WGPU_EXPORT WGPUDevice wgpuWagyuAdapterRequestDeviceSync(WGPUAdapter adapter, WGPU_NULLABLE const WGPUDeviceDescriptor *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuCommandEncoderBlit(WGPUCommandEncoder commandEncoder, const WGPUTexelCopyTextureInfo *source, const WGPUExtent3D *sourceExtent, const WGPUTexelCopyTextureInfo *destination, const WGPUExtent3D *destinationExtent, WGPUFilterMode filter) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuCommandEncoderExecuteCallback(WGPUCommandEncoder commandEncoder, WGPUWagyuExecuteCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuCommandEncoderGenerateMipmap(WGPUCommandEncoder commandEncoder, WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuComputePassEncoderExecuteCallback(WGPUComputePassEncoder computePassEncoder, WGPUWagyuExecuteCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceClearPipelineBinaryCache(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceEnableImaginationWorkarounds(WGPUDevice device, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceGetExtensions(WGPUDevice device, WGPUWagyuStringArray *extensions) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUFuture wgpuWagyuDeviceFlush(WGPUDevice device, WGPUWagyuDeviceFlushCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWagyuExternalTexture wgpuWagyuDeviceImportExternalTexture(WGPUDevice device, const WGPUWagyuExternalTextureDescriptor *descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceIntrospectShaderCode(WGPUDevice device, WGPUShaderStage stages, const WGPUShaderModuleDescriptor *descriptor, WGPUWagyuShaderEntryPointArray *entryPoints) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUFuture wgpuWagyuDevicePipelineBinaryCacheStatistics(WGPUDevice device, WGPUWagyuPipelineBinaryCacheStatisticsCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDevicePopulatePipelineBinaryCache(WGPUDevice device, const WGPUWagyuDevicePipelineBinaryData *data) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceSetPipelineBinaryCallback(WGPUDevice device, WGPUWagyuPipelineBinaryCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceSetPipelineBinaryErrorCallback(WGPUDevice device, WGPUWagyuPipelineBinaryErrorCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureAddRef(WGPUWagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureGetInfo(WGPUWagyuExternalTexture externalTexture, WGPUWagyuExternalTextureInfo *info) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureRelease(WGPUWagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureSetLabel(WGPUWagyuExternalTexture externalTexture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceEnableImaginationWorkarounds(WGPUInstance instance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT uint32_t wgpuWagyuInstanceGetApiVersion(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBackendType wgpuWagyuInstanceGetBackend(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceGetExposeWGSLFeatures(WGPUInstance instance, WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWagyuRelaxedCompliance wgpuWagyuInstanceGetRelaxedCompliance(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceGetExposedWgslFeatures(WGPUInstance instance, WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTextureFormat wgpuWagyuInstanceGetScreenDirectFormat(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTextureFormat wgpuWagyuInstanceGetScreenIndirectFormat(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuInstanceGetSync(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUAdapter wgpuWagyuInstanceRequestAdapterSync(WGPUInstance instance, WGPU_NULLABLE const WGPURequestAdapterOptions *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetCommandBufferLimit(WGPUInstance instance, uint32_t limit) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetExposeWGSLFeatures(WGPUInstance instance, const WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetExposedWgslFeatures(WGPUInstance instance, const WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetImmediate(WGPUInstance instance, WGPUBool enabled) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetRunBarriersOnIncoherent(WGPUInstance instance, WGPUBool run) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetStagingBufferCacheSize(WGPUInstance instance, uint32_t size) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetSync(WGPUInstance instance, WGPUBool sync) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceAddRef(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceRelease(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuRelaxedComplianceGetBufferClear(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuRelaxedComplianceGetTextureClear(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetAll(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetBufferClear(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetTextureClear(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuQueueCopyExternalImageToTexture(WGPUQueue queue, const WGPUWagyuCopyExternalImageSourceInfo *source, const WGPUWagyuCopyExternalImageDestInfo *destination, const WGPUExtent3D *copySize) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearColorAttachments(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, uint32_t baseAttachment, uint32_t numAttachments, const WGPUColor *color, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearDepthAttachment(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, float depth, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearPixelLocalStorage(WGPURenderBundleEncoder renderBundleEncoder, uint32_t offset, uint32_t size, WGPU_NULLABLE const uint32_t *values) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearStencilAttachment(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, uint32_t stencil, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderExecuteCallback(WGPURenderBundleEncoder renderBundleEncoder, WGPUWagyuExecuteCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetScissorRect(WGPURenderBundleEncoder renderBundleEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetScissorRectIndirect(WGPURenderBundleEncoder renderBundleEncoder, uint64_t indirectOffset, const uint32_t *indirectBuffer, size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetViewport(WGPURenderBundleEncoder renderBundleEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE;
@@ -516,15 +653,17 @@ WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetViewportWithoutDepthIndirect(WGP
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearColorAttachments(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, uint32_t baseAttachment, uint32_t numAttachments, const WGPUColor *color, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearDepthAttachment(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, float depth, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearStencilAttachment(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, uint32_t stencil, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearPixelLocalStorage(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRenderPassEncoderClearPixelLocalStorage *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearPixelLocalStorage(WGPURenderPassEncoder renderPassEncoder, uint32_t offset, uint32_t size, WGPU_NULLABLE const uint32_t *values) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderExecuteBundle(WGPURenderPassEncoder renderPassEncoder, WGPURenderBundle bundle) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderExecuteCallback(WGPURenderPassEncoder renderPassEncoder, WGPUWagyuExecuteCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderEntryPointArrayFreeMembers(WGPUWagyuShaderEntryPointArray value) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderEntryPointArrayFreeMembers(WGPUWagyuShaderEntryPointArray shaderEntryPointArray) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderModuleDestroy(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUFuture wgpuWagyuShaderModuleEntryPoints(WGPUShaderModule shaderModule, uint32_t stage, WGPUWagyuShaderModuleEntryPointsCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderModuleIntrospect(WGPUShaderModule shaderModule, WGPUShaderStage stages, WGPUWagyuShaderEntryPointArray *shaderEntryPointArray) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuTextureIsSwapchain(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuStringArrayFreeMembers(WGPUWagyuStringArray stringArray) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceDestroy(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTexture wgpuWagyuSurfaceGetCurrentDepthStencilTexture(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
@@ -538,14 +677,13 @@ WGPU_EXPORT void wgpuWagyuSurfaceSetWidth(WGPUSurface surface, float width) WGPU
WGPU_EXPORT void wgpuWagyuSurfaceSetX(WGPUSurface surface, float x) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceSetY(WGPUSurface surface, float y) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuWGSLFeatureTypeArrayFreeMembers(WGPUWagyuWGSLFeatureTypeArray value) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuTextureIsSwapchain(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuTextureReadPixels(WGPUTexture texture, void *data, size_t dataSize) WGPU_FUNCTION_ATTRIBUTE;
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
WGPU_EXPORT void wgpuWagyuWGSLFeatureTypeArrayFreeMembers(WGPUWagyuWGSLFeatureTypeArray wgslFeatureTypeArray) WGPU_FUNCTION_ATTRIBUTE;
#if defined(__cplusplus) && !defined(__cppcheck)
} // extern "C"
#endif
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
} // namespace wagyu2
#endif
#endif /* WEBGPU_WAGYU_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
#ifndef WEBGPU_CPP_CHAINED_STRUCT_H_
#define WEBGPU_CPP_CHAINED_STRUCT_H_
#include <cstddef>
#include <cstdint>
// This header file declares the ChainedStruct structures separately from the WebGPU
// headers so that dependencies can directly extend structures without including the larger header
// which exposes capabilities that may require correctly set proc tables.
namespace wgpu {
enum class SType : uint32_t;
struct ChainedStruct {
ChainedStruct const * nextInChain = nullptr;
SType sType = SType(0u);
};
struct ChainedStructOut {
ChainedStructOut * nextInChain = nullptr;
SType sType = SType(0u);
};
} // namespace wgpu}
#endif // WEBGPU_CPP_CHAINED_STRUCT_H_

View File

@@ -1,161 +0,0 @@
// Copyright 2017 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef WEBGPU_ENUM_CLASS_BITMASKS_H_
#define WEBGPU_ENUM_CLASS_BITMASKS_H_
#include <type_traits>
// The operators in wgpu:: namespace need be introduced into other namespaces with
// using-declarations for C++ Argument Dependent Lookup to work.
#define WGPU_IMPORT_BITMASK_OPERATORS \
using wgpu::operator|; \
using wgpu::operator&; \
using wgpu::operator^; \
using wgpu::operator~; \
using wgpu::operator&=; \
using wgpu::operator|=; \
using wgpu::operator^=; \
using wgpu::HasZeroOrOneBits;
namespace wgpu {
template <typename T>
struct IsWGPUBitmask {
static constexpr bool enable = false;
};
template <typename T, typename Enable = void>
struct LowerBitmask {
static constexpr bool enable = false;
};
template <typename T>
struct LowerBitmask<T, typename std::enable_if<IsWGPUBitmask<T>::enable>::type> {
static constexpr bool enable = true;
using type = T;
constexpr static T Lower(T t) { return t; }
};
template <typename T>
struct BoolConvertible {
using Integral = typename std::underlying_type<T>::type;
// NOLINTNEXTLINE(runtime/explicit)
explicit constexpr BoolConvertible(Integral value) : value(value) {}
constexpr operator bool() const { return value != 0; }
constexpr operator T() const { return static_cast<T>(value); }
Integral value;
};
template <typename T>
struct LowerBitmask<BoolConvertible<T>> {
static constexpr bool enable = true;
using type = T;
static constexpr type Lower(BoolConvertible<T> t) { return t; }
};
template <
typename T1,
typename T2,
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator|(T1 left, T2 right) {
using T = typename LowerBitmask<T1>::type;
using Integral = typename std::underlying_type<T>::type;
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) |
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
}
template <
typename T1,
typename T2,
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator&(T1 left, T2 right) {
using T = typename LowerBitmask<T1>::type;
using Integral = typename std::underlying_type<T>::type;
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) &
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
}
template <
typename T1,
typename T2,
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator^(T1 left, T2 right) {
using T = typename LowerBitmask<T1>::type;
using Integral = typename std::underlying_type<T>::type;
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) ^
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
}
template <typename T1>
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator~(T1 t) {
using T = typename LowerBitmask<T1>::type;
using Integral = typename std::underlying_type<T>::type;
return BoolConvertible<T>(~static_cast<Integral>(LowerBitmask<T1>::Lower(t)));
}
template <
typename T,
typename T2,
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
constexpr T& operator&=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);
l = l & r;
return l;
}
template <
typename T,
typename T2,
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
constexpr T& operator|=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);
l = l | r;
return l;
}
template <
typename T,
typename T2,
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
constexpr T& operator^=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);
l = l ^ r;
return l;
}
template <typename T>
constexpr bool HasZeroOrOneBits(T value) {
using Integral = typename std::underlying_type<T>::type;
return (static_cast<Integral>(value) & (static_cast<Integral>(value) - 1)) == 0;
}
} // namespace wgpu
#endif // WEBGPU_ENUM_CLASS_BITMASKS_H_

View File

@@ -1,588 +0,0 @@
#ifndef WEBGPU_WAGYU_H
#define WEBGPU_WAGYU_H
#include "webgpu/webgpu.h"
#define WGPU_WAGYU_EXTENSION_LEVEL 1
// Reserved range for Wagyu starts at 0x00060000
// https://github.com/webgpu-native/webgpu-headers/blob/main/doc/articles/Extensions.md#registry-of-prefixes-and-enum-blocks
#define WGPU_WAGYU_RESERVED_RANGE_BASE 0x00060000
#if defined(__cplusplus)
#if __cplusplus >= 201103L
#define WGPU_WAGYU_MAKE_INIT_STRUCT(type, value) (type value)
#else
#define WGPU_WAGYU_MAKE_INIT_STRUCT(type, value) value
#endif
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define WGPU_WAGYU_MAKE_INIT_STRUCT(type, value) ((type)value)
#else
#define WGPU_WAGYU_MAKE_INIT_STRUCT(type, value) value
#endif
#define _wgpu_COMMA ,
#define WGPU_WAGYU_CHAIN_INIT(sType) \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUChainedStruct, { /*.next = */ NULL _wgpu_COMMA /*.sType = */ (WGPUSType) sType _wgpu_COMMA })
#define WGPU_WAGYU_CHAIN_OUT_INIT(sType) \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUChainedStructOut, { /*.next = */ NULL _wgpu_COMMA /*.sType = */ (WGPUSType) sType _wgpu_COMMA })
// This should be equivalent to the type of the same name in the new webgpu.h
#if !defined(WGPUOptionalBool)
#define WGPUOptionalBool int32_t
#define WGPUOptionalBool_False 0x00000000
#define WGPUOptionalBool_True 0x00000001
#define WGPUOptionalBool_Undefined 0x00000002
#define WGPUOptionalBool_Force32 0x7FFFFFFF
#endif
#define WGPU_WAGYU_STRLEN SIZE_MAX
#define WGPU_WAGYU_PIXEL_LOCAL_STORAGE_SIZE_UNDEFINED UINT32_MAX
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
namespace wagyu1 {
#endif
typedef struct WGPUWagyuRelaxedComplianceImpl *WGPUWagyuRelaxedCompliance WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUWagyuExternalTextureImpl *WGPUWagyuExternalTexture WGPU_OBJECT_ATTRIBUTE;
typedef enum WGPUWagyuDeviceFlushStatus
{
WGPUWagyuDeviceFlushStatus_Success = 0x00000000,
WGPUWagyuDeviceFlushStatus_Error = 0x00000001,
WGPUWagyuDeviceFlushStatus_Force32 = 0x7FFFFFFF
} WGPUWagyuDeviceFlushStatus WGPU_ENUM_ATTRIBUTE;
// These values extend the WGPUSType enum set from webgpu.h
typedef enum WGPUSType_Wagyu
{
WGPUSType_WagyuAdapterInfo = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0001,
WGPUSType_WagyuColorTargetState = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0002,
WGPUSType_WagyuCommandEncoderDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0003,
WGPUSType_WagyuComputePipelineDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0004,
WGPUSType_WagyuDeviceDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0005,
WGPUSType_WagyuExternalTextureBindingEntry = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0006,
WGPUSType_WagyuExternalTextureBindingLayout = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0007,
WGPUSType_WagyuFragmentState = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0008,
WGPUSType_WagyuInputTextureBindingLayout = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x0009,
WGPUSType_WagyuRenderPassDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x000A,
WGPUSType_WagyuRenderPipelineDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x000B,
WGPUSType_WagyuShaderModuleDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x000C,
WGPUSType_WagyuSurfaceConfiguration = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x000D,
WGPUSType_WagyuTextureDescriptor = WGPU_WAGYU_RESERVED_RANGE_BASE + 0x000E,
WGPUSType_WagyuForce32 = 0x7FFFFFFF
} WGPUSType_Wagyu WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuPredefinedColorSpace
{
WGPUWagyuPredefinedColorSpace_SRGB = 0x00000001,
WGPUWagyuPredefinedColorSpace_DisplayP3 = 0x00000002,
WGPUWagyuPredefinedColorSpace_Force32 = 0x7FFFFFFF
} WGPUWagyuPredefinedColorSpace WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuShaderLanguage
{
WGPUWagyuShaderLanguage_Detect = 0x00000000,
WGPUWagyuShaderLanguage_GLSL = 0x00000001,
WGPUWagyuShaderLanguage_GLSLRAW = 0x00000002,
WGPUWagyuShaderLanguage_WGSL = 0x00000003,
WGPUWagyuShaderLanguage_SPIRV = 0x00000004,
WGPUWagyuShaderLanguage_Force32 = 0x7FFFFFFF
} WGPUWagyuShaderLanguage WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWagyuWGSLFeatureType
{
WGPUWagyuWGSLFeatureType_Testing = 0x00000001,
WGPUWagyuWGSLFeatureType_UnsafeExperimental = 0x00000002,
WGPUWagyuWGSLFeatureType_Experimental = 0x00000004,
WGPUWagyuWGSLFeatureType_All = 0x00000007,
WGPUWagyuWGSLFeatureType_Force32 = 0x7FFFFFFF
} WGPUWagyuWGSLFeatureType WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUWagyuFragmentStateFeaturesFlags;
static const WGPUWagyuFragmentStateFeaturesFlags WGPUWagyuFragmentStateFeaturesFlags_None = 0x00000000;
static const WGPUWagyuFragmentStateFeaturesFlags WGPUWagyuFragmentStateFeaturesFlags_RasterizationOrderAttachmentAccess = 0x00000001;
// These values extend the WGPUTextureUsage enum set from webgpu.h
static const WGPUTextureUsage WGPUTextureUsage_WagyuInputAttachment = (WGPUTextureUsage)(0x40000000);
static const WGPUTextureUsage WGPUTextureUsage_WagyuTransientAttachment = (WGPUTextureUsage)(0x20000000);
typedef void (*WGPUWagyuDeviceFlushCallback)(WGPUDevice device, WGPUWagyuDeviceFlushStatus status, void *userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef struct WGPUWagyuStringView
{
WGPU_NULLABLE const char *data;
size_t length;
} WGPUWagyuStringView WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_STRING_VIEW_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuStringView, { /*.data = */ NULL _wgpu_COMMA /*.length = */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuNrdpVersion
{
uint32_t major;
uint32_t minor;
uint32_t patch;
uint32_t rev;
} WGPUWagyuNrdpVersion WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_NRDP_VERSION_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuNrdpVersion, { /*.major = */ 0 _wgpu_COMMA /*.minor = */ 0 _wgpu_COMMA /*.patch = */ 0 _wgpu_COMMA /*.rev = */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuAdapterInfo
{
WGPUChainedStructOut chain;
uint32_t extensionLevel;
WGPUWagyuNrdpVersion nrdpVersion;
} WGPUWagyuAdapterInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_ADAPTER_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuAdapterInfo, { /*.chain*/ WGPU_WAGYU_CHAIN_OUT_INIT(WGPUSType_WagyuAdapterInfo) _wgpu_COMMA /*.level*/ 0 _wgpu_COMMA /*.nrdpVersion*/ WGPU_WAGYU_NRDP_VERSION_INIT _wgpu_COMMA })
typedef struct WGPUWagyuColorTargetState
{
WGPUChainedStruct chain;
WGPUOptionalBool usedAsInput;
} WGPUWagyuColorTargetState WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_COLOR_TARGET_STATE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuColorTargetState, \
{ /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuColorTargetState) _wgpu_COMMA /*.usedAsInput*/ WGPUOptionalBool_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuCommandEncoderDescriptor
{
WGPUChainedStruct chain;
WGPUOptionalBool measureExecutionTime;
} WGPUWagyuCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_COMMAND_ENCODER_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuCommandEncoderDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuCommandEncoderDescriptor) _wgpu_COMMA /*.measureExecutionTime*/ WGPUOptionalBool_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuComputePipelineDescriptor
{
WGPUChainedStruct chain;
WGPUWagyuStringView cacheKey;
} WGPUWagyuComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_COMPUTE_PIPELINE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuComputePipelineDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuComputePipelineDescriptor) _wgpu_COMMA /*.cacheKey*/ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuDeviceDescriptor
{
WGPUChainedStruct chain;
WGPUBool dataBufferNeedsDetach;
WGPUBool wantsIndirectRendering;
} WGPUWagyuDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDeviceDescriptor, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuDeviceDescriptor) _wgpu_COMMA /*.dataBufferNeedsDetach*/ 1 _wgpu_COMMA /*.wantsIndirectRendering*/ 0 _wgpu_COMMA })
typedef struct WGPUWagyuDeviceFlushCallbackInfo
{
WGPUChainedStruct *nextInChain;
WGPUCallbackMode mode;
WGPUWagyuDeviceFlushCallback callback;
void *userdata;
} WGPUWagyuDeviceFlushCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_FLUSHCALLBACK_INFO_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDeviceFlushCallbackInfo, { /*.nextInChain = */ NULL _wgpu_COMMA /*.mode = */ WGPUCallbackMode_AllowSpontaneous _wgpu_COMMA /*.callback = */ NULL _wgpu_COMMA /*.userdata1 = */ NULL _wgpu_COMMA /*.userdata2 = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinary
{
size_t binarySize;
void *binary;
size_t blobKeySize;
void *blobKey;
} WGPUWagyuDevicePipelineBinary WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinary, { /*.binarySize*/ 0 _wgpu_COMMA /*.binary*/ NULL _wgpu_COMMA /*.blobKeySize*/ 0 _wgpu_COMMA /*.blobKey*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryBlobKey
{
size_t size;
const void *data;
} WGPUWagyuDevicePipelineBinaryBlobKey WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_BLOB_KEY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryBlobKey, { /*.size*/ 0 _wgpu_COMMA /*.data*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryCacheKey
{
WGPUWagyuStringView cacheKey;
size_t blobKeysLength;
WGPUWagyuDevicePipelineBinaryBlobKey *blobKeys;
} WGPUWagyuDevicePipelineBinaryCacheKey WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_CACHE_KEY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryCacheKey, { /*.cacheKey*/ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /*.blobKeysLength*/ 0 _wgpu_COMMA })
typedef struct WGPUWagyuDevicePipelineBinaryData
{
size_t binariesLength;
WGPUWagyuDevicePipelineBinary *binaries;
size_t cacheKeysLength;
WGPUWagyuDevicePipelineBinaryCacheKey *cacheKeys;
} WGPUWagyuDevicePipelineBinaryData WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_DEVICE_PIPELINE_BINARY_DATA_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuDevicePipelineBinaryData, { /*.binariesLength*/ 0 _wgpu_COMMA /*.binaries*/ NULL _wgpu_COMMA /*.cacheKeysLength*/ 0 _wgpu_COMMA /*.cacheKeys*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureDescriptor
{
const WGPUChainedStruct *nextInChain;
WGPUWagyuStringView label;
WGPUWagyuStringView source;
WGPUWagyuPredefinedColorSpace colorSpace;
} WGPUWagyuExternalTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_EXTERNAL_TEXTURE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExternalTextureDescriptor, { /*nextInChain = */ NULL _wgpu_COMMA /*label = */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /*source = */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /*colorSpace = */ WGPUWagyuPredefinedColorSpace_SRGB _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureBindingEntry
{
WGPUChainedStruct chain;
WGPUWagyuExternalTexture externalTexture;
} WGPUWagyuExternalTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_EXTERNAL_TEXTURE_BINDING_ENTRY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExternalTextureBindingEntry, \
{ /*.chain = */ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuExternalTextureBindingEntry) _wgpu_COMMA /*.externalTexture = */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuExternalTextureBindingLayout
{
WGPUChainedStruct chain;
} WGPUWagyuExternalTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_EXTERNAL_TEXTURE_BINDING_LAYOUT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuExternalTextureBindingLayout, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuExternalTextureBindingLayout) _wgpu_COMMA })
typedef struct WGPUWagyuInputAttachmentState
{
WGPUTextureFormat format;
WGPUOptionalBool usedAsColor;
} WGPUWagyuInputAttachmentState WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_INPUT_ATTACHMENT_STATE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuInputAttachmentState, \
{ /*.format*/ WGPUTextureFormat_Undefined _wgpu_COMMA /*.usedAsColor*/ WGPUOptionalBool_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuFragmentState
{
WGPUChainedStruct chain;
size_t inputCount;
WGPU_NULLABLE WGPUWagyuInputAttachmentState *inputs;
WGPUWagyuFragmentStateFeaturesFlags featureFlags;
} WGPUWagyuFragmentState WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_FRAGMENT_STATE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuFragmentState, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuFragmentState) _wgpu_COMMA /*.inputCount*/ 0 _wgpu_COMMA /*.inputs*/ NULL _wgpu_COMMA /*.featureFlags*/ WGPUWagyuFragmentStateFeaturesFlags_None _wgpu_COMMA })
typedef struct WGPUWagyuInputTextureBindingLayout
{
WGPUChainedStruct chain;
WGPUTextureViewDimension viewDimension;
} WGPUWagyuInputTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_INPUT_TEXTURE_BINDING_LAYOUT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuInputTextureBindingLayout, { /*.chain*/ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuInputTextureBindingLayout) _wgpu_COMMA /*.viewDimension*/ WGPUTextureViewDimension_2D _wgpu_COMMA })
typedef struct WGPUWagyuRect
{
int32_t x;
int32_t y;
uint32_t width;
uint32_t height;
} WGPUWagyuRect WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RECT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRect, { /* .x */ 0 _wgpu_COMMA /* .y */ 0 _wgpu_COMMA /* .width */ 0 _wgpu_COMMA /* .height */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuRenderPassInputAttachment
{
WGPUTextureView view;
WGPU_NULLABLE WGPUColor *clearValue;
WGPULoadOp loadOp;
WGPUStoreOp storeOp;
} WGPUWagyuRenderPassInputAttachment WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RENDER_PASS_INPUT_ATTACHMENT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPassInputAttachment, { /* .view */ NULL _wgpu_COMMA /* .clearValue */ NULL _wgpu_COMMA /* .loadOp */ WGPULoadOp_Undefined _wgpu_COMMA /* .storeOp */ WGPUStoreOp_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuRenderPassDescriptor
{
WGPUChainedStruct chain;
size_t inputAttachmentCount;
WGPU_NULLABLE WGPUWagyuRenderPassInputAttachment *inputAttachments;
WGPUOptionalBool pixelLocalStorageEnabled;
uint32_t pixelLocalStorageSize;
} WGPUWagyuRenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RENDER_PASS_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPassDescriptor, { /* .chain */ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuRenderPassDescriptor) _wgpu_COMMA /* .inputAttachmentCount */ 0 _wgpu_COMMA /* .inputAttachments */ NULL _wgpu_COMMA /* .pixelLocalStorageEnabled */ WGPUOptionalBool_Undefined _wgpu_COMMA /* .pixelLocalStorageSize */ WGPU_WAGYU_PIXEL_LOCAL_STORAGE_SIZE_UNDEFINED _wgpu_COMMA })
typedef struct WGPUWagyuRenderPipelineDescriptor
{
WGPUChainedStruct chain;
WGPUWagyuStringView cacheKey;
} WGPUWagyuRenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RENDER_PIPELINE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPipelineDescriptor, { /* .chain */ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuRenderPipelineDescriptor) _wgpu_COMMA /* .cacheKey */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionStructMember
{
WGPUWagyuStringView name;
uint32_t group;
uint32_t binding;
uint32_t offset;
uint32_t size;
uint32_t type;
WGPUBool imageMultisampled;
WGPUTextureViewDimension imageDimension;
WGPUTextureFormat imageFormat;
} WGPUWagyuShaderReflectionStructMember WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_REFLECTION_STRUCT_MEMBER_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderReflectionStructMember, { /* .name */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /* .group */ 0 _wgpu_COMMA /* .binding */ 0 _wgpu_COMMA /* .offset */ 0 _wgpu_COMMA /* .size */ 0 _wgpu_COMMA /* .type */ 0 _wgpu_COMMA /* .imageMultisampled */ 0 _wgpu_COMMA /* .imageDimension */ WGPUTextureViewDimension_Undefined _wgpu_COMMA /* .imageFormat */ WGPUTextureFormat_Undefined _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionLocation
{
WGPUWagyuStringView name;
uint32_t location;
uint32_t size;
uint32_t type;
} WGPUWagyuShaderReflectionLocation WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_REFLECTION_LOCATION_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderReflectionLocation, { /* .name */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /* .location */ 0 _wgpu_COMMA /* .size */ 0 _wgpu_COMMA /* .type */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionResource
{
WGPUWagyuStringView name;
uint32_t group;
uint32_t binding;
uint32_t bindingType;
WGPUBool multisampled;
WGPUTextureViewDimension dimension;
WGPUTextureFormat format;
uint64_t bufferSize;
} WGPUWagyuShaderReflectionResource WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_REFLECTION_RESOURCE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderReflectionResource, { /* .name */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /* .group */ 0 _wgpu_COMMA /* .binding */ 0 _wgpu_COMMA /* .bindingType */ 0 _wgpu_COMMA /* .multisampled */ 0 _wgpu_COMMA /* .dimension */ WGPUTextureViewDimension_Undefined _wgpu_COMMA /* .format */ WGPUTextureFormat_Undefined _wgpu_COMMA /* .bufferSize */ 0 _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionSpecializationConstant
{
uint32_t id;
uint32_t internalId;
uint32_t type;
WGPUWagyuStringView name;
} WGPUWagyuShaderReflectionSpecializationConstant WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_REFLECTION_SPECIALIZATION_CONSTANT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderReflectionSpecializationConstant, { /* .id */ 0 _wgpu_COMMA /* .internalId */ 0 _wgpu_COMMA /* .type */ 0 _wgpu_COMMA /* .name */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuShaderReflectionData
{
size_t resourceCount;
WGPUWagyuShaderReflectionResource *resources;
size_t constantCount;
WGPUWagyuShaderReflectionSpecializationConstant *constants;
size_t uniformCount;
WGPUWagyuShaderReflectionStructMember *uniforms;
size_t attributeCount;
WGPUWagyuShaderReflectionLocation *attributes;
WGPUWagyuStringView wgsl;
} WGPUWagyuShaderReflectionData WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_REFLECTION_DATA_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderReflectionData, { /* .resourceCount */ 0 _wgpu_COMMA /* .resources */ NULL _wgpu_COMMA /* .constantCount */ 0 _wgpu_COMMA /* .constants */ NULL _wgpu_COMMA /* .uniformCount */ 0 _wgpu_COMMA /* .uniforms */ NULL _wgpu_COMMA /* .attributeCount */ 0 _wgpu_COMMA /* .attributes */ NULL _wgpu_COMMA /* .wgsl */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA })
typedef struct WGPUWagyuShaderEntryPoint
{
WGPUWagyuStringView entryPoint;
WGPUShaderStage stage;
WGPUWagyuShaderReflectionData reflection;
} WGPUWagyuShaderEntryPoint WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_ENTRY_POINT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderEntryPoint, { /* .entryPoint */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /* .stage */ WGPUShaderStage_NONE _wgpu_COMMA /* .reflection */ WGPU_WAGYU_SHADER_REFLECTION_DATA_INIT _wgpu_COMMA })
typedef struct WGPUWagyuShaderEntryPointArray
{
size_t entryPointCount;
WGPUWagyuShaderEntryPoint *entryPoints;
} WGPUWagyuShaderEntryPointArray WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_ENTRY_POINT_ARRAY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderEntryPointArray, { /* .entryPointCount */ 0 _wgpu_COMMA /* .entryPoints */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuRenderPassEncoderClearPixelLocalStorage
{
uint32_t offset;
size_t valueCount;
WGPU_NULLABLE uint32_t *values;
uint32_t size;
} WGPUWagyuRenderPassEncoderClearPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_RENDER_PASS_ENCODER_CLEAR_PIXEL_LOCAL_STORAGE_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuRenderPassEncoderClearPixelLocalStorage, { /* .offset */ 0 _wgpu_COMMA /* .valueCount */ 0 _wgpu_COMMA /* .values */ NULL _wgpu_COMMA /* .size */ WGPU_WAGYU_PIXEL_LOCAL_STORAGE_SIZE_UNDEFINED _wgpu_COMMA })
typedef struct WGPUWagyuShaderModuleCompilationHint
{
WGPUChainedStruct *nextInChain;
WGPUWagyuStringView entryPoint;
/**
* If set to NULL, it will be treated as "auto"
*/
WGPUPipelineLayout layout;
} WGPUWagyuShaderModuleCompilationHint;
#define WGPU_WAGYU_SHADER_MODULE_COMPILATION_HINT_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderModuleCompilationHint, { /* .nextInChain */ NULL _wgpu_COMMA /* .entryPoint */ WGPU_WAGYU_STRING_VIEW_INIT _wgpu_COMMA /* .layout */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuShaderModuleDescriptor
{
WGPUChainedStruct chain;
size_t codeSize; // bytes
const void *code;
WGPUWagyuShaderLanguage language;
size_t compilationHintCount;
const struct WGPUWagyuShaderModuleCompilationHint *compilationHints;
} WGPUWagyuShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SHADER_MODULE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuShaderModuleDescriptor, { /*.chain=*/WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuShaderModuleDescriptor) _wgpu_COMMA /*.codeSize*/ 0 _wgpu_COMMA /*.code*/ NULL _wgpu_COMMA /*.language*/ WGPUWagyuShaderLanguage_Detect _wgpu_COMMA /*.compilationHintCount*/ 0 _wgpu_COMMA /*.compilationHints*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuStringArray
{
size_t stringCount;
WGPU_NULLABLE WGPUWagyuStringView *strings;
} WGPUWagyuStringArray WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_STRING_ARRAY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuStringArray, { /* .stringCount */ 0 _wgpu_COMMA /* .strings */ NULL _wgpu_COMMA })
typedef struct WGPUWagyuSurfaceConfiguration
{
WGPUChainedStruct chain;
int32_t *indirectRenderTargets;
} WGPUWagyuSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_SURFACE_CONFIGURATION_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuSurfaceConfiguration, { /*.chain=*/WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuSurfaceConfiguration) _wgpu_COMMA /*.indirectRenderTargets*/ NULL _wgpu_COMMA })
typedef struct WGPUWagyuTextureDescriptor
{
WGPUChainedStruct chain;
WGPUBool useSurfaceCache;
} WGPUWagyuTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_TEXTURE_DESCRIPTOR_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuTextureDescriptor, { /*.chain = */ WGPU_WAGYU_CHAIN_INIT(WGPUSType_WagyuTextureDescriptor) _wgpu_COMMA /*.useSurfaceCache = */ 1 _wgpu_COMMA })
typedef struct WGPUWagyuWGSLFeatureTypeArray
{
size_t featureCount;
WGPU_NULLABLE WGPUWagyuWGSLFeatureType *features;
} WGPUWagyuWGSLFeatureTypeArray WGPU_STRUCTURE_ATTRIBUTE;
#define WGPU_WAGYU_WGSL_FEATURE_TYPE_ARRAY_INIT \
WGPU_WAGYU_MAKE_INIT_STRUCT(WGPUWagyuWGSLFeatureTypeArray, { /* .featureCount */ 0 _wgpu_COMMA /* .features */ NULL _wgpu_COMMA })
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
extern "C" {
#endif
WGPU_EXPORT WGPUBackendType wgpuWagyuAdapterGetBackend(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuAdapterGetExtensions(WGPUAdapter adapter, WGPUWagyuStringArray *extensions) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuAdapterGetGraphicsReport(WGPUAdapter adapter, WGPUWagyuStringView *graphicsReport) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuAdapterGetName(WGPUAdapter adapter, WGPUWagyuStringView *name) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUDevice wgpuWagyuAdapterRequestDeviceSync(WGPUAdapter adapter, WGPU_NULLABLE const WGPUDeviceDescriptor *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuCommandEncoderBlit(WGPUCommandEncoder commandEncoder, const WGPUImageCopyTexture *source, const WGPUExtent3D *sourceExtent, const WGPUImageCopyTexture *destination, const WGPUExtent3D *destinationExtent, WGPUFilterMode filter) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuCommandEncoderGenerateMipmap(WGPUCommandEncoder commandEncoder, WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceClearPipelineBinaryCache(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceEnableImaginationWorkarounds(WGPUDevice device, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceGetExtensions(WGPUDevice device, WGPUWagyuStringArray *extensions) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceFlush(WGPUDevice device, WGPUWagyuDeviceFlushCallback callback, void *userdata) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWagyuExternalTexture wgpuWagyuDeviceImportExternalTexture(WGPUDevice device, const WGPUWagyuExternalTextureDescriptor *descriptor) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDeviceIntrospectShaderCode(WGPUDevice device, WGPUShaderStage stages, const WGPUShaderModuleDescriptor *descriptor, WGPUWagyuShaderEntryPointArray *entryPoints) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuDevicePopulatePipelineBinaryCache(WGPUDevice device, const WGPUWagyuDevicePipelineBinaryData *data) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureReference(WGPUWagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureRelease(WGPUWagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuExternalTextureSetLabel(WGPUWagyuExternalTexture externalTexture, const char *label) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceEnableImaginationWorkarounds(WGPUInstance instance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT uint32_t wgpuWagyuInstanceGetApiVersion(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBackendType wgpuWagyuInstanceGetBackend(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceGetExposeWGSLFeatures(WGPUInstance instance, WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUWagyuRelaxedCompliance wgpuWagyuInstanceGetRelaxedCompliance(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTextureFormat wgpuWagyuInstanceGetScreenDirectFormat(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTextureFormat wgpuWagyuInstanceGetScreenIndirectFormat(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuInstanceGetSync(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUAdapter wgpuWagyuInstanceRequestAdapterSync(WGPUInstance instance, WGPU_NULLABLE const WGPURequestAdapterOptions *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetCommandBufferLimit(WGPUInstance instance, uint32_t limit) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetExposeWGSLFeatures(WGPUInstance instance, const WGPUWagyuWGSLFeatureTypeArray *wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetImmediate(WGPUInstance instance, WGPUBool enabled) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetRunBarriersOnIncoherent(WGPUInstance instance, WGPUBool run) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetStagingBufferCacheSize(WGPUInstance instance, uint32_t size) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuInstanceSetSync(WGPUInstance instance, WGPUBool sync) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceReference(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceRelease(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuRelaxedComplianceGetBufferClear(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUBool wgpuWagyuRelaxedComplianceGetTextureClear(WGPUWagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetAll(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetBufferClear(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRelaxedComplianceSetTextureClear(WGPUWagyuRelaxedCompliance relaxedCompliance, WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearColorAttachments(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, uint32_t baseAttachment, uint32_t numAttachments, const WGPUColor *color, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearDepthAttachment(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, float depth, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderClearStencilAttachment(WGPURenderBundleEncoder renderBundleEncoder, const WGPUWagyuRect *rect, uint32_t stencil, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetScissorRect(WGPURenderBundleEncoder renderBundleEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetScissorRectIndirect(WGPURenderBundleEncoder renderBundleEncoder, uint64_t indirectOffset, const uint32_t *indirectBuffer, size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetViewport(WGPURenderBundleEncoder renderBundleEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetViewportWithDepthIndirect(WGPURenderBundleEncoder renderBundleEncoder, uint64_t indirectOffset, const float *indirectBuffer, size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderBundleEncoderSetViewportWithoutDepthIndirect(WGPURenderBundleEncoder renderBundleEncoder, uint64_t indirectOffset, const float *indirectBuffer, size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearColorAttachments(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, uint32_t baseAttachment, uint32_t numAttachments, const WGPUColor *color, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearDepthAttachment(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, float depth, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearStencilAttachment(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRect *rect, uint32_t stencil, uint32_t baseArrayLayer, uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderClearPixelLocalStorage(WGPURenderPassEncoder renderPassEncoder, const WGPUWagyuRenderPassEncoderClearPixelLocalStorage *options) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuRenderPassEncoderExecuteBundle(WGPURenderPassEncoder renderPassEncoder, WGPURenderBundle bundle) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderEntryPointArrayFreeMembers(WGPUWagyuShaderEntryPointArray value) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderModuleDestroy(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuShaderModuleIntrospect(WGPUShaderModule shaderModule, WGPUShaderStage stages, WGPUWagyuShaderEntryPointArray *shaderEntryPointArray) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceDestroy(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT WGPUTexture wgpuWagyuSurfaceGetCurrentDepthStencilTexture(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT float wgpuWagyuSurfaceGetHeight(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT float wgpuWagyuSurfaceGetWidth(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT float wgpuWagyuSurfaceGetX(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT float wgpuWagyuSurfaceGetY(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfacePresent(WGPUSurface surface, WGPUTexture target) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceSetHeight(WGPUSurface surface, float height) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceSetWidth(WGPUSurface surface, float width) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceSetX(WGPUSurface surface, float x) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuSurfaceSetY(WGPUSurface surface, float y) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuWagyuWGSLFeatureTypeArrayFreeMembers(WGPUWagyuWGSLFeatureTypeArray value) WGPU_FUNCTION_ATTRIBUTE;
#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck)
} // extern "C"
#endif
#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck)
} // namespace wagyu1
#endif
#endif /* WEBGPU_WAGYU_H */

View File

@@ -1,270 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* global addToLibrary */
const LibraryWebGPU = {
wgpuAdapterEnumerateFeatures: undefined,
wgpuAdapterGetInfo: undefined,
wgpuAdapterGetLimits: undefined,
wgpuAdapterGetProperties: undefined,
wgpuAdapterHasFeature: undefined,
wgpuAdapterInfoFreeMembers: undefined,
wgpuAdapterPropertiesFreeMembers: undefined,
wgpuAdapterReference: undefined,
wgpuAdapterRelease: undefined,
wgpuAdapterRequestDevice: undefined,
wgpuBindGroupLayoutReference: undefined,
wgpuBindGroupLayoutRelease: undefined,
wgpuBindGroupLayoutSetLabel: undefined,
wgpuBindGroupReference: undefined,
wgpuBindGroupRelease: undefined,
wgpuBindGroupSetLabel: undefined,
wgpuBufferDestroy: undefined,
wgpuBufferGetConstMappedRange: undefined,
wgpuBufferGetMapState: undefined,
wgpuBufferGetMappedRange: undefined,
wgpuBufferGetSize: undefined,
wgpuBufferGetUsage: undefined,
wgpuBufferMapAsync: undefined,
wgpuBufferReference: undefined,
wgpuBufferRelease: undefined,
wgpuBufferSetLabel: undefined,
wgpuBufferUnmap: undefined,
wgpuCommandBufferReference: undefined,
wgpuCommandBufferRelease: undefined,
wgpuCommandBufferSetLabel: undefined,
wgpuCommandEncoderBeginComputePass: undefined,
wgpuCommandEncoderBeginRenderPass: undefined,
wgpuCommandEncoderClearBuffer: undefined,
wgpuCommandEncoderCopyBufferToBuffer: undefined,
wgpuCommandEncoderCopyBufferToTexture: undefined,
wgpuCommandEncoderCopyTextureToBuffer: undefined,
wgpuCommandEncoderCopyTextureToTexture: undefined,
wgpuCommandEncoderFinish: undefined,
wgpuCommandEncoderInsertDebugMarker: undefined,
wgpuCommandEncoderPopDebugGroup: undefined,
wgpuCommandEncoderPushDebugGroup: undefined,
wgpuCommandEncoderReference: undefined,
wgpuCommandEncoderRelease: undefined,
wgpuCommandEncoderResolveQuerySet: undefined,
wgpuCommandEncoderSetLabel: undefined,
wgpuCommandEncoderWriteTimestamp: undefined,
wgpuComputePassEncoderDispatchWorkgroups: undefined,
wgpuComputePassEncoderDispatchWorkgroupsIndirect: undefined,
wgpuComputePassEncoderEnd: undefined,
wgpuComputePassEncoderInsertDebugMarker: undefined,
wgpuComputePassEncoderPopDebugGroup: undefined,
wgpuComputePassEncoderPushDebugGroup: undefined,
wgpuComputePassEncoderReference: undefined,
wgpuComputePassEncoderRelease: undefined,
wgpuComputePassEncoderSetBindGroup: undefined,
wgpuComputePassEncoderSetLabel: undefined,
wgpuComputePassEncoderSetPipeline: undefined,
wgpuComputePassEncoderWriteTimestamp: undefined,
wgpuComputePipelineGetBindGroupLayout: undefined,
wgpuComputePipelineReference: undefined,
wgpuComputePipelineRelease: undefined,
wgpuComputePipelineSetLabel: undefined,
wgpuCreateInstance: undefined,
wgpuDeviceCreateBindGroup: undefined,
wgpuDeviceCreateBindGroupLayout: undefined,
wgpuDeviceCreateBuffer: undefined,
wgpuDeviceCreateCommandEncoder: undefined,
wgpuDeviceCreateComputePipeline: undefined,
wgpuDeviceCreateComputePipelineAsync: undefined,
wgpuDeviceCreatePipelineLayout: undefined,
wgpuDeviceCreateQuerySet: undefined,
wgpuDeviceCreateRenderBundleEncoder: undefined,
wgpuDeviceCreateRenderPipeline: undefined,
wgpuDeviceCreateRenderPipelineAsync: undefined,
wgpuDeviceCreateSampler: undefined,
wgpuDeviceCreateShaderModule: undefined,
wgpuDeviceCreateSwapChain: undefined,
wgpuDeviceCreateTexture: undefined,
wgpuDeviceDestroy: undefined,
wgpuDeviceEnumerateFeatures: undefined,
wgpuDeviceGetLimits: undefined,
wgpuDeviceGetQueue: undefined,
wgpuDeviceHasFeature: undefined,
wgpuDevicePopErrorScope: undefined,
wgpuDevicePushErrorScope: undefined,
wgpuDeviceReference: undefined,
wgpuDeviceRelease: undefined,
wgpuDeviceSetLabel: undefined,
wgpuDeviceSetUncapturedErrorCallback: undefined,
wgpuGetInstanceFeatures: undefined,
wgpuGetProcAddress: undefined,
wgpuInstanceCreateSurface: undefined,
wgpuInstanceHasWGSLLanguageFeature: undefined,
wgpuInstanceProcessEvents: undefined,
wgpuInstanceReference: undefined,
wgpuInstanceRelease: undefined,
wgpuInstanceRequestAdapter: undefined,
wgpuPipelineLayoutReference: undefined,
wgpuPipelineLayoutRelease: undefined,
wgpuPipelineLayoutSetLabel: undefined,
wgpuQuerySetDestroy: undefined,
wgpuQuerySetGetCount: undefined,
wgpuQuerySetGetType: undefined,
wgpuQuerySetReference: undefined,
wgpuQuerySetRelease: undefined,
wgpuQuerySetSetLabel: undefined,
wgpuQueueOnSubmittedWorkDone: undefined,
wgpuQueueReference: undefined,
wgpuQueueRelease: undefined,
wgpuQueueSetLabel: undefined,
wgpuQueueSubmit: undefined,
wgpuQueueWriteBuffer: undefined,
wgpuQueueWriteTexture: undefined,
wgpuRenderBundleEncoderDraw: undefined,
wgpuRenderBundleEncoderDrawIndexed: undefined,
wgpuRenderBundleEncoderDrawIndexedIndirect: undefined,
wgpuRenderBundleEncoderDrawIndirect: undefined,
wgpuRenderBundleEncoderFinish: undefined,
wgpuRenderBundleEncoderInsertDebugMarker: undefined,
wgpuRenderBundleEncoderPopDebugGroup: undefined,
wgpuRenderBundleEncoderPushDebugGroup: undefined,
wgpuRenderBundleEncoderReference: undefined,
wgpuRenderBundleEncoderRelease: undefined,
wgpuRenderBundleEncoderSetBindGroup: undefined,
wgpuRenderBundleEncoderSetIndexBuffer: undefined,
wgpuRenderBundleEncoderSetLabel: undefined,
wgpuRenderBundleEncoderSetPipeline: undefined,
wgpuRenderBundleEncoderSetVertexBuffer: undefined,
wgpuRenderBundleReference: undefined,
wgpuRenderBundleRelease: undefined,
wgpuRenderBundleSetLabel: undefined,
wgpuRenderPassEncoderBeginOcclusionQuery: undefined,
wgpuRenderPassEncoderDraw: undefined,
wgpuRenderPassEncoderDrawIndexed: undefined,
wgpuRenderPassEncoderDrawIndexedIndirect: undefined,
wgpuRenderPassEncoderDrawIndirect: undefined,
wgpuRenderPassEncoderEnd: undefined,
wgpuRenderPassEncoderEndOcclusionQuery: undefined,
wgpuRenderPassEncoderExecuteBundles: undefined,
wgpuRenderPassEncoderInsertDebugMarker: undefined,
wgpuRenderPassEncoderPopDebugGroup: undefined,
wgpuRenderPassEncoderPushDebugGroup: undefined,
wgpuRenderPassEncoderReference: undefined,
wgpuRenderPassEncoderRelease: undefined,
wgpuRenderPassEncoderSetBindGroup: undefined,
wgpuRenderPassEncoderSetBlendConstant: undefined,
wgpuRenderPassEncoderSetIndexBuffer: undefined,
wgpuRenderPassEncoderSetLabel: undefined,
wgpuRenderPassEncoderSetPipeline: undefined,
wgpuRenderPassEncoderSetScissorRect: undefined,
wgpuRenderPassEncoderSetStencilReference: undefined,
wgpuRenderPassEncoderSetVertexBuffer: undefined,
wgpuRenderPassEncoderSetViewport: undefined,
wgpuRenderPassEncoderWriteTimestamp: undefined,
wgpuRenderPipelineGetBindGroupLayout: undefined,
wgpuRenderPipelineReference: undefined,
wgpuRenderPipelineRelease: undefined,
wgpuRenderPipelineSetLabel: undefined,
wgpuSamplerReference: undefined,
wgpuSamplerRelease: undefined,
wgpuSamplerSetLabel: undefined,
wgpuShaderModuleGetCompilationInfo: undefined,
wgpuShaderModuleReference: undefined,
wgpuShaderModuleRelease: undefined,
wgpuShaderModuleSetLabel: undefined,
wgpuSurfaceCapabilitiesFreeMembers: undefined,
wgpuSurfaceConfigure: undefined,
wgpuSurfaceGetCapabilities: undefined,
wgpuSurfaceGetCurrentTexture: undefined,
wgpuSurfaceGetPreferredFormat: undefined,
wgpuSurfacePresent: undefined,
wgpuSurfaceReference: undefined,
wgpuSurfaceRelease: undefined,
wgpuSurfaceUnconfigure: undefined,
wgpuSwapChainGetCurrentTexture: undefined,
wgpuSwapChainGetCurrentTextureView: undefined,
wgpuSwapChainPresent: undefined,
wgpuSwapChainReference: undefined,
wgpuSwapChainRelease: undefined,
wgpuTextureCreateView: undefined,
wgpuTextureDestroy: undefined,
wgpuTextureGetDepthOrArrayLayers: undefined,
wgpuTextureGetDimension: undefined,
wgpuTextureGetFormat: undefined,
wgpuTextureGetHeight: undefined,
wgpuTextureGetMipLevelCount: undefined,
wgpuTextureGetSampleCount: undefined,
wgpuTextureGetUsage: undefined,
wgpuTextureGetWidth: undefined,
wgpuTextureReference: undefined,
wgpuTextureRelease: undefined,
wgpuTextureSetLabel: undefined,
wgpuTextureViewReference: undefined,
wgpuTextureViewRelease: undefined,
wgpuTextureViewSetLabel: undefined,
wgpuWagyuAdapterGetBackend: undefined,
wgpuWagyuAdapterGetExtensions: undefined,
wgpuWagyuAdapterGetGraphicsReport: undefined,
wgpuWagyuAdapterGetName: undefined,
wgpuWagyuAdapterRequestDeviceSync: undefined,
wgpuWagyuCommandEncoderBlit: undefined,
wgpuWagyuCommandEncoderGenerateMipmap: undefined,
wgpuWagyuDeviceClearPipelineBinaryCache: undefined,
wgpuWagyuDeviceEnableImaginationWorkarounds: undefined,
wgpuWagyuDeviceFlush: undefined,
wgpuWagyuDeviceGetExtensions: undefined,
wgpuWagyuDeviceImportExternalTexture: undefined,
wgpuWagyuDeviceIntrospectShaderCode: undefined,
wgpuWagyuDevicePopulatePipelineBinaryCache: undefined,
wgpuWagyuExternalTextureReference: undefined,
wgpuWagyuExternalTextureRelease: undefined,
wgpuWagyuExternalTextureSetLabel: undefined,
wgpuWagyuInstanceEnableImaginationWorkarounds: undefined,
wgpuWagyuInstanceGetApiVersion: undefined,
wgpuWagyuInstanceGetBackend: undefined,
wgpuWagyuInstanceGetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceGetRelaxedCompliance: undefined,
wgpuWagyuInstanceGetScreenDirectFormat: undefined,
wgpuWagyuInstanceGetScreenIndirectFormat: undefined,
wgpuWagyuInstanceGetSync: undefined,
wgpuWagyuInstanceRequestAdapterSync: undefined,
wgpuWagyuInstanceSetCommandBufferLimit: undefined,
wgpuWagyuInstanceSetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceSetImmediate: undefined,
wgpuWagyuInstanceSetRunBarriersOnIncoherent: undefined,
wgpuWagyuInstanceSetStagingBufferCacheSize: undefined,
wgpuWagyuInstanceSetSync: undefined,
wgpuWagyuRelaxedComplianceGetBufferClear: undefined,
wgpuWagyuRelaxedComplianceGetTextureClear: undefined,
wgpuWagyuRelaxedComplianceReference: undefined,
wgpuWagyuRelaxedComplianceRelease: undefined,
wgpuWagyuRelaxedComplianceSetAll: undefined,
wgpuWagyuRelaxedComplianceSetBufferClear: undefined,
wgpuWagyuRelaxedComplianceSetTextureClear: undefined,
wgpuWagyuRenderBundleEncoderClearColorAttachments: undefined,
wgpuWagyuRenderBundleEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderBundleEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRect: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRectIndirect: undefined,
wgpuWagyuRenderBundleEncoderSetViewport: undefined,
wgpuWagyuRenderBundleEncoderSetViewportWithDepthIndirect: undefined,
wgpuWagyuRenderBundleEncoderSetViewportWithoutDepthIndirect: undefined,
wgpuWagyuRenderPassEncoderClearColorAttachments: undefined,
wgpuWagyuRenderPassEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderPassEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderPassEncoderExecuteBundle: undefined,
wgpuWagyuRenderPassEncoderSetShaderPixelLocalStorageEnabled: undefined,
wgpuWagyuShaderEntryPointArrayFreeMembers: undefined,
wgpuWagyuShaderModuleDestroy: undefined,
wgpuWagyuShaderModuleIntrospect: undefined,
wgpuWagyuSurfaceDestroy: undefined,
wgpuWagyuSurfaceGetCurrentDepthStencilTexture: undefined,
wgpuWagyuSurfaceGetHeight: undefined,
wgpuWagyuSurfaceGetWidth: undefined,
wgpuWagyuSurfaceGetX: undefined,
wgpuWagyuSurfaceGetY: undefined,
wgpuWagyuSurfacePresent: undefined,
wgpuWagyuSurfaceSetHeight: undefined,
wgpuWagyuSurfaceSetWidth: undefined,
wgpuWagyuSurfaceSetX: undefined,
wgpuWagyuSurfaceSetY: undefined,
wgpuWagyuWGSLFeatureTypeArrayFreeMembers: undefined
};
addToLibrary(LibraryWebGPU);

View File

@@ -1,75 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* global addToLibrary */
const LibraryWebGPUExtensions = {
wgpuWagyuAdapterGetBackend: undefined,
wgpuWagyuAdapterGetExtensions: undefined,
wgpuWagyuAdapterGetGraphicsReport: undefined,
wgpuWagyuAdapterGetName: undefined,
wgpuWagyuAdapterRequestDeviceSync: undefined,
wgpuWagyuCommandEncoderBlit: undefined,
wgpuWagyuCommandEncoderGenerateMipmap: undefined,
wgpuWagyuDeviceClearPipelineBinaryCache: undefined,
wgpuWagyuDeviceEnableImaginationWorkarounds: undefined,
wgpuWagyuDeviceGetExtensions: undefined,
wgpuWagyuDeviceFlush: undefined,
wgpuWagyuDeviceImportExternalTexture: undefined,
wgpuWagyuDeviceIntrospectShaderCode: undefined,
wgpuWagyuDevicePopulatePipelineBinaryCache: undefined,
wgpuWagyuExternalTextureAddRef: undefined,
wgpuWagyuExternalTextureRelease: undefined,
wgpuWagyuExternalTextureSetLabel: undefined,
wgpuWagyuInstanceEnableImaginationWorkarounds: undefined,
wgpuWagyuInstanceGetApiVersion: undefined,
wgpuWagyuInstanceGetBackend: undefined,
wgpuWagyuInstanceGetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceGetRelaxedCompliance: undefined,
wgpuWagyuInstanceGetScreenDirectFormat: undefined,
wgpuWagyuInstanceGetScreenIndirectFormat: undefined,
wgpuWagyuInstanceGetSync: undefined,
wgpuWagyuInstanceRequestAdapterSync: undefined,
wgpuWagyuInstanceSetCommandBufferLimit: undefined,
wgpuWagyuInstanceSetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceSetImmediate: undefined,
wgpuWagyuInstanceSetRunBarriersOnIncoherent: undefined,
wgpuWagyuInstanceSetStagingBufferCacheSize: undefined,
wgpuWagyuInstanceSetSync: undefined,
wgpuWagyuRelaxedComplianceAddRef: undefined,
wgpuWagyuRelaxedComplianceRelease: undefined,
wgpuWagyuRelaxedComplianceGetBufferClear: undefined,
wgpuWagyuRelaxedComplianceGetTextureClear: undefined,
wgpuWagyuRelaxedComplianceSetAll: undefined,
wgpuWagyuRelaxedComplianceSetBufferClear: undefined,
wgpuWagyuRelaxedComplianceSetTextureClear: undefined,
wgpuWagyuRenderBundleEncoderClearColorAttachments: undefined,
wgpuWagyuRenderBundleEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderBundleEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRect: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRectIndirect: undefined,
wgpuWagyuRenderBundleEncoderSetViewport: undefined,
wgpuWagyuRenderBundleEncoderSetViewportWithDepthIndirect: undefined,
wgpuWagyuRenderBundleEncoderSetViewportWithoutDepthIndirect: undefined,
wgpuWagyuRenderPassEncoderClearColorAttachments: undefined,
wgpuWagyuRenderPassEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderPassEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderPassEncoderSetShaderPixelLocalStorageEnabled: undefined,
wgpuWagyuRenderPassEncoderExecuteBundle: undefined,
wgpuWagyuShaderEntryPointArrayFreeMembers: undefined,
wgpuWagyuShaderModuleDestroy: undefined,
wgpuWagyuShaderModuleIntrospect: undefined,
wgpuWagyuSurfaceDestroy: undefined,
wgpuWagyuSurfaceGetCurrentDepthStencilTexture: undefined,
wgpuWagyuSurfaceGetHeight: undefined,
wgpuWagyuSurfaceGetWidth: undefined,
wgpuWagyuSurfaceGetX: undefined,
wgpuWagyuSurfaceGetY: undefined,
wgpuWagyuSurfacePresent: undefined,
wgpuWagyuSurfaceSetHeight: undefined,
wgpuWagyuSurfaceSetWidth: undefined,
wgpuWagyuSurfaceSetX: undefined,
wgpuWagyuSurfaceSetY: undefined,
wgpuWagyuWGSLFeatureTypeArrayFreeMembers: undefined
};
addToLibrary(LibraryWebGPUExtensions);

File diff suppressed because it is too large Load Diff

View File

@@ -1,120 +0,0 @@
# Emscripten WebGPU port with optional Wagyu extensions
import os
import zlib
from typing import Dict, Optional
OPTIONS = {
'wagyu': "Enable Wagyu extensions (default: false)",
}
_VALID_OPTION_VALUES = {
'wagyu': {'true', 'false'},
}
_opts: Dict[str, Optional[str]] = {
'wagyu': 'false',
}
def _get_base_dir():
return os.path.dirname(os.path.realpath(__file__))
def _get_include_dir():
return os.path.join(_get_base_dir(), 'include')
def _get_src_dir():
return os.path.join(_get_base_dir(), 'src')
def _get_srcs():
return [ _get_src_dir() + '/webgpu_cpp.cpp' ]
def _recurse_dir(path):
for (dirpath, dirnames, filenames) in os.walk(path):
for filename in filenames:
yield os.path.join(dirpath, filename)
def _get_build_files():
return sorted([
__file__,
*_get_srcs(),
*_recurse_dir(_get_include_dir()),
])
# compiler
def _check_option(option, value, error_handler):
if value not in _VALID_OPTION_VALUES[option]:
error_handler(
f'[{option}] can be {list(_VALID_OPTION_VALUES[option])}, got [{value}]'
)
return value
def handle_options(options, error_handler):
for option, value in options.items():
value = value.lower()
_opts[option] = _check_option(option, value, error_handler)
def process_args(ports):
args = ['-isystem', _get_include_dir()]
return args
# linker
def _get_flags(settings):
lib_name_suffix = ''
flags = [] # '-lexports.js'
return (lib_name_suffix, flags)
def _get_name(settings):
hash_value = 0
def add(x):
nonlocal hash_value
hash_value = zlib.adler32(x, hash_value)
build_files = _get_build_files()
for filename in build_files:
add(open(filename, 'rb').read())
(lib_name_suffix, _) = _get_flags(settings)
return f'libwebgpu-{hash_value:08x}{lib_name_suffix}.a'
def clear(ports, settings, shared):
shared.cache.erase_lib(_get_name(settings))
def get(ports, settings, shared):
if settings.allowed_settings:
return []
def create(final):
includes = [_get_include_dir()]
(_, flags) = _get_flags(settings)
ports.build_port(_get_src_dir(), final, 'webgpu', includes=includes, flags=flags, srcs=_get_srcs())
lib_name = _get_name(settings)
return [shared.cache.get_lib(lib_name, create, what='port')]
def linker_setup(ports, settings):
if settings.USE_WEBGPU:
raise Exception('webgpu-port is not compatible with deprecated Emscripten USE_WEBGPU option')
src_dir = _get_src_dir()
settings.JS_LIBRARIES += [ os.path.join(src_dir, 'library_webgpu_stubs.js') ]
if _opts['wagyu'] == 'true':
settings.JS_LIBRARIES += [ os.path.join(src_dir, 'library_webgpu_wagyu_stubs.js') ]

View File

@@ -92,8 +92,11 @@ const LibraryWebGPU = {
wgpuDevicePushErrorScope: undefined,
wgpuDeviceRelease: undefined,
wgpuDeviceSetLabel: undefined,
wgpuGetInstanceCapabilities: undefined,
wgpuGetInstanceCapabilities: undefined, // deprecated in final version of webgpu.h
wgpuGetInstanceFeatures: undefined, // added in final version of webgpu.h
wgpuGetInstanceLimits: undefined, // added in final version of webgpu.h
wgpuGetProcAddress: undefined,
wgpuHasInstanceFeature: undefined, // added in final version of webgpu.h
wgpuInstanceAddRef: undefined,
wgpuInstanceCreateSurface: undefined,
wgpuInstanceGetWGSLLanguageFeatures: undefined,

View File

@@ -9,42 +9,43 @@ const LibraryWebGPUExtensions = {
wgpuWagyuAdapterGetName: undefined,
wgpuWagyuAdapterRequestDeviceSync: undefined,
wgpuWagyuCommandEncoderBlit: undefined,
wgpuWagyuCommandEncoderExecuteCallback: undefined,
wgpuWagyuCommandEncoderGenerateMipmap: undefined,
wgpuWagyuComputePassEncoderExecuteCallback: undefined,
wgpuWagyuDeviceClearPipelineBinaryCache: undefined,
wgpuWagyuDeviceEnableImaginationWorkarounds: undefined,
wgpuWagyuDeviceGetExtensions: undefined,
wgpuWagyuDeviceFlush: undefined,
wgpuWagyuDeviceGetExtensions: undefined,
wgpuWagyuDeviceImportExternalTexture: undefined,
wgpuWagyuDeviceIntrospectShaderCode: undefined,
wgpuWagyuDevicePipelineBinaryCacheStatistics: undefined,
wgpuWagyuDevicePopulatePipelineBinaryCache: undefined,
wgpuWagyuDeviceSetPipelineBinaryCallback: undefined,
wgpuWagyuDeviceSetPipelineBinaryErrorCallback: undefined,
wgpuWagyuExternalTextureAddRef: undefined,
wgpuWagyuExternalTextureGetInfo: undefined,
wgpuWagyuExternalTextureRelease: undefined,
wgpuWagyuExternalTextureSetLabel: undefined,
wgpuWagyuInstanceEnableImaginationWorkarounds: undefined,
wgpuWagyuInstanceGetApiVersion: undefined,
wgpuWagyuInstanceGetBackend: undefined,
wgpuWagyuInstanceGetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceGetRelaxedCompliance: undefined,
wgpuWagyuInstanceGetExposedWgslFeatures: undefined,
wgpuWagyuInstanceGetScreenDirectFormat: undefined,
wgpuWagyuInstanceGetScreenIndirectFormat: undefined,
wgpuWagyuInstanceGetSync: undefined,
wgpuWagyuInstanceRequestAdapterSync: undefined,
wgpuWagyuInstanceSetCommandBufferLimit: undefined,
wgpuWagyuInstanceSetExposeWGSLFeatures: undefined,
wgpuWagyuInstanceSetExposedWgslFeatures: undefined,
wgpuWagyuInstanceSetImmediate: undefined,
wgpuWagyuInstanceSetRunBarriersOnIncoherent: undefined,
wgpuWagyuInstanceSetStagingBufferCacheSize: undefined,
wgpuWagyuInstanceSetSync: undefined,
wgpuWagyuRelaxedComplianceAddRef: undefined,
wgpuWagyuRelaxedComplianceRelease: undefined,
wgpuWagyuRelaxedComplianceGetBufferClear: undefined,
wgpuWagyuRelaxedComplianceGetTextureClear: undefined,
wgpuWagyuRelaxedComplianceSetAll: undefined,
wgpuWagyuRelaxedComplianceSetBufferClear: undefined,
wgpuWagyuRelaxedComplianceSetTextureClear: undefined,
wgpuWagyuQueueCopyExternalImageToTexture: undefined,
wgpuWagyuRenderBundleEncoderClearColorAttachments: undefined,
wgpuWagyuRenderBundleEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderBundleEncoderClearPixelLocalStorage: undefined,
wgpuWagyuRenderBundleEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderBundleEncoderExecuteCallback: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRect: undefined,
wgpuWagyuRenderBundleEncoderSetScissorRectIndirect: undefined,
wgpuWagyuRenderBundleEncoderSetViewport: undefined,
@@ -52,12 +53,16 @@ const LibraryWebGPUExtensions = {
wgpuWagyuRenderBundleEncoderSetViewportWithoutDepthIndirect: undefined,
wgpuWagyuRenderPassEncoderClearColorAttachments: undefined,
wgpuWagyuRenderPassEncoderClearDepthAttachment: undefined,
wgpuWagyuRenderPassEncoderClearPixelLocalStorage: undefined,
wgpuWagyuRenderPassEncoderClearStencilAttachment: undefined,
wgpuWagyuRenderPassEncoderSetShaderPixelLocalStorageEnabled: undefined,
wgpuWagyuRenderPassEncoderExecuteBundle: undefined,
wgpuWagyuRenderPassEncoderExecuteCallback: undefined,
wgpuWagyuRenderPassEncoderSetShaderPixelLocalStorageEnabled: undefined,
wgpuWagyuShaderEntryPointArrayFreeMembers: undefined,
wgpuWagyuShaderModuleDestroy: undefined,
wgpuWagyuShaderModuleEntryPoints: undefined,
wgpuWagyuShaderModuleIntrospect: undefined,
wgpuWagyuStringArrayFreeMembers: undefined,
wgpuWagyuSurfaceDestroy: undefined,
wgpuWagyuSurfaceGetCurrentDepthStencilTexture: undefined,
wgpuWagyuSurfaceGetHeight: undefined,
@@ -70,6 +75,7 @@ const LibraryWebGPUExtensions = {
wgpuWagyuSurfaceSetX: undefined,
wgpuWagyuSurfaceSetY: undefined,
wgpuWagyuTextureIsSwapchain: undefined,
wgpuWagyuTextureReadPixels: undefined,
wgpuWagyuWGSLFeatureTypeArrayFreeMembers: undefined
};

View File

@@ -0,0 +1,22 @@
#include "webgpu/webgpu_wagyu.h"
#define WGPU_WAGYU_HEADER_VERSION_MAJOR 1
#define WGPU_WAGYU_HEADER_VERSION_MINOR 0
#define WASM_EXPORT(NAME) __attribute__((used, export_name(#NAME))) NAME
typedef struct WGPUWagyuVersionInfo
{
uint32_t webgpuMajor;
uint32_t webgpuMinor;
uint32_t wagyuExtensionLevel;
} WGPUWagyuVersionInfo;
void WASM_EXPORT(wgpuWagyuGetCompiledVersion)(WGPUWagyuVersionInfo *versionInfo)
{
if (versionInfo) {
versionInfo->webgpuMajor = WGPU_WAGYU_HEADER_VERSION_MAJOR;
versionInfo->webgpuMinor = WGPU_WAGYU_HEADER_VERSION_MINOR;
versionInfo->wagyuExtensionLevel = WGPU_WAGYU_EXTENSION_LEVEL;
}
}

View File

@@ -30,8 +30,7 @@ def _get_src_dir():
def _get_srcs():
return []
return [ _get_src_dir() + '/webgpu.c' ]
def _recurse_dir(path):
for (dirpath, dirnames, filenames) in os.walk(path):
@@ -72,7 +71,7 @@ def process_args(ports):
def _get_flags(settings):
lib_name_suffix = ''
flags = ['-lexports.js']
flags = []
return (lib_name_suffix, flags)
@@ -102,7 +101,7 @@ def get(ports, settings, shared):
def create(final):
includes = [_get_include_dir()]
(_, flags) = _get_flags(settings)
flags += ['-g', '-std=c++20', '-fno-exceptions', '-fno-rtti']
flags += []
ports.build_port(_get_src_dir(), final, 'webgpu', includes=includes, flags=flags, srcs=_get_srcs())
lib_name = _get_name(settings)
@@ -117,5 +116,8 @@ def linker_setup(ports, settings):
settings.JS_LIBRARIES += [ os.path.join(src_dir, 'library_webgpu_stubs.js') ]
# Ensure the function gets exported
settings.EXPORTED_FUNCTIONS += ['_wgpuWagyuGetCompiledVersion']
if _opts['wagyu'] == 'true':
settings.JS_LIBRARIES += [ os.path.join(src_dir, 'library_webgpu_wagyu_stubs.js') ]

View File

@@ -345,7 +345,7 @@ public:
? rive::gpu::LoadAction::clear
: rive::gpu::LoadAction::preserveRenderTarget,
.clearColor = options.clearColor,
.msaaSampleCount = m_backendParams.msaa ? 4 : 0,
.msaaSampleCount = m_backendParams.msaa ? 4u : 0u,
.disableRasterOrdering = options.disableRasterOrdering,
.wireframe = options.wireframe,
.clockwiseFillOverride =