diff --git a/renderer/premake5_pls_renderer.lua b/renderer/premake5_pls_renderer.lua index 84ce433bb..266b3ed45 100644 --- a/renderer/premake5_pls_renderer.lua +++ b/renderer/premake5_pls_renderer.lua @@ -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({ diff --git a/renderer/src/webgpu/render_context_webgpu_impl.cpp b/renderer/src/webgpu/render_context_webgpu_impl.cpp index bf39b81cc..a2c71a75a 100644 --- a/renderer/src/webgpu/render_context_webgpu_impl.cpp +++ b/renderer/src/webgpu/render_context_webgpu_impl.cpp @@ -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 } diff --git a/renderer/src/webgpu/wagyu-port/.clang-format-ignore b/renderer/src/webgpu/wagyu-port/.clang-format-ignore deleted file mode 100644 index e39efe3fc..000000000 --- a/renderer/src/webgpu/wagyu-port/.clang-format-ignore +++ /dev/null @@ -1,3 +0,0 @@ -new/include/webgpu/* -old/include/webgpu/* -old/src/* diff --git a/renderer/src/webgpu/wagyu-port/README.md b/renderer/src/webgpu/wagyu-port/README.md index cc91a3490..9f7a436f2 100644 --- a/renderer/src/webgpu/wagyu-port/README.md +++ b/renderer/src/webgpu/wagyu-port/README.md @@ -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 ``` diff --git a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu.h b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu.h similarity index 92% rename from renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu.h rename to renderer/src/webgpu/wagyu-port/include/webgpu/webgpu.h index 921364e0f..1655e5743 100644 --- a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu.h +++ b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu.h @@ -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_ diff --git a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_cpp.h b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_cpp.h similarity index 94% rename from renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_cpp.h rename to renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_cpp.h index 1e06db9ef..cbd830a8b 100644 --- a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_cpp.h +++ b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_cpp.h @@ -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, T> { template -using BufferMapCallback = typename detail::CallbackTypeBase, T...>::Callback; +using BufferMapCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using CompilationInfoCallback = typename detail::CallbackTypeBase, T...>::Callback; +using CompilationInfoCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase, T...>::Callback; +using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase, T...>::Callback; +using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using PopErrorScopeCallback = typename detail::CallbackTypeBase, T...>::Callback; +using PopErrorScopeCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using QueueWorkDoneCallback = typename detail::CallbackTypeBase, T...>::Callback; +using QueueWorkDoneCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using RequestAdapterCallback = typename detail::CallbackTypeBase, T...>::Callback; +using RequestAdapterCallback = typename detail::CallbackTypeBase, T...>::Callback; template -using RequestDeviceCallback = typename detail::CallbackTypeBase, T...>::Callback; +using RequestDeviceCallback = typename detail::CallbackTypeBase, T...>::Callback; template using DeviceLostCallback = typename detail::CallbackTypeBase, T...>::Callback; template @@ -1434,7 +1452,7 @@ class Instance : public ObjectBase { 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 { 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(this); +InstanceLimits::operator const WGPUInstanceLimits&() const noexcept { + return *reinterpret_cast(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(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(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(this); +TextureComponentSwizzle::operator const WGPUTextureComponentSwizzle&() const noexcept { + return *reinterpret_cast(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(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(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(features)); + wgpuAdapterGetFeatures(Get(), reinterpret_cast(features)); } ConvertibleStatus Adapter::GetInfo(AdapterInfo * info) const { *info = AdapterInfo(); - auto result = wgpuAdapterGetInfo(Get(), reinterpret_cast(info)); + auto result = wgpuAdapterGetInfo(Get(), reinterpret_cast(info)); return static_cast(result); } ConvertibleStatus Adapter::GetLimits(Limits * limits) const { - auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast(limits)); + auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast(limits)); return static_cast(result); } Bool Adapter::HasFeature(FeatureName feature) const { @@ -4319,7 +4463,7 @@ Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode } callbackInfo.userdata1 = reinterpret_cast(+callback); callbackInfo.userdata2 = reinterpret_cast(userdata); - auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); return Future { result.id }; @@ -4352,7 +4496,7 @@ Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackInfo.userdata1 = reinterpret_cast(lambda); callbackInfo.userdata2 = nullptr; } - auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(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(data), size); + auto result = wgpuBufferReadMappedRange(Get(), offset, reinterpret_cast(data), size); return static_cast(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(data), size); + auto result = wgpuBufferWriteMappedRange(Get(), offset, reinterpret_cast(data), size); return static_cast(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(descriptor)); + auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast(descriptor)); return ComputePassEncoder::Acquire(result); } RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast(descriptor)); + auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast(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(source), reinterpret_cast(destination), reinterpret_cast(copySize)); + wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); } void CommandEncoder::CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); + wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); } void CommandEncoder::CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); + wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); } CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast(descriptor)); + auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast(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(&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(dynamicOffsets)); + wgpuComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); } void ComputePassEncoder::SetLabel(StringView label) const { wgpuComputePassEncoderSetLabel(Get(), *reinterpret_cast(&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(descriptor)); + auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast(descriptor)); return BindGroup::Acquire(result); } BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); return BindGroupLayout::Acquire(result); } Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); return Buffer::Acquire(result); } CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); return CommandEncoder::Acquire(result); } ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); return ComputePipeline::Acquire(result); } template (+callback); callbackInfo.userdata2 = reinterpret_cast(userdata); - auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); return Future { result.id }; @@ -4758,25 +4902,25 @@ Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * desc callbackInfo.userdata1 = reinterpret_cast(lambda); callbackInfo.userdata2 = nullptr; } - auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); return Future { result.id }; } PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); return PipelineLayout::Acquire(result); } QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); return QuerySet::Acquire(result); } RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); return RenderBundleEncoder::Acquire(result); } RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); return RenderPipeline::Acquire(result); } template (+callback); callbackInfo.userdata2 = reinterpret_cast(userdata); - auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); return Future { result.id }; @@ -4835,21 +4979,21 @@ Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descri callbackInfo.userdata1 = reinterpret_cast(lambda); callbackInfo.userdata2 = nullptr; } - auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); + auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); return Future { result.id }; } Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); return Sampler::Acquire(result); } ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); return ShaderModule::Acquire(result); } Texture Device::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast(descriptor)); + auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast(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(adapterInfo)); + auto result = wgpuDeviceGetAdapterInfo(Get(), reinterpret_cast(adapterInfo)); return static_cast(result); } void Device::GetFeatures(SupportedFeatures * features) const { *features = SupportedFeatures(); - wgpuDeviceGetFeatures(Get(), reinterpret_cast(features)); + wgpuDeviceGetFeatures(Get(), reinterpret_cast(features)); } ConvertibleStatus Device::GetLimits(Limits * limits) const { - auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast(limits)); + auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast(limits)); return static_cast(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(descriptor)); + auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast(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(features)); - return static_cast(result); + wgpuInstanceGetWGSLLanguageFeatures(Get(), reinterpret_cast(features)); } Bool Instance::HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const { auto result = wgpuInstanceHasWGSLLanguageFeature(Get(), static_cast(feature)); @@ -5005,7 +5148,7 @@ Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackM } callbackInfo.userdata1 = reinterpret_cast(+callback); callbackInfo.userdata2 = reinterpret_cast(userdata); - auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); + auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); return Future { result.id }; @@ -5038,13 +5181,13 @@ Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackM callbackInfo.userdata1 = reinterpret_cast(lambda); callbackInfo.userdata2 = nullptr; } - auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); + auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(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(futures), timeoutNS); + auto result = wgpuInstanceWaitAny(Get(), futureCount, reinterpret_cast(futures), timeoutNS); return static_cast(result); } @@ -5184,13 +5327,13 @@ void Queue::SetLabel(StringView label) const { wgpuQueueSetLabel(Get(), *reinterpret_cast(&label)); } void Queue::Submit(size_t commandCount, CommandBuffer const * commands) const { - wgpuQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); + wgpuQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); } void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const { - wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); + wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(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(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(writeSize)); + wgpuQueueWriteTexture(Get(), reinterpret_cast(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(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(descriptor)); + auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast(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(&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(dynamicOffsets)); + wgpuRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); } void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { wgpuRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(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(bundles)); + wgpuRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast(bundles)); } void RenderPassEncoder::InsertDebugMarker(StringView markerLabel) const { wgpuRenderPassEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); @@ -5326,10 +5469,10 @@ void RenderPassEncoder::PushDebugGroup(StringView groupLabel) const { wgpuRenderPassEncoderPushDebugGroup(Get(), *reinterpret_cast(&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(dynamicOffsets)); + wgpuRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); } void RenderPassEncoder::SetBlendConstant(Color const * color) const { - wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast(color)); + wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast(color)); } void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { wgpuRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(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(config)); + wgpuSurfaceConfigure(Get(), reinterpret_cast(config)); } ConvertibleStatus Surface::GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const { *capabilities = SurfaceCapabilities(); - auto result = wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast(capabilities)); + auto result = wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast(capabilities)); return static_cast(result); } void Surface::GetCurrentTexture(SurfaceTexture * surfaceTexture) const { - wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast(surfaceTexture)); + wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast(surfaceTexture)); } -void Surface::Present() const { - wgpuSurfacePresent(Get()); +ConvertibleStatus Surface::Present() const { + auto result = wgpuSurfacePresent(Get()); + return static_cast(result); } void Surface::SetLabel(StringView label) const { wgpuSurfaceSetLabel(Get(), *reinterpret_cast(&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(descriptor)); + auto result = wgpuTextureCreateView(Get(), reinterpret_cast(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(descriptor)); + auto result = wgpuCreateInstance(reinterpret_cast(descriptor)); return Instance::Acquire(result); } -static inline Status GetInstanceCapabilities(InstanceCapabilities * capabilities) { - auto result = wgpuGetInstanceCapabilities(reinterpret_cast(capabilities)); +static inline void GetInstanceFeatures(SupportedInstanceFeatures * features) { + wgpuGetInstanceFeatures(reinterpret_cast(features)); +} +static inline Status GetInstanceLimits(InstanceLimits * limits) { + auto result = wgpuGetInstanceLimits(reinterpret_cast(limits)); return static_cast(result); } +static inline Bool HasInstanceFeature(InstanceFeatureName feature) { + auto result = wgpuHasInstanceFeature(static_cast(feature)); + return result; +} static inline Proc GetProcAddress(StringView procName) { auto result = wgpuGetProcAddress(*reinterpret_cast(&procName)); return reinterpret_cast(result); @@ -5634,6 +5776,7 @@ static inline Proc GetProcAddress(StringView procName) { } // namespace wgpu namespace wgpu { + template<> struct IsWGPUBitmask { static constexpr bool enable = true; @@ -5659,6 +5802,14 @@ struct IsWGPUBitmask { 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 { diff --git a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_cpp_chained_struct.h b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_cpp_chained_struct.h similarity index 100% rename from renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_cpp_chained_struct.h rename to renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_cpp_chained_struct.h diff --git a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_enum_class_bitmasks.h b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_enum_class_bitmasks.h similarity index 100% rename from renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_enum_class_bitmasks.h rename to renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_enum_class_bitmasks.h diff --git a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_wagyu.h b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_wagyu.h similarity index 71% rename from renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_wagyu.h rename to renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_wagyu.h index 6edae5a1c..c3e559742 100644 --- a/renderer/src/webgpu/wagyu-port/new/include/webgpu/webgpu_wagyu.h +++ b/renderer/src/webgpu/wagyu-port/include/webgpu/webgpu_wagyu.h @@ -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) -} // extern "C" -#endif +WGPU_EXPORT void wgpuWagyuWGSLFeatureTypeArrayFreeMembers(WGPUWagyuWGSLFeatureTypeArray wgslFeatureTypeArray) WGPU_FUNCTION_ATTRIBUTE; -#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck) -} // namespace wagyu2 +#if defined(__cplusplus) && !defined(__cppcheck) +} // extern "C" #endif #endif /* WEBGPU_WAGYU_H */ diff --git a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu.h b/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu.h deleted file mode 100644 index 45ea1b07f..000000000 --- a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu.h +++ /dev/null @@ -1,1901 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2019, "WebGPU native" developers -// All rights reserved. -// -// 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_H_ -#define WEBGPU_H_ - -#if defined(WGPU_SHARED_LIBRARY) -# if defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __declspec(dllexport) -# else -# define WGPU_EXPORT __declspec(dllimport) -# endif -# else // defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __attribute__((visibility("default"))) -# else -# define WGPU_EXPORT -# endif -# endif // defined(_WIN32) -#else // defined(WGPU_SHARED_LIBRARY) -# define WGPU_EXPORT -#endif // defined(WGPU_SHARED_LIBRARY) - -#if !defined(WGPU_OBJECT_ATTRIBUTE) -#define WGPU_OBJECT_ATTRIBUTE -#endif -#if !defined(WGPU_ENUM_ATTRIBUTE) -#define WGPU_ENUM_ATTRIBUTE -#endif -#if !defined(WGPU_STRUCTURE_ATTRIBUTE) -#define WGPU_STRUCTURE_ATTRIBUTE -#endif -#if !defined(WGPU_FUNCTION_ATTRIBUTE) -#define WGPU_FUNCTION_ATTRIBUTE -#endif -#if !defined(WGPU_NULLABLE) -#define WGPU_NULLABLE -#endif - -#include -#include - -#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck) -namespace wagyu1 { -#endif - -#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED UINT32_MAX -#define WGPU_COPY_STRIDE_UNDEFINED UINT32_MAX -#define WGPU_DEPTH_SLICE_UNDEFINED UINT32_MAX -#define WGPU_LIMIT_U32_UNDEFINED UINT32_MAX -#define WGPU_LIMIT_U64_UNDEFINED UINT64_MAX -#define WGPU_MIP_LEVEL_COUNT_UNDEFINED UINT32_MAX -#define WGPU_QUERY_SET_INDEX_UNDEFINED UINT32_MAX -#define WGPU_WHOLE_MAP_SIZE SIZE_MAX -#define WGPU_WHOLE_SIZE UINT64_MAX - -typedef uint32_t WGPUFlags; -typedef uint32_t WGPUBool; - -typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBufferImpl* WGPUBuffer WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUComputePipelineImpl* WGPUComputePipeline WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUDeviceImpl* WGPUDevice WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUInstanceImpl* WGPUInstance WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUQuerySetImpl* WGPUQuerySet WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUQueueImpl* WGPUQueue WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPURenderBundleImpl* WGPURenderBundle WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPURenderPipelineImpl* WGPURenderPipeline WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUSamplerImpl* WGPUSampler WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUShaderModuleImpl* WGPUShaderModule WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUSurfaceImpl* WGPUSurface WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUSwapChainImpl* WGPUSwapChain WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; - -// Structure forward declarations -struct WGPUAdapterInfo; -struct WGPUAdapterProperties; -struct WGPUBindGroupEntry; -struct WGPUBlendComponent; -struct WGPUBufferBindingLayout; -struct WGPUBufferDescriptor; -struct WGPUBufferMapCallbackInfo; -struct WGPUColor; -struct WGPUCommandBufferDescriptor; -struct WGPUCommandEncoderDescriptor; -struct WGPUCompilationMessage; -struct WGPUComputePassTimestampWrites; -struct WGPUConstantEntry; -struct WGPUExtent3D; -struct WGPUFuture; -struct WGPUInstanceFeatures; -struct WGPULimits; -struct WGPUMultisampleState; -struct WGPUOrigin3D; -struct WGPUPipelineLayoutDescriptor; -struct WGPUPrimitiveDepthClipControl; -struct WGPUPrimitiveState; -struct WGPUQuerySetDescriptor; -struct WGPUQueueDescriptor; -struct WGPUQueueWorkDoneCallbackInfo; -struct WGPURenderBundleDescriptor; -struct WGPURenderBundleEncoderDescriptor; -struct WGPURenderPassDepthStencilAttachment; -struct WGPURenderPassDescriptorMaxDrawCount; -struct WGPURenderPassTimestampWrites; -struct WGPURequestAdapterCallbackInfo; -struct WGPURequestAdapterOptions; -struct WGPUSamplerBindingLayout; -struct WGPUSamplerDescriptor; -struct WGPUShaderModuleSPIRVDescriptor; -struct WGPUShaderModuleWGSLDescriptor; -struct WGPUShaderModuleDescriptor; -struct WGPUStencilFaceState; -struct WGPUStorageTextureBindingLayout; -struct WGPUSurfaceCapabilities; -struct WGPUSurfaceConfiguration; -struct WGPUSurfaceDescriptor; -struct WGPUSurfaceDescriptorFromCanvasHTMLSelector; -struct WGPUSurfaceTexture; -struct WGPUSwapChainDescriptor; -struct WGPUTextureBindingLayout; -struct WGPUTextureBindingViewDimensionDescriptor; -struct WGPUTextureDataLayout; -struct WGPUTextureViewDescriptor; -struct WGPUVertexAttribute; -struct WGPUBindGroupDescriptor; -struct WGPUBindGroupLayoutEntry; -struct WGPUBlendState; -struct WGPUCompilationInfo; -struct WGPUComputePassDescriptor; -struct WGPUDepthStencilState; -struct WGPUFutureWaitInfo; -struct WGPUImageCopyBuffer; -struct WGPUImageCopyTexture; -struct WGPUInstanceDescriptor; -struct WGPUProgrammableStageDescriptor; -struct WGPURenderPassColorAttachment; -struct WGPURequiredLimits; -struct WGPUSupportedLimits; -struct WGPUTextureDescriptor; -struct WGPUVertexBufferLayout; -struct WGPUBindGroupLayoutDescriptor; -struct WGPUColorTargetState; -struct WGPUComputePipelineDescriptor; -struct WGPUDeviceDescriptor; -struct WGPURenderPassDescriptor; -struct WGPUVertexState; -struct WGPUFragmentState; -struct WGPURenderPipelineDescriptor; - -typedef enum WGPUWGSLFeatureName { - WGPUWGSLFeatureName_Undefined = 0x00000000, - WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, - WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002, - WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003, - WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004, - WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF -} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUAdapterType { - WGPUAdapterType_DiscreteGPU = 0x00000001, - WGPUAdapterType_IntegratedGPU = 0x00000002, - WGPUAdapterType_CPU = 0x00000003, - WGPUAdapterType_Unknown = 0x00000004, - WGPUAdapterType_Force32 = 0x7FFFFFFF -} WGPUAdapterType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUAddressMode { - WGPUAddressMode_Undefined = 0x00000000, - WGPUAddressMode_ClampToEdge = 0x00000001, - WGPUAddressMode_Repeat = 0x00000002, - WGPUAddressMode_MirrorRepeat = 0x00000003, - WGPUAddressMode_Force32 = 0x7FFFFFFF -} WGPUAddressMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBackendType { - WGPUBackendType_Undefined = 0x00000000, - WGPUBackendType_Null = 0x00000001, - WGPUBackendType_WebGPU = 0x00000002, - WGPUBackendType_D3D11 = 0x00000003, - WGPUBackendType_D3D12 = 0x00000004, - WGPUBackendType_Metal = 0x00000005, - WGPUBackendType_Vulkan = 0x00000006, - WGPUBackendType_OpenGL = 0x00000007, - WGPUBackendType_OpenGLES = 0x00000008, - WGPUBackendType_Force32 = 0x7FFFFFFF -} WGPUBackendType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBlendFactor { - WGPUBlendFactor_Undefined = 0x00000000, - WGPUBlendFactor_Zero = 0x00000001, - WGPUBlendFactor_One = 0x00000002, - WGPUBlendFactor_Src = 0x00000003, - WGPUBlendFactor_OneMinusSrc = 0x00000004, - WGPUBlendFactor_SrcAlpha = 0x00000005, - WGPUBlendFactor_OneMinusSrcAlpha = 0x00000006, - WGPUBlendFactor_Dst = 0x00000007, - WGPUBlendFactor_OneMinusDst = 0x00000008, - WGPUBlendFactor_DstAlpha = 0x00000009, - WGPUBlendFactor_OneMinusDstAlpha = 0x0000000A, - WGPUBlendFactor_SrcAlphaSaturated = 0x0000000B, - WGPUBlendFactor_Constant = 0x0000000C, - WGPUBlendFactor_OneMinusConstant = 0x0000000D, - WGPUBlendFactor_Force32 = 0x7FFFFFFF -} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBlendOperation { - WGPUBlendOperation_Undefined = 0x00000000, - WGPUBlendOperation_Add = 0x00000001, - WGPUBlendOperation_Subtract = 0x00000002, - WGPUBlendOperation_ReverseSubtract = 0x00000003, - WGPUBlendOperation_Min = 0x00000004, - WGPUBlendOperation_Max = 0x00000005, - WGPUBlendOperation_Force32 = 0x7FFFFFFF -} WGPUBlendOperation WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBufferBindingType { - WGPUBufferBindingType_Undefined = 0x00000000, - WGPUBufferBindingType_Uniform = 0x00000001, - WGPUBufferBindingType_Storage = 0x00000002, - WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, - WGPUBufferBindingType_Force32 = 0x7FFFFFFF -} WGPUBufferBindingType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBufferMapAsyncStatus { - WGPUBufferMapAsyncStatus_Success = 0x00000000, - WGPUBufferMapAsyncStatus_ValidationError = 0x00000001, - WGPUBufferMapAsyncStatus_Unknown = 0x00000002, - WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, - WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, - WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, - WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000006, - WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000007, - WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000008, - WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUBufferMapAsyncStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBufferMapState { - WGPUBufferMapState_Unmapped = 0x00000001, - WGPUBufferMapState_Pending = 0x00000002, - WGPUBufferMapState_Mapped = 0x00000003, - WGPUBufferMapState_Force32 = 0x7FFFFFFF -} WGPUBufferMapState WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCallbackMode { - WGPUCallbackMode_WaitAnyOnly = 0x00000000, - WGPUCallbackMode_AllowProcessEvents = 0x00000001, - WGPUCallbackMode_AllowSpontaneous = 0x00000002, - WGPUCallbackMode_Force32 = 0x7FFFFFFF -} WGPUCallbackMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompareFunction { - WGPUCompareFunction_Undefined = 0x00000000, - WGPUCompareFunction_Never = 0x00000001, - WGPUCompareFunction_Less = 0x00000002, - WGPUCompareFunction_Equal = 0x00000003, - WGPUCompareFunction_LessEqual = 0x00000004, - WGPUCompareFunction_Greater = 0x00000005, - WGPUCompareFunction_NotEqual = 0x00000006, - WGPUCompareFunction_GreaterEqual = 0x00000007, - WGPUCompareFunction_Always = 0x00000008, - WGPUCompareFunction_Force32 = 0x7FFFFFFF -} WGPUCompareFunction WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompilationInfoRequestStatus { - WGPUCompilationInfoRequestStatus_Success = 0x00000000, - WGPUCompilationInfoRequestStatus_Error = 0x00000001, - WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002, - WGPUCompilationInfoRequestStatus_Unknown = 0x00000003, - WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF -} WGPUCompilationInfoRequestStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompilationMessageType { - WGPUCompilationMessageType_Error = 0x00000001, - WGPUCompilationMessageType_Warning = 0x00000002, - WGPUCompilationMessageType_Info = 0x00000003, - WGPUCompilationMessageType_Force32 = 0x7FFFFFFF -} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompositeAlphaMode { - WGPUCompositeAlphaMode_Auto = 0x00000000, - WGPUCompositeAlphaMode_Opaque = 0x00000001, - WGPUCompositeAlphaMode_Premultiplied = 0x00000002, - WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003, - WGPUCompositeAlphaMode_Inherit = 0x00000004, - WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF -} WGPUCompositeAlphaMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCreatePipelineAsyncStatus { - WGPUCreatePipelineAsyncStatus_Success = 0x00000000, - WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000001, - WGPUCreatePipelineAsyncStatus_InternalError = 0x00000002, - WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000003, - WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000004, - WGPUCreatePipelineAsyncStatus_Unknown = 0x00000005, - WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUCreatePipelineAsyncStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCullMode { - WGPUCullMode_Undefined = 0x00000000, - WGPUCullMode_None = 0x00000001, - WGPUCullMode_Front = 0x00000002, - WGPUCullMode_Back = 0x00000003, - WGPUCullMode_Force32 = 0x7FFFFFFF -} WGPUCullMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUDeviceLostReason { - WGPUDeviceLostReason_Undefined = 0x00000001, - WGPUDeviceLostReason_Unknown = 0x00000001, - WGPUDeviceLostReason_Destroyed = 0x00000002, - WGPUDeviceLostReason_Force32 = 0x7FFFFFFF -} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUErrorFilter { - WGPUErrorFilter_Validation = 0x00000001, - WGPUErrorFilter_OutOfMemory = 0x00000002, - WGPUErrorFilter_Internal = 0x00000003, - WGPUErrorFilter_Force32 = 0x7FFFFFFF -} WGPUErrorFilter WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUErrorType { - WGPUErrorType_NoError = 0x00000000, - WGPUErrorType_Validation = 0x00000001, - WGPUErrorType_OutOfMemory = 0x00000002, - WGPUErrorType_Internal = 0x00000003, - WGPUErrorType_Unknown = 0x00000004, - WGPUErrorType_DeviceLost = 0x00000005, - WGPUErrorType_Force32 = 0x7FFFFFFF -} WGPUErrorType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFeatureName { - WGPUFeatureName_Undefined = 0x00000000, - WGPUFeatureName_DepthClipControl = 0x00000001, - WGPUFeatureName_Depth32FloatStencil8 = 0x00000002, - WGPUFeatureName_TimestampQuery = 0x00000003, - WGPUFeatureName_TextureCompressionBC = 0x00000004, - WGPUFeatureName_TextureCompressionETC2 = 0x00000005, - WGPUFeatureName_TextureCompressionASTC = 0x00000006, - WGPUFeatureName_IndirectFirstInstance = 0x00000007, - WGPUFeatureName_ShaderF16 = 0x00000008, - WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009, - WGPUFeatureName_BGRA8UnormStorage = 0x0000000A, - WGPUFeatureName_Float32Filterable = 0x0000000B, - WGPUFeatureName_Force32 = 0x7FFFFFFF -} WGPUFeatureName WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFilterMode { - WGPUFilterMode_Undefined = 0x00000000, - WGPUFilterMode_Nearest = 0x00000001, - WGPUFilterMode_Linear = 0x00000002, - WGPUFilterMode_Force32 = 0x7FFFFFFF -} WGPUFilterMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFrontFace { - WGPUFrontFace_Undefined = 0x00000000, - WGPUFrontFace_CCW = 0x00000001, - WGPUFrontFace_CW = 0x00000002, - WGPUFrontFace_Force32 = 0x7FFFFFFF -} WGPUFrontFace WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUIndexFormat { - WGPUIndexFormat_Undefined = 0x00000000, - WGPUIndexFormat_Uint16 = 0x00000001, - WGPUIndexFormat_Uint32 = 0x00000002, - WGPUIndexFormat_Force32 = 0x7FFFFFFF -} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPULoadOp { - WGPULoadOp_Undefined = 0x00000000, - WGPULoadOp_Clear = 0x00000001, - WGPULoadOp_Load = 0x00000002, - WGPULoadOp_Force32 = 0x7FFFFFFF -} WGPULoadOp WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUMipmapFilterMode { - WGPUMipmapFilterMode_Undefined = 0x00000000, - WGPUMipmapFilterMode_Nearest = 0x00000001, - WGPUMipmapFilterMode_Linear = 0x00000002, - WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF -} WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPowerPreference { - WGPUPowerPreference_Undefined = 0x00000000, - WGPUPowerPreference_LowPower = 0x00000001, - WGPUPowerPreference_HighPerformance = 0x00000002, - WGPUPowerPreference_Force32 = 0x7FFFFFFF -} WGPUPowerPreference WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPresentMode { - WGPUPresentMode_Fifo = 0x00000001, - WGPUPresentMode_Immediate = 0x00000003, - WGPUPresentMode_Mailbox = 0x00000004, - WGPUPresentMode_Force32 = 0x7FFFFFFF -} WGPUPresentMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPrimitiveTopology { - WGPUPrimitiveTopology_Undefined = 0x00000000, - WGPUPrimitiveTopology_PointList = 0x00000001, - WGPUPrimitiveTopology_LineList = 0x00000002, - WGPUPrimitiveTopology_LineStrip = 0x00000003, - WGPUPrimitiveTopology_TriangleList = 0x00000004, - WGPUPrimitiveTopology_TriangleStrip = 0x00000005, - WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF -} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUQueryType { - WGPUQueryType_Occlusion = 0x00000001, - WGPUQueryType_Timestamp = 0x00000002, - WGPUQueryType_Force32 = 0x7FFFFFFF -} WGPUQueryType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUQueueWorkDoneStatus { - WGPUQueueWorkDoneStatus_Success = 0x00000000, - WGPUQueueWorkDoneStatus_Error = 0x00000001, - WGPUQueueWorkDoneStatus_Unknown = 0x00000002, - WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003, - WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF -} WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPURequestAdapterStatus { - WGPURequestAdapterStatus_Success = 0x00000000, - WGPURequestAdapterStatus_Unavailable = 0x00000001, - WGPURequestAdapterStatus_Error = 0x00000002, - WGPURequestAdapterStatus_Unknown = 0x00000003, - WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF -} WGPURequestAdapterStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPURequestDeviceStatus { - WGPURequestDeviceStatus_Success = 0x00000000, - WGPURequestDeviceStatus_Error = 0x00000001, - WGPURequestDeviceStatus_Unknown = 0x00000002, - WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF -} WGPURequestDeviceStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSType { - WGPUSType_Invalid = 0x00000000, - WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, - WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, - WGPUSType_PrimitiveDepthClipControl = 0x00000007, - WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, - WGPUSType_TextureBindingViewDimensionDescriptor = 0x00000011, - WGPUSType_Force32 = 0x7FFFFFFF -} WGPUSType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSamplerBindingType { - WGPUSamplerBindingType_Undefined = 0x00000000, - WGPUSamplerBindingType_Filtering = 0x00000001, - WGPUSamplerBindingType_NonFiltering = 0x00000002, - WGPUSamplerBindingType_Comparison = 0x00000003, - WGPUSamplerBindingType_Force32 = 0x7FFFFFFF -} WGPUSamplerBindingType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStencilOperation { - WGPUStencilOperation_Undefined = 0x00000000, - WGPUStencilOperation_Keep = 0x00000001, - WGPUStencilOperation_Zero = 0x00000002, - WGPUStencilOperation_Replace = 0x00000003, - WGPUStencilOperation_Invert = 0x00000004, - WGPUStencilOperation_IncrementClamp = 0x00000005, - WGPUStencilOperation_DecrementClamp = 0x00000006, - WGPUStencilOperation_IncrementWrap = 0x00000007, - WGPUStencilOperation_DecrementWrap = 0x00000008, - WGPUStencilOperation_Force32 = 0x7FFFFFFF -} WGPUStencilOperation WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStorageTextureAccess { - WGPUStorageTextureAccess_Undefined = 0x00000000, - WGPUStorageTextureAccess_WriteOnly = 0x00000001, - WGPUStorageTextureAccess_ReadOnly = 0x00000002, - WGPUStorageTextureAccess_ReadWrite = 0x00000003, - WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF -} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStoreOp { - WGPUStoreOp_Undefined = 0x00000000, - WGPUStoreOp_Store = 0x00000001, - WGPUStoreOp_Discard = 0x00000002, - WGPUStoreOp_Force32 = 0x7FFFFFFF -} WGPUStoreOp WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSurfaceGetCurrentTextureStatus { - WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000, - WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001, - WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002, - WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003, - WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004, - WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005, - WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF -} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureAspect { - WGPUTextureAspect_Undefined = 0x00000000, - WGPUTextureAspect_All = 0x00000001, - WGPUTextureAspect_StencilOnly = 0x00000002, - WGPUTextureAspect_DepthOnly = 0x00000003, - WGPUTextureAspect_Force32 = 0x7FFFFFFF -} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureDimension { - WGPUTextureDimension_Undefined = 0x00000000, - WGPUTextureDimension_1D = 0x00000001, - WGPUTextureDimension_2D = 0x00000002, - WGPUTextureDimension_3D = 0x00000003, - WGPUTextureDimension_Force32 = 0x7FFFFFFF -} WGPUTextureDimension WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureFormat { - WGPUTextureFormat_Undefined = 0x00000000, - WGPUTextureFormat_R8Unorm = 0x00000001, - WGPUTextureFormat_R8Snorm = 0x00000002, - WGPUTextureFormat_R8Uint = 0x00000003, - WGPUTextureFormat_R8Sint = 0x00000004, - WGPUTextureFormat_R16Uint = 0x00000005, - WGPUTextureFormat_R16Sint = 0x00000006, - WGPUTextureFormat_R16Float = 0x00000007, - WGPUTextureFormat_RG8Unorm = 0x00000008, - WGPUTextureFormat_RG8Snorm = 0x00000009, - WGPUTextureFormat_RG8Uint = 0x0000000A, - WGPUTextureFormat_RG8Sint = 0x0000000B, - WGPUTextureFormat_R32Float = 0x0000000C, - WGPUTextureFormat_R32Uint = 0x0000000D, - WGPUTextureFormat_R32Sint = 0x0000000E, - WGPUTextureFormat_RG16Uint = 0x0000000F, - WGPUTextureFormat_RG16Sint = 0x00000010, - WGPUTextureFormat_RG16Float = 0x00000011, - WGPUTextureFormat_RGBA8Unorm = 0x00000012, - WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013, - WGPUTextureFormat_RGBA8Snorm = 0x00000014, - WGPUTextureFormat_RGBA8Uint = 0x00000015, - WGPUTextureFormat_RGBA8Sint = 0x00000016, - WGPUTextureFormat_BGRA8Unorm = 0x00000017, - WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018, - WGPUTextureFormat_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_Force32 = 0x7FFFFFFF -} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureSampleType { - WGPUTextureSampleType_Undefined = 0x00000000, - WGPUTextureSampleType_Float = 0x00000001, - WGPUTextureSampleType_UnfilterableFloat = 0x00000002, - WGPUTextureSampleType_Depth = 0x00000003, - WGPUTextureSampleType_Sint = 0x00000004, - WGPUTextureSampleType_Uint = 0x00000005, - WGPUTextureSampleType_Force32 = 0x7FFFFFFF -} WGPUTextureSampleType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureViewDimension { - WGPUTextureViewDimension_Undefined = 0x00000000, - WGPUTextureViewDimension_1D = 0x00000001, - WGPUTextureViewDimension_2D = 0x00000002, - WGPUTextureViewDimension_2DArray = 0x00000003, - WGPUTextureViewDimension_Cube = 0x00000004, - WGPUTextureViewDimension_CubeArray = 0x00000005, - WGPUTextureViewDimension_3D = 0x00000006, - WGPUTextureViewDimension_Force32 = 0x7FFFFFFF -} WGPUTextureViewDimension WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUVertexFormat { - WGPUVertexFormat_Undefined = 0x00000000, - WGPUVertexFormat_Uint8x2 = 0x00000001, - WGPUVertexFormat_Uint8x4 = 0x00000002, - WGPUVertexFormat_Sint8x2 = 0x00000003, - WGPUVertexFormat_Sint8x4 = 0x00000004, - WGPUVertexFormat_Unorm8x2 = 0x00000005, - WGPUVertexFormat_Unorm8x4 = 0x00000006, - WGPUVertexFormat_Snorm8x2 = 0x00000007, - WGPUVertexFormat_Snorm8x4 = 0x00000008, - WGPUVertexFormat_Uint16x2 = 0x00000009, - WGPUVertexFormat_Uint16x4 = 0x0000000A, - WGPUVertexFormat_Sint16x2 = 0x0000000B, - WGPUVertexFormat_Sint16x4 = 0x0000000C, - WGPUVertexFormat_Unorm16x2 = 0x0000000D, - WGPUVertexFormat_Unorm16x4 = 0x0000000E, - WGPUVertexFormat_Snorm16x2 = 0x0000000F, - WGPUVertexFormat_Snorm16x4 = 0x00000010, - WGPUVertexFormat_Float16x2 = 0x00000011, - WGPUVertexFormat_Float16x4 = 0x00000012, - WGPUVertexFormat_Float32 = 0x00000013, - WGPUVertexFormat_Float32x2 = 0x00000014, - WGPUVertexFormat_Float32x3 = 0x00000015, - WGPUVertexFormat_Float32x4 = 0x00000016, - WGPUVertexFormat_Uint32 = 0x00000017, - WGPUVertexFormat_Uint32x2 = 0x00000018, - WGPUVertexFormat_Uint32x3 = 0x00000019, - WGPUVertexFormat_Uint32x4 = 0x0000001A, - WGPUVertexFormat_Sint32 = 0x0000001B, - WGPUVertexFormat_Sint32x2 = 0x0000001C, - WGPUVertexFormat_Sint32x3 = 0x0000001D, - WGPUVertexFormat_Sint32x4 = 0x0000001E, - WGPUVertexFormat_Unorm10_10_10_2 = 0x0000001F, - WGPUVertexFormat_Force32 = 0x7FFFFFFF -} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUVertexStepMode { - WGPUVertexStepMode_Undefined = 0x00000000, - WGPUVertexStepMode_VertexBufferNotUsed = 0x00000001, - WGPUVertexStepMode_Vertex = 0x00000002, - WGPUVertexStepMode_Instance = 0x00000003, - WGPUVertexStepMode_Force32 = 0x7FFFFFFF -} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUWaitStatus { - WGPUWaitStatus_Success = 0x00000000, - WGPUWaitStatus_TimedOut = 0x00000001, - WGPUWaitStatus_UnsupportedTimeout = 0x00000002, - WGPUWaitStatus_UnsupportedCount = 0x00000003, - WGPUWaitStatus_UnsupportedMixedSources = 0x00000004, - WGPUWaitStatus_Unknown = 0x00000005, - WGPUWaitStatus_Force32 = 0x7FFFFFFF -} WGPUWaitStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBufferUsage { - WGPUBufferUsage_None = 0x00000000, - WGPUBufferUsage_MapRead = 0x00000001, - WGPUBufferUsage_MapWrite = 0x00000002, - WGPUBufferUsage_CopySrc = 0x00000004, - WGPUBufferUsage_CopyDst = 0x00000008, - WGPUBufferUsage_Index = 0x00000010, - WGPUBufferUsage_Vertex = 0x00000020, - WGPUBufferUsage_Uniform = 0x00000040, - WGPUBufferUsage_Storage = 0x00000080, - WGPUBufferUsage_Indirect = 0x00000100, - WGPUBufferUsage_QueryResolve = 0x00000200, - WGPUBufferUsage_Force32 = 0x7FFFFFFF -} WGPUBufferUsage WGPU_ENUM_ATTRIBUTE; -typedef WGPUFlags WGPUBufferUsageFlags WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUColorWriteMask { - WGPUColorWriteMask_None = 0x00000000, - WGPUColorWriteMask_Red = 0x00000001, - WGPUColorWriteMask_Green = 0x00000002, - WGPUColorWriteMask_Blue = 0x00000004, - WGPUColorWriteMask_Alpha = 0x00000008, - WGPUColorWriteMask_All = 0x0000000F, - WGPUColorWriteMask_Force32 = 0x7FFFFFFF -} WGPUColorWriteMask WGPU_ENUM_ATTRIBUTE; -typedef WGPUFlags WGPUColorWriteMaskFlags WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUMapMode { - WGPUMapMode_None = 0x00000000, - WGPUMapMode_Read = 0x00000001, - WGPUMapMode_Write = 0x00000002, - WGPUMapMode_Force32 = 0x7FFFFFFF -} WGPUMapMode WGPU_ENUM_ATTRIBUTE; -typedef WGPUFlags WGPUMapModeFlags WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUShaderStage { - WGPUShaderStage_None = 0x00000000, - WGPUShaderStage_Vertex = 0x00000001, - WGPUShaderStage_Fragment = 0x00000002, - WGPUShaderStage_Compute = 0x00000004, - WGPUShaderStage_Force32 = 0x7FFFFFFF -} WGPUShaderStage WGPU_ENUM_ATTRIBUTE; -typedef WGPUFlags WGPUShaderStageFlags WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureUsage { - WGPUTextureUsage_None = 0x00000000, - WGPUTextureUsage_CopySrc = 0x00000001, - WGPUTextureUsage_CopyDst = 0x00000002, - WGPUTextureUsage_TextureBinding = 0x00000004, - WGPUTextureUsage_StorageBinding = 0x00000008, - WGPUTextureUsage_RenderAttachment = 0x00000010, - WGPUTextureUsage_Force32 = 0x7FFFFFFF -} WGPUTextureUsage WGPU_ENUM_ATTRIBUTE; -typedef WGPUFlags WGPUTextureUsageFlags WGPU_ENUM_ATTRIBUTE; - -typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; - -typedef struct WGPUChainedStruct { - struct WGPUChainedStruct const * next; - WGPUSType sType; -} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUChainedStructOut { - struct WGPUChainedStructOut * next; - WGPUSType sType; -} WGPUChainedStructOut WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUAdapterInfo { - WGPUChainedStructOut * nextInChain; - char const * vendor; - char const * architecture; - char const * device; - char const * description; - WGPUBackendType backendType; - WGPUAdapterType adapterType; - uint32_t vendorID; - uint32_t deviceID; -} WGPUAdapterInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUAdapterProperties { - WGPUChainedStructOut * nextInChain; - uint32_t vendorID; - char const * vendorName; - char const * architecture; - uint32_t deviceID; - char const * name; - char const * driverDescription; - WGPUAdapterType adapterType; - WGPUBackendType backendType; - WGPUBool compatibilityMode; -} WGPUAdapterProperties WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBindGroupEntry { - WGPUChainedStruct const * nextInChain; - uint32_t binding; - WGPU_NULLABLE WGPUBuffer buffer; - uint64_t offset; - uint64_t size; - WGPU_NULLABLE WGPUSampler sampler; - WGPU_NULLABLE WGPUTextureView textureView; -} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBlendComponent { - WGPUBlendOperation operation; - WGPUBlendFactor srcFactor; - WGPUBlendFactor dstFactor; -} WGPUBlendComponent WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBufferBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUBufferBindingType type; - WGPUBool hasDynamicOffset; - uint64_t minBindingSize; -} WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBufferDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUBufferUsageFlags usage; - uint64_t size; - WGPUBool mappedAtCreation; -} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBufferMapCallbackInfo { - WGPUChainedStruct const * nextInChain; - WGPUCallbackMode mode; - WGPUBufferMapCallback callback; - void * userdata; -} WGPUBufferMapCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUColor { - double r; - double g; - double b; - double a; -} WGPUColor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUCommandBufferDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUCommandEncoderDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUCompilationMessage { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * message; - WGPUCompilationMessageType type; - uint64_t lineNum; - uint64_t linePos; - uint64_t offset; - uint64_t length; - uint64_t utf16LinePos; - uint64_t utf16Offset; - uint64_t utf16Length; -} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUComputePassTimestampWrites { - WGPUQuerySet querySet; - uint32_t beginningOfPassWriteIndex; - uint32_t endOfPassWriteIndex; -} WGPUComputePassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUConstantEntry { - WGPUChainedStruct const * nextInChain; - char const * key; - double value; -} WGPUConstantEntry WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUExtent3D { - uint32_t width; - uint32_t height; - uint32_t depthOrArrayLayers; -} WGPUExtent3D WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUFuture { - uint64_t id; -} WGPUFuture WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUInstanceFeatures { - WGPUChainedStruct const * nextInChain; - WGPUBool timedWaitAnyEnable; - size_t timedWaitAnyMaxCount; -} WGPUInstanceFeatures WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPULimits { - uint32_t maxTextureDimension1D; - uint32_t maxTextureDimension2D; - uint32_t maxTextureDimension3D; - uint32_t maxTextureArrayLayers; - uint32_t maxBindGroups; - uint32_t maxBindGroupsPlusVertexBuffers; - uint32_t maxBindingsPerBindGroup; - uint32_t maxDynamicUniformBuffersPerPipelineLayout; - uint32_t maxDynamicStorageBuffersPerPipelineLayout; - uint32_t maxSampledTexturesPerShaderStage; - uint32_t maxSamplersPerShaderStage; - uint32_t maxStorageBuffersPerShaderStage; - uint32_t maxStorageTexturesPerShaderStage; - uint32_t maxUniformBuffersPerShaderStage; - uint64_t maxUniformBufferBindingSize; - uint64_t maxStorageBufferBindingSize; - uint32_t minUniformBufferOffsetAlignment; - uint32_t minStorageBufferOffsetAlignment; - uint32_t maxVertexBuffers; - uint64_t maxBufferSize; - uint32_t maxVertexAttributes; - uint32_t maxVertexBufferArrayStride; - uint32_t maxInterStageShaderComponents; - uint32_t maxInterStageShaderVariables; - uint32_t maxColorAttachments; - uint32_t maxColorAttachmentBytesPerSample; - uint32_t maxComputeWorkgroupStorageSize; - uint32_t maxComputeInvocationsPerWorkgroup; - uint32_t maxComputeWorkgroupSizeX; - uint32_t maxComputeWorkgroupSizeY; - uint32_t maxComputeWorkgroupSizeZ; - uint32_t maxComputeWorkgroupsPerDimension; -} WGPULimits WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUMultisampleState { - WGPUChainedStruct const * nextInChain; - uint32_t count; - uint32_t mask; - WGPUBool alphaToCoverageEnabled; -} WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUOrigin3D { - uint32_t x; - uint32_t y; - uint32_t z; -} WGPUOrigin3D WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUPipelineLayoutDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - size_t bindGroupLayoutCount; - WGPUBindGroupLayout const * bindGroupLayouts; -} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPUPrimitiveState -typedef struct WGPUPrimitiveDepthClipControl { - WGPUChainedStruct chain; - WGPUBool unclippedDepth; -} WGPUPrimitiveDepthClipControl WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUPrimitiveState { - WGPUChainedStruct const * nextInChain; - WGPUPrimitiveTopology topology; - WGPUIndexFormat stripIndexFormat; - WGPUFrontFace frontFace; - WGPUCullMode cullMode; -} WGPUPrimitiveState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUQuerySetDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUQueryType type; - uint32_t count; -} WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUQueueDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUQueueWorkDoneCallbackInfo { - WGPUChainedStruct const * nextInChain; - WGPUCallbackMode mode; - WGPUQueueWorkDoneCallback callback; - void * userdata; -} WGPUQueueWorkDoneCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderBundleDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPURenderBundleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderBundleEncoderDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - size_t colorFormatCount; - WGPUTextureFormat const * colorFormats; - WGPUTextureFormat depthStencilFormat; - uint32_t sampleCount; - WGPUBool depthReadOnly; - WGPUBool stencilReadOnly; -} WGPURenderBundleEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderPassDepthStencilAttachment { - WGPUTextureView view; - WGPULoadOp depthLoadOp; - WGPUStoreOp depthStoreOp; - float depthClearValue; - WGPUBool depthReadOnly; - WGPULoadOp stencilLoadOp; - WGPUStoreOp stencilStoreOp; - uint32_t stencilClearValue; - WGPUBool stencilReadOnly; -} WGPURenderPassDepthStencilAttachment WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPURenderPassDescriptorMaxDrawCount { - WGPUChainedStruct chain; - uint64_t maxDrawCount; -} WGPURenderPassDescriptorMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderPassTimestampWrites { - WGPUQuerySet querySet; - uint32_t beginningOfPassWriteIndex; - uint32_t endOfPassWriteIndex; -} WGPURenderPassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURequestAdapterCallbackInfo { - WGPUChainedStruct const * nextInChain; - WGPUCallbackMode mode; - WGPURequestAdapterCallback callback; - void * userdata; -} WGPURequestAdapterCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURequestAdapterOptions { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE WGPUSurface compatibleSurface; - WGPUPowerPreference powerPreference; - WGPUBackendType backendType; - WGPUBool forceFallbackAdapter; - WGPUBool compatibilityMode; -} WGPURequestAdapterOptions WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSamplerBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUSamplerBindingType type; -} WGPUSamplerBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSamplerDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUAddressMode addressModeU; - WGPUAddressMode addressModeV; - WGPUAddressMode addressModeW; - WGPUFilterMode magFilter; - WGPUFilterMode minFilter; - WGPUMipmapFilterMode mipmapFilter; - float lodMinClamp; - float lodMaxClamp; - WGPUCompareFunction compare; - uint16_t maxAnisotropy; -} WGPUSamplerDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUShaderModuleSPIRVDescriptor { - WGPUChainedStruct chain; - uint32_t codeSize; - uint32_t const * code; -} WGPUShaderModuleSPIRVDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUShaderModuleWGSLDescriptor { - WGPUChainedStruct chain; - char const * code; -} WGPUShaderModuleWGSLDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUShaderModuleDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUStencilFaceState { - WGPUCompareFunction compare; - WGPUStencilOperation failOp; - WGPUStencilOperation depthFailOp; - WGPUStencilOperation passOp; -} WGPUStencilFaceState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUStorageTextureBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUStorageTextureAccess access; - WGPUTextureFormat format; - WGPUTextureViewDimension viewDimension; -} WGPUStorageTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSurfaceCapabilities { - WGPUChainedStructOut * nextInChain; - size_t formatCount; - WGPUTextureFormat const * formats; - size_t presentModeCount; - WGPUPresentMode const * presentModes; - size_t alphaModeCount; - WGPUCompositeAlphaMode const * alphaModes; -} WGPUSurfaceCapabilities WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSurfaceConfiguration { - WGPUChainedStruct const * nextInChain; - WGPUDevice device; - WGPUTextureFormat format; - WGPUTextureUsageFlags usage; - size_t viewFormatCount; - WGPUTextureFormat const * viewFormats; - WGPUCompositeAlphaMode alphaMode; - uint32_t width; - uint32_t height; - WGPUPresentMode presentMode; -} WGPUSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSurfaceDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; -} WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { - WGPUChainedStruct chain; - char const * selector; -} WGPUSurfaceDescriptorFromCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSurfaceTexture { - WGPUTexture texture; - WGPUBool suboptimal; - WGPUSurfaceGetCurrentTextureStatus status; -} WGPUSurfaceTexture WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSwapChainDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureFormat format; - uint32_t width; - uint32_t height; - WGPUPresentMode presentMode; -} WGPUSwapChainDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUTextureBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUTextureSampleType sampleType; - WGPUTextureViewDimension viewDimension; - WGPUBool multisampled; -} WGPUTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -// Can be chained in WGPUTextureDescriptor -typedef struct WGPUTextureBindingViewDimensionDescriptor { - WGPUChainedStruct chain; - WGPUTextureViewDimension textureBindingViewDimension; -} WGPUTextureBindingViewDimensionDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUTextureDataLayout { - WGPUChainedStruct const * nextInChain; - uint64_t offset; - uint32_t bytesPerRow; - uint32_t rowsPerImage; -} WGPUTextureDataLayout WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUTextureViewDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUTextureFormat format; - WGPUTextureViewDimension dimension; - uint32_t baseMipLevel; - uint32_t mipLevelCount; - uint32_t baseArrayLayer; - uint32_t arrayLayerCount; - WGPUTextureAspect aspect; -} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUVertexAttribute { - WGPUVertexFormat format; - uint64_t offset; - uint32_t shaderLocation; -} WGPUVertexAttribute WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBindGroupDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUBindGroupLayout layout; - size_t entryCount; - WGPUBindGroupEntry const * entries; -} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBindGroupLayoutEntry { - WGPUChainedStruct const * nextInChain; - uint32_t binding; - WGPUShaderStageFlags visibility; - WGPUBufferBindingLayout buffer; - WGPUSamplerBindingLayout sampler; - WGPUTextureBindingLayout texture; - WGPUStorageTextureBindingLayout storageTexture; -} WGPUBindGroupLayoutEntry WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBlendState { - WGPUBlendComponent color; - WGPUBlendComponent alpha; -} WGPUBlendState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUCompilationInfo { - WGPUChainedStruct const * nextInChain; - size_t messageCount; - WGPUCompilationMessage const * messages; -} WGPUCompilationInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUComputePassDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPU_NULLABLE WGPUComputePassTimestampWrites const * timestampWrites; -} WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUDepthStencilState { - WGPUChainedStruct const * nextInChain; - WGPUTextureFormat format; - WGPUBool depthWriteEnabled; - WGPUCompareFunction depthCompare; - WGPUStencilFaceState stencilFront; - WGPUStencilFaceState stencilBack; - uint32_t stencilReadMask; - uint32_t stencilWriteMask; - int32_t depthBias; - float depthBiasSlopeScale; - float depthBiasClamp; -} WGPUDepthStencilState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUFutureWaitInfo { - WGPUFuture future; - WGPUBool completed; -} WGPUFutureWaitInfo WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUImageCopyBuffer { - WGPUChainedStruct const * nextInChain; - WGPUTextureDataLayout layout; - WGPUBuffer buffer; -} WGPUImageCopyBuffer WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUImageCopyTexture { - WGPUChainedStruct const * nextInChain; - WGPUTexture texture; - uint32_t mipLevel; - WGPUOrigin3D origin; - WGPUTextureAspect aspect; -} WGPUImageCopyTexture WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUInstanceDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUInstanceFeatures features; -} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUProgrammableStageDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - WGPU_NULLABLE char const * entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; -} WGPUProgrammableStageDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderPassColorAttachment { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE WGPUTextureView view; - uint32_t depthSlice; - WGPU_NULLABLE WGPUTextureView resolveTarget; - WGPULoadOp loadOp; - WGPUStoreOp storeOp; - WGPUColor clearValue; -} WGPURenderPassColorAttachment WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURequiredLimits { - WGPUChainedStruct const * nextInChain; - WGPULimits limits; -} WGPURequiredLimits WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUSupportedLimits { - WGPUChainedStructOut * nextInChain; - WGPULimits limits; -} WGPUSupportedLimits WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUTextureDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureDimension dimension; - WGPUExtent3D size; - WGPUTextureFormat format; - uint32_t mipLevelCount; - uint32_t sampleCount; - size_t viewFormatCount; - WGPUTextureFormat const * viewFormats; -} WGPUTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUVertexBufferLayout { - uint64_t arrayStride; - WGPUVertexStepMode stepMode; - size_t attributeCount; - WGPUVertexAttribute const * attributes; -} WGPUVertexBufferLayout WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBindGroupLayoutDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - size_t entryCount; - WGPUBindGroupLayoutEntry const * entries; -} WGPUBindGroupLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUColorTargetState { - WGPUChainedStruct const * nextInChain; - WGPUTextureFormat format; - WGPU_NULLABLE WGPUBlendState const * blend; - WGPUColorWriteMaskFlags writeMask; -} WGPUColorTargetState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUComputePipelineDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPU_NULLABLE WGPUPipelineLayout layout; - WGPUProgrammableStageDescriptor compute; -} WGPUComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUDeviceDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - size_t requiredFeatureCount; - WGPUFeatureName const * requiredFeatures; - WGPU_NULLABLE WGPURequiredLimits const * requiredLimits; - WGPUQueueDescriptor defaultQueue; - WGPUDeviceLostCallback deviceLostCallback; - void * deviceLostUserdata; -} WGPUDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderPassDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - size_t colorAttachmentCount; - WGPURenderPassColorAttachment const * colorAttachments; - WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; - WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; - WGPU_NULLABLE WGPURenderPassTimestampWrites const * timestampWrites; -} WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUVertexState { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - WGPU_NULLABLE char const * entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; - size_t bufferCount; - WGPUVertexBufferLayout const * buffers; -} WGPUVertexState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUFragmentState { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - WGPU_NULLABLE char const * entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; - size_t targetCount; - WGPUColorTargetState const * targets; -} WGPUFragmentState WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPURenderPipelineDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPU_NULLABLE WGPUPipelineLayout layout; - WGPUVertexState vertex; - WGPUPrimitiveState primitive; - WGPU_NULLABLE WGPUDepthStencilState const * depthStencil; - WGPUMultisampleState multisample; - WGPU_NULLABLE WGPUFragmentState const * fragment; -} WGPURenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#if defined(__cplusplus) && !defined(USE_WGPU_WAGYU_NAMESPACE) && !defined(__cppcheck) -extern "C" { -#endif - -#if !defined(WGPU_SKIP_PROCS) - -typedef void (*WGPUProcAdapterInfoFreeMembers)(WGPUAdapterInfo value) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterPropertiesFreeMembers)(WGPUAdapterProperties value) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcGetInstanceFeatures)(WGPUInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceCapabilitiesFreeMembers)(WGPUSurfaceCapabilities value) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Adapter -typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterGetInfo)(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of BindGroup -typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of BindGroupLayout -typedef void (*WGPUProcBindGroupLayoutSetLabel)(WGPUBindGroupLayout bindGroupLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Buffer -typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of CommandBuffer -typedef void (*WGPUProcCommandBufferSetLabel)(WGPUCommandBuffer commandBuffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of CommandEncoder -typedef WGPUComputePassEncoder (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderClearBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderSetLabel)(WGPUCommandEncoder commandEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ComputePassEncoder -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ComputePipeline -typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; - -// 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 WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceReference)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Instance -typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcInstanceHasWGSLLanguageFeature)(WGPUInstance instance, WGPUWGSLFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUWaitStatus (*WGPUProcInstanceWaitAny)(WGPUInstance instance, size_t futureCount, WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceReference)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of PipelineLayout -typedef void (*WGPUProcPipelineLayoutSetLabel)(WGPUPipelineLayout pipelineLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of QuerySet -typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcQuerySetGetCount)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQueryType (*WGPUProcQuerySetGetType)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Queue -typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueReference)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueRelease)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderBundle -typedef void (*WGPUProcRenderBundleSetLabel)(WGPURenderBundle renderBundle, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderBundleEncoder -typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetLabel)(WGPURenderBundleEncoder renderBundleEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderPassEncoder -typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetBlendConstant)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderWriteTimestamp)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderPipeline -typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Sampler -typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ShaderModule -typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Surface -typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureFormat (*WGPUProcSurfaceGetPreferredFormat)(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SwapChain -typedef WGPUTexture (*WGPUProcSwapChainGetCurrentTexture)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Texture -typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureDestroy)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetDepthOrArrayLayers)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureDimension (*WGPUProcTextureGetDimension)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureFormat (*WGPUProcTextureGetFormat)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetHeight)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureUsageFlags (*WGPUProcTextureGetUsage)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureReference)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureRelease)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of TextureView -typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureViewReference)(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 void wgpuAdapterInfoFreeMembers(WGPUAdapterInfo value) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterPropertiesFreeMembers(WGPUAdapterProperties value) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuGetInstanceFeatures(WGPUInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPU_NULLABLE WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities value) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Adapter -WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterGetInfo(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroup -WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroupLayout -WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Buffer -WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBufferUsageFlags wgpuBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandBuffer -WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandEncoder -WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePassEncoder -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; - -// 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 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 void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -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 WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of PipelineLayout -WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of QuerySet -WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Queue -WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundle -WGPU_EXPORT void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundleEncoder -WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPassEncoder -WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Sampler -WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ShaderModule -WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Surface -WGPU_EXPORT void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureFormat wgpuSurfaceGetPreferredFormat(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceUnconfigure(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SwapChain -WGPU_EXPORT WGPUTexture wgpuSwapChainGetCurrentTexture(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Texture -WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetDepthOrArrayLayers(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureDimension wgpuTextureGetDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureFormat wgpuTextureGetFormat(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetHeight(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureUsageFlags wgpuTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of TextureView -WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureViewReference(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) -} // extern "C" -#endif - -#if defined(USE_WGPU_WAGYU_NAMESPACE) || defined(__cppcheck) -} // namespace wagyu -#endif - -#endif // WEBGPU_H_ diff --git a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp.h b/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp.h deleted file mode 100644 index 046ee3952..000000000 --- a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp.h +++ /dev/null @@ -1,1895 +0,0 @@ -// Copyright 2024 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_CPP_H_ -#define WEBGPU_CPP_H_ - -#include "webgpu/webgpu.h" -#include "webgpu/webgpu_cpp_chained_struct.h" -#include "webgpu/webgpu_enum_class_bitmasks.h" -#include -#include -#include -#include - -namespace wgpu { - - namespace detail { - constexpr size_t ConstexprMax(size_t a, size_t b) { - return a > b ? a : b; - } - } // namespace detail - - static constexpr uint32_t kArrayLayerCountUndefined = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; - static constexpr uint32_t kCopyStrideUndefined = WGPU_COPY_STRIDE_UNDEFINED; - static constexpr uint32_t kDepthSliceUndefined = WGPU_DEPTH_SLICE_UNDEFINED; - static constexpr uint32_t kLimitU32Undefined = WGPU_LIMIT_U32_UNDEFINED; - static constexpr uint64_t kLimitU64Undefined = WGPU_LIMIT_U64_UNDEFINED; - static constexpr uint32_t kMipLevelCountUndefined = WGPU_MIP_LEVEL_COUNT_UNDEFINED; - static constexpr uint32_t kQuerySetIndexUndefined = WGPU_QUERY_SET_INDEX_UNDEFINED; - static constexpr size_t kWholeMapSize = WGPU_WHOLE_MAP_SIZE; - static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE; - - enum class WGSLFeatureName : uint32_t { - Undefined = 0x00000000, - ReadonlyAndReadwriteStorageTextures = 0x00000001, - Packed4x8IntegerDotProduct = 0x00000002, - UnrestrictedPointerParameters = 0x00000003, - PointerCompositeAccess = 0x00000004, - }; - - enum class AdapterType : uint32_t { - DiscreteGPU = 0x00000001, - IntegratedGPU = 0x00000002, - CPU = 0x00000003, - Unknown = 0x00000004, - }; - - enum class AddressMode : uint32_t { - Undefined = 0x00000000, - ClampToEdge = 0x00000001, - Repeat = 0x00000002, - MirrorRepeat = 0x00000003, - }; - - enum class BackendType : uint32_t { - Undefined = 0x00000000, - Null = 0x00000001, - WebGPU = 0x00000002, - D3D11 = 0x00000003, - D3D12 = 0x00000004, - Metal = 0x00000005, - Vulkan = 0x00000006, - OpenGL = 0x00000007, - OpenGLES = 0x00000008, - }; - - enum class BlendFactor : uint32_t { - Undefined = 0x00000000, - Zero = 0x00000001, - One = 0x00000002, - Src = 0x00000003, - OneMinusSrc = 0x00000004, - SrcAlpha = 0x00000005, - OneMinusSrcAlpha = 0x00000006, - Dst = 0x00000007, - OneMinusDst = 0x00000008, - DstAlpha = 0x00000009, - OneMinusDstAlpha = 0x0000000A, - SrcAlphaSaturated = 0x0000000B, - Constant = 0x0000000C, - OneMinusConstant = 0x0000000D, - }; - - enum class BlendOperation : uint32_t { - Undefined = 0x00000000, - Add = 0x00000001, - Subtract = 0x00000002, - ReverseSubtract = 0x00000003, - Min = 0x00000004, - Max = 0x00000005, - }; - - enum class BufferBindingType : uint32_t { - Undefined = 0x00000000, - Uniform = 0x00000001, - Storage = 0x00000002, - ReadOnlyStorage = 0x00000003, - }; - - enum class BufferMapAsyncStatus : uint32_t { - Success = 0x00000000, - ValidationError = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - DestroyedBeforeCallback = 0x00000004, - UnmappedBeforeCallback = 0x00000005, - MappingAlreadyPending = 0x00000006, - OffsetOutOfRange = 0x00000007, - SizeOutOfRange = 0x00000008, - }; - - enum class BufferMapState : uint32_t { - Unmapped = 0x00000001, - Pending = 0x00000002, - Mapped = 0x00000003, - }; - - enum class CallbackMode : uint32_t { - WaitAnyOnly = 0x00000000, - AllowProcessEvents = 0x00000001, - AllowSpontaneous = 0x00000002, - }; - - enum class CompareFunction : uint32_t { - Undefined = 0x00000000, - Never = 0x00000001, - Less = 0x00000002, - Equal = 0x00000003, - LessEqual = 0x00000004, - Greater = 0x00000005, - NotEqual = 0x00000006, - GreaterEqual = 0x00000007, - Always = 0x00000008, - }; - - enum class CompilationInfoRequestStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - DeviceLost = 0x00000002, - Unknown = 0x00000003, - }; - - enum class CompilationMessageType : uint32_t { - Error = 0x00000001, - Warning = 0x00000002, - Info = 0x00000003, - }; - - enum class CompositeAlphaMode : uint32_t { - Auto = 0x00000000, - Opaque = 0x00000001, - Premultiplied = 0x00000002, - Unpremultiplied = 0x00000003, - Inherit = 0x00000004, - }; - - enum class CreatePipelineAsyncStatus : uint32_t { - Success = 0x00000000, - ValidationError = 0x00000001, - InternalError = 0x00000002, - DeviceLost = 0x00000003, - DeviceDestroyed = 0x00000004, - Unknown = 0x00000005, - }; - - enum class CullMode : uint32_t { - Undefined = 0x00000000, - None = 0x00000001, - Front = 0x00000002, - Back = 0x00000003, - }; - - enum class DeviceLostReason : uint32_t { - Undefined = 0x00000001, - Unknown = 0x00000001, - Destroyed = 0x00000002, - }; - - enum class ErrorFilter : uint32_t { - Validation = 0x00000001, - OutOfMemory = 0x00000002, - Internal = 0x00000003, - }; - - enum class ErrorType : uint32_t { - NoError = 0x00000000, - Validation = 0x00000001, - OutOfMemory = 0x00000002, - Internal = 0x00000003, - Unknown = 0x00000004, - DeviceLost = 0x00000005, - }; - - enum class FeatureName : uint32_t { - Undefined = 0x00000000, - DepthClipControl = 0x00000001, - Depth32FloatStencil8 = 0x00000002, - TimestampQuery = 0x00000003, - TextureCompressionBC = 0x00000004, - TextureCompressionETC2 = 0x00000005, - TextureCompressionASTC = 0x00000006, - IndirectFirstInstance = 0x00000007, - ShaderF16 = 0x00000008, - RG11B10UfloatRenderable = 0x00000009, - BGRA8UnormStorage = 0x0000000A, - Float32Filterable = 0x0000000B, - }; - - enum class FilterMode : uint32_t { - Undefined = 0x00000000, - Nearest = 0x00000001, - Linear = 0x00000002, - }; - - enum class FrontFace : uint32_t { - Undefined = 0x00000000, - CCW = 0x00000001, - CW = 0x00000002, - }; - - enum class IndexFormat : uint32_t { - Undefined = 0x00000000, - Uint16 = 0x00000001, - Uint32 = 0x00000002, - }; - - enum class LoadOp : uint32_t { - Undefined = 0x00000000, - Clear = 0x00000001, - Load = 0x00000002, - }; - - enum class MipmapFilterMode : uint32_t { - Undefined = 0x00000000, - Nearest = 0x00000001, - Linear = 0x00000002, - }; - - enum class PowerPreference : uint32_t { - Undefined = 0x00000000, - LowPower = 0x00000001, - HighPerformance = 0x00000002, - }; - - enum class PresentMode : uint32_t { - Fifo = 0x00000001, - Immediate = 0x00000003, - Mailbox = 0x00000004, - }; - - enum class PrimitiveTopology : uint32_t { - Undefined = 0x00000000, - PointList = 0x00000001, - LineList = 0x00000002, - LineStrip = 0x00000003, - TriangleList = 0x00000004, - TriangleStrip = 0x00000005, - }; - - enum class QueryType : uint32_t { - Occlusion = 0x00000001, - Timestamp = 0x00000002, - }; - - enum class QueueWorkDoneStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - }; - - enum class RequestAdapterStatus : uint32_t { - Success = 0x00000000, - Unavailable = 0x00000001, - Error = 0x00000002, - Unknown = 0x00000003, - }; - - enum class RequestDeviceStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - }; - - enum class SType : uint32_t { - Invalid = 0x00000000, - SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - ShaderModuleSPIRVDescriptor = 0x00000005, - ShaderModuleWGSLDescriptor = 0x00000006, - PrimitiveDepthClipControl = 0x00000007, - RenderPassDescriptorMaxDrawCount = 0x0000000F, - TextureBindingViewDimensionDescriptor = 0x00000011, - }; - - enum class SamplerBindingType : uint32_t { - Undefined = 0x00000000, - Filtering = 0x00000001, - NonFiltering = 0x00000002, - Comparison = 0x00000003, - }; - - enum class StencilOperation : uint32_t { - Undefined = 0x00000000, - Keep = 0x00000001, - Zero = 0x00000002, - Replace = 0x00000003, - Invert = 0x00000004, - IncrementClamp = 0x00000005, - DecrementClamp = 0x00000006, - IncrementWrap = 0x00000007, - DecrementWrap = 0x00000008, - }; - - enum class StorageTextureAccess : uint32_t { - Undefined = 0x00000000, - WriteOnly = 0x00000001, - ReadOnly = 0x00000002, - ReadWrite = 0x00000003, - }; - - enum class StoreOp : uint32_t { - Undefined = 0x00000000, - Store = 0x00000001, - Discard = 0x00000002, - }; - - enum class SurfaceGetCurrentTextureStatus : uint32_t { - Success = WGPUSurfaceGetCurrentTextureStatus_Success, - Timeout = WGPUSurfaceGetCurrentTextureStatus_Timeout, - Outdated = WGPUSurfaceGetCurrentTextureStatus_Outdated, - Lost = WGPUSurfaceGetCurrentTextureStatus_Lost, - OutOfMemory = WGPUSurfaceGetCurrentTextureStatus_OutOfMemory, - DeviceLost = WGPUSurfaceGetCurrentTextureStatus_DeviceLost, - }; - - enum class TextureAspect : uint32_t { - Undefined = 0x00000000, - All = 0x00000001, - StencilOnly = 0x00000002, - DepthOnly = 0x00000003, - }; - - enum class TextureDimension : uint32_t { - Undefined = 0x00000000, - e1D = 0x00000001, - e2D = 0x00000002, - e3D = 0x00000003, - }; - - enum class TextureFormat : uint32_t { - Undefined = 0x00000000, - R8Unorm = 0x00000001, - R8Snorm = 0x00000002, - R8Uint = 0x00000003, - R8Sint = 0x00000004, - R16Uint = 0x00000005, - R16Sint = 0x00000006, - R16Float = 0x00000007, - RG8Unorm = 0x00000008, - RG8Snorm = 0x00000009, - RG8Uint = 0x0000000A, - RG8Sint = 0x0000000B, - R32Float = 0x0000000C, - R32Uint = 0x0000000D, - R32Sint = 0x0000000E, - RG16Uint = 0x0000000F, - RG16Sint = 0x00000010, - RG16Float = 0x00000011, - RGBA8Unorm = 0x00000012, - RGBA8UnormSrgb = 0x00000013, - RGBA8Snorm = 0x00000014, - RGBA8Uint = 0x00000015, - RGBA8Sint = 0x00000016, - BGRA8Unorm = 0x00000017, - BGRA8UnormSrgb = 0x00000018, - RGB10A2Uint = 0x00000019, - RGB10A2Unorm = 0x0000001A, - RG11B10Ufloat = 0x0000001B, - RGB9E5Ufloat = 0x0000001C, - RG32Float = 0x0000001D, - RG32Uint = 0x0000001E, - RG32Sint = 0x0000001F, - RGBA16Uint = 0x00000020, - RGBA16Sint = 0x00000021, - RGBA16Float = 0x00000022, - RGBA32Float = 0x00000023, - RGBA32Uint = 0x00000024, - RGBA32Sint = 0x00000025, - Stencil8 = 0x00000026, - Depth16Unorm = 0x00000027, - Depth24Plus = 0x00000028, - Depth24PlusStencil8 = 0x00000029, - Depth32Float = 0x0000002A, - Depth32FloatStencil8 = 0x0000002B, - BC1RGBAUnorm = 0x0000002C, - BC1RGBAUnormSrgb = 0x0000002D, - BC2RGBAUnorm = 0x0000002E, - BC2RGBAUnormSrgb = 0x0000002F, - BC3RGBAUnorm = 0x00000030, - BC3RGBAUnormSrgb = 0x00000031, - BC4RUnorm = 0x00000032, - BC4RSnorm = 0x00000033, - BC5RGUnorm = 0x00000034, - BC5RGSnorm = 0x00000035, - BC6HRGBUfloat = 0x00000036, - BC6HRGBFloat = 0x00000037, - BC7RGBAUnorm = 0x00000038, - BC7RGBAUnormSrgb = 0x00000039, - ETC2RGB8Unorm = 0x0000003A, - ETC2RGB8UnormSrgb = 0x0000003B, - ETC2RGB8A1Unorm = 0x0000003C, - ETC2RGB8A1UnormSrgb = 0x0000003D, - ETC2RGBA8Unorm = 0x0000003E, - ETC2RGBA8UnormSrgb = 0x0000003F, - EACR11Unorm = 0x00000040, - EACR11Snorm = 0x00000041, - EACRG11Unorm = 0x00000042, - EACRG11Snorm = 0x00000043, - ASTC4x4Unorm = 0x00000044, - ASTC4x4UnormSrgb = 0x00000045, - ASTC5x4Unorm = 0x00000046, - ASTC5x4UnormSrgb = 0x00000047, - ASTC5x5Unorm = 0x00000048, - ASTC5x5UnormSrgb = 0x00000049, - ASTC6x5Unorm = 0x0000004A, - ASTC6x5UnormSrgb = 0x0000004B, - ASTC6x6Unorm = 0x0000004C, - ASTC6x6UnormSrgb = 0x0000004D, - ASTC8x5Unorm = 0x0000004E, - ASTC8x5UnormSrgb = 0x0000004F, - ASTC8x6Unorm = 0x00000050, - ASTC8x6UnormSrgb = 0x00000051, - ASTC8x8Unorm = 0x00000052, - ASTC8x8UnormSrgb = 0x00000053, - ASTC10x5Unorm = 0x00000054, - ASTC10x5UnormSrgb = 0x00000055, - ASTC10x6Unorm = 0x00000056, - ASTC10x6UnormSrgb = 0x00000057, - ASTC10x8Unorm = 0x00000058, - ASTC10x8UnormSrgb = 0x00000059, - ASTC10x10Unorm = 0x0000005A, - ASTC10x10UnormSrgb = 0x0000005B, - ASTC12x10Unorm = 0x0000005C, - ASTC12x10UnormSrgb = 0x0000005D, - ASTC12x12Unorm = 0x0000005E, - ASTC12x12UnormSrgb = 0x0000005F, - }; - - enum class TextureSampleType : uint32_t { - Undefined = 0x00000000, - Float = 0x00000001, - UnfilterableFloat = 0x00000002, - Depth = 0x00000003, - Sint = 0x00000004, - Uint = 0x00000005, - }; - - enum class TextureViewDimension : uint32_t { - Undefined = 0x00000000, - e1D = 0x00000001, - e2D = 0x00000002, - e2DArray = 0x00000003, - Cube = 0x00000004, - CubeArray = 0x00000005, - e3D = 0x00000006, - }; - - enum class VertexFormat : uint32_t { - Undefined = 0x00000000, - Uint8x2 = 0x00000001, - Uint8x4 = 0x00000002, - Sint8x2 = 0x00000003, - Sint8x4 = 0x00000004, - Unorm8x2 = 0x00000005, - Unorm8x4 = 0x00000006, - Snorm8x2 = 0x00000007, - Snorm8x4 = 0x00000008, - Uint16x2 = 0x00000009, - Uint16x4 = 0x0000000A, - Sint16x2 = 0x0000000B, - Sint16x4 = 0x0000000C, - Unorm16x2 = 0x0000000D, - Unorm16x4 = 0x0000000E, - Snorm16x2 = 0x0000000F, - Snorm16x4 = 0x00000010, - Float16x2 = 0x00000011, - Float16x4 = 0x00000012, - Float32 = 0x00000013, - Float32x2 = 0x00000014, - Float32x3 = 0x00000015, - Float32x4 = 0x00000016, - Uint32 = 0x00000017, - Uint32x2 = 0x00000018, - Uint32x3 = 0x00000019, - Uint32x4 = 0x0000001A, - Sint32 = 0x0000001B, - Sint32x2 = 0x0000001C, - Sint32x3 = 0x0000001D, - Sint32x4 = 0x0000001E, - Unorm10_10_10_2 = 0x0000001F, - }; - - enum class VertexStepMode : uint32_t { - Undefined = 0x00000000, - VertexBufferNotUsed = 0x00000001, - Vertex = 0x00000002, - Instance = 0x00000003, - }; - - enum class WaitStatus : uint32_t { - Success = 0x00000000, - TimedOut = 0x00000001, - UnsupportedTimeout = 0x00000002, - UnsupportedCount = 0x00000003, - UnsupportedMixedSources = 0x00000004, - Unknown = 0x00000005, - }; - - - enum class BufferUsage : uint32_t { - None = 0x00000000, - MapRead = 0x00000001, - MapWrite = 0x00000002, - CopySrc = 0x00000004, - CopyDst = 0x00000008, - Index = 0x00000010, - Vertex = 0x00000020, - Uniform = 0x00000040, - Storage = 0x00000080, - Indirect = 0x00000100, - QueryResolve = 0x00000200, - }; - - enum class ColorWriteMask : uint32_t { - None = 0x00000000, - Red = 0x00000001, - Green = 0x00000002, - Blue = 0x00000004, - Alpha = 0x00000008, - All = 0x0000000F, - }; - - enum class MapMode : uint32_t { - None = 0x00000000, - Read = 0x00000001, - Write = 0x00000002, - }; - - enum class ShaderStage : uint32_t { - None = 0x00000000, - Vertex = 0x00000001, - Fragment = 0x00000002, - Compute = 0x00000004, - }; - - enum class TextureUsage : uint32_t { - None = 0x00000000, - CopySrc = 0x00000001, - CopyDst = 0x00000002, - TextureBinding = 0x00000004, - StorageBinding = 0x00000008, - RenderAttachment = 0x00000010, - }; - - - using BufferMapCallback = WGPUBufferMapCallback; - using CompilationInfoCallback = WGPUCompilationInfoCallback; - using CreateComputePipelineAsyncCallback = WGPUCreateComputePipelineAsyncCallback; - using CreateRenderPipelineAsyncCallback = WGPUCreateRenderPipelineAsyncCallback; - using DeviceLostCallback = WGPUDeviceLostCallback; - using ErrorCallback = WGPUErrorCallback; - using Proc = WGPUProc; - using QueueWorkDoneCallback = WGPUQueueWorkDoneCallback; - using RequestAdapterCallback = WGPURequestAdapterCallback; - using RequestDeviceCallback = WGPURequestDeviceCallback; - - class Adapter; - class BindGroup; - class BindGroupLayout; - class Buffer; - class CommandBuffer; - class CommandEncoder; - class ComputePassEncoder; - class ComputePipeline; - class Device; - class Instance; - class PipelineLayout; - class QuerySet; - class Queue; - class RenderBundle; - class RenderBundleEncoder; - class RenderPassEncoder; - class RenderPipeline; - class Sampler; - class ShaderModule; - class Surface; - class SwapChain; - class Texture; - class TextureView; - - struct AdapterInfo; - struct AdapterProperties; - struct BindGroupEntry; - struct BlendComponent; - struct BufferBindingLayout; - struct BufferDescriptor; - struct BufferMapCallbackInfo; - struct Color; - struct CommandBufferDescriptor; - struct CommandEncoderDescriptor; - struct CompilationMessage; - struct ComputePassTimestampWrites; - struct ConstantEntry; - struct Extent3D; - struct Future; - struct InstanceFeatures; - struct Limits; - struct MultisampleState; - struct Origin3D; - struct PipelineLayoutDescriptor; - struct PrimitiveDepthClipControl; - struct PrimitiveState; - struct QuerySetDescriptor; - struct QueueDescriptor; - struct QueueWorkDoneCallbackInfo; - struct RenderBundleDescriptor; - struct RenderBundleEncoderDescriptor; - struct RenderPassDepthStencilAttachment; - struct RenderPassDescriptorMaxDrawCount; - struct RenderPassTimestampWrites; - struct RequestAdapterCallbackInfo; - struct RequestAdapterOptions; - struct SamplerBindingLayout; - struct SamplerDescriptor; - struct ShaderModuleSPIRVDescriptor; - struct ShaderModuleWGSLDescriptor; - struct ShaderModuleDescriptor; - struct StencilFaceState; - struct StorageTextureBindingLayout; - struct SurfaceCapabilities; - struct SurfaceConfiguration; - struct SurfaceDescriptor; - struct SurfaceDescriptorFromCanvasHTMLSelector; - struct SurfaceTexture; - struct SwapChainDescriptor; - struct TextureBindingLayout; - struct TextureBindingViewDimensionDescriptor; - struct TextureDataLayout; - struct TextureViewDescriptor; - struct VertexAttribute; - struct BindGroupDescriptor; - struct BindGroupLayoutEntry; - struct BlendState; - struct CompilationInfo; - struct ComputePassDescriptor; - struct DepthStencilState; - struct FutureWaitInfo; - struct ImageCopyBuffer; - struct ImageCopyTexture; - struct InstanceDescriptor; - struct ProgrammableStageDescriptor; - struct RenderPassColorAttachment; - struct RequiredLimits; - struct SupportedLimits; - struct TextureDescriptor; - struct VertexBufferLayout; - struct BindGroupLayoutDescriptor; - struct ColorTargetState; - struct ComputePipelineDescriptor; - struct DeviceDescriptor; - struct RenderPassDescriptor; - struct VertexState; - struct FragmentState; - struct RenderPipelineDescriptor; - - - // Special class for booleans in order to allow implicit conversions. - class Bool { - public: - constexpr Bool() = default; - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr Bool(bool value) : mValue(static_cast(value)) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - Bool(WGPUBool value): mValue(value) {} - - constexpr operator bool() const { return static_cast(mValue); } - - private: - friend struct std::hash; - // Default to false. - WGPUBool mValue = static_cast(false); - }; - - template - class ObjectBase { - public: - ObjectBase() = default; - ObjectBase(CType handle): mHandle(handle) { - if (mHandle) Derived::WGPUReference(mHandle); - } - ~ObjectBase() { - if (mHandle) Derived::WGPURelease(mHandle); - } - - ObjectBase(ObjectBase const& other) - : ObjectBase(other.Get()) { - } - Derived& operator=(ObjectBase const& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - if (mHandle) Derived::WGPUReference(mHandle); - } - - return static_cast(*this); - } - - ObjectBase(ObjectBase&& other) { - mHandle = other.mHandle; - other.mHandle = 0; - } - Derived& operator=(ObjectBase&& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - other.mHandle = 0; - } - - return static_cast(*this); - } - - ObjectBase(std::nullptr_t) {} - Derived& operator=(std::nullptr_t) { - if (mHandle != nullptr) { - Derived::WGPURelease(mHandle); - mHandle = nullptr; - } - return static_cast(*this); - } - - bool operator==(std::nullptr_t) const { - return mHandle == nullptr; - } - bool operator!=(std::nullptr_t) const { - return mHandle != nullptr; - } - - explicit operator bool() const { - return mHandle != nullptr; - } - CType Get() const { - return mHandle; - } - CType MoveToCHandle() { - CType result = mHandle; - mHandle = 0; - return result; - } - static Derived Acquire(CType handle) { - Derived result; - result.mHandle = handle; - return result; - } - - protected: - CType mHandle = nullptr; - }; - - - - class Adapter : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - size_t EnumerateFeatures(FeatureName * features) const; - void GetInfo(AdapterInfo * info) const; - Bool GetLimits(SupportedLimits * limits) const; - void GetProperties(AdapterProperties * properties) const; - Bool HasFeature(FeatureName feature) const; - void RequestDevice(DeviceDescriptor const * descriptor, RequestDeviceCallback callback, void * userdata) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUAdapter handle); - static void WGPURelease(WGPUAdapter handle); - }; - - class BindGroup : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUBindGroup handle); - static void WGPURelease(WGPUBindGroup handle); - }; - - class BindGroupLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUBindGroupLayout handle); - static void WGPURelease(WGPUBindGroupLayout handle); - }; - - class Buffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Destroy() const; - void const * GetConstMappedRange(size_t offset = 0, size_t size = WGPU_WHOLE_MAP_SIZE) const; - BufferMapState GetMapState() const; - void * GetMappedRange(size_t offset = 0, size_t size = WGPU_WHOLE_MAP_SIZE) const; - uint64_t GetSize() const; - BufferUsage GetUsage() const; - void MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallback callback, void * userdata) const; - void SetLabel(char const * label) const; - void Unmap() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUBuffer handle); - static void WGPURelease(WGPUBuffer handle); - }; - - class CommandBuffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUCommandBuffer handle); - static void WGPURelease(WGPUCommandBuffer handle); - }; - - class CommandEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - ComputePassEncoder BeginComputePass(ComputePassDescriptor const * descriptor = nullptr) const; - RenderPassEncoder BeginRenderPass(RenderPassDescriptor const * descriptor) const; - void ClearBuffer(Buffer const& buffer, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; - void CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const; - void CopyBufferToTexture(ImageCopyBuffer const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const; - void CopyTextureToBuffer(ImageCopyTexture const * source, ImageCopyBuffer const * destination, Extent3D const * copySize) const; - void CopyTextureToTexture(ImageCopyTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const; - CommandBuffer Finish(CommandBufferDescriptor const * descriptor = nullptr) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const; - void SetLabel(char const * label) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUCommandEncoder handle); - static void WGPURelease(WGPUCommandEncoder handle); - }; - - class ComputePassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const; - void DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void End() const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetLabel(char const * label) const; - void SetPipeline(ComputePipeline const& pipeline) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUComputePassEncoder handle); - static void WGPURelease(WGPUComputePassEncoder handle); - }; - - class ComputePipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUComputePipeline handle); - static void WGPURelease(WGPUComputePipeline handle); - }; - - class Device : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroup CreateBindGroup(BindGroupDescriptor const * descriptor) const; - BindGroupLayout CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const; - Buffer CreateBuffer(BufferDescriptor const * descriptor) const; - CommandEncoder CreateCommandEncoder(CommandEncoderDescriptor const * descriptor = nullptr) const; - ComputePipeline CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const; - void CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CreateComputePipelineAsyncCallback callback, void * userdata) const; - PipelineLayout CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const; - QuerySet CreateQuerySet(QuerySetDescriptor const * descriptor) const; - RenderBundleEncoder CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const; - RenderPipeline CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const; - void CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CreateRenderPipelineAsyncCallback callback, void * userdata) const; - Sampler CreateSampler(SamplerDescriptor const * descriptor = nullptr) const; - ShaderModule CreateShaderModule(ShaderModuleDescriptor const * descriptor) const; - SwapChain CreateSwapChain(Surface const& surface, SwapChainDescriptor const * descriptor) const; - Texture CreateTexture(TextureDescriptor const * descriptor) const; - void Destroy() const; - size_t EnumerateFeatures(FeatureName * features) const; - Bool GetLimits(SupportedLimits * limits) const; - Queue GetQueue() const; - Bool HasFeature(FeatureName feature) const; - void PopErrorScope(ErrorCallback callback, void * userdata) const; - void PushErrorScope(ErrorFilter filter) const; - void SetLabel(char const * label) const; - void SetUncapturedErrorCallback(ErrorCallback callback, void * userdata) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUDevice handle); - static void WGPURelease(WGPUDevice handle); - }; - - class Instance : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - Surface CreateSurface(SurfaceDescriptor const * descriptor) const; - Bool HasWGSLLanguageFeature(WGSLFeatureName feature) const; - void ProcessEvents() const; - void RequestAdapter(RequestAdapterOptions const * options, RequestAdapterCallback callback, void * userdata) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUInstance handle); - static void WGPURelease(WGPUInstance handle); - }; - - class PipelineLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUPipelineLayout handle); - static void WGPURelease(WGPUPipelineLayout handle); - }; - - class QuerySet : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Destroy() const; - uint32_t GetCount() const; - QueryType GetType() const; - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUQuerySet handle); - static void WGPURelease(WGPUQuerySet handle); - }; - - class Queue : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void OnSubmittedWorkDone(QueueWorkDoneCallback callback, void * userdata) const; - void SetLabel(char const * label) const; - void Submit(size_t commandCount, CommandBuffer const * commands) const; - void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const; - void WriteTexture(ImageCopyTexture const * destination, void const * data, size_t dataSize, TextureDataLayout const * dataLayout, Extent3D const * writeSize) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUQueue handle); - static void WGPURelease(WGPUQueue handle); - }; - - class RenderBundle : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderBundle handle); - static void WGPURelease(WGPURenderBundle handle); - }; - - class RenderBundleEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - RenderBundle Finish(RenderBundleDescriptor const * descriptor = nullptr) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; - void SetLabel(char const * label) const; - void SetPipeline(RenderPipeline const& pipeline) const; - void SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderBundleEncoder handle); - static void WGPURelease(WGPURenderBundleEncoder handle); - }; - - class RenderPassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void BeginOcclusionQuery(uint32_t queryIndex) const; - void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void End() const; - void EndOcclusionQuery() const; - void ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetBlendConstant(Color const * color) const; - void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; - void SetLabel(char const * label) const; - void SetPipeline(RenderPipeline const& pipeline) const; - void SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; - void SetStencilReference(uint32_t reference) const; - void SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; - void SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderPassEncoder handle); - static void WGPURelease(WGPURenderPassEncoder handle); - }; - - class RenderPipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderPipeline handle); - static void WGPURelease(WGPURenderPipeline handle); - }; - - class Sampler : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUSampler handle); - static void WGPURelease(WGPUSampler handle); - }; - - class ShaderModule : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void GetCompilationInfo(CompilationInfoCallback callback, void * userdata) const; - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUShaderModule handle); - static void WGPURelease(WGPUShaderModule handle); - }; - - class Surface : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Configure(SurfaceConfiguration const * config) const; - void GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const; - void GetCurrentTexture(SurfaceTexture * surfaceTexture) const; - TextureFormat GetPreferredFormat(Adapter const& adapter) const; - void Present() const; - void Unconfigure() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUSurface handle); - static void WGPURelease(WGPUSurface handle); - }; - - class SwapChain : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - Texture GetCurrentTexture() const; - TextureView GetCurrentTextureView() const; - void Present() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUSwapChain handle); - static void WGPURelease(WGPUSwapChain handle); - }; - - class Texture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - TextureView CreateView(TextureViewDescriptor const * descriptor = nullptr) const; - void Destroy() const; - uint32_t GetDepthOrArrayLayers() const; - TextureDimension GetDimension() const; - TextureFormat GetFormat() const; - uint32_t GetHeight() const; - uint32_t GetMipLevelCount() const; - uint32_t GetSampleCount() const; - TextureUsage GetUsage() const; - uint32_t GetWidth() const; - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUTexture handle); - static void WGPURelease(WGPUTexture handle); - }; - - class TextureView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void SetLabel(char const * label) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUTextureView handle); - static void WGPURelease(WGPUTextureView handle); - }; - - - Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr); - Bool GetInstanceFeatures(InstanceFeatures * features); - Proc GetProcAddress(Device device, char const * procName); - - struct AdapterInfo { - AdapterInfo() = default; - ~AdapterInfo(); - AdapterInfo(const AdapterInfo&) = delete; - AdapterInfo& operator=(const AdapterInfo&) = delete; - AdapterInfo(AdapterInfo&&); - AdapterInfo& operator=(AdapterInfo&&); - ChainedStructOut * nextInChain = nullptr; - char const * const vendor = nullptr; - char const * const architecture = nullptr; - char const * const device = nullptr; - char const * const description = nullptr; - BackendType const backendType = {}; - AdapterType const adapterType = {}; - uint32_t const vendorID = {}; - uint32_t const deviceID = {}; - }; - - struct AdapterProperties { - AdapterProperties() = default; - ~AdapterProperties(); - AdapterProperties(const AdapterProperties&) = delete; - AdapterProperties& operator=(const AdapterProperties&) = delete; - AdapterProperties(AdapterProperties&&); - AdapterProperties& operator=(AdapterProperties&&); - ChainedStructOut * nextInChain = nullptr; - uint32_t const vendorID = {}; - char const * const vendorName = nullptr; - char const * const architecture = nullptr; - uint32_t const deviceID = {}; - char const * const name = nullptr; - char const * const driverDescription = nullptr; - AdapterType const adapterType = {}; - BackendType const backendType = {}; - Bool const compatibilityMode = false; - }; - - struct BindGroupEntry { - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size = WGPU_WHOLE_SIZE; - Sampler sampler = nullptr; - TextureView textureView = nullptr; - }; - - struct BlendComponent { - BlendOperation operation = BlendOperation::Add; - BlendFactor srcFactor = BlendFactor::One; - BlendFactor dstFactor = BlendFactor::Zero; - }; - - struct BufferBindingLayout { - ChainedStruct const * nextInChain = nullptr; - BufferBindingType type = BufferBindingType::Undefined; - Bool hasDynamicOffset = false; - uint64_t minBindingSize = 0; - }; - - struct BufferDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - BufferUsage usage; - uint64_t size; - Bool mappedAtCreation = false; - }; - - struct BufferMapCallbackInfo { - ChainedStruct const * nextInChain = nullptr; - CallbackMode mode; - BufferMapCallback callback; - void * userdata; - }; - - struct Color { - double r; - double g; - double b; - double a; - }; - - struct CommandBufferDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct CommandEncoderDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct CompilationMessage { - ChainedStruct const * nextInChain = nullptr; - char const * message = nullptr; - CompilationMessageType type; - uint64_t lineNum; - uint64_t linePos; - uint64_t offset; - uint64_t length; - uint64_t utf16LinePos; - uint64_t utf16Offset; - uint64_t utf16Length; - }; - - struct ComputePassTimestampWrites { - QuerySet querySet; - uint32_t beginningOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; - uint32_t endOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; - }; - - struct ConstantEntry { - ChainedStruct const * nextInChain = nullptr; - char const * key; - double value; - }; - - struct Extent3D { - uint32_t width; - uint32_t height = 1; - uint32_t depthOrArrayLayers = 1; - }; - - struct Future { - uint64_t id; - }; - - struct InstanceFeatures { - ChainedStruct const * nextInChain = nullptr; - Bool timedWaitAnyEnable = false; - size_t timedWaitAnyMaxCount = 0; - }; - - struct Limits { - uint32_t maxTextureDimension1D = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxTextureDimension2D = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxTextureDimension3D = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxTextureArrayLayers = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxBindGroups = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxBindGroupsPlusVertexBuffers = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxBindingsPerBindGroup = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxDynamicUniformBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxDynamicStorageBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxSampledTexturesPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxSamplersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxStorageBuffersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxStorageTexturesPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxUniformBuffersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - uint64_t maxUniformBufferBindingSize = WGPU_LIMIT_U64_UNDEFINED; - uint64_t maxStorageBufferBindingSize = WGPU_LIMIT_U64_UNDEFINED; - uint32_t minUniformBufferOffsetAlignment = WGPU_LIMIT_U32_UNDEFINED; - uint32_t minStorageBufferOffsetAlignment = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxVertexBuffers = WGPU_LIMIT_U32_UNDEFINED; - uint64_t maxBufferSize = WGPU_LIMIT_U64_UNDEFINED; - uint32_t maxVertexAttributes = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxVertexBufferArrayStride = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxInterStageShaderComponents = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxInterStageShaderVariables = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxColorAttachments = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxColorAttachmentBytesPerSample = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeWorkgroupStorageSize = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeInvocationsPerWorkgroup = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeWorkgroupSizeX = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeWorkgroupSizeY = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeWorkgroupSizeZ = WGPU_LIMIT_U32_UNDEFINED; - uint32_t maxComputeWorkgroupsPerDimension = WGPU_LIMIT_U32_UNDEFINED; - }; - - struct MultisampleState { - ChainedStruct const * nextInChain = nullptr; - uint32_t count = 1; - uint32_t mask = 0xFFFFFFFF; - Bool alphaToCoverageEnabled = false; - }; - - struct Origin3D { - uint32_t x = 0; - uint32_t y = 0; - uint32_t z = 0; - }; - - struct PipelineLayoutDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - size_t bindGroupLayoutCount; - BindGroupLayout const * bindGroupLayouts; - }; - - // Can be chained in PrimitiveState - struct PrimitiveDepthClipControl : ChainedStruct { - PrimitiveDepthClipControl() { - sType = SType::PrimitiveDepthClipControl; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); - alignas(kFirstMemberAlignment) Bool unclippedDepth = false; - }; - - struct PrimitiveState { - ChainedStruct const * nextInChain = nullptr; - PrimitiveTopology topology = PrimitiveTopology::TriangleList; - IndexFormat stripIndexFormat = IndexFormat::Undefined; - FrontFace frontFace = FrontFace::CCW; - CullMode cullMode = CullMode::None; - }; - - struct QuerySetDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - QueryType type; - uint32_t count; - }; - - struct QueueDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct QueueWorkDoneCallbackInfo { - ChainedStruct const * nextInChain = nullptr; - CallbackMode mode; - QueueWorkDoneCallback callback; - void * userdata; - }; - - struct RenderBundleDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct RenderBundleEncoderDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - size_t colorFormatCount; - TextureFormat const * colorFormats; - TextureFormat depthStencilFormat = TextureFormat::Undefined; - uint32_t sampleCount = 1; - Bool depthReadOnly = false; - Bool stencilReadOnly = false; - }; - - struct RenderPassDepthStencilAttachment { - TextureView view; - LoadOp depthLoadOp = LoadOp::Undefined; - StoreOp depthStoreOp = StoreOp::Undefined; - float depthClearValue = NAN; - Bool depthReadOnly = false; - LoadOp stencilLoadOp = LoadOp::Undefined; - StoreOp stencilStoreOp = StoreOp::Undefined; - uint32_t stencilClearValue = 0; - Bool stencilReadOnly = false; - }; - - // Can be chained in RenderPassDescriptor - struct RenderPassDescriptorMaxDrawCount : ChainedStruct { - RenderPassDescriptorMaxDrawCount() { - sType = SType::RenderPassDescriptorMaxDrawCount; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t )); - alignas(kFirstMemberAlignment) uint64_t maxDrawCount = 50000000; - }; - - struct RenderPassTimestampWrites { - QuerySet querySet; - uint32_t beginningOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; - uint32_t endOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; - }; - - struct RequestAdapterCallbackInfo { - ChainedStruct const * nextInChain = nullptr; - CallbackMode mode; - RequestAdapterCallback callback; - void * userdata; - }; - - struct RequestAdapterOptions { - ChainedStruct const * nextInChain = nullptr; - Surface compatibleSurface = nullptr; - PowerPreference powerPreference = PowerPreference::Undefined; - BackendType backendType = BackendType::Undefined; - Bool forceFallbackAdapter = false; - Bool compatibilityMode = false; - }; - - struct SamplerBindingLayout { - ChainedStruct const * nextInChain = nullptr; - SamplerBindingType type = SamplerBindingType::Undefined; - }; - - struct SamplerDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - AddressMode addressModeU = AddressMode::ClampToEdge; - AddressMode addressModeV = AddressMode::ClampToEdge; - AddressMode addressModeW = AddressMode::ClampToEdge; - FilterMode magFilter = FilterMode::Nearest; - FilterMode minFilter = FilterMode::Nearest; - MipmapFilterMode mipmapFilter = MipmapFilterMode::Nearest; - float lodMinClamp = 0.0f; - float lodMaxClamp = 32.0f; - CompareFunction compare = CompareFunction::Undefined; - uint16_t maxAnisotropy = 1; - }; - - // Can be chained in ShaderModuleDescriptor - struct ShaderModuleSPIRVDescriptor : ChainedStruct { - ShaderModuleSPIRVDescriptor() { - sType = SType::ShaderModuleSPIRVDescriptor; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); - alignas(kFirstMemberAlignment) uint32_t codeSize; - uint32_t const * code; - }; - - // Can be chained in ShaderModuleDescriptor - struct ShaderModuleWGSLDescriptor : ChainedStruct { - ShaderModuleWGSLDescriptor() { - sType = SType::ShaderModuleWGSLDescriptor; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(char const * )); - alignas(kFirstMemberAlignment) char const * code; - }; - - struct ShaderModuleDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct StencilFaceState { - CompareFunction compare = CompareFunction::Always; - StencilOperation failOp = StencilOperation::Keep; - StencilOperation depthFailOp = StencilOperation::Keep; - StencilOperation passOp = StencilOperation::Keep; - }; - - struct StorageTextureBindingLayout { - ChainedStruct const * nextInChain = nullptr; - StorageTextureAccess access = StorageTextureAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::e2D; - }; - - struct SurfaceCapabilities { - SurfaceCapabilities() = default; - ~SurfaceCapabilities(); - SurfaceCapabilities(const SurfaceCapabilities&) = delete; - SurfaceCapabilities& operator=(const SurfaceCapabilities&) = delete; - SurfaceCapabilities(SurfaceCapabilities&&); - SurfaceCapabilities& operator=(SurfaceCapabilities&&); - ChainedStructOut * nextInChain = nullptr; - size_t const formatCount = {}; - TextureFormat const * const formats = {}; - size_t const presentModeCount = {}; - PresentMode const * const presentModes = {}; - size_t const alphaModeCount = {}; - CompositeAlphaMode const * const alphaModes = {}; - }; - - struct SurfaceConfiguration { - ChainedStruct const * nextInChain = nullptr; - Device device; - TextureFormat format; - TextureUsage usage = TextureUsage::RenderAttachment; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats; - CompositeAlphaMode alphaMode = CompositeAlphaMode::Auto; - uint32_t width; - uint32_t height; - PresentMode presentMode = PresentMode::Fifo; - }; - - struct SurfaceDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - // Can be chained in SurfaceDescriptor - struct SurfaceDescriptorFromCanvasHTMLSelector : ChainedStruct { - SurfaceDescriptorFromCanvasHTMLSelector() { - sType = SType::SurfaceDescriptorFromCanvasHTMLSelector; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(char const * )); - alignas(kFirstMemberAlignment) char const * selector; - }; - - struct SurfaceTexture { - Texture texture; - Bool suboptimal; - SurfaceGetCurrentTextureStatus status; - }; - - struct SwapChainDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureUsage usage; - TextureFormat format; - uint32_t width; - uint32_t height; - PresentMode presentMode; - }; - - struct TextureBindingLayout { - ChainedStruct const * nextInChain = nullptr; - TextureSampleType sampleType = TextureSampleType::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::e2D; - Bool multisampled = false; - }; - - // Can be chained in TextureDescriptor - struct TextureBindingViewDimensionDescriptor : ChainedStruct { - TextureBindingViewDimensionDescriptor() { - sType = SType::TextureBindingViewDimensionDescriptor; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension )); - alignas(kFirstMemberAlignment) TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; - }; - - struct TextureDataLayout { - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - uint32_t bytesPerRow = WGPU_COPY_STRIDE_UNDEFINED; - uint32_t rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED; - }; - - struct TextureViewDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension dimension = TextureViewDimension::Undefined; - uint32_t baseMipLevel = 0; - uint32_t mipLevelCount = WGPU_MIP_LEVEL_COUNT_UNDEFINED; - uint32_t baseArrayLayer = 0; - uint32_t arrayLayerCount = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; - TextureAspect aspect = TextureAspect::All; - }; - - struct VertexAttribute { - VertexFormat format; - uint64_t offset; - uint32_t shaderLocation; - }; - - struct BindGroupDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - BindGroupLayout layout; - size_t entryCount; - BindGroupEntry const * entries; - }; - - struct BindGroupLayoutEntry { - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - ShaderStage visibility; - BufferBindingLayout buffer; - SamplerBindingLayout sampler; - TextureBindingLayout texture; - StorageTextureBindingLayout storageTexture; - }; - - struct BlendState { - BlendComponent color; - BlendComponent alpha; - }; - - struct CompilationInfo { - ChainedStruct const * nextInChain = nullptr; - size_t messageCount; - CompilationMessage const * messages; - }; - - struct ComputePassDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - ComputePassTimestampWrites const * timestampWrites = nullptr; - }; - - struct DepthStencilState { - ChainedStruct const * nextInChain = nullptr; - TextureFormat format; - Bool depthWriteEnabled = false; - CompareFunction depthCompare = CompareFunction::Undefined; - StencilFaceState stencilFront; - StencilFaceState stencilBack; - uint32_t stencilReadMask = 0xFFFFFFFF; - uint32_t stencilWriteMask = 0xFFFFFFFF; - int32_t depthBias = 0; - float depthBiasSlopeScale = 0.0f; - float depthBiasClamp = 0.0f; - }; - - struct FutureWaitInfo { - Future future; - Bool completed = false; - }; - - struct ImageCopyBuffer { - ChainedStruct const * nextInChain = nullptr; - TextureDataLayout layout; - Buffer buffer; - }; - - struct ImageCopyTexture { - ChainedStruct const * nextInChain = nullptr; - Texture texture; - uint32_t mipLevel = 0; - Origin3D origin; - TextureAspect aspect = TextureAspect::All; - }; - - struct InstanceDescriptor { - ChainedStruct const * nextInChain = nullptr; - InstanceFeatures features; - }; - - struct ProgrammableStageDescriptor { - ChainedStruct const * nextInChain = nullptr; - ShaderModule module; - char const * entryPoint = nullptr; - size_t constantCount = 0; - ConstantEntry const * constants; - }; - - struct RenderPassColorAttachment { - ChainedStruct const * nextInChain = nullptr; - TextureView view = nullptr; - uint32_t depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; - TextureView resolveTarget = nullptr; - LoadOp loadOp; - StoreOp storeOp; - Color clearValue; - }; - - struct RequiredLimits { - ChainedStruct const * nextInChain = nullptr; - Limits limits; - }; - - struct SupportedLimits { - ChainedStructOut * nextInChain = nullptr; - Limits limits; - }; - - struct TextureDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureUsage usage; - TextureDimension dimension = TextureDimension::e2D; - Extent3D size; - TextureFormat format; - uint32_t mipLevelCount = 1; - uint32_t sampleCount = 1; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats; - }; - - struct VertexBufferLayout { - uint64_t arrayStride; - VertexStepMode stepMode = VertexStepMode::Vertex; - size_t attributeCount; - VertexAttribute const * attributes; - }; - - struct BindGroupLayoutDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - size_t entryCount; - BindGroupLayoutEntry const * entries; - }; - - struct ColorTargetState { - ChainedStruct const * nextInChain = nullptr; - TextureFormat format; - BlendState const * blend = nullptr; - ColorWriteMask writeMask = ColorWriteMask::All; - }; - - struct ComputePipelineDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - PipelineLayout layout = nullptr; - ProgrammableStageDescriptor compute; - }; - - struct DeviceDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - size_t requiredFeatureCount = 0; - FeatureName const * requiredFeatures = nullptr; - RequiredLimits const * requiredLimits = nullptr; - QueueDescriptor defaultQueue; - DeviceLostCallback deviceLostCallback = nullptr; - void * deviceLostUserdata = nullptr; - }; - - struct RenderPassDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - size_t colorAttachmentCount; - RenderPassColorAttachment const * colorAttachments; - RenderPassDepthStencilAttachment const * depthStencilAttachment = nullptr; - QuerySet occlusionQuerySet = nullptr; - RenderPassTimestampWrites const * timestampWrites = nullptr; - }; - - struct VertexState { - ChainedStruct const * nextInChain = nullptr; - ShaderModule module; - char const * entryPoint = nullptr; - size_t constantCount = 0; - ConstantEntry const * constants; - size_t bufferCount = 0; - VertexBufferLayout const * buffers; - }; - - struct FragmentState { - ChainedStruct const * nextInChain = nullptr; - ShaderModule module; - char const * entryPoint = nullptr; - size_t constantCount = 0; - ConstantEntry const * constants; - size_t targetCount; - ColorTargetState const * targets; - }; - - struct RenderPipelineDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - PipelineLayout layout = nullptr; - VertexState vertex; - PrimitiveState primitive; - DepthStencilState const * depthStencil = nullptr; - MultisampleState multisample; - FragmentState const * fragment = nullptr; - }; - -} // namespace wgpu - -namespace wgpu { - template<> - struct IsWGPUBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsWGPUBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsWGPUBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsWGPUBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsWGPUBitmask { - static constexpr bool enable = true; - }; - -} // namespace wgpu - -namespace std { -// Custom boolean class needs corresponding hash function so that it appears as a transparent bool. -template <> -struct hash { - public: - size_t operator()(const wgpu::Bool &v) const { - return hash()(v); - } -}; -} // namespace std - -#endif // WEBGPU_CPP_H_ diff --git a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp_chained_struct.h b/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp_chained_struct.h deleted file mode 100644 index bb3a1be12..000000000 --- a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_cpp_chained_struct.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef WEBGPU_CPP_CHAINED_STRUCT_H_ -#define WEBGPU_CPP_CHAINED_STRUCT_H_ - -#include -#include - -// 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_ diff --git a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_enum_class_bitmasks.h b/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_enum_class_bitmasks.h deleted file mode 100644 index e98c8c5da..000000000 --- a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_enum_class_bitmasks.h +++ /dev/null @@ -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 - -// 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 -struct IsWGPUBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask::enable>::type> { - static constexpr bool enable = true; - using type = T; - constexpr static T Lower(T t) { return t; } -}; - -template -struct BoolConvertible { - using Integral = typename std::underlying_type::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(value); } - - Integral value; -}; - -template -struct LowerBitmask> { - static constexpr bool enable = true; - using type = T; - static constexpr type Lower(BoolConvertible t) { return t; } -}; - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator|(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) | - static_cast(LowerBitmask::Lower(right))); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator&(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) & - static_cast(LowerBitmask::Lower(right))); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator^(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) ^ - static_cast(LowerBitmask::Lower(right))); -} - -template -constexpr BoolConvertible::type> operator~(T1 t) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(~static_cast(LowerBitmask::Lower(t))); -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator&=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l & r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator|=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l | r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator^=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l ^ r; - return l; -} - -template -constexpr bool HasZeroOrOneBits(T value) { - using Integral = typename std::underlying_type::type; - return (static_cast(value) & (static_cast(value) - 1)) == 0; -} - -} // namespace wgpu - -#endif // WEBGPU_ENUM_CLASS_BITMASKS_H_ diff --git a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_wagyu.h b/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_wagyu.h deleted file mode 100644 index fcfdc5ca8..000000000 --- a/renderer/src/webgpu/wagyu-port/old/include/webgpu/webgpu_wagyu.h +++ /dev/null @@ -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 */ diff --git a/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_stubs.js b/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_stubs.js deleted file mode 100644 index 75b5793f9..000000000 --- a/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_stubs.js +++ /dev/null @@ -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); diff --git a/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_wagyu_stubs.js b/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_wagyu_stubs.js deleted file mode 100644 index c4ca4cd4c..000000000 --- a/renderer/src/webgpu/wagyu-port/old/src/library_webgpu_wagyu_stubs.js +++ /dev/null @@ -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); diff --git a/renderer/src/webgpu/wagyu-port/old/src/webgpu_cpp.cpp b/renderer/src/webgpu/wagyu-port/old/src/webgpu_cpp.cpp deleted file mode 100644 index 19c1d74cb..000000000 --- a/renderer/src/webgpu/wagyu-port/old/src/webgpu_cpp.cpp +++ /dev/null @@ -1,2916 +0,0 @@ -// Copyright 2024 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. - -#include - -#include "webgpu/webgpu_cpp.h" - -#if defined(__GNUC__) || defined(__clang__) -// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported -#pragma GCC diagnostic ignored "-Winvalid-offsetof" -#endif - -namespace wgpu { - - // WGSLFeatureName - - static_assert(sizeof(WGSLFeatureName) == sizeof(WGPUWGSLFeatureName), "sizeof mismatch for WGSLFeatureName"); - static_assert(alignof(WGSLFeatureName) == alignof(WGPUWGSLFeatureName), "alignof mismatch for WGSLFeatureName"); - - static_assert(static_cast(WGSLFeatureName::Undefined) == WGPUWGSLFeatureName_Undefined, "value mismatch for WGSLFeatureName::Undefined"); - static_assert(static_cast(WGSLFeatureName::ReadonlyAndReadwriteStorageTextures) == WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures, "value mismatch for WGSLFeatureName::ReadonlyAndReadwriteStorageTextures"); - static_assert(static_cast(WGSLFeatureName::Packed4x8IntegerDotProduct) == WGPUWGSLFeatureName_Packed4x8IntegerDotProduct, "value mismatch for WGSLFeatureName::Packed4x8IntegerDotProduct"); - static_assert(static_cast(WGSLFeatureName::UnrestrictedPointerParameters) == WGPUWGSLFeatureName_UnrestrictedPointerParameters, "value mismatch for WGSLFeatureName::UnrestrictedPointerParameters"); - static_assert(static_cast(WGSLFeatureName::PointerCompositeAccess) == WGPUWGSLFeatureName_PointerCompositeAccess, "value mismatch for WGSLFeatureName::PointerCompositeAccess"); - - // AdapterType - - static_assert(sizeof(AdapterType) == sizeof(WGPUAdapterType), "sizeof mismatch for AdapterType"); - static_assert(alignof(AdapterType) == alignof(WGPUAdapterType), "alignof mismatch for AdapterType"); - - static_assert(static_cast(AdapterType::DiscreteGPU) == WGPUAdapterType_DiscreteGPU, "value mismatch for AdapterType::DiscreteGPU"); - static_assert(static_cast(AdapterType::IntegratedGPU) == WGPUAdapterType_IntegratedGPU, "value mismatch for AdapterType::IntegratedGPU"); - static_assert(static_cast(AdapterType::CPU) == WGPUAdapterType_CPU, "value mismatch for AdapterType::CPU"); - static_assert(static_cast(AdapterType::Unknown) == WGPUAdapterType_Unknown, "value mismatch for AdapterType::Unknown"); - - // AddressMode - - static_assert(sizeof(AddressMode) == sizeof(WGPUAddressMode), "sizeof mismatch for AddressMode"); - static_assert(alignof(AddressMode) == alignof(WGPUAddressMode), "alignof mismatch for AddressMode"); - - static_assert(static_cast(AddressMode::Undefined) == WGPUAddressMode_Undefined, "value mismatch for AddressMode::Undefined"); - static_assert(static_cast(AddressMode::ClampToEdge) == WGPUAddressMode_ClampToEdge, "value mismatch for AddressMode::ClampToEdge"); - static_assert(static_cast(AddressMode::Repeat) == WGPUAddressMode_Repeat, "value mismatch for AddressMode::Repeat"); - static_assert(static_cast(AddressMode::MirrorRepeat) == WGPUAddressMode_MirrorRepeat, "value mismatch for AddressMode::MirrorRepeat"); - - // BackendType - - static_assert(sizeof(BackendType) == sizeof(WGPUBackendType), "sizeof mismatch for BackendType"); - static_assert(alignof(BackendType) == alignof(WGPUBackendType), "alignof mismatch for BackendType"); - - static_assert(static_cast(BackendType::Undefined) == WGPUBackendType_Undefined, "value mismatch for BackendType::Undefined"); - static_assert(static_cast(BackendType::Null) == WGPUBackendType_Null, "value mismatch for BackendType::Null"); - static_assert(static_cast(BackendType::WebGPU) == WGPUBackendType_WebGPU, "value mismatch for BackendType::WebGPU"); - static_assert(static_cast(BackendType::D3D11) == WGPUBackendType_D3D11, "value mismatch for BackendType::D3D11"); - static_assert(static_cast(BackendType::D3D12) == WGPUBackendType_D3D12, "value mismatch for BackendType::D3D12"); - static_assert(static_cast(BackendType::Metal) == WGPUBackendType_Metal, "value mismatch for BackendType::Metal"); - static_assert(static_cast(BackendType::Vulkan) == WGPUBackendType_Vulkan, "value mismatch for BackendType::Vulkan"); - static_assert(static_cast(BackendType::OpenGL) == WGPUBackendType_OpenGL, "value mismatch for BackendType::OpenGL"); - static_assert(static_cast(BackendType::OpenGLES) == WGPUBackendType_OpenGLES, "value mismatch for BackendType::OpenGLES"); - - // BlendFactor - - static_assert(sizeof(BlendFactor) == sizeof(WGPUBlendFactor), "sizeof mismatch for BlendFactor"); - static_assert(alignof(BlendFactor) == alignof(WGPUBlendFactor), "alignof mismatch for BlendFactor"); - - static_assert(static_cast(BlendFactor::Undefined) == WGPUBlendFactor_Undefined, "value mismatch for BlendFactor::Undefined"); - static_assert(static_cast(BlendFactor::Zero) == WGPUBlendFactor_Zero, "value mismatch for BlendFactor::Zero"); - static_assert(static_cast(BlendFactor::One) == WGPUBlendFactor_One, "value mismatch for BlendFactor::One"); - static_assert(static_cast(BlendFactor::Src) == WGPUBlendFactor_Src, "value mismatch for BlendFactor::Src"); - static_assert(static_cast(BlendFactor::OneMinusSrc) == WGPUBlendFactor_OneMinusSrc, "value mismatch for BlendFactor::OneMinusSrc"); - static_assert(static_cast(BlendFactor::SrcAlpha) == WGPUBlendFactor_SrcAlpha, "value mismatch for BlendFactor::SrcAlpha"); - static_assert(static_cast(BlendFactor::OneMinusSrcAlpha) == WGPUBlendFactor_OneMinusSrcAlpha, "value mismatch for BlendFactor::OneMinusSrcAlpha"); - static_assert(static_cast(BlendFactor::Dst) == WGPUBlendFactor_Dst, "value mismatch for BlendFactor::Dst"); - static_assert(static_cast(BlendFactor::OneMinusDst) == WGPUBlendFactor_OneMinusDst, "value mismatch for BlendFactor::OneMinusDst"); - static_assert(static_cast(BlendFactor::DstAlpha) == WGPUBlendFactor_DstAlpha, "value mismatch for BlendFactor::DstAlpha"); - static_assert(static_cast(BlendFactor::OneMinusDstAlpha) == WGPUBlendFactor_OneMinusDstAlpha, "value mismatch for BlendFactor::OneMinusDstAlpha"); - static_assert(static_cast(BlendFactor::SrcAlphaSaturated) == WGPUBlendFactor_SrcAlphaSaturated, "value mismatch for BlendFactor::SrcAlphaSaturated"); - static_assert(static_cast(BlendFactor::Constant) == WGPUBlendFactor_Constant, "value mismatch for BlendFactor::Constant"); - static_assert(static_cast(BlendFactor::OneMinusConstant) == WGPUBlendFactor_OneMinusConstant, "value mismatch for BlendFactor::OneMinusConstant"); - - // BlendOperation - - static_assert(sizeof(BlendOperation) == sizeof(WGPUBlendOperation), "sizeof mismatch for BlendOperation"); - static_assert(alignof(BlendOperation) == alignof(WGPUBlendOperation), "alignof mismatch for BlendOperation"); - - static_assert(static_cast(BlendOperation::Undefined) == WGPUBlendOperation_Undefined, "value mismatch for BlendOperation::Undefined"); - static_assert(static_cast(BlendOperation::Add) == WGPUBlendOperation_Add, "value mismatch for BlendOperation::Add"); - static_assert(static_cast(BlendOperation::Subtract) == WGPUBlendOperation_Subtract, "value mismatch for BlendOperation::Subtract"); - static_assert(static_cast(BlendOperation::ReverseSubtract) == WGPUBlendOperation_ReverseSubtract, "value mismatch for BlendOperation::ReverseSubtract"); - static_assert(static_cast(BlendOperation::Min) == WGPUBlendOperation_Min, "value mismatch for BlendOperation::Min"); - static_assert(static_cast(BlendOperation::Max) == WGPUBlendOperation_Max, "value mismatch for BlendOperation::Max"); - - // BufferBindingType - - static_assert(sizeof(BufferBindingType) == sizeof(WGPUBufferBindingType), "sizeof mismatch for BufferBindingType"); - static_assert(alignof(BufferBindingType) == alignof(WGPUBufferBindingType), "alignof mismatch for BufferBindingType"); - - static_assert(static_cast(BufferBindingType::Undefined) == WGPUBufferBindingType_Undefined, "value mismatch for BufferBindingType::Undefined"); - static_assert(static_cast(BufferBindingType::Uniform) == WGPUBufferBindingType_Uniform, "value mismatch for BufferBindingType::Uniform"); - static_assert(static_cast(BufferBindingType::Storage) == WGPUBufferBindingType_Storage, "value mismatch for BufferBindingType::Storage"); - static_assert(static_cast(BufferBindingType::ReadOnlyStorage) == WGPUBufferBindingType_ReadOnlyStorage, "value mismatch for BufferBindingType::ReadOnlyStorage"); - - // BufferMapAsyncStatus - - static_assert(sizeof(BufferMapAsyncStatus) == sizeof(WGPUBufferMapAsyncStatus), "sizeof mismatch for BufferMapAsyncStatus"); - static_assert(alignof(BufferMapAsyncStatus) == alignof(WGPUBufferMapAsyncStatus), "alignof mismatch for BufferMapAsyncStatus"); - - static_assert(static_cast(BufferMapAsyncStatus::Success) == WGPUBufferMapAsyncStatus_Success, "value mismatch for BufferMapAsyncStatus::Success"); - static_assert(static_cast(BufferMapAsyncStatus::ValidationError) == WGPUBufferMapAsyncStatus_ValidationError, "value mismatch for BufferMapAsyncStatus::ValidationError"); - static_assert(static_cast(BufferMapAsyncStatus::Unknown) == WGPUBufferMapAsyncStatus_Unknown, "value mismatch for BufferMapAsyncStatus::Unknown"); - static_assert(static_cast(BufferMapAsyncStatus::DeviceLost) == WGPUBufferMapAsyncStatus_DeviceLost, "value mismatch for BufferMapAsyncStatus::DeviceLost"); - static_assert(static_cast(BufferMapAsyncStatus::DestroyedBeforeCallback) == WGPUBufferMapAsyncStatus_DestroyedBeforeCallback, "value mismatch for BufferMapAsyncStatus::DestroyedBeforeCallback"); - static_assert(static_cast(BufferMapAsyncStatus::UnmappedBeforeCallback) == WGPUBufferMapAsyncStatus_UnmappedBeforeCallback, "value mismatch for BufferMapAsyncStatus::UnmappedBeforeCallback"); - static_assert(static_cast(BufferMapAsyncStatus::MappingAlreadyPending) == WGPUBufferMapAsyncStatus_MappingAlreadyPending, "value mismatch for BufferMapAsyncStatus::MappingAlreadyPending"); - static_assert(static_cast(BufferMapAsyncStatus::OffsetOutOfRange) == WGPUBufferMapAsyncStatus_OffsetOutOfRange, "value mismatch for BufferMapAsyncStatus::OffsetOutOfRange"); - static_assert(static_cast(BufferMapAsyncStatus::SizeOutOfRange) == WGPUBufferMapAsyncStatus_SizeOutOfRange, "value mismatch for BufferMapAsyncStatus::SizeOutOfRange"); - - // BufferMapState - - static_assert(sizeof(BufferMapState) == sizeof(WGPUBufferMapState), "sizeof mismatch for BufferMapState"); - static_assert(alignof(BufferMapState) == alignof(WGPUBufferMapState), "alignof mismatch for BufferMapState"); - - static_assert(static_cast(BufferMapState::Unmapped) == WGPUBufferMapState_Unmapped, "value mismatch for BufferMapState::Unmapped"); - static_assert(static_cast(BufferMapState::Pending) == WGPUBufferMapState_Pending, "value mismatch for BufferMapState::Pending"); - static_assert(static_cast(BufferMapState::Mapped) == WGPUBufferMapState_Mapped, "value mismatch for BufferMapState::Mapped"); - - // CallbackMode - - static_assert(sizeof(CallbackMode) == sizeof(WGPUCallbackMode), "sizeof mismatch for CallbackMode"); - static_assert(alignof(CallbackMode) == alignof(WGPUCallbackMode), "alignof mismatch for CallbackMode"); - - static_assert(static_cast(CallbackMode::WaitAnyOnly) == WGPUCallbackMode_WaitAnyOnly, "value mismatch for CallbackMode::WaitAnyOnly"); - static_assert(static_cast(CallbackMode::AllowProcessEvents) == WGPUCallbackMode_AllowProcessEvents, "value mismatch for CallbackMode::AllowProcessEvents"); - static_assert(static_cast(CallbackMode::AllowSpontaneous) == WGPUCallbackMode_AllowSpontaneous, "value mismatch for CallbackMode::AllowSpontaneous"); - - // CompareFunction - - static_assert(sizeof(CompareFunction) == sizeof(WGPUCompareFunction), "sizeof mismatch for CompareFunction"); - static_assert(alignof(CompareFunction) == alignof(WGPUCompareFunction), "alignof mismatch for CompareFunction"); - - static_assert(static_cast(CompareFunction::Undefined) == WGPUCompareFunction_Undefined, "value mismatch for CompareFunction::Undefined"); - static_assert(static_cast(CompareFunction::Never) == WGPUCompareFunction_Never, "value mismatch for CompareFunction::Never"); - static_assert(static_cast(CompareFunction::Less) == WGPUCompareFunction_Less, "value mismatch for CompareFunction::Less"); - static_assert(static_cast(CompareFunction::Equal) == WGPUCompareFunction_Equal, "value mismatch for CompareFunction::Equal"); - static_assert(static_cast(CompareFunction::LessEqual) == WGPUCompareFunction_LessEqual, "value mismatch for CompareFunction::LessEqual"); - static_assert(static_cast(CompareFunction::Greater) == WGPUCompareFunction_Greater, "value mismatch for CompareFunction::Greater"); - static_assert(static_cast(CompareFunction::NotEqual) == WGPUCompareFunction_NotEqual, "value mismatch for CompareFunction::NotEqual"); - static_assert(static_cast(CompareFunction::GreaterEqual) == WGPUCompareFunction_GreaterEqual, "value mismatch for CompareFunction::GreaterEqual"); - static_assert(static_cast(CompareFunction::Always) == WGPUCompareFunction_Always, "value mismatch for CompareFunction::Always"); - - // CompilationInfoRequestStatus - - static_assert(sizeof(CompilationInfoRequestStatus) == sizeof(WGPUCompilationInfoRequestStatus), "sizeof mismatch for CompilationInfoRequestStatus"); - static_assert(alignof(CompilationInfoRequestStatus) == alignof(WGPUCompilationInfoRequestStatus), "alignof mismatch for CompilationInfoRequestStatus"); - - static_assert(static_cast(CompilationInfoRequestStatus::Success) == WGPUCompilationInfoRequestStatus_Success, "value mismatch for CompilationInfoRequestStatus::Success"); - static_assert(static_cast(CompilationInfoRequestStatus::Error) == WGPUCompilationInfoRequestStatus_Error, "value mismatch for CompilationInfoRequestStatus::Error"); - static_assert(static_cast(CompilationInfoRequestStatus::DeviceLost) == WGPUCompilationInfoRequestStatus_DeviceLost, "value mismatch for CompilationInfoRequestStatus::DeviceLost"); - static_assert(static_cast(CompilationInfoRequestStatus::Unknown) == WGPUCompilationInfoRequestStatus_Unknown, "value mismatch for CompilationInfoRequestStatus::Unknown"); - - // CompilationMessageType - - static_assert(sizeof(CompilationMessageType) == sizeof(WGPUCompilationMessageType), "sizeof mismatch for CompilationMessageType"); - static_assert(alignof(CompilationMessageType) == alignof(WGPUCompilationMessageType), "alignof mismatch for CompilationMessageType"); - - static_assert(static_cast(CompilationMessageType::Error) == WGPUCompilationMessageType_Error, "value mismatch for CompilationMessageType::Error"); - static_assert(static_cast(CompilationMessageType::Warning) == WGPUCompilationMessageType_Warning, "value mismatch for CompilationMessageType::Warning"); - static_assert(static_cast(CompilationMessageType::Info) == WGPUCompilationMessageType_Info, "value mismatch for CompilationMessageType::Info"); - - // CompositeAlphaMode - - static_assert(sizeof(CompositeAlphaMode) == sizeof(WGPUCompositeAlphaMode), "sizeof mismatch for CompositeAlphaMode"); - static_assert(alignof(CompositeAlphaMode) == alignof(WGPUCompositeAlphaMode), "alignof mismatch for CompositeAlphaMode"); - - static_assert(static_cast(CompositeAlphaMode::Auto) == WGPUCompositeAlphaMode_Auto, "value mismatch for CompositeAlphaMode::Auto"); - static_assert(static_cast(CompositeAlphaMode::Opaque) == WGPUCompositeAlphaMode_Opaque, "value mismatch for CompositeAlphaMode::Opaque"); - static_assert(static_cast(CompositeAlphaMode::Premultiplied) == WGPUCompositeAlphaMode_Premultiplied, "value mismatch for CompositeAlphaMode::Premultiplied"); - static_assert(static_cast(CompositeAlphaMode::Unpremultiplied) == WGPUCompositeAlphaMode_Unpremultiplied, "value mismatch for CompositeAlphaMode::Unpremultiplied"); - static_assert(static_cast(CompositeAlphaMode::Inherit) == WGPUCompositeAlphaMode_Inherit, "value mismatch for CompositeAlphaMode::Inherit"); - - // CreatePipelineAsyncStatus - - static_assert(sizeof(CreatePipelineAsyncStatus) == sizeof(WGPUCreatePipelineAsyncStatus), "sizeof mismatch for CreatePipelineAsyncStatus"); - static_assert(alignof(CreatePipelineAsyncStatus) == alignof(WGPUCreatePipelineAsyncStatus), "alignof mismatch for CreatePipelineAsyncStatus"); - - static_assert(static_cast(CreatePipelineAsyncStatus::Success) == WGPUCreatePipelineAsyncStatus_Success, "value mismatch for CreatePipelineAsyncStatus::Success"); - static_assert(static_cast(CreatePipelineAsyncStatus::ValidationError) == WGPUCreatePipelineAsyncStatus_ValidationError, "value mismatch for CreatePipelineAsyncStatus::ValidationError"); - static_assert(static_cast(CreatePipelineAsyncStatus::InternalError) == WGPUCreatePipelineAsyncStatus_InternalError, "value mismatch for CreatePipelineAsyncStatus::InternalError"); - static_assert(static_cast(CreatePipelineAsyncStatus::DeviceLost) == WGPUCreatePipelineAsyncStatus_DeviceLost, "value mismatch for CreatePipelineAsyncStatus::DeviceLost"); - static_assert(static_cast(CreatePipelineAsyncStatus::DeviceDestroyed) == WGPUCreatePipelineAsyncStatus_DeviceDestroyed, "value mismatch for CreatePipelineAsyncStatus::DeviceDestroyed"); - static_assert(static_cast(CreatePipelineAsyncStatus::Unknown) == WGPUCreatePipelineAsyncStatus_Unknown, "value mismatch for CreatePipelineAsyncStatus::Unknown"); - - // CullMode - - static_assert(sizeof(CullMode) == sizeof(WGPUCullMode), "sizeof mismatch for CullMode"); - static_assert(alignof(CullMode) == alignof(WGPUCullMode), "alignof mismatch for CullMode"); - - static_assert(static_cast(CullMode::Undefined) == WGPUCullMode_Undefined, "value mismatch for CullMode::Undefined"); - static_assert(static_cast(CullMode::None) == WGPUCullMode_None, "value mismatch for CullMode::None"); - static_assert(static_cast(CullMode::Front) == WGPUCullMode_Front, "value mismatch for CullMode::Front"); - static_assert(static_cast(CullMode::Back) == WGPUCullMode_Back, "value mismatch for CullMode::Back"); - - // DeviceLostReason - - static_assert(sizeof(DeviceLostReason) == sizeof(WGPUDeviceLostReason), "sizeof mismatch for DeviceLostReason"); - static_assert(alignof(DeviceLostReason) == alignof(WGPUDeviceLostReason), "alignof mismatch for DeviceLostReason"); - - static_assert(static_cast(DeviceLostReason::Undefined) == WGPUDeviceLostReason_Undefined, "value mismatch for DeviceLostReason::Undefined"); - static_assert(static_cast(DeviceLostReason::Unknown) == WGPUDeviceLostReason_Unknown, "value mismatch for DeviceLostReason::Unknown"); - static_assert(static_cast(DeviceLostReason::Destroyed) == WGPUDeviceLostReason_Destroyed, "value mismatch for DeviceLostReason::Destroyed"); - - // ErrorFilter - - static_assert(sizeof(ErrorFilter) == sizeof(WGPUErrorFilter), "sizeof mismatch for ErrorFilter"); - static_assert(alignof(ErrorFilter) == alignof(WGPUErrorFilter), "alignof mismatch for ErrorFilter"); - - static_assert(static_cast(ErrorFilter::Validation) == WGPUErrorFilter_Validation, "value mismatch for ErrorFilter::Validation"); - static_assert(static_cast(ErrorFilter::OutOfMemory) == WGPUErrorFilter_OutOfMemory, "value mismatch for ErrorFilter::OutOfMemory"); - static_assert(static_cast(ErrorFilter::Internal) == WGPUErrorFilter_Internal, "value mismatch for ErrorFilter::Internal"); - - // ErrorType - - static_assert(sizeof(ErrorType) == sizeof(WGPUErrorType), "sizeof mismatch for ErrorType"); - static_assert(alignof(ErrorType) == alignof(WGPUErrorType), "alignof mismatch for ErrorType"); - - static_assert(static_cast(ErrorType::NoError) == WGPUErrorType_NoError, "value mismatch for ErrorType::NoError"); - static_assert(static_cast(ErrorType::Validation) == WGPUErrorType_Validation, "value mismatch for ErrorType::Validation"); - static_assert(static_cast(ErrorType::OutOfMemory) == WGPUErrorType_OutOfMemory, "value mismatch for ErrorType::OutOfMemory"); - static_assert(static_cast(ErrorType::Internal) == WGPUErrorType_Internal, "value mismatch for ErrorType::Internal"); - static_assert(static_cast(ErrorType::Unknown) == WGPUErrorType_Unknown, "value mismatch for ErrorType::Unknown"); - static_assert(static_cast(ErrorType::DeviceLost) == WGPUErrorType_DeviceLost, "value mismatch for ErrorType::DeviceLost"); - - // FeatureName - - static_assert(sizeof(FeatureName) == sizeof(WGPUFeatureName), "sizeof mismatch for FeatureName"); - static_assert(alignof(FeatureName) == alignof(WGPUFeatureName), "alignof mismatch for FeatureName"); - - static_assert(static_cast(FeatureName::Undefined) == WGPUFeatureName_Undefined, "value mismatch for FeatureName::Undefined"); - static_assert(static_cast(FeatureName::DepthClipControl) == WGPUFeatureName_DepthClipControl, "value mismatch for FeatureName::DepthClipControl"); - static_assert(static_cast(FeatureName::Depth32FloatStencil8) == WGPUFeatureName_Depth32FloatStencil8, "value mismatch for FeatureName::Depth32FloatStencil8"); - static_assert(static_cast(FeatureName::TimestampQuery) == WGPUFeatureName_TimestampQuery, "value mismatch for FeatureName::TimestampQuery"); - static_assert(static_cast(FeatureName::TextureCompressionBC) == WGPUFeatureName_TextureCompressionBC, "value mismatch for FeatureName::TextureCompressionBC"); - static_assert(static_cast(FeatureName::TextureCompressionETC2) == WGPUFeatureName_TextureCompressionETC2, "value mismatch for FeatureName::TextureCompressionETC2"); - static_assert(static_cast(FeatureName::TextureCompressionASTC) == WGPUFeatureName_TextureCompressionASTC, "value mismatch for FeatureName::TextureCompressionASTC"); - static_assert(static_cast(FeatureName::IndirectFirstInstance) == WGPUFeatureName_IndirectFirstInstance, "value mismatch for FeatureName::IndirectFirstInstance"); - static_assert(static_cast(FeatureName::ShaderF16) == WGPUFeatureName_ShaderF16, "value mismatch for FeatureName::ShaderF16"); - static_assert(static_cast(FeatureName::RG11B10UfloatRenderable) == WGPUFeatureName_RG11B10UfloatRenderable, "value mismatch for FeatureName::RG11B10UfloatRenderable"); - static_assert(static_cast(FeatureName::BGRA8UnormStorage) == WGPUFeatureName_BGRA8UnormStorage, "value mismatch for FeatureName::BGRA8UnormStorage"); - static_assert(static_cast(FeatureName::Float32Filterable) == WGPUFeatureName_Float32Filterable, "value mismatch for FeatureName::Float32Filterable"); - - // FilterMode - - static_assert(sizeof(FilterMode) == sizeof(WGPUFilterMode), "sizeof mismatch for FilterMode"); - static_assert(alignof(FilterMode) == alignof(WGPUFilterMode), "alignof mismatch for FilterMode"); - - static_assert(static_cast(FilterMode::Undefined) == WGPUFilterMode_Undefined, "value mismatch for FilterMode::Undefined"); - static_assert(static_cast(FilterMode::Nearest) == WGPUFilterMode_Nearest, "value mismatch for FilterMode::Nearest"); - static_assert(static_cast(FilterMode::Linear) == WGPUFilterMode_Linear, "value mismatch for FilterMode::Linear"); - - // FrontFace - - static_assert(sizeof(FrontFace) == sizeof(WGPUFrontFace), "sizeof mismatch for FrontFace"); - static_assert(alignof(FrontFace) == alignof(WGPUFrontFace), "alignof mismatch for FrontFace"); - - static_assert(static_cast(FrontFace::Undefined) == WGPUFrontFace_Undefined, "value mismatch for FrontFace::Undefined"); - static_assert(static_cast(FrontFace::CCW) == WGPUFrontFace_CCW, "value mismatch for FrontFace::CCW"); - static_assert(static_cast(FrontFace::CW) == WGPUFrontFace_CW, "value mismatch for FrontFace::CW"); - - // IndexFormat - - static_assert(sizeof(IndexFormat) == sizeof(WGPUIndexFormat), "sizeof mismatch for IndexFormat"); - static_assert(alignof(IndexFormat) == alignof(WGPUIndexFormat), "alignof mismatch for IndexFormat"); - - static_assert(static_cast(IndexFormat::Undefined) == WGPUIndexFormat_Undefined, "value mismatch for IndexFormat::Undefined"); - static_assert(static_cast(IndexFormat::Uint16) == WGPUIndexFormat_Uint16, "value mismatch for IndexFormat::Uint16"); - static_assert(static_cast(IndexFormat::Uint32) == WGPUIndexFormat_Uint32, "value mismatch for IndexFormat::Uint32"); - - // LoadOp - - static_assert(sizeof(LoadOp) == sizeof(WGPULoadOp), "sizeof mismatch for LoadOp"); - static_assert(alignof(LoadOp) == alignof(WGPULoadOp), "alignof mismatch for LoadOp"); - - static_assert(static_cast(LoadOp::Undefined) == WGPULoadOp_Undefined, "value mismatch for LoadOp::Undefined"); - static_assert(static_cast(LoadOp::Clear) == WGPULoadOp_Clear, "value mismatch for LoadOp::Clear"); - static_assert(static_cast(LoadOp::Load) == WGPULoadOp_Load, "value mismatch for LoadOp::Load"); - - // MipmapFilterMode - - static_assert(sizeof(MipmapFilterMode) == sizeof(WGPUMipmapFilterMode), "sizeof mismatch for MipmapFilterMode"); - static_assert(alignof(MipmapFilterMode) == alignof(WGPUMipmapFilterMode), "alignof mismatch for MipmapFilterMode"); - - static_assert(static_cast(MipmapFilterMode::Undefined) == WGPUMipmapFilterMode_Undefined, "value mismatch for MipmapFilterMode::Undefined"); - static_assert(static_cast(MipmapFilterMode::Nearest) == WGPUMipmapFilterMode_Nearest, "value mismatch for MipmapFilterMode::Nearest"); - static_assert(static_cast(MipmapFilterMode::Linear) == WGPUMipmapFilterMode_Linear, "value mismatch for MipmapFilterMode::Linear"); - - // PowerPreference - - static_assert(sizeof(PowerPreference) == sizeof(WGPUPowerPreference), "sizeof mismatch for PowerPreference"); - static_assert(alignof(PowerPreference) == alignof(WGPUPowerPreference), "alignof mismatch for PowerPreference"); - - static_assert(static_cast(PowerPreference::Undefined) == WGPUPowerPreference_Undefined, "value mismatch for PowerPreference::Undefined"); - static_assert(static_cast(PowerPreference::LowPower) == WGPUPowerPreference_LowPower, "value mismatch for PowerPreference::LowPower"); - static_assert(static_cast(PowerPreference::HighPerformance) == WGPUPowerPreference_HighPerformance, "value mismatch for PowerPreference::HighPerformance"); - - // PresentMode - - static_assert(sizeof(PresentMode) == sizeof(WGPUPresentMode), "sizeof mismatch for PresentMode"); - static_assert(alignof(PresentMode) == alignof(WGPUPresentMode), "alignof mismatch for PresentMode"); - - static_assert(static_cast(PresentMode::Fifo) == WGPUPresentMode_Fifo, "value mismatch for PresentMode::Fifo"); - static_assert(static_cast(PresentMode::Immediate) == WGPUPresentMode_Immediate, "value mismatch for PresentMode::Immediate"); - static_assert(static_cast(PresentMode::Mailbox) == WGPUPresentMode_Mailbox, "value mismatch for PresentMode::Mailbox"); - - // PrimitiveTopology - - static_assert(sizeof(PrimitiveTopology) == sizeof(WGPUPrimitiveTopology), "sizeof mismatch for PrimitiveTopology"); - static_assert(alignof(PrimitiveTopology) == alignof(WGPUPrimitiveTopology), "alignof mismatch for PrimitiveTopology"); - - static_assert(static_cast(PrimitiveTopology::Undefined) == WGPUPrimitiveTopology_Undefined, "value mismatch for PrimitiveTopology::Undefined"); - static_assert(static_cast(PrimitiveTopology::PointList) == WGPUPrimitiveTopology_PointList, "value mismatch for PrimitiveTopology::PointList"); - static_assert(static_cast(PrimitiveTopology::LineList) == WGPUPrimitiveTopology_LineList, "value mismatch for PrimitiveTopology::LineList"); - static_assert(static_cast(PrimitiveTopology::LineStrip) == WGPUPrimitiveTopology_LineStrip, "value mismatch for PrimitiveTopology::LineStrip"); - static_assert(static_cast(PrimitiveTopology::TriangleList) == WGPUPrimitiveTopology_TriangleList, "value mismatch for PrimitiveTopology::TriangleList"); - static_assert(static_cast(PrimitiveTopology::TriangleStrip) == WGPUPrimitiveTopology_TriangleStrip, "value mismatch for PrimitiveTopology::TriangleStrip"); - - // QueryType - - static_assert(sizeof(QueryType) == sizeof(WGPUQueryType), "sizeof mismatch for QueryType"); - static_assert(alignof(QueryType) == alignof(WGPUQueryType), "alignof mismatch for QueryType"); - - static_assert(static_cast(QueryType::Occlusion) == WGPUQueryType_Occlusion, "value mismatch for QueryType::Occlusion"); - static_assert(static_cast(QueryType::Timestamp) == WGPUQueryType_Timestamp, "value mismatch for QueryType::Timestamp"); - - // QueueWorkDoneStatus - - static_assert(sizeof(QueueWorkDoneStatus) == sizeof(WGPUQueueWorkDoneStatus), "sizeof mismatch for QueueWorkDoneStatus"); - static_assert(alignof(QueueWorkDoneStatus) == alignof(WGPUQueueWorkDoneStatus), "alignof mismatch for QueueWorkDoneStatus"); - - static_assert(static_cast(QueueWorkDoneStatus::Success) == WGPUQueueWorkDoneStatus_Success, "value mismatch for QueueWorkDoneStatus::Success"); - static_assert(static_cast(QueueWorkDoneStatus::Error) == WGPUQueueWorkDoneStatus_Error, "value mismatch for QueueWorkDoneStatus::Error"); - static_assert(static_cast(QueueWorkDoneStatus::Unknown) == WGPUQueueWorkDoneStatus_Unknown, "value mismatch for QueueWorkDoneStatus::Unknown"); - static_assert(static_cast(QueueWorkDoneStatus::DeviceLost) == WGPUQueueWorkDoneStatus_DeviceLost, "value mismatch for QueueWorkDoneStatus::DeviceLost"); - - // RequestAdapterStatus - - static_assert(sizeof(RequestAdapterStatus) == sizeof(WGPURequestAdapterStatus), "sizeof mismatch for RequestAdapterStatus"); - static_assert(alignof(RequestAdapterStatus) == alignof(WGPURequestAdapterStatus), "alignof mismatch for RequestAdapterStatus"); - - static_assert(static_cast(RequestAdapterStatus::Success) == WGPURequestAdapterStatus_Success, "value mismatch for RequestAdapterStatus::Success"); - static_assert(static_cast(RequestAdapterStatus::Unavailable) == WGPURequestAdapterStatus_Unavailable, "value mismatch for RequestAdapterStatus::Unavailable"); - static_assert(static_cast(RequestAdapterStatus::Error) == WGPURequestAdapterStatus_Error, "value mismatch for RequestAdapterStatus::Error"); - static_assert(static_cast(RequestAdapterStatus::Unknown) == WGPURequestAdapterStatus_Unknown, "value mismatch for RequestAdapterStatus::Unknown"); - - // RequestDeviceStatus - - static_assert(sizeof(RequestDeviceStatus) == sizeof(WGPURequestDeviceStatus), "sizeof mismatch for RequestDeviceStatus"); - static_assert(alignof(RequestDeviceStatus) == alignof(WGPURequestDeviceStatus), "alignof mismatch for RequestDeviceStatus"); - - static_assert(static_cast(RequestDeviceStatus::Success) == WGPURequestDeviceStatus_Success, "value mismatch for RequestDeviceStatus::Success"); - static_assert(static_cast(RequestDeviceStatus::Error) == WGPURequestDeviceStatus_Error, "value mismatch for RequestDeviceStatus::Error"); - static_assert(static_cast(RequestDeviceStatus::Unknown) == WGPURequestDeviceStatus_Unknown, "value mismatch for RequestDeviceStatus::Unknown"); - - // SType - - static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType"); - static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType"); - - static_assert(static_cast(SType::Invalid) == WGPUSType_Invalid, "value mismatch for SType::Invalid"); - static_assert(static_cast(SType::SurfaceDescriptorFromCanvasHTMLSelector) == WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector, "value mismatch for SType::SurfaceDescriptorFromCanvasHTMLSelector"); - static_assert(static_cast(SType::ShaderModuleSPIRVDescriptor) == WGPUSType_ShaderModuleSPIRVDescriptor, "value mismatch for SType::ShaderModuleSPIRVDescriptor"); - static_assert(static_cast(SType::ShaderModuleWGSLDescriptor) == WGPUSType_ShaderModuleWGSLDescriptor, "value mismatch for SType::ShaderModuleWGSLDescriptor"); - static_assert(static_cast(SType::PrimitiveDepthClipControl) == WGPUSType_PrimitiveDepthClipControl, "value mismatch for SType::PrimitiveDepthClipControl"); - static_assert(static_cast(SType::RenderPassDescriptorMaxDrawCount) == WGPUSType_RenderPassDescriptorMaxDrawCount, "value mismatch for SType::RenderPassDescriptorMaxDrawCount"); - static_assert(static_cast(SType::TextureBindingViewDimensionDescriptor) == WGPUSType_TextureBindingViewDimensionDescriptor, "value mismatch for SType::TextureBindingViewDimensionDescriptor"); - - // SamplerBindingType - - static_assert(sizeof(SamplerBindingType) == sizeof(WGPUSamplerBindingType), "sizeof mismatch for SamplerBindingType"); - static_assert(alignof(SamplerBindingType) == alignof(WGPUSamplerBindingType), "alignof mismatch for SamplerBindingType"); - - static_assert(static_cast(SamplerBindingType::Undefined) == WGPUSamplerBindingType_Undefined, "value mismatch for SamplerBindingType::Undefined"); - static_assert(static_cast(SamplerBindingType::Filtering) == WGPUSamplerBindingType_Filtering, "value mismatch for SamplerBindingType::Filtering"); - static_assert(static_cast(SamplerBindingType::NonFiltering) == WGPUSamplerBindingType_NonFiltering, "value mismatch for SamplerBindingType::NonFiltering"); - static_assert(static_cast(SamplerBindingType::Comparison) == WGPUSamplerBindingType_Comparison, "value mismatch for SamplerBindingType::Comparison"); - - // StencilOperation - - static_assert(sizeof(StencilOperation) == sizeof(WGPUStencilOperation), "sizeof mismatch for StencilOperation"); - static_assert(alignof(StencilOperation) == alignof(WGPUStencilOperation), "alignof mismatch for StencilOperation"); - - static_assert(static_cast(StencilOperation::Undefined) == WGPUStencilOperation_Undefined, "value mismatch for StencilOperation::Undefined"); - static_assert(static_cast(StencilOperation::Keep) == WGPUStencilOperation_Keep, "value mismatch for StencilOperation::Keep"); - static_assert(static_cast(StencilOperation::Zero) == WGPUStencilOperation_Zero, "value mismatch for StencilOperation::Zero"); - static_assert(static_cast(StencilOperation::Replace) == WGPUStencilOperation_Replace, "value mismatch for StencilOperation::Replace"); - static_assert(static_cast(StencilOperation::Invert) == WGPUStencilOperation_Invert, "value mismatch for StencilOperation::Invert"); - static_assert(static_cast(StencilOperation::IncrementClamp) == WGPUStencilOperation_IncrementClamp, "value mismatch for StencilOperation::IncrementClamp"); - static_assert(static_cast(StencilOperation::DecrementClamp) == WGPUStencilOperation_DecrementClamp, "value mismatch for StencilOperation::DecrementClamp"); - static_assert(static_cast(StencilOperation::IncrementWrap) == WGPUStencilOperation_IncrementWrap, "value mismatch for StencilOperation::IncrementWrap"); - static_assert(static_cast(StencilOperation::DecrementWrap) == WGPUStencilOperation_DecrementWrap, "value mismatch for StencilOperation::DecrementWrap"); - - // StorageTextureAccess - - static_assert(sizeof(StorageTextureAccess) == sizeof(WGPUStorageTextureAccess), "sizeof mismatch for StorageTextureAccess"); - static_assert(alignof(StorageTextureAccess) == alignof(WGPUStorageTextureAccess), "alignof mismatch for StorageTextureAccess"); - - static_assert(static_cast(StorageTextureAccess::Undefined) == WGPUStorageTextureAccess_Undefined, "value mismatch for StorageTextureAccess::Undefined"); - static_assert(static_cast(StorageTextureAccess::WriteOnly) == WGPUStorageTextureAccess_WriteOnly, "value mismatch for StorageTextureAccess::WriteOnly"); - static_assert(static_cast(StorageTextureAccess::ReadOnly) == WGPUStorageTextureAccess_ReadOnly, "value mismatch for StorageTextureAccess::ReadOnly"); - static_assert(static_cast(StorageTextureAccess::ReadWrite) == WGPUStorageTextureAccess_ReadWrite, "value mismatch for StorageTextureAccess::ReadWrite"); - - // StoreOp - - static_assert(sizeof(StoreOp) == sizeof(WGPUStoreOp), "sizeof mismatch for StoreOp"); - static_assert(alignof(StoreOp) == alignof(WGPUStoreOp), "alignof mismatch for StoreOp"); - - static_assert(static_cast(StoreOp::Undefined) == WGPUStoreOp_Undefined, "value mismatch for StoreOp::Undefined"); - static_assert(static_cast(StoreOp::Store) == WGPUStoreOp_Store, "value mismatch for StoreOp::Store"); - static_assert(static_cast(StoreOp::Discard) == WGPUStoreOp_Discard, "value mismatch for StoreOp::Discard"); - - // SurfaceGetCurrentTextureStatus - - static_assert(sizeof(SurfaceGetCurrentTextureStatus) == sizeof(WGPUSurfaceGetCurrentTextureStatus), "sizeof mismatch for SurfaceGetCurrentTextureStatus"); - static_assert(alignof(SurfaceGetCurrentTextureStatus) == alignof(WGPUSurfaceGetCurrentTextureStatus), "alignof mismatch for SurfaceGetCurrentTextureStatus"); - - static_assert(static_cast(SurfaceGetCurrentTextureStatus::Success) == WGPUSurfaceGetCurrentTextureStatus_Success, "value mismatch for SurfaceGetCurrentTextureStatus::Success"); - static_assert(static_cast(SurfaceGetCurrentTextureStatus::Timeout) == WGPUSurfaceGetCurrentTextureStatus_Timeout, "value mismatch for SurfaceGetCurrentTextureStatus::Timeout"); - static_assert(static_cast(SurfaceGetCurrentTextureStatus::Outdated) == WGPUSurfaceGetCurrentTextureStatus_Outdated, "value mismatch for SurfaceGetCurrentTextureStatus::Outdated"); - static_assert(static_cast(SurfaceGetCurrentTextureStatus::Lost) == WGPUSurfaceGetCurrentTextureStatus_Lost, "value mismatch for SurfaceGetCurrentTextureStatus::Lost"); - static_assert(static_cast(SurfaceGetCurrentTextureStatus::OutOfMemory) == WGPUSurfaceGetCurrentTextureStatus_OutOfMemory, "value mismatch for SurfaceGetCurrentTextureStatus::OutOfMemory"); - static_assert(static_cast(SurfaceGetCurrentTextureStatus::DeviceLost) == WGPUSurfaceGetCurrentTextureStatus_DeviceLost, "value mismatch for SurfaceGetCurrentTextureStatus::DeviceLost"); - - // TextureAspect - - static_assert(sizeof(TextureAspect) == sizeof(WGPUTextureAspect), "sizeof mismatch for TextureAspect"); - static_assert(alignof(TextureAspect) == alignof(WGPUTextureAspect), "alignof mismatch for TextureAspect"); - - static_assert(static_cast(TextureAspect::Undefined) == WGPUTextureAspect_Undefined, "value mismatch for TextureAspect::Undefined"); - static_assert(static_cast(TextureAspect::All) == WGPUTextureAspect_All, "value mismatch for TextureAspect::All"); - static_assert(static_cast(TextureAspect::StencilOnly) == WGPUTextureAspect_StencilOnly, "value mismatch for TextureAspect::StencilOnly"); - static_assert(static_cast(TextureAspect::DepthOnly) == WGPUTextureAspect_DepthOnly, "value mismatch for TextureAspect::DepthOnly"); - - // TextureDimension - - static_assert(sizeof(TextureDimension) == sizeof(WGPUTextureDimension), "sizeof mismatch for TextureDimension"); - static_assert(alignof(TextureDimension) == alignof(WGPUTextureDimension), "alignof mismatch for TextureDimension"); - - static_assert(static_cast(TextureDimension::Undefined) == WGPUTextureDimension_Undefined, "value mismatch for TextureDimension::Undefined"); - static_assert(static_cast(TextureDimension::e1D) == WGPUTextureDimension_1D, "value mismatch for TextureDimension::e1D"); - static_assert(static_cast(TextureDimension::e2D) == WGPUTextureDimension_2D, "value mismatch for TextureDimension::e2D"); - static_assert(static_cast(TextureDimension::e3D) == WGPUTextureDimension_3D, "value mismatch for TextureDimension::e3D"); - - // TextureFormat - - static_assert(sizeof(TextureFormat) == sizeof(WGPUTextureFormat), "sizeof mismatch for TextureFormat"); - static_assert(alignof(TextureFormat) == alignof(WGPUTextureFormat), "alignof mismatch for TextureFormat"); - - static_assert(static_cast(TextureFormat::Undefined) == WGPUTextureFormat_Undefined, "value mismatch for TextureFormat::Undefined"); - static_assert(static_cast(TextureFormat::R8Unorm) == WGPUTextureFormat_R8Unorm, "value mismatch for TextureFormat::R8Unorm"); - static_assert(static_cast(TextureFormat::R8Snorm) == WGPUTextureFormat_R8Snorm, "value mismatch for TextureFormat::R8Snorm"); - static_assert(static_cast(TextureFormat::R8Uint) == WGPUTextureFormat_R8Uint, "value mismatch for TextureFormat::R8Uint"); - static_assert(static_cast(TextureFormat::R8Sint) == WGPUTextureFormat_R8Sint, "value mismatch for TextureFormat::R8Sint"); - static_assert(static_cast(TextureFormat::R16Uint) == WGPUTextureFormat_R16Uint, "value mismatch for TextureFormat::R16Uint"); - static_assert(static_cast(TextureFormat::R16Sint) == WGPUTextureFormat_R16Sint, "value mismatch for TextureFormat::R16Sint"); - static_assert(static_cast(TextureFormat::R16Float) == WGPUTextureFormat_R16Float, "value mismatch for TextureFormat::R16Float"); - static_assert(static_cast(TextureFormat::RG8Unorm) == WGPUTextureFormat_RG8Unorm, "value mismatch for TextureFormat::RG8Unorm"); - static_assert(static_cast(TextureFormat::RG8Snorm) == WGPUTextureFormat_RG8Snorm, "value mismatch for TextureFormat::RG8Snorm"); - static_assert(static_cast(TextureFormat::RG8Uint) == WGPUTextureFormat_RG8Uint, "value mismatch for TextureFormat::RG8Uint"); - static_assert(static_cast(TextureFormat::RG8Sint) == WGPUTextureFormat_RG8Sint, "value mismatch for TextureFormat::RG8Sint"); - static_assert(static_cast(TextureFormat::R32Float) == WGPUTextureFormat_R32Float, "value mismatch for TextureFormat::R32Float"); - static_assert(static_cast(TextureFormat::R32Uint) == WGPUTextureFormat_R32Uint, "value mismatch for TextureFormat::R32Uint"); - static_assert(static_cast(TextureFormat::R32Sint) == WGPUTextureFormat_R32Sint, "value mismatch for TextureFormat::R32Sint"); - static_assert(static_cast(TextureFormat::RG16Uint) == WGPUTextureFormat_RG16Uint, "value mismatch for TextureFormat::RG16Uint"); - static_assert(static_cast(TextureFormat::RG16Sint) == WGPUTextureFormat_RG16Sint, "value mismatch for TextureFormat::RG16Sint"); - static_assert(static_cast(TextureFormat::RG16Float) == WGPUTextureFormat_RG16Float, "value mismatch for TextureFormat::RG16Float"); - static_assert(static_cast(TextureFormat::RGBA8Unorm) == WGPUTextureFormat_RGBA8Unorm, "value mismatch for TextureFormat::RGBA8Unorm"); - static_assert(static_cast(TextureFormat::RGBA8UnormSrgb) == WGPUTextureFormat_RGBA8UnormSrgb, "value mismatch for TextureFormat::RGBA8UnormSrgb"); - static_assert(static_cast(TextureFormat::RGBA8Snorm) == WGPUTextureFormat_RGBA8Snorm, "value mismatch for TextureFormat::RGBA8Snorm"); - static_assert(static_cast(TextureFormat::RGBA8Uint) == WGPUTextureFormat_RGBA8Uint, "value mismatch for TextureFormat::RGBA8Uint"); - static_assert(static_cast(TextureFormat::RGBA8Sint) == WGPUTextureFormat_RGBA8Sint, "value mismatch for TextureFormat::RGBA8Sint"); - static_assert(static_cast(TextureFormat::BGRA8Unorm) == WGPUTextureFormat_BGRA8Unorm, "value mismatch for TextureFormat::BGRA8Unorm"); - static_assert(static_cast(TextureFormat::BGRA8UnormSrgb) == WGPUTextureFormat_BGRA8UnormSrgb, "value mismatch for TextureFormat::BGRA8UnormSrgb"); - static_assert(static_cast(TextureFormat::RGB10A2Uint) == WGPUTextureFormat_RGB10A2Uint, "value mismatch for TextureFormat::RGB10A2Uint"); - static_assert(static_cast(TextureFormat::RGB10A2Unorm) == WGPUTextureFormat_RGB10A2Unorm, "value mismatch for TextureFormat::RGB10A2Unorm"); - static_assert(static_cast(TextureFormat::RG11B10Ufloat) == WGPUTextureFormat_RG11B10Ufloat, "value mismatch for TextureFormat::RG11B10Ufloat"); - static_assert(static_cast(TextureFormat::RGB9E5Ufloat) == WGPUTextureFormat_RGB9E5Ufloat, "value mismatch for TextureFormat::RGB9E5Ufloat"); - static_assert(static_cast(TextureFormat::RG32Float) == WGPUTextureFormat_RG32Float, "value mismatch for TextureFormat::RG32Float"); - static_assert(static_cast(TextureFormat::RG32Uint) == WGPUTextureFormat_RG32Uint, "value mismatch for TextureFormat::RG32Uint"); - static_assert(static_cast(TextureFormat::RG32Sint) == WGPUTextureFormat_RG32Sint, "value mismatch for TextureFormat::RG32Sint"); - static_assert(static_cast(TextureFormat::RGBA16Uint) == WGPUTextureFormat_RGBA16Uint, "value mismatch for TextureFormat::RGBA16Uint"); - static_assert(static_cast(TextureFormat::RGBA16Sint) == WGPUTextureFormat_RGBA16Sint, "value mismatch for TextureFormat::RGBA16Sint"); - static_assert(static_cast(TextureFormat::RGBA16Float) == WGPUTextureFormat_RGBA16Float, "value mismatch for TextureFormat::RGBA16Float"); - static_assert(static_cast(TextureFormat::RGBA32Float) == WGPUTextureFormat_RGBA32Float, "value mismatch for TextureFormat::RGBA32Float"); - static_assert(static_cast(TextureFormat::RGBA32Uint) == WGPUTextureFormat_RGBA32Uint, "value mismatch for TextureFormat::RGBA32Uint"); - static_assert(static_cast(TextureFormat::RGBA32Sint) == WGPUTextureFormat_RGBA32Sint, "value mismatch for TextureFormat::RGBA32Sint"); - static_assert(static_cast(TextureFormat::Stencil8) == WGPUTextureFormat_Stencil8, "value mismatch for TextureFormat::Stencil8"); - static_assert(static_cast(TextureFormat::Depth16Unorm) == WGPUTextureFormat_Depth16Unorm, "value mismatch for TextureFormat::Depth16Unorm"); - static_assert(static_cast(TextureFormat::Depth24Plus) == WGPUTextureFormat_Depth24Plus, "value mismatch for TextureFormat::Depth24Plus"); - static_assert(static_cast(TextureFormat::Depth24PlusStencil8) == WGPUTextureFormat_Depth24PlusStencil8, "value mismatch for TextureFormat::Depth24PlusStencil8"); - static_assert(static_cast(TextureFormat::Depth32Float) == WGPUTextureFormat_Depth32Float, "value mismatch for TextureFormat::Depth32Float"); - static_assert(static_cast(TextureFormat::Depth32FloatStencil8) == WGPUTextureFormat_Depth32FloatStencil8, "value mismatch for TextureFormat::Depth32FloatStencil8"); - static_assert(static_cast(TextureFormat::BC1RGBAUnorm) == WGPUTextureFormat_BC1RGBAUnorm, "value mismatch for TextureFormat::BC1RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC1RGBAUnormSrgb) == WGPUTextureFormat_BC1RGBAUnormSrgb, "value mismatch for TextureFormat::BC1RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC2RGBAUnorm) == WGPUTextureFormat_BC2RGBAUnorm, "value mismatch for TextureFormat::BC2RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC2RGBAUnormSrgb) == WGPUTextureFormat_BC2RGBAUnormSrgb, "value mismatch for TextureFormat::BC2RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC3RGBAUnorm) == WGPUTextureFormat_BC3RGBAUnorm, "value mismatch for TextureFormat::BC3RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC3RGBAUnormSrgb) == WGPUTextureFormat_BC3RGBAUnormSrgb, "value mismatch for TextureFormat::BC3RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC4RUnorm) == WGPUTextureFormat_BC4RUnorm, "value mismatch for TextureFormat::BC4RUnorm"); - static_assert(static_cast(TextureFormat::BC4RSnorm) == WGPUTextureFormat_BC4RSnorm, "value mismatch for TextureFormat::BC4RSnorm"); - static_assert(static_cast(TextureFormat::BC5RGUnorm) == WGPUTextureFormat_BC5RGUnorm, "value mismatch for TextureFormat::BC5RGUnorm"); - static_assert(static_cast(TextureFormat::BC5RGSnorm) == WGPUTextureFormat_BC5RGSnorm, "value mismatch for TextureFormat::BC5RGSnorm"); - static_assert(static_cast(TextureFormat::BC6HRGBUfloat) == WGPUTextureFormat_BC6HRGBUfloat, "value mismatch for TextureFormat::BC6HRGBUfloat"); - static_assert(static_cast(TextureFormat::BC6HRGBFloat) == WGPUTextureFormat_BC6HRGBFloat, "value mismatch for TextureFormat::BC6HRGBFloat"); - static_assert(static_cast(TextureFormat::BC7RGBAUnorm) == WGPUTextureFormat_BC7RGBAUnorm, "value mismatch for TextureFormat::BC7RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC7RGBAUnormSrgb) == WGPUTextureFormat_BC7RGBAUnormSrgb, "value mismatch for TextureFormat::BC7RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::ETC2RGB8Unorm) == WGPUTextureFormat_ETC2RGB8Unorm, "value mismatch for TextureFormat::ETC2RGB8Unorm"); - static_assert(static_cast(TextureFormat::ETC2RGB8UnormSrgb) == WGPUTextureFormat_ETC2RGB8UnormSrgb, "value mismatch for TextureFormat::ETC2RGB8UnormSrgb"); - static_assert(static_cast(TextureFormat::ETC2RGB8A1Unorm) == WGPUTextureFormat_ETC2RGB8A1Unorm, "value mismatch for TextureFormat::ETC2RGB8A1Unorm"); - static_assert(static_cast(TextureFormat::ETC2RGB8A1UnormSrgb) == WGPUTextureFormat_ETC2RGB8A1UnormSrgb, "value mismatch for TextureFormat::ETC2RGB8A1UnormSrgb"); - static_assert(static_cast(TextureFormat::ETC2RGBA8Unorm) == WGPUTextureFormat_ETC2RGBA8Unorm, "value mismatch for TextureFormat::ETC2RGBA8Unorm"); - static_assert(static_cast(TextureFormat::ETC2RGBA8UnormSrgb) == WGPUTextureFormat_ETC2RGBA8UnormSrgb, "value mismatch for TextureFormat::ETC2RGBA8UnormSrgb"); - static_assert(static_cast(TextureFormat::EACR11Unorm) == WGPUTextureFormat_EACR11Unorm, "value mismatch for TextureFormat::EACR11Unorm"); - static_assert(static_cast(TextureFormat::EACR11Snorm) == WGPUTextureFormat_EACR11Snorm, "value mismatch for TextureFormat::EACR11Snorm"); - static_assert(static_cast(TextureFormat::EACRG11Unorm) == WGPUTextureFormat_EACRG11Unorm, "value mismatch for TextureFormat::EACRG11Unorm"); - static_assert(static_cast(TextureFormat::EACRG11Snorm) == WGPUTextureFormat_EACRG11Snorm, "value mismatch for TextureFormat::EACRG11Snorm"); - static_assert(static_cast(TextureFormat::ASTC4x4Unorm) == WGPUTextureFormat_ASTC4x4Unorm, "value mismatch for TextureFormat::ASTC4x4Unorm"); - static_assert(static_cast(TextureFormat::ASTC4x4UnormSrgb) == WGPUTextureFormat_ASTC4x4UnormSrgb, "value mismatch for TextureFormat::ASTC4x4UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC5x4Unorm) == WGPUTextureFormat_ASTC5x4Unorm, "value mismatch for TextureFormat::ASTC5x4Unorm"); - static_assert(static_cast(TextureFormat::ASTC5x4UnormSrgb) == WGPUTextureFormat_ASTC5x4UnormSrgb, "value mismatch for TextureFormat::ASTC5x4UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC5x5Unorm) == WGPUTextureFormat_ASTC5x5Unorm, "value mismatch for TextureFormat::ASTC5x5Unorm"); - static_assert(static_cast(TextureFormat::ASTC5x5UnormSrgb) == WGPUTextureFormat_ASTC5x5UnormSrgb, "value mismatch for TextureFormat::ASTC5x5UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC6x5Unorm) == WGPUTextureFormat_ASTC6x5Unorm, "value mismatch for TextureFormat::ASTC6x5Unorm"); - static_assert(static_cast(TextureFormat::ASTC6x5UnormSrgb) == WGPUTextureFormat_ASTC6x5UnormSrgb, "value mismatch for TextureFormat::ASTC6x5UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC6x6Unorm) == WGPUTextureFormat_ASTC6x6Unorm, "value mismatch for TextureFormat::ASTC6x6Unorm"); - static_assert(static_cast(TextureFormat::ASTC6x6UnormSrgb) == WGPUTextureFormat_ASTC6x6UnormSrgb, "value mismatch for TextureFormat::ASTC6x6UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC8x5Unorm) == WGPUTextureFormat_ASTC8x5Unorm, "value mismatch for TextureFormat::ASTC8x5Unorm"); - static_assert(static_cast(TextureFormat::ASTC8x5UnormSrgb) == WGPUTextureFormat_ASTC8x5UnormSrgb, "value mismatch for TextureFormat::ASTC8x5UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC8x6Unorm) == WGPUTextureFormat_ASTC8x6Unorm, "value mismatch for TextureFormat::ASTC8x6Unorm"); - static_assert(static_cast(TextureFormat::ASTC8x6UnormSrgb) == WGPUTextureFormat_ASTC8x6UnormSrgb, "value mismatch for TextureFormat::ASTC8x6UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC8x8Unorm) == WGPUTextureFormat_ASTC8x8Unorm, "value mismatch for TextureFormat::ASTC8x8Unorm"); - static_assert(static_cast(TextureFormat::ASTC8x8UnormSrgb) == WGPUTextureFormat_ASTC8x8UnormSrgb, "value mismatch for TextureFormat::ASTC8x8UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC10x5Unorm) == WGPUTextureFormat_ASTC10x5Unorm, "value mismatch for TextureFormat::ASTC10x5Unorm"); - static_assert(static_cast(TextureFormat::ASTC10x5UnormSrgb) == WGPUTextureFormat_ASTC10x5UnormSrgb, "value mismatch for TextureFormat::ASTC10x5UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC10x6Unorm) == WGPUTextureFormat_ASTC10x6Unorm, "value mismatch for TextureFormat::ASTC10x6Unorm"); - static_assert(static_cast(TextureFormat::ASTC10x6UnormSrgb) == WGPUTextureFormat_ASTC10x6UnormSrgb, "value mismatch for TextureFormat::ASTC10x6UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC10x8Unorm) == WGPUTextureFormat_ASTC10x8Unorm, "value mismatch for TextureFormat::ASTC10x8Unorm"); - static_assert(static_cast(TextureFormat::ASTC10x8UnormSrgb) == WGPUTextureFormat_ASTC10x8UnormSrgb, "value mismatch for TextureFormat::ASTC10x8UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC10x10Unorm) == WGPUTextureFormat_ASTC10x10Unorm, "value mismatch for TextureFormat::ASTC10x10Unorm"); - static_assert(static_cast(TextureFormat::ASTC10x10UnormSrgb) == WGPUTextureFormat_ASTC10x10UnormSrgb, "value mismatch for TextureFormat::ASTC10x10UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC12x10Unorm) == WGPUTextureFormat_ASTC12x10Unorm, "value mismatch for TextureFormat::ASTC12x10Unorm"); - static_assert(static_cast(TextureFormat::ASTC12x10UnormSrgb) == WGPUTextureFormat_ASTC12x10UnormSrgb, "value mismatch for TextureFormat::ASTC12x10UnormSrgb"); - static_assert(static_cast(TextureFormat::ASTC12x12Unorm) == WGPUTextureFormat_ASTC12x12Unorm, "value mismatch for TextureFormat::ASTC12x12Unorm"); - static_assert(static_cast(TextureFormat::ASTC12x12UnormSrgb) == WGPUTextureFormat_ASTC12x12UnormSrgb, "value mismatch for TextureFormat::ASTC12x12UnormSrgb"); - - // TextureSampleType - - static_assert(sizeof(TextureSampleType) == sizeof(WGPUTextureSampleType), "sizeof mismatch for TextureSampleType"); - static_assert(alignof(TextureSampleType) == alignof(WGPUTextureSampleType), "alignof mismatch for TextureSampleType"); - - static_assert(static_cast(TextureSampleType::Undefined) == WGPUTextureSampleType_Undefined, "value mismatch for TextureSampleType::Undefined"); - static_assert(static_cast(TextureSampleType::Float) == WGPUTextureSampleType_Float, "value mismatch for TextureSampleType::Float"); - static_assert(static_cast(TextureSampleType::UnfilterableFloat) == WGPUTextureSampleType_UnfilterableFloat, "value mismatch for TextureSampleType::UnfilterableFloat"); - static_assert(static_cast(TextureSampleType::Depth) == WGPUTextureSampleType_Depth, "value mismatch for TextureSampleType::Depth"); - static_assert(static_cast(TextureSampleType::Sint) == WGPUTextureSampleType_Sint, "value mismatch for TextureSampleType::Sint"); - static_assert(static_cast(TextureSampleType::Uint) == WGPUTextureSampleType_Uint, "value mismatch for TextureSampleType::Uint"); - - // TextureViewDimension - - static_assert(sizeof(TextureViewDimension) == sizeof(WGPUTextureViewDimension), "sizeof mismatch for TextureViewDimension"); - static_assert(alignof(TextureViewDimension) == alignof(WGPUTextureViewDimension), "alignof mismatch for TextureViewDimension"); - - static_assert(static_cast(TextureViewDimension::Undefined) == WGPUTextureViewDimension_Undefined, "value mismatch for TextureViewDimension::Undefined"); - static_assert(static_cast(TextureViewDimension::e1D) == WGPUTextureViewDimension_1D, "value mismatch for TextureViewDimension::e1D"); - static_assert(static_cast(TextureViewDimension::e2D) == WGPUTextureViewDimension_2D, "value mismatch for TextureViewDimension::e2D"); - static_assert(static_cast(TextureViewDimension::e2DArray) == WGPUTextureViewDimension_2DArray, "value mismatch for TextureViewDimension::e2DArray"); - static_assert(static_cast(TextureViewDimension::Cube) == WGPUTextureViewDimension_Cube, "value mismatch for TextureViewDimension::Cube"); - static_assert(static_cast(TextureViewDimension::CubeArray) == WGPUTextureViewDimension_CubeArray, "value mismatch for TextureViewDimension::CubeArray"); - static_assert(static_cast(TextureViewDimension::e3D) == WGPUTextureViewDimension_3D, "value mismatch for TextureViewDimension::e3D"); - - // VertexFormat - - static_assert(sizeof(VertexFormat) == sizeof(WGPUVertexFormat), "sizeof mismatch for VertexFormat"); - static_assert(alignof(VertexFormat) == alignof(WGPUVertexFormat), "alignof mismatch for VertexFormat"); - - static_assert(static_cast(VertexFormat::Undefined) == WGPUVertexFormat_Undefined, "value mismatch for VertexFormat::Undefined"); - static_assert(static_cast(VertexFormat::Uint8x2) == WGPUVertexFormat_Uint8x2, "value mismatch for VertexFormat::Uint8x2"); - static_assert(static_cast(VertexFormat::Uint8x4) == WGPUVertexFormat_Uint8x4, "value mismatch for VertexFormat::Uint8x4"); - static_assert(static_cast(VertexFormat::Sint8x2) == WGPUVertexFormat_Sint8x2, "value mismatch for VertexFormat::Sint8x2"); - static_assert(static_cast(VertexFormat::Sint8x4) == WGPUVertexFormat_Sint8x4, "value mismatch for VertexFormat::Sint8x4"); - static_assert(static_cast(VertexFormat::Unorm8x2) == WGPUVertexFormat_Unorm8x2, "value mismatch for VertexFormat::Unorm8x2"); - static_assert(static_cast(VertexFormat::Unorm8x4) == WGPUVertexFormat_Unorm8x4, "value mismatch for VertexFormat::Unorm8x4"); - static_assert(static_cast(VertexFormat::Snorm8x2) == WGPUVertexFormat_Snorm8x2, "value mismatch for VertexFormat::Snorm8x2"); - static_assert(static_cast(VertexFormat::Snorm8x4) == WGPUVertexFormat_Snorm8x4, "value mismatch for VertexFormat::Snorm8x4"); - static_assert(static_cast(VertexFormat::Uint16x2) == WGPUVertexFormat_Uint16x2, "value mismatch for VertexFormat::Uint16x2"); - static_assert(static_cast(VertexFormat::Uint16x4) == WGPUVertexFormat_Uint16x4, "value mismatch for VertexFormat::Uint16x4"); - static_assert(static_cast(VertexFormat::Sint16x2) == WGPUVertexFormat_Sint16x2, "value mismatch for VertexFormat::Sint16x2"); - static_assert(static_cast(VertexFormat::Sint16x4) == WGPUVertexFormat_Sint16x4, "value mismatch for VertexFormat::Sint16x4"); - static_assert(static_cast(VertexFormat::Unorm16x2) == WGPUVertexFormat_Unorm16x2, "value mismatch for VertexFormat::Unorm16x2"); - static_assert(static_cast(VertexFormat::Unorm16x4) == WGPUVertexFormat_Unorm16x4, "value mismatch for VertexFormat::Unorm16x4"); - static_assert(static_cast(VertexFormat::Snorm16x2) == WGPUVertexFormat_Snorm16x2, "value mismatch for VertexFormat::Snorm16x2"); - static_assert(static_cast(VertexFormat::Snorm16x4) == WGPUVertexFormat_Snorm16x4, "value mismatch for VertexFormat::Snorm16x4"); - static_assert(static_cast(VertexFormat::Float16x2) == WGPUVertexFormat_Float16x2, "value mismatch for VertexFormat::Float16x2"); - static_assert(static_cast(VertexFormat::Float16x4) == WGPUVertexFormat_Float16x4, "value mismatch for VertexFormat::Float16x4"); - static_assert(static_cast(VertexFormat::Float32) == WGPUVertexFormat_Float32, "value mismatch for VertexFormat::Float32"); - static_assert(static_cast(VertexFormat::Float32x2) == WGPUVertexFormat_Float32x2, "value mismatch for VertexFormat::Float32x2"); - static_assert(static_cast(VertexFormat::Float32x3) == WGPUVertexFormat_Float32x3, "value mismatch for VertexFormat::Float32x3"); - static_assert(static_cast(VertexFormat::Float32x4) == WGPUVertexFormat_Float32x4, "value mismatch for VertexFormat::Float32x4"); - static_assert(static_cast(VertexFormat::Uint32) == WGPUVertexFormat_Uint32, "value mismatch for VertexFormat::Uint32"); - static_assert(static_cast(VertexFormat::Uint32x2) == WGPUVertexFormat_Uint32x2, "value mismatch for VertexFormat::Uint32x2"); - static_assert(static_cast(VertexFormat::Uint32x3) == WGPUVertexFormat_Uint32x3, "value mismatch for VertexFormat::Uint32x3"); - static_assert(static_cast(VertexFormat::Uint32x4) == WGPUVertexFormat_Uint32x4, "value mismatch for VertexFormat::Uint32x4"); - static_assert(static_cast(VertexFormat::Sint32) == WGPUVertexFormat_Sint32, "value mismatch for VertexFormat::Sint32"); - static_assert(static_cast(VertexFormat::Sint32x2) == WGPUVertexFormat_Sint32x2, "value mismatch for VertexFormat::Sint32x2"); - static_assert(static_cast(VertexFormat::Sint32x3) == WGPUVertexFormat_Sint32x3, "value mismatch for VertexFormat::Sint32x3"); - static_assert(static_cast(VertexFormat::Sint32x4) == WGPUVertexFormat_Sint32x4, "value mismatch for VertexFormat::Sint32x4"); - static_assert(static_cast(VertexFormat::Unorm10_10_10_2) == WGPUVertexFormat_Unorm10_10_10_2, "value mismatch for VertexFormat::Unorm10_10_10_2"); - - // VertexStepMode - - static_assert(sizeof(VertexStepMode) == sizeof(WGPUVertexStepMode), "sizeof mismatch for VertexStepMode"); - static_assert(alignof(VertexStepMode) == alignof(WGPUVertexStepMode), "alignof mismatch for VertexStepMode"); - - static_assert(static_cast(VertexStepMode::Undefined) == WGPUVertexStepMode_Undefined, "value mismatch for VertexStepMode::Undefined"); - static_assert(static_cast(VertexStepMode::VertexBufferNotUsed) == WGPUVertexStepMode_VertexBufferNotUsed, "value mismatch for VertexStepMode::VertexBufferNotUsed"); - static_assert(static_cast(VertexStepMode::Vertex) == WGPUVertexStepMode_Vertex, "value mismatch for VertexStepMode::Vertex"); - static_assert(static_cast(VertexStepMode::Instance) == WGPUVertexStepMode_Instance, "value mismatch for VertexStepMode::Instance"); - - // WaitStatus - - static_assert(sizeof(WaitStatus) == sizeof(WGPUWaitStatus), "sizeof mismatch for WaitStatus"); - static_assert(alignof(WaitStatus) == alignof(WGPUWaitStatus), "alignof mismatch for WaitStatus"); - - static_assert(static_cast(WaitStatus::Success) == WGPUWaitStatus_Success, "value mismatch for WaitStatus::Success"); - static_assert(static_cast(WaitStatus::TimedOut) == WGPUWaitStatus_TimedOut, "value mismatch for WaitStatus::TimedOut"); - static_assert(static_cast(WaitStatus::UnsupportedTimeout) == WGPUWaitStatus_UnsupportedTimeout, "value mismatch for WaitStatus::UnsupportedTimeout"); - static_assert(static_cast(WaitStatus::UnsupportedCount) == WGPUWaitStatus_UnsupportedCount, "value mismatch for WaitStatus::UnsupportedCount"); - static_assert(static_cast(WaitStatus::UnsupportedMixedSources) == WGPUWaitStatus_UnsupportedMixedSources, "value mismatch for WaitStatus::UnsupportedMixedSources"); - static_assert(static_cast(WaitStatus::Unknown) == WGPUWaitStatus_Unknown, "value mismatch for WaitStatus::Unknown"); - - // BufferUsage - - static_assert(sizeof(BufferUsage) == sizeof(WGPUBufferUsageFlags), "sizeof mismatch for BufferUsage"); - static_assert(alignof(BufferUsage) == alignof(WGPUBufferUsageFlags), "alignof mismatch for BufferUsage"); - - static_assert(static_cast(BufferUsage::None) == WGPUBufferUsage_None, "value mismatch for BufferUsage::None"); - static_assert(static_cast(BufferUsage::MapRead) == WGPUBufferUsage_MapRead, "value mismatch for BufferUsage::MapRead"); - static_assert(static_cast(BufferUsage::MapWrite) == WGPUBufferUsage_MapWrite, "value mismatch for BufferUsage::MapWrite"); - static_assert(static_cast(BufferUsage::CopySrc) == WGPUBufferUsage_CopySrc, "value mismatch for BufferUsage::CopySrc"); - static_assert(static_cast(BufferUsage::CopyDst) == WGPUBufferUsage_CopyDst, "value mismatch for BufferUsage::CopyDst"); - static_assert(static_cast(BufferUsage::Index) == WGPUBufferUsage_Index, "value mismatch for BufferUsage::Index"); - static_assert(static_cast(BufferUsage::Vertex) == WGPUBufferUsage_Vertex, "value mismatch for BufferUsage::Vertex"); - static_assert(static_cast(BufferUsage::Uniform) == WGPUBufferUsage_Uniform, "value mismatch for BufferUsage::Uniform"); - static_assert(static_cast(BufferUsage::Storage) == WGPUBufferUsage_Storage, "value mismatch for BufferUsage::Storage"); - static_assert(static_cast(BufferUsage::Indirect) == WGPUBufferUsage_Indirect, "value mismatch for BufferUsage::Indirect"); - static_assert(static_cast(BufferUsage::QueryResolve) == WGPUBufferUsage_QueryResolve, "value mismatch for BufferUsage::QueryResolve"); - - // ColorWriteMask - - static_assert(sizeof(ColorWriteMask) == sizeof(WGPUColorWriteMaskFlags), "sizeof mismatch for ColorWriteMask"); - static_assert(alignof(ColorWriteMask) == alignof(WGPUColorWriteMaskFlags), "alignof mismatch for ColorWriteMask"); - - static_assert(static_cast(ColorWriteMask::None) == WGPUColorWriteMask_None, "value mismatch for ColorWriteMask::None"); - static_assert(static_cast(ColorWriteMask::Red) == WGPUColorWriteMask_Red, "value mismatch for ColorWriteMask::Red"); - static_assert(static_cast(ColorWriteMask::Green) == WGPUColorWriteMask_Green, "value mismatch for ColorWriteMask::Green"); - static_assert(static_cast(ColorWriteMask::Blue) == WGPUColorWriteMask_Blue, "value mismatch for ColorWriteMask::Blue"); - static_assert(static_cast(ColorWriteMask::Alpha) == WGPUColorWriteMask_Alpha, "value mismatch for ColorWriteMask::Alpha"); - static_assert(static_cast(ColorWriteMask::All) == WGPUColorWriteMask_All, "value mismatch for ColorWriteMask::All"); - - // MapMode - - static_assert(sizeof(MapMode) == sizeof(WGPUMapModeFlags), "sizeof mismatch for MapMode"); - static_assert(alignof(MapMode) == alignof(WGPUMapModeFlags), "alignof mismatch for MapMode"); - - static_assert(static_cast(MapMode::None) == WGPUMapMode_None, "value mismatch for MapMode::None"); - static_assert(static_cast(MapMode::Read) == WGPUMapMode_Read, "value mismatch for MapMode::Read"); - static_assert(static_cast(MapMode::Write) == WGPUMapMode_Write, "value mismatch for MapMode::Write"); - - // ShaderStage - - static_assert(sizeof(ShaderStage) == sizeof(WGPUShaderStageFlags), "sizeof mismatch for ShaderStage"); - static_assert(alignof(ShaderStage) == alignof(WGPUShaderStageFlags), "alignof mismatch for ShaderStage"); - - static_assert(static_cast(ShaderStage::None) == WGPUShaderStage_None, "value mismatch for ShaderStage::None"); - static_assert(static_cast(ShaderStage::Vertex) == WGPUShaderStage_Vertex, "value mismatch for ShaderStage::Vertex"); - static_assert(static_cast(ShaderStage::Fragment) == WGPUShaderStage_Fragment, "value mismatch for ShaderStage::Fragment"); - static_assert(static_cast(ShaderStage::Compute) == WGPUShaderStage_Compute, "value mismatch for ShaderStage::Compute"); - - // TextureUsage - - static_assert(sizeof(TextureUsage) == sizeof(WGPUTextureUsageFlags), "sizeof mismatch for TextureUsage"); - static_assert(alignof(TextureUsage) == alignof(WGPUTextureUsageFlags), "alignof mismatch for TextureUsage"); - - static_assert(static_cast(TextureUsage::None) == WGPUTextureUsage_None, "value mismatch for TextureUsage::None"); - static_assert(static_cast(TextureUsage::CopySrc) == WGPUTextureUsage_CopySrc, "value mismatch for TextureUsage::CopySrc"); - static_assert(static_cast(TextureUsage::CopyDst) == WGPUTextureUsage_CopyDst, "value mismatch for TextureUsage::CopyDst"); - static_assert(static_cast(TextureUsage::TextureBinding) == WGPUTextureUsage_TextureBinding, "value mismatch for TextureUsage::TextureBinding"); - static_assert(static_cast(TextureUsage::StorageBinding) == WGPUTextureUsage_StorageBinding, "value mismatch for TextureUsage::StorageBinding"); - static_assert(static_cast(TextureUsage::RenderAttachment) == WGPUTextureUsage_RenderAttachment, "value mismatch for TextureUsage::RenderAttachment"); - - // ChainedStruct - - static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct), - "sizeof mismatch for ChainedStruct"); - static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), - "alignof mismatch for ChainedStruct"); - static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next), - "offsetof mismatch for ChainedStruct::nextInChain"); - static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), - "offsetof mismatch for ChainedStruct::sType"); - - // AdapterInfo - - static_assert(sizeof(AdapterInfo) == sizeof(WGPUAdapterInfo), "sizeof mismatch for AdapterInfo"); - static_assert(alignof(AdapterInfo) == alignof(WGPUAdapterInfo), "alignof mismatch for AdapterInfo"); - - static_assert(offsetof(AdapterInfo, nextInChain) == offsetof(WGPUAdapterInfo, nextInChain), - "offsetof mismatch for AdapterInfo::nextInChain"); - static_assert(offsetof(AdapterInfo, vendor) == offsetof(WGPUAdapterInfo, vendor), - "offsetof mismatch for AdapterInfo::vendor"); - static_assert(offsetof(AdapterInfo, architecture) == offsetof(WGPUAdapterInfo, architecture), - "offsetof mismatch for AdapterInfo::architecture"); - static_assert(offsetof(AdapterInfo, device) == offsetof(WGPUAdapterInfo, device), - "offsetof mismatch for AdapterInfo::device"); - static_assert(offsetof(AdapterInfo, description) == offsetof(WGPUAdapterInfo, description), - "offsetof mismatch for AdapterInfo::description"); - static_assert(offsetof(AdapterInfo, backendType) == offsetof(WGPUAdapterInfo, backendType), - "offsetof mismatch for AdapterInfo::backendType"); - static_assert(offsetof(AdapterInfo, adapterType) == offsetof(WGPUAdapterInfo, adapterType), - "offsetof mismatch for AdapterInfo::adapterType"); - static_assert(offsetof(AdapterInfo, vendorID) == offsetof(WGPUAdapterInfo, vendorID), - "offsetof mismatch for AdapterInfo::vendorID"); - static_assert(offsetof(AdapterInfo, deviceID) == offsetof(WGPUAdapterInfo, deviceID), - "offsetof mismatch for AdapterInfo::deviceID"); - - // AdapterProperties - - static_assert(sizeof(AdapterProperties) == sizeof(WGPUAdapterProperties), "sizeof mismatch for AdapterProperties"); - static_assert(alignof(AdapterProperties) == alignof(WGPUAdapterProperties), "alignof mismatch for AdapterProperties"); - - static_assert(offsetof(AdapterProperties, nextInChain) == offsetof(WGPUAdapterProperties, nextInChain), - "offsetof mismatch for AdapterProperties::nextInChain"); - static_assert(offsetof(AdapterProperties, vendorID) == offsetof(WGPUAdapterProperties, vendorID), - "offsetof mismatch for AdapterProperties::vendorID"); - static_assert(offsetof(AdapterProperties, vendorName) == offsetof(WGPUAdapterProperties, vendorName), - "offsetof mismatch for AdapterProperties::vendorName"); - static_assert(offsetof(AdapterProperties, architecture) == offsetof(WGPUAdapterProperties, architecture), - "offsetof mismatch for AdapterProperties::architecture"); - static_assert(offsetof(AdapterProperties, deviceID) == offsetof(WGPUAdapterProperties, deviceID), - "offsetof mismatch for AdapterProperties::deviceID"); - static_assert(offsetof(AdapterProperties, name) == offsetof(WGPUAdapterProperties, name), - "offsetof mismatch for AdapterProperties::name"); - static_assert(offsetof(AdapterProperties, driverDescription) == offsetof(WGPUAdapterProperties, driverDescription), - "offsetof mismatch for AdapterProperties::driverDescription"); - static_assert(offsetof(AdapterProperties, adapterType) == offsetof(WGPUAdapterProperties, adapterType), - "offsetof mismatch for AdapterProperties::adapterType"); - static_assert(offsetof(AdapterProperties, backendType) == offsetof(WGPUAdapterProperties, backendType), - "offsetof mismatch for AdapterProperties::backendType"); - static_assert(offsetof(AdapterProperties, compatibilityMode) == offsetof(WGPUAdapterProperties, compatibilityMode), - "offsetof mismatch for AdapterProperties::compatibilityMode"); - - // BindGroupEntry - - static_assert(sizeof(BindGroupEntry) == sizeof(WGPUBindGroupEntry), "sizeof mismatch for BindGroupEntry"); - static_assert(alignof(BindGroupEntry) == alignof(WGPUBindGroupEntry), "alignof mismatch for BindGroupEntry"); - - static_assert(offsetof(BindGroupEntry, nextInChain) == offsetof(WGPUBindGroupEntry, nextInChain), - "offsetof mismatch for BindGroupEntry::nextInChain"); - static_assert(offsetof(BindGroupEntry, binding) == offsetof(WGPUBindGroupEntry, binding), - "offsetof mismatch for BindGroupEntry::binding"); - static_assert(offsetof(BindGroupEntry, buffer) == offsetof(WGPUBindGroupEntry, buffer), - "offsetof mismatch for BindGroupEntry::buffer"); - static_assert(offsetof(BindGroupEntry, offset) == offsetof(WGPUBindGroupEntry, offset), - "offsetof mismatch for BindGroupEntry::offset"); - static_assert(offsetof(BindGroupEntry, size) == offsetof(WGPUBindGroupEntry, size), - "offsetof mismatch for BindGroupEntry::size"); - static_assert(offsetof(BindGroupEntry, sampler) == offsetof(WGPUBindGroupEntry, sampler), - "offsetof mismatch for BindGroupEntry::sampler"); - static_assert(offsetof(BindGroupEntry, textureView) == offsetof(WGPUBindGroupEntry, textureView), - "offsetof mismatch for BindGroupEntry::textureView"); - - // BlendComponent - - static_assert(sizeof(BlendComponent) == sizeof(WGPUBlendComponent), "sizeof mismatch for BlendComponent"); - static_assert(alignof(BlendComponent) == alignof(WGPUBlendComponent), "alignof mismatch for BlendComponent"); - - static_assert(offsetof(BlendComponent, operation) == offsetof(WGPUBlendComponent, operation), - "offsetof mismatch for BlendComponent::operation"); - static_assert(offsetof(BlendComponent, srcFactor) == offsetof(WGPUBlendComponent, srcFactor), - "offsetof mismatch for BlendComponent::srcFactor"); - static_assert(offsetof(BlendComponent, dstFactor) == offsetof(WGPUBlendComponent, dstFactor), - "offsetof mismatch for BlendComponent::dstFactor"); - - // BufferBindingLayout - - static_assert(sizeof(BufferBindingLayout) == sizeof(WGPUBufferBindingLayout), "sizeof mismatch for BufferBindingLayout"); - static_assert(alignof(BufferBindingLayout) == alignof(WGPUBufferBindingLayout), "alignof mismatch for BufferBindingLayout"); - - static_assert(offsetof(BufferBindingLayout, nextInChain) == offsetof(WGPUBufferBindingLayout, nextInChain), - "offsetof mismatch for BufferBindingLayout::nextInChain"); - static_assert(offsetof(BufferBindingLayout, type) == offsetof(WGPUBufferBindingLayout, type), - "offsetof mismatch for BufferBindingLayout::type"); - static_assert(offsetof(BufferBindingLayout, hasDynamicOffset) == offsetof(WGPUBufferBindingLayout, hasDynamicOffset), - "offsetof mismatch for BufferBindingLayout::hasDynamicOffset"); - static_assert(offsetof(BufferBindingLayout, minBindingSize) == offsetof(WGPUBufferBindingLayout, minBindingSize), - "offsetof mismatch for BufferBindingLayout::minBindingSize"); - - // BufferDescriptor - - static_assert(sizeof(BufferDescriptor) == sizeof(WGPUBufferDescriptor), "sizeof mismatch for BufferDescriptor"); - static_assert(alignof(BufferDescriptor) == alignof(WGPUBufferDescriptor), "alignof mismatch for BufferDescriptor"); - - static_assert(offsetof(BufferDescriptor, nextInChain) == offsetof(WGPUBufferDescriptor, nextInChain), - "offsetof mismatch for BufferDescriptor::nextInChain"); - static_assert(offsetof(BufferDescriptor, label) == offsetof(WGPUBufferDescriptor, label), - "offsetof mismatch for BufferDescriptor::label"); - static_assert(offsetof(BufferDescriptor, usage) == offsetof(WGPUBufferDescriptor, usage), - "offsetof mismatch for BufferDescriptor::usage"); - static_assert(offsetof(BufferDescriptor, size) == offsetof(WGPUBufferDescriptor, size), - "offsetof mismatch for BufferDescriptor::size"); - static_assert(offsetof(BufferDescriptor, mappedAtCreation) == offsetof(WGPUBufferDescriptor, mappedAtCreation), - "offsetof mismatch for BufferDescriptor::mappedAtCreation"); - - // BufferMapCallbackInfo - - static_assert(sizeof(BufferMapCallbackInfo) == sizeof(WGPUBufferMapCallbackInfo), "sizeof mismatch for BufferMapCallbackInfo"); - static_assert(alignof(BufferMapCallbackInfo) == alignof(WGPUBufferMapCallbackInfo), "alignof mismatch for BufferMapCallbackInfo"); - - static_assert(offsetof(BufferMapCallbackInfo, nextInChain) == offsetof(WGPUBufferMapCallbackInfo, nextInChain), - "offsetof mismatch for BufferMapCallbackInfo::nextInChain"); - static_assert(offsetof(BufferMapCallbackInfo, mode) == offsetof(WGPUBufferMapCallbackInfo, mode), - "offsetof mismatch for BufferMapCallbackInfo::mode"); - static_assert(offsetof(BufferMapCallbackInfo, callback) == offsetof(WGPUBufferMapCallbackInfo, callback), - "offsetof mismatch for BufferMapCallbackInfo::callback"); - static_assert(offsetof(BufferMapCallbackInfo, userdata) == offsetof(WGPUBufferMapCallbackInfo, userdata), - "offsetof mismatch for BufferMapCallbackInfo::userdata"); - - // Color - - static_assert(sizeof(Color) == sizeof(WGPUColor), "sizeof mismatch for Color"); - static_assert(alignof(Color) == alignof(WGPUColor), "alignof mismatch for Color"); - - static_assert(offsetof(Color, r) == offsetof(WGPUColor, r), - "offsetof mismatch for Color::r"); - static_assert(offsetof(Color, g) == offsetof(WGPUColor, g), - "offsetof mismatch for Color::g"); - static_assert(offsetof(Color, b) == offsetof(WGPUColor, b), - "offsetof mismatch for Color::b"); - static_assert(offsetof(Color, a) == offsetof(WGPUColor, a), - "offsetof mismatch for Color::a"); - - // CommandBufferDescriptor - - static_assert(sizeof(CommandBufferDescriptor) == sizeof(WGPUCommandBufferDescriptor), "sizeof mismatch for CommandBufferDescriptor"); - static_assert(alignof(CommandBufferDescriptor) == alignof(WGPUCommandBufferDescriptor), "alignof mismatch for CommandBufferDescriptor"); - - static_assert(offsetof(CommandBufferDescriptor, nextInChain) == offsetof(WGPUCommandBufferDescriptor, nextInChain), - "offsetof mismatch for CommandBufferDescriptor::nextInChain"); - static_assert(offsetof(CommandBufferDescriptor, label) == offsetof(WGPUCommandBufferDescriptor, label), - "offsetof mismatch for CommandBufferDescriptor::label"); - - // CommandEncoderDescriptor - - static_assert(sizeof(CommandEncoderDescriptor) == sizeof(WGPUCommandEncoderDescriptor), "sizeof mismatch for CommandEncoderDescriptor"); - static_assert(alignof(CommandEncoderDescriptor) == alignof(WGPUCommandEncoderDescriptor), "alignof mismatch for CommandEncoderDescriptor"); - - static_assert(offsetof(CommandEncoderDescriptor, nextInChain) == offsetof(WGPUCommandEncoderDescriptor, nextInChain), - "offsetof mismatch for CommandEncoderDescriptor::nextInChain"); - static_assert(offsetof(CommandEncoderDescriptor, label) == offsetof(WGPUCommandEncoderDescriptor, label), - "offsetof mismatch for CommandEncoderDescriptor::label"); - - // CompilationMessage - - static_assert(sizeof(CompilationMessage) == sizeof(WGPUCompilationMessage), "sizeof mismatch for CompilationMessage"); - static_assert(alignof(CompilationMessage) == alignof(WGPUCompilationMessage), "alignof mismatch for CompilationMessage"); - - static_assert(offsetof(CompilationMessage, nextInChain) == offsetof(WGPUCompilationMessage, nextInChain), - "offsetof mismatch for CompilationMessage::nextInChain"); - static_assert(offsetof(CompilationMessage, message) == offsetof(WGPUCompilationMessage, message), - "offsetof mismatch for CompilationMessage::message"); - static_assert(offsetof(CompilationMessage, type) == offsetof(WGPUCompilationMessage, type), - "offsetof mismatch for CompilationMessage::type"); - static_assert(offsetof(CompilationMessage, lineNum) == offsetof(WGPUCompilationMessage, lineNum), - "offsetof mismatch for CompilationMessage::lineNum"); - static_assert(offsetof(CompilationMessage, linePos) == offsetof(WGPUCompilationMessage, linePos), - "offsetof mismatch for CompilationMessage::linePos"); - static_assert(offsetof(CompilationMessage, offset) == offsetof(WGPUCompilationMessage, offset), - "offsetof mismatch for CompilationMessage::offset"); - static_assert(offsetof(CompilationMessage, length) == offsetof(WGPUCompilationMessage, length), - "offsetof mismatch for CompilationMessage::length"); - static_assert(offsetof(CompilationMessage, utf16LinePos) == offsetof(WGPUCompilationMessage, utf16LinePos), - "offsetof mismatch for CompilationMessage::utf16LinePos"); - static_assert(offsetof(CompilationMessage, utf16Offset) == offsetof(WGPUCompilationMessage, utf16Offset), - "offsetof mismatch for CompilationMessage::utf16Offset"); - static_assert(offsetof(CompilationMessage, utf16Length) == offsetof(WGPUCompilationMessage, utf16Length), - "offsetof mismatch for CompilationMessage::utf16Length"); - - // ComputePassTimestampWrites - - static_assert(sizeof(ComputePassTimestampWrites) == sizeof(WGPUComputePassTimestampWrites), "sizeof mismatch for ComputePassTimestampWrites"); - static_assert(alignof(ComputePassTimestampWrites) == alignof(WGPUComputePassTimestampWrites), "alignof mismatch for ComputePassTimestampWrites"); - - static_assert(offsetof(ComputePassTimestampWrites, querySet) == offsetof(WGPUComputePassTimestampWrites, querySet), - "offsetof mismatch for ComputePassTimestampWrites::querySet"); - static_assert(offsetof(ComputePassTimestampWrites, beginningOfPassWriteIndex) == offsetof(WGPUComputePassTimestampWrites, beginningOfPassWriteIndex), - "offsetof mismatch for ComputePassTimestampWrites::beginningOfPassWriteIndex"); - static_assert(offsetof(ComputePassTimestampWrites, endOfPassWriteIndex) == offsetof(WGPUComputePassTimestampWrites, endOfPassWriteIndex), - "offsetof mismatch for ComputePassTimestampWrites::endOfPassWriteIndex"); - - // ConstantEntry - - static_assert(sizeof(ConstantEntry) == sizeof(WGPUConstantEntry), "sizeof mismatch for ConstantEntry"); - static_assert(alignof(ConstantEntry) == alignof(WGPUConstantEntry), "alignof mismatch for ConstantEntry"); - - static_assert(offsetof(ConstantEntry, nextInChain) == offsetof(WGPUConstantEntry, nextInChain), - "offsetof mismatch for ConstantEntry::nextInChain"); - static_assert(offsetof(ConstantEntry, key) == offsetof(WGPUConstantEntry, key), - "offsetof mismatch for ConstantEntry::key"); - static_assert(offsetof(ConstantEntry, value) == offsetof(WGPUConstantEntry, value), - "offsetof mismatch for ConstantEntry::value"); - - // Extent3D - - static_assert(sizeof(Extent3D) == sizeof(WGPUExtent3D), "sizeof mismatch for Extent3D"); - static_assert(alignof(Extent3D) == alignof(WGPUExtent3D), "alignof mismatch for Extent3D"); - - static_assert(offsetof(Extent3D, width) == offsetof(WGPUExtent3D, width), - "offsetof mismatch for Extent3D::width"); - static_assert(offsetof(Extent3D, height) == offsetof(WGPUExtent3D, height), - "offsetof mismatch for Extent3D::height"); - static_assert(offsetof(Extent3D, depthOrArrayLayers) == offsetof(WGPUExtent3D, depthOrArrayLayers), - "offsetof mismatch for Extent3D::depthOrArrayLayers"); - - // Future - - static_assert(sizeof(Future) == sizeof(WGPUFuture), "sizeof mismatch for Future"); - static_assert(alignof(Future) == alignof(WGPUFuture), "alignof mismatch for Future"); - - static_assert(offsetof(Future, id) == offsetof(WGPUFuture, id), - "offsetof mismatch for Future::id"); - - // InstanceFeatures - - static_assert(sizeof(InstanceFeatures) == sizeof(WGPUInstanceFeatures), "sizeof mismatch for InstanceFeatures"); - static_assert(alignof(InstanceFeatures) == alignof(WGPUInstanceFeatures), "alignof mismatch for InstanceFeatures"); - - static_assert(offsetof(InstanceFeatures, nextInChain) == offsetof(WGPUInstanceFeatures, nextInChain), - "offsetof mismatch for InstanceFeatures::nextInChain"); - static_assert(offsetof(InstanceFeatures, timedWaitAnyEnable) == offsetof(WGPUInstanceFeatures, timedWaitAnyEnable), - "offsetof mismatch for InstanceFeatures::timedWaitAnyEnable"); - static_assert(offsetof(InstanceFeatures, timedWaitAnyMaxCount) == offsetof(WGPUInstanceFeatures, timedWaitAnyMaxCount), - "offsetof mismatch for InstanceFeatures::timedWaitAnyMaxCount"); - - // Limits - - static_assert(sizeof(Limits) == sizeof(WGPULimits), "sizeof mismatch for Limits"); - static_assert(alignof(Limits) == alignof(WGPULimits), "alignof mismatch for Limits"); - - static_assert(offsetof(Limits, maxTextureDimension1D) == offsetof(WGPULimits, maxTextureDimension1D), - "offsetof mismatch for Limits::maxTextureDimension1D"); - static_assert(offsetof(Limits, maxTextureDimension2D) == offsetof(WGPULimits, maxTextureDimension2D), - "offsetof mismatch for Limits::maxTextureDimension2D"); - static_assert(offsetof(Limits, maxTextureDimension3D) == offsetof(WGPULimits, maxTextureDimension3D), - "offsetof mismatch for Limits::maxTextureDimension3D"); - static_assert(offsetof(Limits, maxTextureArrayLayers) == offsetof(WGPULimits, maxTextureArrayLayers), - "offsetof mismatch for Limits::maxTextureArrayLayers"); - static_assert(offsetof(Limits, maxBindGroups) == offsetof(WGPULimits, maxBindGroups), - "offsetof mismatch for Limits::maxBindGroups"); - static_assert(offsetof(Limits, maxBindGroupsPlusVertexBuffers) == offsetof(WGPULimits, maxBindGroupsPlusVertexBuffers), - "offsetof mismatch for Limits::maxBindGroupsPlusVertexBuffers"); - static_assert(offsetof(Limits, maxBindingsPerBindGroup) == offsetof(WGPULimits, maxBindingsPerBindGroup), - "offsetof mismatch for Limits::maxBindingsPerBindGroup"); - static_assert(offsetof(Limits, maxDynamicUniformBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicUniformBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicUniformBuffersPerPipelineLayout"); - static_assert(offsetof(Limits, maxDynamicStorageBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicStorageBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicStorageBuffersPerPipelineLayout"); - static_assert(offsetof(Limits, maxSampledTexturesPerShaderStage) == offsetof(WGPULimits, maxSampledTexturesPerShaderStage), - "offsetof mismatch for Limits::maxSampledTexturesPerShaderStage"); - static_assert(offsetof(Limits, maxSamplersPerShaderStage) == offsetof(WGPULimits, maxSamplersPerShaderStage), - "offsetof mismatch for Limits::maxSamplersPerShaderStage"); - static_assert(offsetof(Limits, maxStorageBuffersPerShaderStage) == offsetof(WGPULimits, maxStorageBuffersPerShaderStage), - "offsetof mismatch for Limits::maxStorageBuffersPerShaderStage"); - static_assert(offsetof(Limits, maxStorageTexturesPerShaderStage) == offsetof(WGPULimits, maxStorageTexturesPerShaderStage), - "offsetof mismatch for Limits::maxStorageTexturesPerShaderStage"); - static_assert(offsetof(Limits, maxUniformBuffersPerShaderStage) == offsetof(WGPULimits, maxUniformBuffersPerShaderStage), - "offsetof mismatch for Limits::maxUniformBuffersPerShaderStage"); - static_assert(offsetof(Limits, maxUniformBufferBindingSize) == offsetof(WGPULimits, maxUniformBufferBindingSize), - "offsetof mismatch for Limits::maxUniformBufferBindingSize"); - static_assert(offsetof(Limits, maxStorageBufferBindingSize) == offsetof(WGPULimits, maxStorageBufferBindingSize), - "offsetof mismatch for Limits::maxStorageBufferBindingSize"); - static_assert(offsetof(Limits, minUniformBufferOffsetAlignment) == offsetof(WGPULimits, minUniformBufferOffsetAlignment), - "offsetof mismatch for Limits::minUniformBufferOffsetAlignment"); - static_assert(offsetof(Limits, minStorageBufferOffsetAlignment) == offsetof(WGPULimits, minStorageBufferOffsetAlignment), - "offsetof mismatch for Limits::minStorageBufferOffsetAlignment"); - static_assert(offsetof(Limits, maxVertexBuffers) == offsetof(WGPULimits, maxVertexBuffers), - "offsetof mismatch for Limits::maxVertexBuffers"); - static_assert(offsetof(Limits, maxBufferSize) == offsetof(WGPULimits, maxBufferSize), - "offsetof mismatch for Limits::maxBufferSize"); - static_assert(offsetof(Limits, maxVertexAttributes) == offsetof(WGPULimits, maxVertexAttributes), - "offsetof mismatch for Limits::maxVertexAttributes"); - static_assert(offsetof(Limits, maxVertexBufferArrayStride) == offsetof(WGPULimits, maxVertexBufferArrayStride), - "offsetof mismatch for Limits::maxVertexBufferArrayStride"); - static_assert(offsetof(Limits, maxInterStageShaderComponents) == offsetof(WGPULimits, maxInterStageShaderComponents), - "offsetof mismatch for Limits::maxInterStageShaderComponents"); - static_assert(offsetof(Limits, maxInterStageShaderVariables) == offsetof(WGPULimits, maxInterStageShaderVariables), - "offsetof mismatch for Limits::maxInterStageShaderVariables"); - static_assert(offsetof(Limits, maxColorAttachments) == offsetof(WGPULimits, maxColorAttachments), - "offsetof mismatch for Limits::maxColorAttachments"); - static_assert(offsetof(Limits, maxColorAttachmentBytesPerSample) == offsetof(WGPULimits, maxColorAttachmentBytesPerSample), - "offsetof mismatch for Limits::maxColorAttachmentBytesPerSample"); - static_assert(offsetof(Limits, maxComputeWorkgroupStorageSize) == offsetof(WGPULimits, maxComputeWorkgroupStorageSize), - "offsetof mismatch for Limits::maxComputeWorkgroupStorageSize"); - static_assert(offsetof(Limits, maxComputeInvocationsPerWorkgroup) == offsetof(WGPULimits, maxComputeInvocationsPerWorkgroup), - "offsetof mismatch for Limits::maxComputeInvocationsPerWorkgroup"); - static_assert(offsetof(Limits, maxComputeWorkgroupSizeX) == offsetof(WGPULimits, maxComputeWorkgroupSizeX), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeX"); - static_assert(offsetof(Limits, maxComputeWorkgroupSizeY) == offsetof(WGPULimits, maxComputeWorkgroupSizeY), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeY"); - static_assert(offsetof(Limits, maxComputeWorkgroupSizeZ) == offsetof(WGPULimits, maxComputeWorkgroupSizeZ), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeZ"); - static_assert(offsetof(Limits, maxComputeWorkgroupsPerDimension) == offsetof(WGPULimits, maxComputeWorkgroupsPerDimension), - "offsetof mismatch for Limits::maxComputeWorkgroupsPerDimension"); - - // MultisampleState - - static_assert(sizeof(MultisampleState) == sizeof(WGPUMultisampleState), "sizeof mismatch for MultisampleState"); - static_assert(alignof(MultisampleState) == alignof(WGPUMultisampleState), "alignof mismatch for MultisampleState"); - - static_assert(offsetof(MultisampleState, nextInChain) == offsetof(WGPUMultisampleState, nextInChain), - "offsetof mismatch for MultisampleState::nextInChain"); - static_assert(offsetof(MultisampleState, count) == offsetof(WGPUMultisampleState, count), - "offsetof mismatch for MultisampleState::count"); - static_assert(offsetof(MultisampleState, mask) == offsetof(WGPUMultisampleState, mask), - "offsetof mismatch for MultisampleState::mask"); - static_assert(offsetof(MultisampleState, alphaToCoverageEnabled) == offsetof(WGPUMultisampleState, alphaToCoverageEnabled), - "offsetof mismatch for MultisampleState::alphaToCoverageEnabled"); - - // Origin3D - - static_assert(sizeof(Origin3D) == sizeof(WGPUOrigin3D), "sizeof mismatch for Origin3D"); - static_assert(alignof(Origin3D) == alignof(WGPUOrigin3D), "alignof mismatch for Origin3D"); - - static_assert(offsetof(Origin3D, x) == offsetof(WGPUOrigin3D, x), - "offsetof mismatch for Origin3D::x"); - static_assert(offsetof(Origin3D, y) == offsetof(WGPUOrigin3D, y), - "offsetof mismatch for Origin3D::y"); - static_assert(offsetof(Origin3D, z) == offsetof(WGPUOrigin3D, z), - "offsetof mismatch for Origin3D::z"); - - // PipelineLayoutDescriptor - - static_assert(sizeof(PipelineLayoutDescriptor) == sizeof(WGPUPipelineLayoutDescriptor), "sizeof mismatch for PipelineLayoutDescriptor"); - static_assert(alignof(PipelineLayoutDescriptor) == alignof(WGPUPipelineLayoutDescriptor), "alignof mismatch for PipelineLayoutDescriptor"); - - static_assert(offsetof(PipelineLayoutDescriptor, nextInChain) == offsetof(WGPUPipelineLayoutDescriptor, nextInChain), - "offsetof mismatch for PipelineLayoutDescriptor::nextInChain"); - static_assert(offsetof(PipelineLayoutDescriptor, label) == offsetof(WGPUPipelineLayoutDescriptor, label), - "offsetof mismatch for PipelineLayoutDescriptor::label"); - static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayoutCount) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayoutCount), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayoutCount"); - static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayouts) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayouts), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayouts"); - - // PrimitiveDepthClipControl - - static_assert(sizeof(PrimitiveDepthClipControl) == sizeof(WGPUPrimitiveDepthClipControl), "sizeof mismatch for PrimitiveDepthClipControl"); - static_assert(alignof(PrimitiveDepthClipControl) == alignof(WGPUPrimitiveDepthClipControl), "alignof mismatch for PrimitiveDepthClipControl"); - - static_assert(offsetof(PrimitiveDepthClipControl, unclippedDepth) == offsetof(WGPUPrimitiveDepthClipControl, unclippedDepth), - "offsetof mismatch for PrimitiveDepthClipControl::unclippedDepth"); - - // PrimitiveState - - static_assert(sizeof(PrimitiveState) == sizeof(WGPUPrimitiveState), "sizeof mismatch for PrimitiveState"); - static_assert(alignof(PrimitiveState) == alignof(WGPUPrimitiveState), "alignof mismatch for PrimitiveState"); - - static_assert(offsetof(PrimitiveState, nextInChain) == offsetof(WGPUPrimitiveState, nextInChain), - "offsetof mismatch for PrimitiveState::nextInChain"); - static_assert(offsetof(PrimitiveState, topology) == offsetof(WGPUPrimitiveState, topology), - "offsetof mismatch for PrimitiveState::topology"); - static_assert(offsetof(PrimitiveState, stripIndexFormat) == offsetof(WGPUPrimitiveState, stripIndexFormat), - "offsetof mismatch for PrimitiveState::stripIndexFormat"); - static_assert(offsetof(PrimitiveState, frontFace) == offsetof(WGPUPrimitiveState, frontFace), - "offsetof mismatch for PrimitiveState::frontFace"); - static_assert(offsetof(PrimitiveState, cullMode) == offsetof(WGPUPrimitiveState, cullMode), - "offsetof mismatch for PrimitiveState::cullMode"); - - // QuerySetDescriptor - - static_assert(sizeof(QuerySetDescriptor) == sizeof(WGPUQuerySetDescriptor), "sizeof mismatch for QuerySetDescriptor"); - static_assert(alignof(QuerySetDescriptor) == alignof(WGPUQuerySetDescriptor), "alignof mismatch for QuerySetDescriptor"); - - static_assert(offsetof(QuerySetDescriptor, nextInChain) == offsetof(WGPUQuerySetDescriptor, nextInChain), - "offsetof mismatch for QuerySetDescriptor::nextInChain"); - static_assert(offsetof(QuerySetDescriptor, label) == offsetof(WGPUQuerySetDescriptor, label), - "offsetof mismatch for QuerySetDescriptor::label"); - static_assert(offsetof(QuerySetDescriptor, type) == offsetof(WGPUQuerySetDescriptor, type), - "offsetof mismatch for QuerySetDescriptor::type"); - static_assert(offsetof(QuerySetDescriptor, count) == offsetof(WGPUQuerySetDescriptor, count), - "offsetof mismatch for QuerySetDescriptor::count"); - - // QueueDescriptor - - static_assert(sizeof(QueueDescriptor) == sizeof(WGPUQueueDescriptor), "sizeof mismatch for QueueDescriptor"); - static_assert(alignof(QueueDescriptor) == alignof(WGPUQueueDescriptor), "alignof mismatch for QueueDescriptor"); - - static_assert(offsetof(QueueDescriptor, nextInChain) == offsetof(WGPUQueueDescriptor, nextInChain), - "offsetof mismatch for QueueDescriptor::nextInChain"); - static_assert(offsetof(QueueDescriptor, label) == offsetof(WGPUQueueDescriptor, label), - "offsetof mismatch for QueueDescriptor::label"); - - // QueueWorkDoneCallbackInfo - - static_assert(sizeof(QueueWorkDoneCallbackInfo) == sizeof(WGPUQueueWorkDoneCallbackInfo), "sizeof mismatch for QueueWorkDoneCallbackInfo"); - static_assert(alignof(QueueWorkDoneCallbackInfo) == alignof(WGPUQueueWorkDoneCallbackInfo), "alignof mismatch for QueueWorkDoneCallbackInfo"); - - static_assert(offsetof(QueueWorkDoneCallbackInfo, nextInChain) == offsetof(WGPUQueueWorkDoneCallbackInfo, nextInChain), - "offsetof mismatch for QueueWorkDoneCallbackInfo::nextInChain"); - static_assert(offsetof(QueueWorkDoneCallbackInfo, mode) == offsetof(WGPUQueueWorkDoneCallbackInfo, mode), - "offsetof mismatch for QueueWorkDoneCallbackInfo::mode"); - static_assert(offsetof(QueueWorkDoneCallbackInfo, callback) == offsetof(WGPUQueueWorkDoneCallbackInfo, callback), - "offsetof mismatch for QueueWorkDoneCallbackInfo::callback"); - static_assert(offsetof(QueueWorkDoneCallbackInfo, userdata) == offsetof(WGPUQueueWorkDoneCallbackInfo, userdata), - "offsetof mismatch for QueueWorkDoneCallbackInfo::userdata"); - - // RenderBundleDescriptor - - static_assert(sizeof(RenderBundleDescriptor) == sizeof(WGPURenderBundleDescriptor), "sizeof mismatch for RenderBundleDescriptor"); - static_assert(alignof(RenderBundleDescriptor) == alignof(WGPURenderBundleDescriptor), "alignof mismatch for RenderBundleDescriptor"); - - static_assert(offsetof(RenderBundleDescriptor, nextInChain) == offsetof(WGPURenderBundleDescriptor, nextInChain), - "offsetof mismatch for RenderBundleDescriptor::nextInChain"); - static_assert(offsetof(RenderBundleDescriptor, label) == offsetof(WGPURenderBundleDescriptor, label), - "offsetof mismatch for RenderBundleDescriptor::label"); - - // RenderBundleEncoderDescriptor - - static_assert(sizeof(RenderBundleEncoderDescriptor) == sizeof(WGPURenderBundleEncoderDescriptor), "sizeof mismatch for RenderBundleEncoderDescriptor"); - static_assert(alignof(RenderBundleEncoderDescriptor) == alignof(WGPURenderBundleEncoderDescriptor), "alignof mismatch for RenderBundleEncoderDescriptor"); - - static_assert(offsetof(RenderBundleEncoderDescriptor, nextInChain) == offsetof(WGPURenderBundleEncoderDescriptor, nextInChain), - "offsetof mismatch for RenderBundleEncoderDescriptor::nextInChain"); - static_assert(offsetof(RenderBundleEncoderDescriptor, label) == offsetof(WGPURenderBundleEncoderDescriptor, label), - "offsetof mismatch for RenderBundleEncoderDescriptor::label"); - static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormatCount) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormatCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormatCount"); - static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormats) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormats), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormats"); - static_assert(offsetof(RenderBundleEncoderDescriptor, depthStencilFormat) == offsetof(WGPURenderBundleEncoderDescriptor, depthStencilFormat), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthStencilFormat"); - static_assert(offsetof(RenderBundleEncoderDescriptor, sampleCount) == offsetof(WGPURenderBundleEncoderDescriptor, sampleCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::sampleCount"); - static_assert(offsetof(RenderBundleEncoderDescriptor, depthReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, depthReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthReadOnly"); - static_assert(offsetof(RenderBundleEncoderDescriptor, stencilReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, stencilReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::stencilReadOnly"); - - // RenderPassDepthStencilAttachment - - static_assert(sizeof(RenderPassDepthStencilAttachment) == sizeof(WGPURenderPassDepthStencilAttachment), "sizeof mismatch for RenderPassDepthStencilAttachment"); - static_assert(alignof(RenderPassDepthStencilAttachment) == alignof(WGPURenderPassDepthStencilAttachment), "alignof mismatch for RenderPassDepthStencilAttachment"); - - static_assert(offsetof(RenderPassDepthStencilAttachment, view) == offsetof(WGPURenderPassDepthStencilAttachment, view), - "offsetof mismatch for RenderPassDepthStencilAttachment::view"); - static_assert(offsetof(RenderPassDepthStencilAttachment, depthLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthLoadOp"); - static_assert(offsetof(RenderPassDepthStencilAttachment, depthStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthStoreOp"); - static_assert(offsetof(RenderPassDepthStencilAttachment, depthClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, depthClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthClearValue"); - static_assert(offsetof(RenderPassDepthStencilAttachment, depthReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, depthReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthReadOnly"); - static_assert(offsetof(RenderPassDepthStencilAttachment, stencilLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilLoadOp"); - static_assert(offsetof(RenderPassDepthStencilAttachment, stencilStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilStoreOp"); - static_assert(offsetof(RenderPassDepthStencilAttachment, stencilClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, stencilClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilClearValue"); - static_assert(offsetof(RenderPassDepthStencilAttachment, stencilReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, stencilReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilReadOnly"); - - // RenderPassDescriptorMaxDrawCount - - static_assert(sizeof(RenderPassDescriptorMaxDrawCount) == sizeof(WGPURenderPassDescriptorMaxDrawCount), "sizeof mismatch for RenderPassDescriptorMaxDrawCount"); - static_assert(alignof(RenderPassDescriptorMaxDrawCount) == alignof(WGPURenderPassDescriptorMaxDrawCount), "alignof mismatch for RenderPassDescriptorMaxDrawCount"); - - static_assert(offsetof(RenderPassDescriptorMaxDrawCount, maxDrawCount) == offsetof(WGPURenderPassDescriptorMaxDrawCount, maxDrawCount), - "offsetof mismatch for RenderPassDescriptorMaxDrawCount::maxDrawCount"); - - // RenderPassTimestampWrites - - static_assert(sizeof(RenderPassTimestampWrites) == sizeof(WGPURenderPassTimestampWrites), "sizeof mismatch for RenderPassTimestampWrites"); - static_assert(alignof(RenderPassTimestampWrites) == alignof(WGPURenderPassTimestampWrites), "alignof mismatch for RenderPassTimestampWrites"); - - static_assert(offsetof(RenderPassTimestampWrites, querySet) == offsetof(WGPURenderPassTimestampWrites, querySet), - "offsetof mismatch for RenderPassTimestampWrites::querySet"); - static_assert(offsetof(RenderPassTimestampWrites, beginningOfPassWriteIndex) == offsetof(WGPURenderPassTimestampWrites, beginningOfPassWriteIndex), - "offsetof mismatch for RenderPassTimestampWrites::beginningOfPassWriteIndex"); - static_assert(offsetof(RenderPassTimestampWrites, endOfPassWriteIndex) == offsetof(WGPURenderPassTimestampWrites, endOfPassWriteIndex), - "offsetof mismatch for RenderPassTimestampWrites::endOfPassWriteIndex"); - - // RequestAdapterCallbackInfo - - static_assert(sizeof(RequestAdapterCallbackInfo) == sizeof(WGPURequestAdapterCallbackInfo), "sizeof mismatch for RequestAdapterCallbackInfo"); - static_assert(alignof(RequestAdapterCallbackInfo) == alignof(WGPURequestAdapterCallbackInfo), "alignof mismatch for RequestAdapterCallbackInfo"); - - static_assert(offsetof(RequestAdapterCallbackInfo, nextInChain) == offsetof(WGPURequestAdapterCallbackInfo, nextInChain), - "offsetof mismatch for RequestAdapterCallbackInfo::nextInChain"); - static_assert(offsetof(RequestAdapterCallbackInfo, mode) == offsetof(WGPURequestAdapterCallbackInfo, mode), - "offsetof mismatch for RequestAdapterCallbackInfo::mode"); - static_assert(offsetof(RequestAdapterCallbackInfo, callback) == offsetof(WGPURequestAdapterCallbackInfo, callback), - "offsetof mismatch for RequestAdapterCallbackInfo::callback"); - static_assert(offsetof(RequestAdapterCallbackInfo, userdata) == offsetof(WGPURequestAdapterCallbackInfo, userdata), - "offsetof mismatch for RequestAdapterCallbackInfo::userdata"); - - // RequestAdapterOptions - - static_assert(sizeof(RequestAdapterOptions) == sizeof(WGPURequestAdapterOptions), "sizeof mismatch for RequestAdapterOptions"); - static_assert(alignof(RequestAdapterOptions) == alignof(WGPURequestAdapterOptions), "alignof mismatch for RequestAdapterOptions"); - - static_assert(offsetof(RequestAdapterOptions, nextInChain) == offsetof(WGPURequestAdapterOptions, nextInChain), - "offsetof mismatch for RequestAdapterOptions::nextInChain"); - static_assert(offsetof(RequestAdapterOptions, compatibleSurface) == offsetof(WGPURequestAdapterOptions, compatibleSurface), - "offsetof mismatch for RequestAdapterOptions::compatibleSurface"); - static_assert(offsetof(RequestAdapterOptions, powerPreference) == offsetof(WGPURequestAdapterOptions, powerPreference), - "offsetof mismatch for RequestAdapterOptions::powerPreference"); - static_assert(offsetof(RequestAdapterOptions, backendType) == offsetof(WGPURequestAdapterOptions, backendType), - "offsetof mismatch for RequestAdapterOptions::backendType"); - static_assert(offsetof(RequestAdapterOptions, forceFallbackAdapter) == offsetof(WGPURequestAdapterOptions, forceFallbackAdapter), - "offsetof mismatch for RequestAdapterOptions::forceFallbackAdapter"); - static_assert(offsetof(RequestAdapterOptions, compatibilityMode) == offsetof(WGPURequestAdapterOptions, compatibilityMode), - "offsetof mismatch for RequestAdapterOptions::compatibilityMode"); - - // SamplerBindingLayout - - static_assert(sizeof(SamplerBindingLayout) == sizeof(WGPUSamplerBindingLayout), "sizeof mismatch for SamplerBindingLayout"); - static_assert(alignof(SamplerBindingLayout) == alignof(WGPUSamplerBindingLayout), "alignof mismatch for SamplerBindingLayout"); - - static_assert(offsetof(SamplerBindingLayout, nextInChain) == offsetof(WGPUSamplerBindingLayout, nextInChain), - "offsetof mismatch for SamplerBindingLayout::nextInChain"); - static_assert(offsetof(SamplerBindingLayout, type) == offsetof(WGPUSamplerBindingLayout, type), - "offsetof mismatch for SamplerBindingLayout::type"); - - // SamplerDescriptor - - static_assert(sizeof(SamplerDescriptor) == sizeof(WGPUSamplerDescriptor), "sizeof mismatch for SamplerDescriptor"); - static_assert(alignof(SamplerDescriptor) == alignof(WGPUSamplerDescriptor), "alignof mismatch for SamplerDescriptor"); - - static_assert(offsetof(SamplerDescriptor, nextInChain) == offsetof(WGPUSamplerDescriptor, nextInChain), - "offsetof mismatch for SamplerDescriptor::nextInChain"); - static_assert(offsetof(SamplerDescriptor, label) == offsetof(WGPUSamplerDescriptor, label), - "offsetof mismatch for SamplerDescriptor::label"); - static_assert(offsetof(SamplerDescriptor, addressModeU) == offsetof(WGPUSamplerDescriptor, addressModeU), - "offsetof mismatch for SamplerDescriptor::addressModeU"); - static_assert(offsetof(SamplerDescriptor, addressModeV) == offsetof(WGPUSamplerDescriptor, addressModeV), - "offsetof mismatch for SamplerDescriptor::addressModeV"); - static_assert(offsetof(SamplerDescriptor, addressModeW) == offsetof(WGPUSamplerDescriptor, addressModeW), - "offsetof mismatch for SamplerDescriptor::addressModeW"); - static_assert(offsetof(SamplerDescriptor, magFilter) == offsetof(WGPUSamplerDescriptor, magFilter), - "offsetof mismatch for SamplerDescriptor::magFilter"); - static_assert(offsetof(SamplerDescriptor, minFilter) == offsetof(WGPUSamplerDescriptor, minFilter), - "offsetof mismatch for SamplerDescriptor::minFilter"); - static_assert(offsetof(SamplerDescriptor, mipmapFilter) == offsetof(WGPUSamplerDescriptor, mipmapFilter), - "offsetof mismatch for SamplerDescriptor::mipmapFilter"); - static_assert(offsetof(SamplerDescriptor, lodMinClamp) == offsetof(WGPUSamplerDescriptor, lodMinClamp), - "offsetof mismatch for SamplerDescriptor::lodMinClamp"); - static_assert(offsetof(SamplerDescriptor, lodMaxClamp) == offsetof(WGPUSamplerDescriptor, lodMaxClamp), - "offsetof mismatch for SamplerDescriptor::lodMaxClamp"); - static_assert(offsetof(SamplerDescriptor, compare) == offsetof(WGPUSamplerDescriptor, compare), - "offsetof mismatch for SamplerDescriptor::compare"); - static_assert(offsetof(SamplerDescriptor, maxAnisotropy) == offsetof(WGPUSamplerDescriptor, maxAnisotropy), - "offsetof mismatch for SamplerDescriptor::maxAnisotropy"); - - // ShaderModuleSPIRVDescriptor - - static_assert(sizeof(ShaderModuleSPIRVDescriptor) == sizeof(WGPUShaderModuleSPIRVDescriptor), "sizeof mismatch for ShaderModuleSPIRVDescriptor"); - static_assert(alignof(ShaderModuleSPIRVDescriptor) == alignof(WGPUShaderModuleSPIRVDescriptor), "alignof mismatch for ShaderModuleSPIRVDescriptor"); - - static_assert(offsetof(ShaderModuleSPIRVDescriptor, codeSize) == offsetof(WGPUShaderModuleSPIRVDescriptor, codeSize), - "offsetof mismatch for ShaderModuleSPIRVDescriptor::codeSize"); - static_assert(offsetof(ShaderModuleSPIRVDescriptor, code) == offsetof(WGPUShaderModuleSPIRVDescriptor, code), - "offsetof mismatch for ShaderModuleSPIRVDescriptor::code"); - - // ShaderModuleWGSLDescriptor - - static_assert(sizeof(ShaderModuleWGSLDescriptor) == sizeof(WGPUShaderModuleWGSLDescriptor), "sizeof mismatch for ShaderModuleWGSLDescriptor"); - static_assert(alignof(ShaderModuleWGSLDescriptor) == alignof(WGPUShaderModuleWGSLDescriptor), "alignof mismatch for ShaderModuleWGSLDescriptor"); - - static_assert(offsetof(ShaderModuleWGSLDescriptor, code) == offsetof(WGPUShaderModuleWGSLDescriptor, code), - "offsetof mismatch for ShaderModuleWGSLDescriptor::code"); - - // ShaderModuleDescriptor - - static_assert(sizeof(ShaderModuleDescriptor) == sizeof(WGPUShaderModuleDescriptor), "sizeof mismatch for ShaderModuleDescriptor"); - static_assert(alignof(ShaderModuleDescriptor) == alignof(WGPUShaderModuleDescriptor), "alignof mismatch for ShaderModuleDescriptor"); - - static_assert(offsetof(ShaderModuleDescriptor, nextInChain) == offsetof(WGPUShaderModuleDescriptor, nextInChain), - "offsetof mismatch for ShaderModuleDescriptor::nextInChain"); - static_assert(offsetof(ShaderModuleDescriptor, label) == offsetof(WGPUShaderModuleDescriptor, label), - "offsetof mismatch for ShaderModuleDescriptor::label"); - - // StencilFaceState - - static_assert(sizeof(StencilFaceState) == sizeof(WGPUStencilFaceState), "sizeof mismatch for StencilFaceState"); - static_assert(alignof(StencilFaceState) == alignof(WGPUStencilFaceState), "alignof mismatch for StencilFaceState"); - - static_assert(offsetof(StencilFaceState, compare) == offsetof(WGPUStencilFaceState, compare), - "offsetof mismatch for StencilFaceState::compare"); - static_assert(offsetof(StencilFaceState, failOp) == offsetof(WGPUStencilFaceState, failOp), - "offsetof mismatch for StencilFaceState::failOp"); - static_assert(offsetof(StencilFaceState, depthFailOp) == offsetof(WGPUStencilFaceState, depthFailOp), - "offsetof mismatch for StencilFaceState::depthFailOp"); - static_assert(offsetof(StencilFaceState, passOp) == offsetof(WGPUStencilFaceState, passOp), - "offsetof mismatch for StencilFaceState::passOp"); - - // StorageTextureBindingLayout - - static_assert(sizeof(StorageTextureBindingLayout) == sizeof(WGPUStorageTextureBindingLayout), "sizeof mismatch for StorageTextureBindingLayout"); - static_assert(alignof(StorageTextureBindingLayout) == alignof(WGPUStorageTextureBindingLayout), "alignof mismatch for StorageTextureBindingLayout"); - - static_assert(offsetof(StorageTextureBindingLayout, nextInChain) == offsetof(WGPUStorageTextureBindingLayout, nextInChain), - "offsetof mismatch for StorageTextureBindingLayout::nextInChain"); - static_assert(offsetof(StorageTextureBindingLayout, access) == offsetof(WGPUStorageTextureBindingLayout, access), - "offsetof mismatch for StorageTextureBindingLayout::access"); - static_assert(offsetof(StorageTextureBindingLayout, format) == offsetof(WGPUStorageTextureBindingLayout, format), - "offsetof mismatch for StorageTextureBindingLayout::format"); - static_assert(offsetof(StorageTextureBindingLayout, viewDimension) == offsetof(WGPUStorageTextureBindingLayout, viewDimension), - "offsetof mismatch for StorageTextureBindingLayout::viewDimension"); - -template - static T& AsNonConstReference(const T& value) { - return const_cast(value); - } - - // SurfaceCapabilities - SurfaceCapabilities::~SurfaceCapabilities() { - if (this->formats != nullptr || this->presentModes != nullptr || this->alphaModes != nullptr) { - wgpuSurfaceCapabilitiesFreeMembers( - *reinterpret_cast(this)); - } - } - - static void Reset(SurfaceCapabilities& value) { - SurfaceCapabilities defaultValue{}; - AsNonConstReference(value.formatCount) = defaultValue.formatCount; - AsNonConstReference(value.formats) = defaultValue.formats; - AsNonConstReference(value.presentModeCount) = defaultValue.presentModeCount; - AsNonConstReference(value.presentModes) = defaultValue.presentModes; - AsNonConstReference(value.alphaModeCount) = defaultValue.alphaModeCount; - AsNonConstReference(value.alphaModes) = defaultValue.alphaModes; - } - - SurfaceCapabilities::SurfaceCapabilities(SurfaceCapabilities&& rhs) - : formatCount(rhs.formatCount), - formats(rhs.formats), - presentModeCount(rhs.presentModeCount), - presentModes(rhs.presentModes), - alphaModeCount(rhs.alphaModeCount), - alphaModes(rhs.alphaModes){ - Reset(rhs); - } - - SurfaceCapabilities& SurfaceCapabilities::operator=(SurfaceCapabilities&& rhs) { - if (&rhs == this) { - return *this; - } - this->~SurfaceCapabilities(); - AsNonConstReference(this->formatCount) = std::move(rhs.formatCount); - AsNonConstReference(this->formats) = std::move(rhs.formats); - AsNonConstReference(this->presentModeCount) = std::move(rhs.presentModeCount); - AsNonConstReference(this->presentModes) = std::move(rhs.presentModes); - AsNonConstReference(this->alphaModeCount) = std::move(rhs.alphaModeCount); - AsNonConstReference(this->alphaModes) = std::move(rhs.alphaModes); - Reset(rhs); - return *this; - } - - static_assert(sizeof(SurfaceCapabilities) == sizeof(WGPUSurfaceCapabilities), "sizeof mismatch for SurfaceCapabilities"); - static_assert(alignof(SurfaceCapabilities) == alignof(WGPUSurfaceCapabilities), "alignof mismatch for SurfaceCapabilities"); - static_assert(offsetof(SurfaceCapabilities, nextInChain) == offsetof(WGPUSurfaceCapabilities, nextInChain), - "offsetof mismatch for SurfaceCapabilities::nextInChain"); - static_assert(offsetof(SurfaceCapabilities, formatCount) == offsetof(WGPUSurfaceCapabilities, formatCount), - "offsetof mismatch for SurfaceCapabilities::formatCount"); - static_assert(offsetof(SurfaceCapabilities, formats) == offsetof(WGPUSurfaceCapabilities, formats), - "offsetof mismatch for SurfaceCapabilities::formats"); - static_assert(offsetof(SurfaceCapabilities, presentModeCount) == offsetof(WGPUSurfaceCapabilities, presentModeCount), - "offsetof mismatch for SurfaceCapabilities::presentModeCount"); - static_assert(offsetof(SurfaceCapabilities, presentModes) == offsetof(WGPUSurfaceCapabilities, presentModes), - "offsetof mismatch for SurfaceCapabilities::presentModes"); - static_assert(offsetof(SurfaceCapabilities, alphaModeCount) == offsetof(WGPUSurfaceCapabilities, alphaModeCount), - "offsetof mismatch for SurfaceCapabilities::alphaModeCount"); - static_assert(offsetof(SurfaceCapabilities, alphaModes) == offsetof(WGPUSurfaceCapabilities, alphaModes), - "offsetof mismatch for SurfaceCapabilities::alphaModes"); - - // SurfaceConfiguration - - static_assert(sizeof(SurfaceConfiguration) == sizeof(WGPUSurfaceConfiguration), "sizeof mismatch for SurfaceConfiguration"); - static_assert(alignof(SurfaceConfiguration) == alignof(WGPUSurfaceConfiguration), "alignof mismatch for SurfaceConfiguration"); - static_assert(offsetof(SurfaceConfiguration, nextInChain) == offsetof(WGPUSurfaceConfiguration, nextInChain), - "offsetof mismatch for SurfaceConfiguration::nextInChain"); - static_assert(offsetof(SurfaceConfiguration, device) == offsetof(WGPUSurfaceConfiguration, device), - "offsetof mismatch for SurfaceConfiguration::device"); - static_assert(offsetof(SurfaceConfiguration, format) == offsetof(WGPUSurfaceConfiguration, format), - "offsetof mismatch for SurfaceConfiguration::format"); - static_assert(offsetof(SurfaceConfiguration, usage) == offsetof(WGPUSurfaceConfiguration, usage), - "offsetof mismatch for SurfaceConfiguration::usage"); - static_assert(offsetof(SurfaceConfiguration, viewFormatCount) == offsetof(WGPUSurfaceConfiguration, viewFormatCount), - "offsetof mismatch for SurfaceConfiguration::viewFormatCount"); - static_assert(offsetof(SurfaceConfiguration, viewFormats) == offsetof(WGPUSurfaceConfiguration, viewFormats), - "offsetof mismatch for SurfaceConfiguration::viewFormats"); - static_assert(offsetof(SurfaceConfiguration, alphaMode) == offsetof(WGPUSurfaceConfiguration, alphaMode), - "offsetof mismatch for SurfaceConfiguration::alphaMode"); - static_assert(offsetof(SurfaceConfiguration, width) == offsetof(WGPUSurfaceConfiguration, width), - "offsetof mismatch for SurfaceConfiguration::width"); - static_assert(offsetof(SurfaceConfiguration, height) == offsetof(WGPUSurfaceConfiguration, height), - "offsetof mismatch for SurfaceConfiguration::height"); - static_assert(offsetof(SurfaceConfiguration, presentMode) == offsetof(WGPUSurfaceConfiguration, presentMode), - "offsetof mismatch for SurfaceConfiguration::presentMode"); - - // SurfaceDescriptor - - static_assert(sizeof(SurfaceDescriptor) == sizeof(WGPUSurfaceDescriptor), "sizeof mismatch for SurfaceDescriptor"); - static_assert(alignof(SurfaceDescriptor) == alignof(WGPUSurfaceDescriptor), "alignof mismatch for SurfaceDescriptor"); - - static_assert(offsetof(SurfaceDescriptor, nextInChain) == offsetof(WGPUSurfaceDescriptor, nextInChain), - "offsetof mismatch for SurfaceDescriptor::nextInChain"); - static_assert(offsetof(SurfaceDescriptor, label) == offsetof(WGPUSurfaceDescriptor, label), - "offsetof mismatch for SurfaceDescriptor::label"); - - // SurfaceDescriptorFromCanvasHTMLSelector - - static_assert(sizeof(SurfaceDescriptorFromCanvasHTMLSelector) == sizeof(WGPUSurfaceDescriptorFromCanvasHTMLSelector), "sizeof mismatch for SurfaceDescriptorFromCanvasHTMLSelector"); - static_assert(alignof(SurfaceDescriptorFromCanvasHTMLSelector) == alignof(WGPUSurfaceDescriptorFromCanvasHTMLSelector), "alignof mismatch for SurfaceDescriptorFromCanvasHTMLSelector"); - - static_assert(offsetof(SurfaceDescriptorFromCanvasHTMLSelector, selector) == offsetof(WGPUSurfaceDescriptorFromCanvasHTMLSelector, selector), - "offsetof mismatch for SurfaceDescriptorFromCanvasHTMLSelector::selector"); - - // SurfaceTexture - - static_assert(sizeof(SurfaceTexture) == sizeof(WGPUSurfaceTexture), "sizeof mismatch for SurfaceTexture"); - static_assert(alignof(SurfaceTexture) == alignof(WGPUSurfaceTexture), "alignof mismatch for SurfaceTexture"); - static_assert(offsetof(SurfaceTexture, texture) == offsetof(WGPUSurfaceTexture, texture), - "offsetof mismatch for SurfaceTexture::texture"); - static_assert(offsetof(SurfaceTexture, suboptimal) == offsetof(WGPUSurfaceTexture, suboptimal), - "offsetof mismatch for SurfaceTexture::suboptimal"); - static_assert(offsetof(SurfaceTexture, status) == offsetof(WGPUSurfaceTexture, status), - "offsetof mismatch for SurfaceTexture::status"); - - // SwapChainDescriptor - - static_assert(sizeof(SwapChainDescriptor) == sizeof(WGPUSwapChainDescriptor), "sizeof mismatch for SwapChainDescriptor"); - static_assert(alignof(SwapChainDescriptor) == alignof(WGPUSwapChainDescriptor), "alignof mismatch for SwapChainDescriptor"); - - static_assert(offsetof(SwapChainDescriptor, nextInChain) == offsetof(WGPUSwapChainDescriptor, nextInChain), - "offsetof mismatch for SwapChainDescriptor::nextInChain"); - static_assert(offsetof(SwapChainDescriptor, label) == offsetof(WGPUSwapChainDescriptor, label), - "offsetof mismatch for SwapChainDescriptor::label"); - static_assert(offsetof(SwapChainDescriptor, usage) == offsetof(WGPUSwapChainDescriptor, usage), - "offsetof mismatch for SwapChainDescriptor::usage"); - static_assert(offsetof(SwapChainDescriptor, format) == offsetof(WGPUSwapChainDescriptor, format), - "offsetof mismatch for SwapChainDescriptor::format"); - static_assert(offsetof(SwapChainDescriptor, width) == offsetof(WGPUSwapChainDescriptor, width), - "offsetof mismatch for SwapChainDescriptor::width"); - static_assert(offsetof(SwapChainDescriptor, height) == offsetof(WGPUSwapChainDescriptor, height), - "offsetof mismatch for SwapChainDescriptor::height"); - static_assert(offsetof(SwapChainDescriptor, presentMode) == offsetof(WGPUSwapChainDescriptor, presentMode), - "offsetof mismatch for SwapChainDescriptor::presentMode"); - - // TextureBindingLayout - - static_assert(sizeof(TextureBindingLayout) == sizeof(WGPUTextureBindingLayout), "sizeof mismatch for TextureBindingLayout"); - static_assert(alignof(TextureBindingLayout) == alignof(WGPUTextureBindingLayout), "alignof mismatch for TextureBindingLayout"); - - static_assert(offsetof(TextureBindingLayout, nextInChain) == offsetof(WGPUTextureBindingLayout, nextInChain), - "offsetof mismatch for TextureBindingLayout::nextInChain"); - static_assert(offsetof(TextureBindingLayout, sampleType) == offsetof(WGPUTextureBindingLayout, sampleType), - "offsetof mismatch for TextureBindingLayout::sampleType"); - static_assert(offsetof(TextureBindingLayout, viewDimension) == offsetof(WGPUTextureBindingLayout, viewDimension), - "offsetof mismatch for TextureBindingLayout::viewDimension"); - static_assert(offsetof(TextureBindingLayout, multisampled) == offsetof(WGPUTextureBindingLayout, multisampled), - "offsetof mismatch for TextureBindingLayout::multisampled"); - - // TextureBindingViewDimensionDescriptor - - static_assert(sizeof(TextureBindingViewDimensionDescriptor) == sizeof(WGPUTextureBindingViewDimensionDescriptor), "sizeof mismatch for TextureBindingViewDimensionDescriptor"); - static_assert(alignof(TextureBindingViewDimensionDescriptor) == alignof(WGPUTextureBindingViewDimensionDescriptor), "alignof mismatch for TextureBindingViewDimensionDescriptor"); - - static_assert(offsetof(TextureBindingViewDimensionDescriptor, textureBindingViewDimension) == offsetof(WGPUTextureBindingViewDimensionDescriptor, textureBindingViewDimension), - "offsetof mismatch for TextureBindingViewDimensionDescriptor::textureBindingViewDimension"); - - // TextureDataLayout - - static_assert(sizeof(TextureDataLayout) == sizeof(WGPUTextureDataLayout), "sizeof mismatch for TextureDataLayout"); - static_assert(alignof(TextureDataLayout) == alignof(WGPUTextureDataLayout), "alignof mismatch for TextureDataLayout"); - - static_assert(offsetof(TextureDataLayout, nextInChain) == offsetof(WGPUTextureDataLayout, nextInChain), - "offsetof mismatch for TextureDataLayout::nextInChain"); - static_assert(offsetof(TextureDataLayout, offset) == offsetof(WGPUTextureDataLayout, offset), - "offsetof mismatch for TextureDataLayout::offset"); - static_assert(offsetof(TextureDataLayout, bytesPerRow) == offsetof(WGPUTextureDataLayout, bytesPerRow), - "offsetof mismatch for TextureDataLayout::bytesPerRow"); - static_assert(offsetof(TextureDataLayout, rowsPerImage) == offsetof(WGPUTextureDataLayout, rowsPerImage), - "offsetof mismatch for TextureDataLayout::rowsPerImage"); - - // TextureViewDescriptor - - 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"); - - // VertexAttribute - - static_assert(sizeof(VertexAttribute) == sizeof(WGPUVertexAttribute), "sizeof mismatch for VertexAttribute"); - static_assert(alignof(VertexAttribute) == alignof(WGPUVertexAttribute), "alignof mismatch for VertexAttribute"); - - static_assert(offsetof(VertexAttribute, format) == offsetof(WGPUVertexAttribute, format), - "offsetof mismatch for VertexAttribute::format"); - static_assert(offsetof(VertexAttribute, offset) == offsetof(WGPUVertexAttribute, offset), - "offsetof mismatch for VertexAttribute::offset"); - static_assert(offsetof(VertexAttribute, shaderLocation) == offsetof(WGPUVertexAttribute, shaderLocation), - "offsetof mismatch for VertexAttribute::shaderLocation"); - - // BindGroupDescriptor - - static_assert(sizeof(BindGroupDescriptor) == sizeof(WGPUBindGroupDescriptor), "sizeof mismatch for BindGroupDescriptor"); - static_assert(alignof(BindGroupDescriptor) == alignof(WGPUBindGroupDescriptor), "alignof mismatch for BindGroupDescriptor"); - - static_assert(offsetof(BindGroupDescriptor, nextInChain) == offsetof(WGPUBindGroupDescriptor, nextInChain), - "offsetof mismatch for BindGroupDescriptor::nextInChain"); - static_assert(offsetof(BindGroupDescriptor, label) == offsetof(WGPUBindGroupDescriptor, label), - "offsetof mismatch for BindGroupDescriptor::label"); - static_assert(offsetof(BindGroupDescriptor, layout) == offsetof(WGPUBindGroupDescriptor, layout), - "offsetof mismatch for BindGroupDescriptor::layout"); - static_assert(offsetof(BindGroupDescriptor, entryCount) == offsetof(WGPUBindGroupDescriptor, entryCount), - "offsetof mismatch for BindGroupDescriptor::entryCount"); - static_assert(offsetof(BindGroupDescriptor, entries) == offsetof(WGPUBindGroupDescriptor, entries), - "offsetof mismatch for BindGroupDescriptor::entries"); - - // BindGroupLayoutEntry - - static_assert(sizeof(BindGroupLayoutEntry) == sizeof(WGPUBindGroupLayoutEntry), "sizeof mismatch for BindGroupLayoutEntry"); - static_assert(alignof(BindGroupLayoutEntry) == alignof(WGPUBindGroupLayoutEntry), "alignof mismatch for BindGroupLayoutEntry"); - - static_assert(offsetof(BindGroupLayoutEntry, nextInChain) == offsetof(WGPUBindGroupLayoutEntry, nextInChain), - "offsetof mismatch for BindGroupLayoutEntry::nextInChain"); - static_assert(offsetof(BindGroupLayoutEntry, binding) == offsetof(WGPUBindGroupLayoutEntry, binding), - "offsetof mismatch for BindGroupLayoutEntry::binding"); - static_assert(offsetof(BindGroupLayoutEntry, visibility) == offsetof(WGPUBindGroupLayoutEntry, visibility), - "offsetof mismatch for BindGroupLayoutEntry::visibility"); - static_assert(offsetof(BindGroupLayoutEntry, buffer) == offsetof(WGPUBindGroupLayoutEntry, buffer), - "offsetof mismatch for BindGroupLayoutEntry::buffer"); - static_assert(offsetof(BindGroupLayoutEntry, sampler) == offsetof(WGPUBindGroupLayoutEntry, sampler), - "offsetof mismatch for BindGroupLayoutEntry::sampler"); - static_assert(offsetof(BindGroupLayoutEntry, texture) == offsetof(WGPUBindGroupLayoutEntry, texture), - "offsetof mismatch for BindGroupLayoutEntry::texture"); - static_assert(offsetof(BindGroupLayoutEntry, storageTexture) == offsetof(WGPUBindGroupLayoutEntry, storageTexture), - "offsetof mismatch for BindGroupLayoutEntry::storageTexture"); - - // BlendState - - static_assert(sizeof(BlendState) == sizeof(WGPUBlendState), "sizeof mismatch for BlendState"); - static_assert(alignof(BlendState) == alignof(WGPUBlendState), "alignof mismatch for BlendState"); - - static_assert(offsetof(BlendState, color) == offsetof(WGPUBlendState, color), - "offsetof mismatch for BlendState::color"); - static_assert(offsetof(BlendState, alpha) == offsetof(WGPUBlendState, alpha), - "offsetof mismatch for BlendState::alpha"); - - // CompilationInfo - - static_assert(sizeof(CompilationInfo) == sizeof(WGPUCompilationInfo), "sizeof mismatch for CompilationInfo"); - static_assert(alignof(CompilationInfo) == alignof(WGPUCompilationInfo), "alignof mismatch for CompilationInfo"); - - static_assert(offsetof(CompilationInfo, nextInChain) == offsetof(WGPUCompilationInfo, nextInChain), - "offsetof mismatch for CompilationInfo::nextInChain"); - static_assert(offsetof(CompilationInfo, messageCount) == offsetof(WGPUCompilationInfo, messageCount), - "offsetof mismatch for CompilationInfo::messageCount"); - static_assert(offsetof(CompilationInfo, messages) == offsetof(WGPUCompilationInfo, messages), - "offsetof mismatch for CompilationInfo::messages"); - - // ComputePassDescriptor - - static_assert(sizeof(ComputePassDescriptor) == sizeof(WGPUComputePassDescriptor), "sizeof mismatch for ComputePassDescriptor"); - static_assert(alignof(ComputePassDescriptor) == alignof(WGPUComputePassDescriptor), "alignof mismatch for ComputePassDescriptor"); - - static_assert(offsetof(ComputePassDescriptor, nextInChain) == offsetof(WGPUComputePassDescriptor, nextInChain), - "offsetof mismatch for ComputePassDescriptor::nextInChain"); - static_assert(offsetof(ComputePassDescriptor, label) == offsetof(WGPUComputePassDescriptor, label), - "offsetof mismatch for ComputePassDescriptor::label"); - static_assert(offsetof(ComputePassDescriptor, timestampWrites) == offsetof(WGPUComputePassDescriptor, timestampWrites), - "offsetof mismatch for ComputePassDescriptor::timestampWrites"); - - // DepthStencilState - - static_assert(sizeof(DepthStencilState) == sizeof(WGPUDepthStencilState), "sizeof mismatch for DepthStencilState"); - static_assert(alignof(DepthStencilState) == alignof(WGPUDepthStencilState), "alignof mismatch for DepthStencilState"); - - static_assert(offsetof(DepthStencilState, nextInChain) == offsetof(WGPUDepthStencilState, nextInChain), - "offsetof mismatch for DepthStencilState::nextInChain"); - static_assert(offsetof(DepthStencilState, format) == offsetof(WGPUDepthStencilState, format), - "offsetof mismatch for DepthStencilState::format"); - static_assert(offsetof(DepthStencilState, depthWriteEnabled) == offsetof(WGPUDepthStencilState, depthWriteEnabled), - "offsetof mismatch for DepthStencilState::depthWriteEnabled"); - static_assert(offsetof(DepthStencilState, depthCompare) == offsetof(WGPUDepthStencilState, depthCompare), - "offsetof mismatch for DepthStencilState::depthCompare"); - static_assert(offsetof(DepthStencilState, stencilFront) == offsetof(WGPUDepthStencilState, stencilFront), - "offsetof mismatch for DepthStencilState::stencilFront"); - static_assert(offsetof(DepthStencilState, stencilBack) == offsetof(WGPUDepthStencilState, stencilBack), - "offsetof mismatch for DepthStencilState::stencilBack"); - static_assert(offsetof(DepthStencilState, stencilReadMask) == offsetof(WGPUDepthStencilState, stencilReadMask), - "offsetof mismatch for DepthStencilState::stencilReadMask"); - static_assert(offsetof(DepthStencilState, stencilWriteMask) == offsetof(WGPUDepthStencilState, stencilWriteMask), - "offsetof mismatch for DepthStencilState::stencilWriteMask"); - static_assert(offsetof(DepthStencilState, depthBias) == offsetof(WGPUDepthStencilState, depthBias), - "offsetof mismatch for DepthStencilState::depthBias"); - static_assert(offsetof(DepthStencilState, depthBiasSlopeScale) == offsetof(WGPUDepthStencilState, depthBiasSlopeScale), - "offsetof mismatch for DepthStencilState::depthBiasSlopeScale"); - static_assert(offsetof(DepthStencilState, depthBiasClamp) == offsetof(WGPUDepthStencilState, depthBiasClamp), - "offsetof mismatch for DepthStencilState::depthBiasClamp"); - - // FutureWaitInfo - - static_assert(sizeof(FutureWaitInfo) == sizeof(WGPUFutureWaitInfo), "sizeof mismatch for FutureWaitInfo"); - static_assert(alignof(FutureWaitInfo) == alignof(WGPUFutureWaitInfo), "alignof mismatch for FutureWaitInfo"); - - static_assert(offsetof(FutureWaitInfo, future) == offsetof(WGPUFutureWaitInfo, future), - "offsetof mismatch for FutureWaitInfo::future"); - static_assert(offsetof(FutureWaitInfo, completed) == offsetof(WGPUFutureWaitInfo, completed), - "offsetof mismatch for FutureWaitInfo::completed"); - - // ImageCopyBuffer - - static_assert(sizeof(ImageCopyBuffer) == sizeof(WGPUImageCopyBuffer), "sizeof mismatch for ImageCopyBuffer"); - static_assert(alignof(ImageCopyBuffer) == alignof(WGPUImageCopyBuffer), "alignof mismatch for ImageCopyBuffer"); - - static_assert(offsetof(ImageCopyBuffer, nextInChain) == offsetof(WGPUImageCopyBuffer, nextInChain), - "offsetof mismatch for ImageCopyBuffer::nextInChain"); - static_assert(offsetof(ImageCopyBuffer, layout) == offsetof(WGPUImageCopyBuffer, layout), - "offsetof mismatch for ImageCopyBuffer::layout"); - static_assert(offsetof(ImageCopyBuffer, buffer) == offsetof(WGPUImageCopyBuffer, buffer), - "offsetof mismatch for ImageCopyBuffer::buffer"); - - // ImageCopyTexture - - static_assert(sizeof(ImageCopyTexture) == sizeof(WGPUImageCopyTexture), "sizeof mismatch for ImageCopyTexture"); - static_assert(alignof(ImageCopyTexture) == alignof(WGPUImageCopyTexture), "alignof mismatch for ImageCopyTexture"); - - static_assert(offsetof(ImageCopyTexture, nextInChain) == offsetof(WGPUImageCopyTexture, nextInChain), - "offsetof mismatch for ImageCopyTexture::nextInChain"); - static_assert(offsetof(ImageCopyTexture, texture) == offsetof(WGPUImageCopyTexture, texture), - "offsetof mismatch for ImageCopyTexture::texture"); - static_assert(offsetof(ImageCopyTexture, mipLevel) == offsetof(WGPUImageCopyTexture, mipLevel), - "offsetof mismatch for ImageCopyTexture::mipLevel"); - static_assert(offsetof(ImageCopyTexture, origin) == offsetof(WGPUImageCopyTexture, origin), - "offsetof mismatch for ImageCopyTexture::origin"); - static_assert(offsetof(ImageCopyTexture, aspect) == offsetof(WGPUImageCopyTexture, aspect), - "offsetof mismatch for ImageCopyTexture::aspect"); - - // InstanceDescriptor - - static_assert(sizeof(InstanceDescriptor) == sizeof(WGPUInstanceDescriptor), "sizeof mismatch for InstanceDescriptor"); - 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, features) == offsetof(WGPUInstanceDescriptor, features), - "offsetof mismatch for InstanceDescriptor::features"); - - // ProgrammableStageDescriptor - - static_assert(sizeof(ProgrammableStageDescriptor) == sizeof(WGPUProgrammableStageDescriptor), "sizeof mismatch for ProgrammableStageDescriptor"); - static_assert(alignof(ProgrammableStageDescriptor) == alignof(WGPUProgrammableStageDescriptor), "alignof mismatch for ProgrammableStageDescriptor"); - - static_assert(offsetof(ProgrammableStageDescriptor, nextInChain) == offsetof(WGPUProgrammableStageDescriptor, nextInChain), - "offsetof mismatch for ProgrammableStageDescriptor::nextInChain"); - static_assert(offsetof(ProgrammableStageDescriptor, module) == offsetof(WGPUProgrammableStageDescriptor, module), - "offsetof mismatch for ProgrammableStageDescriptor::module"); - static_assert(offsetof(ProgrammableStageDescriptor, entryPoint) == offsetof(WGPUProgrammableStageDescriptor, entryPoint), - "offsetof mismatch for ProgrammableStageDescriptor::entryPoint"); - static_assert(offsetof(ProgrammableStageDescriptor, constantCount) == offsetof(WGPUProgrammableStageDescriptor, constantCount), - "offsetof mismatch for ProgrammableStageDescriptor::constantCount"); - static_assert(offsetof(ProgrammableStageDescriptor, constants) == offsetof(WGPUProgrammableStageDescriptor, constants), - "offsetof mismatch for ProgrammableStageDescriptor::constants"); - - // RenderPassColorAttachment - - static_assert(sizeof(RenderPassColorAttachment) == sizeof(WGPURenderPassColorAttachment), "sizeof mismatch for RenderPassColorAttachment"); - static_assert(alignof(RenderPassColorAttachment) == alignof(WGPURenderPassColorAttachment), "alignof mismatch for RenderPassColorAttachment"); - - static_assert(offsetof(RenderPassColorAttachment, nextInChain) == offsetof(WGPURenderPassColorAttachment, nextInChain), - "offsetof mismatch for RenderPassColorAttachment::nextInChain"); - static_assert(offsetof(RenderPassColorAttachment, view) == offsetof(WGPURenderPassColorAttachment, view), - "offsetof mismatch for RenderPassColorAttachment::view"); - static_assert(offsetof(RenderPassColorAttachment, depthSlice) == offsetof(WGPURenderPassColorAttachment, depthSlice), - "offsetof mismatch for RenderPassColorAttachment::depthSlice"); - static_assert(offsetof(RenderPassColorAttachment, resolveTarget) == offsetof(WGPURenderPassColorAttachment, resolveTarget), - "offsetof mismatch for RenderPassColorAttachment::resolveTarget"); - static_assert(offsetof(RenderPassColorAttachment, loadOp) == offsetof(WGPURenderPassColorAttachment, loadOp), - "offsetof mismatch for RenderPassColorAttachment::loadOp"); - static_assert(offsetof(RenderPassColorAttachment, storeOp) == offsetof(WGPURenderPassColorAttachment, storeOp), - "offsetof mismatch for RenderPassColorAttachment::storeOp"); - static_assert(offsetof(RenderPassColorAttachment, clearValue) == offsetof(WGPURenderPassColorAttachment, clearValue), - "offsetof mismatch for RenderPassColorAttachment::clearValue"); - - // RequiredLimits - - static_assert(sizeof(RequiredLimits) == sizeof(WGPURequiredLimits), "sizeof mismatch for RequiredLimits"); - static_assert(alignof(RequiredLimits) == alignof(WGPURequiredLimits), "alignof mismatch for RequiredLimits"); - - static_assert(offsetof(RequiredLimits, nextInChain) == offsetof(WGPURequiredLimits, nextInChain), - "offsetof mismatch for RequiredLimits::nextInChain"); - static_assert(offsetof(RequiredLimits, limits) == offsetof(WGPURequiredLimits, limits), - "offsetof mismatch for RequiredLimits::limits"); - - // SupportedLimits - - static_assert(sizeof(SupportedLimits) == sizeof(WGPUSupportedLimits), "sizeof mismatch for SupportedLimits"); - static_assert(alignof(SupportedLimits) == alignof(WGPUSupportedLimits), "alignof mismatch for SupportedLimits"); - - static_assert(offsetof(SupportedLimits, nextInChain) == offsetof(WGPUSupportedLimits, nextInChain), - "offsetof mismatch for SupportedLimits::nextInChain"); - static_assert(offsetof(SupportedLimits, limits) == offsetof(WGPUSupportedLimits, limits), - "offsetof mismatch for SupportedLimits::limits"); - - // TextureDescriptor - - static_assert(sizeof(TextureDescriptor) == sizeof(WGPUTextureDescriptor), "sizeof mismatch for TextureDescriptor"); - static_assert(alignof(TextureDescriptor) == alignof(WGPUTextureDescriptor), "alignof mismatch for TextureDescriptor"); - - static_assert(offsetof(TextureDescriptor, nextInChain) == offsetof(WGPUTextureDescriptor, nextInChain), - "offsetof mismatch for TextureDescriptor::nextInChain"); - static_assert(offsetof(TextureDescriptor, label) == offsetof(WGPUTextureDescriptor, label), - "offsetof mismatch for TextureDescriptor::label"); - static_assert(offsetof(TextureDescriptor, usage) == offsetof(WGPUTextureDescriptor, usage), - "offsetof mismatch for TextureDescriptor::usage"); - static_assert(offsetof(TextureDescriptor, dimension) == offsetof(WGPUTextureDescriptor, dimension), - "offsetof mismatch for TextureDescriptor::dimension"); - static_assert(offsetof(TextureDescriptor, size) == offsetof(WGPUTextureDescriptor, size), - "offsetof mismatch for TextureDescriptor::size"); - static_assert(offsetof(TextureDescriptor, format) == offsetof(WGPUTextureDescriptor, format), - "offsetof mismatch for TextureDescriptor::format"); - static_assert(offsetof(TextureDescriptor, mipLevelCount) == offsetof(WGPUTextureDescriptor, mipLevelCount), - "offsetof mismatch for TextureDescriptor::mipLevelCount"); - static_assert(offsetof(TextureDescriptor, sampleCount) == offsetof(WGPUTextureDescriptor, sampleCount), - "offsetof mismatch for TextureDescriptor::sampleCount"); - static_assert(offsetof(TextureDescriptor, viewFormatCount) == offsetof(WGPUTextureDescriptor, viewFormatCount), - "offsetof mismatch for TextureDescriptor::viewFormatCount"); - static_assert(offsetof(TextureDescriptor, viewFormats) == offsetof(WGPUTextureDescriptor, viewFormats), - "offsetof mismatch for TextureDescriptor::viewFormats"); - - // VertexBufferLayout - - static_assert(sizeof(VertexBufferLayout) == sizeof(WGPUVertexBufferLayout), "sizeof mismatch for VertexBufferLayout"); - static_assert(alignof(VertexBufferLayout) == alignof(WGPUVertexBufferLayout), "alignof mismatch for VertexBufferLayout"); - - static_assert(offsetof(VertexBufferLayout, arrayStride) == offsetof(WGPUVertexBufferLayout, arrayStride), - "offsetof mismatch for VertexBufferLayout::arrayStride"); - static_assert(offsetof(VertexBufferLayout, stepMode) == offsetof(WGPUVertexBufferLayout, stepMode), - "offsetof mismatch for VertexBufferLayout::stepMode"); - static_assert(offsetof(VertexBufferLayout, attributeCount) == offsetof(WGPUVertexBufferLayout, attributeCount), - "offsetof mismatch for VertexBufferLayout::attributeCount"); - static_assert(offsetof(VertexBufferLayout, attributes) == offsetof(WGPUVertexBufferLayout, attributes), - "offsetof mismatch for VertexBufferLayout::attributes"); - - // BindGroupLayoutDescriptor - - static_assert(sizeof(BindGroupLayoutDescriptor) == sizeof(WGPUBindGroupLayoutDescriptor), "sizeof mismatch for BindGroupLayoutDescriptor"); - static_assert(alignof(BindGroupLayoutDescriptor) == alignof(WGPUBindGroupLayoutDescriptor), "alignof mismatch for BindGroupLayoutDescriptor"); - - static_assert(offsetof(BindGroupLayoutDescriptor, nextInChain) == offsetof(WGPUBindGroupLayoutDescriptor, nextInChain), - "offsetof mismatch for BindGroupLayoutDescriptor::nextInChain"); - static_assert(offsetof(BindGroupLayoutDescriptor, label) == offsetof(WGPUBindGroupLayoutDescriptor, label), - "offsetof mismatch for BindGroupLayoutDescriptor::label"); - static_assert(offsetof(BindGroupLayoutDescriptor, entryCount) == offsetof(WGPUBindGroupLayoutDescriptor, entryCount), - "offsetof mismatch for BindGroupLayoutDescriptor::entryCount"); - static_assert(offsetof(BindGroupLayoutDescriptor, entries) == offsetof(WGPUBindGroupLayoutDescriptor, entries), - "offsetof mismatch for BindGroupLayoutDescriptor::entries"); - - // ColorTargetState - - static_assert(sizeof(ColorTargetState) == sizeof(WGPUColorTargetState), "sizeof mismatch for ColorTargetState"); - static_assert(alignof(ColorTargetState) == alignof(WGPUColorTargetState), "alignof mismatch for ColorTargetState"); - - static_assert(offsetof(ColorTargetState, nextInChain) == offsetof(WGPUColorTargetState, nextInChain), - "offsetof mismatch for ColorTargetState::nextInChain"); - static_assert(offsetof(ColorTargetState, format) == offsetof(WGPUColorTargetState, format), - "offsetof mismatch for ColorTargetState::format"); - static_assert(offsetof(ColorTargetState, blend) == offsetof(WGPUColorTargetState, blend), - "offsetof mismatch for ColorTargetState::blend"); - static_assert(offsetof(ColorTargetState, writeMask) == offsetof(WGPUColorTargetState, writeMask), - "offsetof mismatch for ColorTargetState::writeMask"); - - // ComputePipelineDescriptor - - static_assert(sizeof(ComputePipelineDescriptor) == sizeof(WGPUComputePipelineDescriptor), "sizeof mismatch for ComputePipelineDescriptor"); - static_assert(alignof(ComputePipelineDescriptor) == alignof(WGPUComputePipelineDescriptor), "alignof mismatch for ComputePipelineDescriptor"); - - static_assert(offsetof(ComputePipelineDescriptor, nextInChain) == offsetof(WGPUComputePipelineDescriptor, nextInChain), - "offsetof mismatch for ComputePipelineDescriptor::nextInChain"); - static_assert(offsetof(ComputePipelineDescriptor, label) == offsetof(WGPUComputePipelineDescriptor, label), - "offsetof mismatch for ComputePipelineDescriptor::label"); - static_assert(offsetof(ComputePipelineDescriptor, layout) == offsetof(WGPUComputePipelineDescriptor, layout), - "offsetof mismatch for ComputePipelineDescriptor::layout"); - static_assert(offsetof(ComputePipelineDescriptor, compute) == offsetof(WGPUComputePipelineDescriptor, compute), - "offsetof mismatch for ComputePipelineDescriptor::compute"); - - // DeviceDescriptor - - static_assert(sizeof(DeviceDescriptor) == sizeof(WGPUDeviceDescriptor), "sizeof mismatch for DeviceDescriptor"); - static_assert(alignof(DeviceDescriptor) == alignof(WGPUDeviceDescriptor), "alignof mismatch for DeviceDescriptor"); - - static_assert(offsetof(DeviceDescriptor, nextInChain) == offsetof(WGPUDeviceDescriptor, nextInChain), - "offsetof mismatch for DeviceDescriptor::nextInChain"); - static_assert(offsetof(DeviceDescriptor, label) == offsetof(WGPUDeviceDescriptor, label), - "offsetof mismatch for DeviceDescriptor::label"); - static_assert(offsetof(DeviceDescriptor, requiredFeatureCount) == offsetof(WGPUDeviceDescriptor, requiredFeatureCount), - "offsetof mismatch for DeviceDescriptor::requiredFeatureCount"); - static_assert(offsetof(DeviceDescriptor, requiredFeatures) == offsetof(WGPUDeviceDescriptor, requiredFeatures), - "offsetof mismatch for DeviceDescriptor::requiredFeatures"); - static_assert(offsetof(DeviceDescriptor, requiredLimits) == offsetof(WGPUDeviceDescriptor, requiredLimits), - "offsetof mismatch for DeviceDescriptor::requiredLimits"); - static_assert(offsetof(DeviceDescriptor, defaultQueue) == offsetof(WGPUDeviceDescriptor, defaultQueue), - "offsetof mismatch for DeviceDescriptor::defaultQueue"); - static_assert(offsetof(DeviceDescriptor, deviceLostCallback) == offsetof(WGPUDeviceDescriptor, deviceLostCallback), - "offsetof mismatch for DeviceDescriptor::deviceLostCallback"); - static_assert(offsetof(DeviceDescriptor, deviceLostUserdata) == offsetof(WGPUDeviceDescriptor, deviceLostUserdata), - "offsetof mismatch for DeviceDescriptor::deviceLostUserdata"); - - // RenderPassDescriptor - - static_assert(sizeof(RenderPassDescriptor) == sizeof(WGPURenderPassDescriptor), "sizeof mismatch for RenderPassDescriptor"); - static_assert(alignof(RenderPassDescriptor) == alignof(WGPURenderPassDescriptor), "alignof mismatch for RenderPassDescriptor"); - - static_assert(offsetof(RenderPassDescriptor, nextInChain) == offsetof(WGPURenderPassDescriptor, nextInChain), - "offsetof mismatch for RenderPassDescriptor::nextInChain"); - static_assert(offsetof(RenderPassDescriptor, label) == offsetof(WGPURenderPassDescriptor, label), - "offsetof mismatch for RenderPassDescriptor::label"); - static_assert(offsetof(RenderPassDescriptor, colorAttachmentCount) == offsetof(WGPURenderPassDescriptor, colorAttachmentCount), - "offsetof mismatch for RenderPassDescriptor::colorAttachmentCount"); - static_assert(offsetof(RenderPassDescriptor, colorAttachments) == offsetof(WGPURenderPassDescriptor, colorAttachments), - "offsetof mismatch for RenderPassDescriptor::colorAttachments"); - static_assert(offsetof(RenderPassDescriptor, depthStencilAttachment) == offsetof(WGPURenderPassDescriptor, depthStencilAttachment), - "offsetof mismatch for RenderPassDescriptor::depthStencilAttachment"); - static_assert(offsetof(RenderPassDescriptor, occlusionQuerySet) == offsetof(WGPURenderPassDescriptor, occlusionQuerySet), - "offsetof mismatch for RenderPassDescriptor::occlusionQuerySet"); - static_assert(offsetof(RenderPassDescriptor, timestampWrites) == offsetof(WGPURenderPassDescriptor, timestampWrites), - "offsetof mismatch for RenderPassDescriptor::timestampWrites"); - - // VertexState - - static_assert(sizeof(VertexState) == sizeof(WGPUVertexState), "sizeof mismatch for VertexState"); - static_assert(alignof(VertexState) == alignof(WGPUVertexState), "alignof mismatch for VertexState"); - - static_assert(offsetof(VertexState, nextInChain) == offsetof(WGPUVertexState, nextInChain), - "offsetof mismatch for VertexState::nextInChain"); - static_assert(offsetof(VertexState, module) == offsetof(WGPUVertexState, module), - "offsetof mismatch for VertexState::module"); - static_assert(offsetof(VertexState, entryPoint) == offsetof(WGPUVertexState, entryPoint), - "offsetof mismatch for VertexState::entryPoint"); - static_assert(offsetof(VertexState, constantCount) == offsetof(WGPUVertexState, constantCount), - "offsetof mismatch for VertexState::constantCount"); - static_assert(offsetof(VertexState, constants) == offsetof(WGPUVertexState, constants), - "offsetof mismatch for VertexState::constants"); - static_assert(offsetof(VertexState, bufferCount) == offsetof(WGPUVertexState, bufferCount), - "offsetof mismatch for VertexState::bufferCount"); - static_assert(offsetof(VertexState, buffers) == offsetof(WGPUVertexState, buffers), - "offsetof mismatch for VertexState::buffers"); - - // FragmentState - - static_assert(sizeof(FragmentState) == sizeof(WGPUFragmentState), "sizeof mismatch for FragmentState"); - static_assert(alignof(FragmentState) == alignof(WGPUFragmentState), "alignof mismatch for FragmentState"); - - static_assert(offsetof(FragmentState, nextInChain) == offsetof(WGPUFragmentState, nextInChain), - "offsetof mismatch for FragmentState::nextInChain"); - static_assert(offsetof(FragmentState, module) == offsetof(WGPUFragmentState, module), - "offsetof mismatch for FragmentState::module"); - static_assert(offsetof(FragmentState, entryPoint) == offsetof(WGPUFragmentState, entryPoint), - "offsetof mismatch for FragmentState::entryPoint"); - static_assert(offsetof(FragmentState, constantCount) == offsetof(WGPUFragmentState, constantCount), - "offsetof mismatch for FragmentState::constantCount"); - static_assert(offsetof(FragmentState, constants) == offsetof(WGPUFragmentState, constants), - "offsetof mismatch for FragmentState::constants"); - static_assert(offsetof(FragmentState, targetCount) == offsetof(WGPUFragmentState, targetCount), - "offsetof mismatch for FragmentState::targetCount"); - static_assert(offsetof(FragmentState, targets) == offsetof(WGPUFragmentState, targets), - "offsetof mismatch for FragmentState::targets"); - - // RenderPipelineDescriptor - - static_assert(sizeof(RenderPipelineDescriptor) == sizeof(WGPURenderPipelineDescriptor), "sizeof mismatch for RenderPipelineDescriptor"); - static_assert(alignof(RenderPipelineDescriptor) == alignof(WGPURenderPipelineDescriptor), "alignof mismatch for RenderPipelineDescriptor"); - - static_assert(offsetof(RenderPipelineDescriptor, nextInChain) == offsetof(WGPURenderPipelineDescriptor, nextInChain), - "offsetof mismatch for RenderPipelineDescriptor::nextInChain"); - static_assert(offsetof(RenderPipelineDescriptor, label) == offsetof(WGPURenderPipelineDescriptor, label), - "offsetof mismatch for RenderPipelineDescriptor::label"); - static_assert(offsetof(RenderPipelineDescriptor, layout) == offsetof(WGPURenderPipelineDescriptor, layout), - "offsetof mismatch for RenderPipelineDescriptor::layout"); - static_assert(offsetof(RenderPipelineDescriptor, vertex) == offsetof(WGPURenderPipelineDescriptor, vertex), - "offsetof mismatch for RenderPipelineDescriptor::vertex"); - static_assert(offsetof(RenderPipelineDescriptor, primitive) == offsetof(WGPURenderPipelineDescriptor, primitive), - "offsetof mismatch for RenderPipelineDescriptor::primitive"); - static_assert(offsetof(RenderPipelineDescriptor, depthStencil) == offsetof(WGPURenderPipelineDescriptor, depthStencil), - "offsetof mismatch for RenderPipelineDescriptor::depthStencil"); - static_assert(offsetof(RenderPipelineDescriptor, multisample) == offsetof(WGPURenderPipelineDescriptor, multisample), - "offsetof mismatch for RenderPipelineDescriptor::multisample"); - static_assert(offsetof(RenderPipelineDescriptor, fragment) == offsetof(WGPURenderPipelineDescriptor, fragment), - "offsetof mismatch for RenderPipelineDescriptor::fragment"); - - // AdapterInfo implementation - AdapterInfo::~AdapterInfo() { - if (this->vendor != nullptr || this->architecture != nullptr || this->device != nullptr || this->description != nullptr) { - wgpuAdapterInfoFreeMembers( - *reinterpret_cast(this)); - } - } - - static void Reset(AdapterInfo& value) { - AdapterInfo defaultValue{}; - AsNonConstReference(value.vendor) = defaultValue.vendor; - AsNonConstReference(value.architecture) = defaultValue.architecture; - AsNonConstReference(value.device) = defaultValue.device; - AsNonConstReference(value.description) = defaultValue.description; - AsNonConstReference(value.backendType) = defaultValue.backendType; - AsNonConstReference(value.adapterType) = defaultValue.adapterType; - AsNonConstReference(value.vendorID) = defaultValue.vendorID; - AsNonConstReference(value.deviceID) = defaultValue.deviceID; - } - - AdapterInfo::AdapterInfo(AdapterInfo&& rhs) - : vendor(rhs.vendor), - architecture(rhs.architecture), - device(rhs.device), - description(rhs.description), - backendType(rhs.backendType), - adapterType(rhs.adapterType), - vendorID(rhs.vendorID), - deviceID(rhs.deviceID){ - Reset(rhs); - } - - AdapterInfo& AdapterInfo::operator=(AdapterInfo&& rhs) { - if (&rhs == this) { - return *this; - } - this->~AdapterInfo(); - AsNonConstReference(this->vendor) = std::move(rhs.vendor); - AsNonConstReference(this->architecture) = std::move(rhs.architecture); - AsNonConstReference(this->device) = std::move(rhs.device); - AsNonConstReference(this->description) = std::move(rhs.description); - AsNonConstReference(this->backendType) = std::move(rhs.backendType); - AsNonConstReference(this->adapterType) = std::move(rhs.adapterType); - AsNonConstReference(this->vendorID) = std::move(rhs.vendorID); - AsNonConstReference(this->deviceID) = std::move(rhs.deviceID); - Reset(rhs); - return *this; - } - - // AdapterProperties - AdapterProperties::~AdapterProperties() { - if (this->vendorName != nullptr || this->architecture != nullptr || this->name != nullptr || this->driverDescription != nullptr) { - wgpuAdapterPropertiesFreeMembers( - *reinterpret_cast(this)); - } - } - - static void Reset(AdapterProperties& value) { - AdapterProperties defaultValue{}; - AsNonConstReference(value.vendorID) = defaultValue.vendorID; - AsNonConstReference(value.vendorName) = defaultValue.vendorName; - AsNonConstReference(value.architecture) = defaultValue.architecture; - AsNonConstReference(value.deviceID) = defaultValue.deviceID; - AsNonConstReference(value.name) = defaultValue.name; - AsNonConstReference(value.driverDescription) = defaultValue.driverDescription; - AsNonConstReference(value.adapterType) = defaultValue.adapterType; - AsNonConstReference(value.backendType) = defaultValue.backendType; - AsNonConstReference(value.compatibilityMode) = defaultValue.compatibilityMode; - } - - AdapterProperties::AdapterProperties(AdapterProperties&& rhs) - : vendorID(rhs.vendorID), - vendorName(rhs.vendorName), - architecture(rhs.architecture), - deviceID(rhs.deviceID), - name(rhs.name), - driverDescription(rhs.driverDescription), - adapterType(rhs.adapterType), - backendType(rhs.backendType), - compatibilityMode(rhs.compatibilityMode){ - Reset(rhs); - } - - AdapterProperties& AdapterProperties::operator=(AdapterProperties&& rhs) { - if (&rhs == this) { - return *this; - } - this->~AdapterProperties(); - AsNonConstReference(this->vendorID) = std::move(rhs.vendorID); - AsNonConstReference(this->vendorName) = std::move(rhs.vendorName); - AsNonConstReference(this->architecture) = std::move(rhs.architecture); - AsNonConstReference(this->deviceID) = std::move(rhs.deviceID); - AsNonConstReference(this->name) = std::move(rhs.name); - AsNonConstReference(this->driverDescription) = std::move(rhs.driverDescription); - AsNonConstReference(this->adapterType) = std::move(rhs.adapterType); - AsNonConstReference(this->backendType) = std::move(rhs.backendType); - AsNonConstReference(this->compatibilityMode) = std::move(rhs.compatibilityMode); - Reset(rhs); - return *this; - } - - - - // Adapter - - static_assert(sizeof(Adapter) == sizeof(WGPUAdapter), "sizeof mismatch for Adapter"); - static_assert(alignof(Adapter) == alignof(WGPUAdapter), "alignof mismatch for Adapter"); - - size_t Adapter::EnumerateFeatures(FeatureName * features) const { - auto result = wgpuAdapterEnumerateFeatures(Get(), reinterpret_cast(features)); - return result; - } - void Adapter::GetInfo(AdapterInfo * info) const { - *info = AdapterInfo(); - wgpuAdapterGetInfo(Get(), reinterpret_cast(info)); - } - Bool Adapter::GetLimits(SupportedLimits * limits) const { - auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast(limits)); - return result; - } - void Adapter::GetProperties(AdapterProperties * properties) const { - *properties = AdapterProperties(); - wgpuAdapterGetProperties(Get(), reinterpret_cast(properties)); - } - Bool Adapter::HasFeature(FeatureName feature) const { - auto result = wgpuAdapterHasFeature(Get(), static_cast(feature)); - return result; - } - void Adapter::RequestDevice(DeviceDescriptor const * descriptor, RequestDeviceCallback callback, void * userdata) const { - wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callback, userdata); - } - void Adapter::WGPUReference(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuAdapterReference(handle); - } - } - void Adapter::WGPURelease(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuAdapterRelease(handle); - } - } - - // BindGroup - - static_assert(sizeof(BindGroup) == sizeof(WGPUBindGroup), "sizeof mismatch for BindGroup"); - static_assert(alignof(BindGroup) == alignof(WGPUBindGroup), "alignof mismatch for BindGroup"); - - void BindGroup::SetLabel(char const * label) const { - wgpuBindGroupSetLabel(Get(), reinterpret_cast(label)); - } - void BindGroup::WGPUReference(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupReference(handle); - } - } - void BindGroup::WGPURelease(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupRelease(handle); - } - } - - // BindGroupLayout - - static_assert(sizeof(BindGroupLayout) == sizeof(WGPUBindGroupLayout), "sizeof mismatch for BindGroupLayout"); - static_assert(alignof(BindGroupLayout) == alignof(WGPUBindGroupLayout), "alignof mismatch for BindGroupLayout"); - - void BindGroupLayout::SetLabel(char const * label) const { - wgpuBindGroupLayoutSetLabel(Get(), reinterpret_cast(label)); - } - void BindGroupLayout::WGPUReference(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutReference(handle); - } - } - void BindGroupLayout::WGPURelease(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutRelease(handle); - } - } - - // Buffer - - static_assert(sizeof(Buffer) == sizeof(WGPUBuffer), "sizeof mismatch for Buffer"); - static_assert(alignof(Buffer) == alignof(WGPUBuffer), "alignof mismatch for Buffer"); - - void Buffer::Destroy() const { - wgpuBufferDestroy(Get()); - } - void const * Buffer::GetConstMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetConstMappedRange(Get(), offset, size); - return result; - } - BufferMapState Buffer::GetMapState() const { - auto result = wgpuBufferGetMapState(Get()); - return static_cast(result); - } - void * Buffer::GetMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetMappedRange(Get(), offset, size); - return result; - } - uint64_t Buffer::GetSize() const { - auto result = wgpuBufferGetSize(Get()); - return result; - } - BufferUsage Buffer::GetUsage() const { - auto result = wgpuBufferGetUsage(Get()); - return static_cast(result); - } - void Buffer::MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallback callback, void * userdata) const { - wgpuBufferMapAsync(Get(), static_cast(mode), offset, size, callback, userdata); - } - void Buffer::SetLabel(char const * label) const { - wgpuBufferSetLabel(Get(), reinterpret_cast(label)); - } - void Buffer::Unmap() const { - wgpuBufferUnmap(Get()); - } - void Buffer::WGPUReference(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferReference(handle); - } - } - void Buffer::WGPURelease(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferRelease(handle); - } - } - - // CommandBuffer - - static_assert(sizeof(CommandBuffer) == sizeof(WGPUCommandBuffer), "sizeof mismatch for CommandBuffer"); - static_assert(alignof(CommandBuffer) == alignof(WGPUCommandBuffer), "alignof mismatch for CommandBuffer"); - - void CommandBuffer::SetLabel(char const * label) const { - wgpuCommandBufferSetLabel(Get(), reinterpret_cast(label)); - } - void CommandBuffer::WGPUReference(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferReference(handle); - } - } - void CommandBuffer::WGPURelease(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferRelease(handle); - } - } - - // CommandEncoder - - static_assert(sizeof(CommandEncoder) == sizeof(WGPUCommandEncoder), "sizeof mismatch for CommandEncoder"); - static_assert(alignof(CommandEncoder) == alignof(WGPUCommandEncoder), "alignof mismatch for CommandEncoder"); - - ComputePassEncoder CommandEncoder::BeginComputePass(ComputePassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast(descriptor)); - return ComputePassEncoder::Acquire(result); - } - RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast(descriptor)); - return RenderPassEncoder::Acquire(result); - } - void CommandEncoder::ClearBuffer(Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuCommandEncoderClearBuffer(Get(), buffer.Get(), offset, size); - } - void CommandEncoder::CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const { - wgpuCommandEncoderCopyBufferToBuffer(Get(), source.Get(), sourceOffset, destination.Get(), destinationOffset, size); - } - void CommandEncoder::CopyBufferToTexture(ImageCopyBuffer const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - void CommandEncoder::CopyTextureToBuffer(ImageCopyTexture const * source, ImageCopyBuffer const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - void CommandEncoder::CopyTextureToTexture(ImageCopyTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast(descriptor)); - return CommandBuffer::Acquire(result); - } - void CommandEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuCommandEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void CommandEncoder::PopDebugGroup() const { - wgpuCommandEncoderPopDebugGroup(Get()); - } - void CommandEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuCommandEncoderPushDebugGroup(Get(), reinterpret_cast(groupLabel)); - } - void CommandEncoder::ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const { - wgpuCommandEncoderResolveQuerySet(Get(), querySet.Get(), firstQuery, queryCount, destination.Get(), destinationOffset); - } - void CommandEncoder::SetLabel(char const * label) const { - wgpuCommandEncoderSetLabel(Get(), reinterpret_cast(label)); - } - void CommandEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuCommandEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void CommandEncoder::WGPUReference(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderReference(handle); - } - } - void CommandEncoder::WGPURelease(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderRelease(handle); - } - } - - // ComputePassEncoder - - static_assert(sizeof(ComputePassEncoder) == sizeof(WGPUComputePassEncoder), "sizeof mismatch for ComputePassEncoder"); - static_assert(alignof(ComputePassEncoder) == alignof(WGPUComputePassEncoder), "alignof mismatch for ComputePassEncoder"); - - void ComputePassEncoder::DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) const { - wgpuComputePassEncoderDispatchWorkgroups(Get(), workgroupCountX, workgroupCountY, workgroupCountZ); - } - void ComputePassEncoder::DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuComputePassEncoderDispatchWorkgroupsIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void ComputePassEncoder::End() const { - wgpuComputePassEncoderEnd(Get()); - } - void ComputePassEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuComputePassEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void ComputePassEncoder::PopDebugGroup() const { - wgpuComputePassEncoderPopDebugGroup(Get()); - } - void ComputePassEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuComputePassEncoderPushDebugGroup(Get(), reinterpret_cast(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(dynamicOffsets)); - } - void ComputePassEncoder::SetLabel(char const * label) const { - wgpuComputePassEncoderSetLabel(Get(), reinterpret_cast(label)); - } - void ComputePassEncoder::SetPipeline(ComputePipeline const& pipeline) const { - wgpuComputePassEncoderSetPipeline(Get(), pipeline.Get()); - } - void ComputePassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuComputePassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void ComputePassEncoder::WGPUReference(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderReference(handle); - } - } - void ComputePassEncoder::WGPURelease(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderRelease(handle); - } - } - - // ComputePipeline - - static_assert(sizeof(ComputePipeline) == sizeof(WGPUComputePipeline), "sizeof mismatch for ComputePipeline"); - static_assert(alignof(ComputePipeline) == alignof(WGPUComputePipeline), "alignof mismatch for ComputePipeline"); - - BindGroupLayout ComputePipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuComputePipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); - } - void ComputePipeline::SetLabel(char const * label) const { - wgpuComputePipelineSetLabel(Get(), reinterpret_cast(label)); - } - void ComputePipeline::WGPUReference(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineReference(handle); - } - } - void ComputePipeline::WGPURelease(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineRelease(handle); - } - } - - // Device - - static_assert(sizeof(Device) == sizeof(WGPUDevice), "sizeof mismatch for Device"); - static_assert(alignof(Device) == alignof(WGPUDevice), "alignof mismatch for Device"); - - BindGroup Device::CreateBindGroup(BindGroupDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast(descriptor)); - return BindGroup::Acquire(result); - } - BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); - return BindGroupLayout::Acquire(result); - } - Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); - } - CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); - return CommandEncoder::Acquire(result); - } - ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); - return ComputePipeline::Acquire(result); - } - void Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CreateComputePipelineAsyncCallback callback, void * userdata) const { - wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callback, userdata); - } - PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); - return PipelineLayout::Acquire(result); - } - QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); - return QuerySet::Acquire(result); - } - RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); - return RenderBundleEncoder::Acquire(result); - } - RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); - return RenderPipeline::Acquire(result); - } - void Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CreateRenderPipelineAsyncCallback callback, void * userdata) const { - wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callback, userdata); - } - Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); - return Sampler::Acquire(result); - } - ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); - return ShaderModule::Acquire(result); - } - SwapChain Device::CreateSwapChain(Surface const& surface, SwapChainDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSwapChain(Get(), surface.Get(), reinterpret_cast(descriptor)); - return SwapChain::Acquire(result); - } - Texture Device::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); - } - void Device::Destroy() const { - wgpuDeviceDestroy(Get()); - } - size_t Device::EnumerateFeatures(FeatureName * features) const { - auto result = wgpuDeviceEnumerateFeatures(Get(), reinterpret_cast(features)); - return result; - } - Bool Device::GetLimits(SupportedLimits * limits) const { - auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast(limits)); - return result; - } - Queue Device::GetQueue() const { - auto result = wgpuDeviceGetQueue(Get()); - return Queue::Acquire(result); - } - Bool Device::HasFeature(FeatureName feature) const { - auto result = wgpuDeviceHasFeature(Get(), static_cast(feature)); - return result; - } - void Device::PopErrorScope(ErrorCallback callback, void * userdata) const { - wgpuDevicePopErrorScope(Get(), callback, userdata); - } - void Device::PushErrorScope(ErrorFilter filter) const { - wgpuDevicePushErrorScope(Get(), static_cast(filter)); - } - void Device::SetLabel(char const * label) const { - wgpuDeviceSetLabel(Get(), reinterpret_cast(label)); - } - void Device::SetUncapturedErrorCallback(ErrorCallback callback, void * userdata) const { - wgpuDeviceSetUncapturedErrorCallback(Get(), callback, userdata); - } - void Device::WGPUReference(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceReference(handle); - } - } - void Device::WGPURelease(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceRelease(handle); - } - } - - // Instance - - static_assert(sizeof(Instance) == sizeof(WGPUInstance), "sizeof mismatch for Instance"); - static_assert(alignof(Instance) == alignof(WGPUInstance), "alignof mismatch for Instance"); - - Surface Instance::CreateSurface(SurfaceDescriptor const * descriptor) const { - auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast(descriptor)); - return Surface::Acquire(result); - } - Bool Instance::HasWGSLLanguageFeature(WGSLFeatureName feature) const { - auto result = wgpuInstanceHasWGSLLanguageFeature(Get(), static_cast(feature)); - return result; - } - void Instance::ProcessEvents() const { - wgpuInstanceProcessEvents(Get()); - } - void Instance::RequestAdapter(RequestAdapterOptions const * options, RequestAdapterCallback callback, void * userdata) const { - wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callback, userdata); - } - void Instance::WGPUReference(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceReference(handle); - } - } - void Instance::WGPURelease(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceRelease(handle); - } - } - - // PipelineLayout - - static_assert(sizeof(PipelineLayout) == sizeof(WGPUPipelineLayout), "sizeof mismatch for PipelineLayout"); - static_assert(alignof(PipelineLayout) == alignof(WGPUPipelineLayout), "alignof mismatch for PipelineLayout"); - - void PipelineLayout::SetLabel(char const * label) const { - wgpuPipelineLayoutSetLabel(Get(), reinterpret_cast(label)); - } - void PipelineLayout::WGPUReference(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutReference(handle); - } - } - void PipelineLayout::WGPURelease(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutRelease(handle); - } - } - - // QuerySet - - static_assert(sizeof(QuerySet) == sizeof(WGPUQuerySet), "sizeof mismatch for QuerySet"); - static_assert(alignof(QuerySet) == alignof(WGPUQuerySet), "alignof mismatch for QuerySet"); - - void QuerySet::Destroy() const { - wgpuQuerySetDestroy(Get()); - } - uint32_t QuerySet::GetCount() const { - auto result = wgpuQuerySetGetCount(Get()); - return result; - } - QueryType QuerySet::GetType() const { - auto result = wgpuQuerySetGetType(Get()); - return static_cast(result); - } - void QuerySet::SetLabel(char const * label) const { - wgpuQuerySetSetLabel(Get(), reinterpret_cast(label)); - } - void QuerySet::WGPUReference(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetReference(handle); - } - } - void QuerySet::WGPURelease(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetRelease(handle); - } - } - - // Queue - - static_assert(sizeof(Queue) == sizeof(WGPUQueue), "sizeof mismatch for Queue"); - static_assert(alignof(Queue) == alignof(WGPUQueue), "alignof mismatch for Queue"); - - void Queue::OnSubmittedWorkDone(QueueWorkDoneCallback callback, void * userdata) const { - wgpuQueueOnSubmittedWorkDone(Get(), callback, userdata); - } - void Queue::SetLabel(char const * label) const { - wgpuQueueSetLabel(Get(), reinterpret_cast(label)); - } - void Queue::Submit(size_t commandCount, CommandBuffer const * commands) const { - wgpuQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); - } - void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const { - wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); - } - void Queue::WriteTexture(ImageCopyTexture const * destination, void const * data, size_t dataSize, TextureDataLayout const * dataLayout, Extent3D const * writeSize) const { - wgpuQueueWriteTexture(Get(), reinterpret_cast(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(writeSize)); - } - void Queue::WGPUReference(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueReference(handle); - } - } - void Queue::WGPURelease(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueRelease(handle); - } - } - - // RenderBundle - - static_assert(sizeof(RenderBundle) == sizeof(WGPURenderBundle), "sizeof mismatch for RenderBundle"); - static_assert(alignof(RenderBundle) == alignof(WGPURenderBundle), "alignof mismatch for RenderBundle"); - - void RenderBundle::SetLabel(char const * label) const { - wgpuRenderBundleSetLabel(Get(), reinterpret_cast(label)); - } - void RenderBundle::WGPUReference(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleReference(handle); - } - } - void RenderBundle::WGPURelease(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleRelease(handle); - } - } - - // RenderBundleEncoder - - static_assert(sizeof(RenderBundleEncoder) == sizeof(WGPURenderBundleEncoder), "sizeof mismatch for RenderBundleEncoder"); - static_assert(alignof(RenderBundleEncoder) == alignof(WGPURenderBundleEncoder), "alignof mismatch for RenderBundleEncoder"); - - void RenderBundleEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); - } - void RenderBundleEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); - } - void RenderBundleEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderBundleEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - RenderBundle RenderBundleEncoder::Finish(RenderBundleDescriptor const * descriptor) const { - auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast(descriptor)); - return RenderBundle::Acquire(result); - } - void RenderBundleEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuRenderBundleEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void RenderBundleEncoder::PopDebugGroup() const { - wgpuRenderBundleEncoderPopDebugGroup(Get()); - } - void RenderBundleEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuRenderBundleEncoderPushDebugGroup(Get(), reinterpret_cast(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(dynamicOffsets)); - } - void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderBundleEncoder::SetLabel(char const * label) const { - wgpuRenderBundleEncoderSetLabel(Get(), reinterpret_cast(label)); - } - void RenderBundleEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderBundleEncoderSetPipeline(Get(), pipeline.Get()); - } - void RenderBundleEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); - } - void RenderBundleEncoder::WGPUReference(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderReference(handle); - } - } - void RenderBundleEncoder::WGPURelease(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderRelease(handle); - } - } - - // RenderPassEncoder - - static_assert(sizeof(RenderPassEncoder) == sizeof(WGPURenderPassEncoder), "sizeof mismatch for RenderPassEncoder"); - static_assert(alignof(RenderPassEncoder) == alignof(WGPURenderPassEncoder), "alignof mismatch for RenderPassEncoder"); - - void RenderPassEncoder::BeginOcclusionQuery(uint32_t queryIndex) const { - wgpuRenderPassEncoderBeginOcclusionQuery(Get(), queryIndex); - } - void RenderPassEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); - } - void RenderPassEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); - } - void RenderPassEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderPassEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderPassEncoder::End() const { - wgpuRenderPassEncoderEnd(Get()); - } - void RenderPassEncoder::EndOcclusionQuery() const { - wgpuRenderPassEncoderEndOcclusionQuery(Get()); - } - void RenderPassEncoder::ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const { - wgpuRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast(bundles)); - } - void RenderPassEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuRenderPassEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void RenderPassEncoder::PopDebugGroup() const { - wgpuRenderPassEncoderPopDebugGroup(Get()); - } - void RenderPassEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuRenderPassEncoderPushDebugGroup(Get(), reinterpret_cast(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(dynamicOffsets)); - } - void RenderPassEncoder::SetBlendConstant(Color const * color) const { - wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast(color)); - } - void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderPassEncoder::SetLabel(char const * label) const { - wgpuRenderPassEncoderSetLabel(Get(), reinterpret_cast(label)); - } - void RenderPassEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderPassEncoderSetPipeline(Get(), pipeline.Get()); - } - void RenderPassEncoder::SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { - wgpuRenderPassEncoderSetScissorRect(Get(), x, y, width, height); - } - void RenderPassEncoder::SetStencilReference(uint32_t reference) const { - wgpuRenderPassEncoderSetStencilReference(Get(), reference); - } - void RenderPassEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); - } - void RenderPassEncoder::SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const { - wgpuRenderPassEncoderSetViewport(Get(), x, y, width, height, minDepth, maxDepth); - } - void RenderPassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuRenderPassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void RenderPassEncoder::WGPUReference(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderReference(handle); - } - } - void RenderPassEncoder::WGPURelease(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderRelease(handle); - } - } - - // RenderPipeline - - static_assert(sizeof(RenderPipeline) == sizeof(WGPURenderPipeline), "sizeof mismatch for RenderPipeline"); - static_assert(alignof(RenderPipeline) == alignof(WGPURenderPipeline), "alignof mismatch for RenderPipeline"); - - BindGroupLayout RenderPipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuRenderPipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); - } - void RenderPipeline::SetLabel(char const * label) const { - wgpuRenderPipelineSetLabel(Get(), reinterpret_cast(label)); - } - void RenderPipeline::WGPUReference(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineReference(handle); - } - } - void RenderPipeline::WGPURelease(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineRelease(handle); - } - } - - // Sampler - - static_assert(sizeof(Sampler) == sizeof(WGPUSampler), "sizeof mismatch for Sampler"); - static_assert(alignof(Sampler) == alignof(WGPUSampler), "alignof mismatch for Sampler"); - - void Sampler::SetLabel(char const * label) const { - wgpuSamplerSetLabel(Get(), reinterpret_cast(label)); - } - void Sampler::WGPUReference(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerReference(handle); - } - } - void Sampler::WGPURelease(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerRelease(handle); - } - } - - // ShaderModule - - static_assert(sizeof(ShaderModule) == sizeof(WGPUShaderModule), "sizeof mismatch for ShaderModule"); - static_assert(alignof(ShaderModule) == alignof(WGPUShaderModule), "alignof mismatch for ShaderModule"); - - void ShaderModule::GetCompilationInfo(CompilationInfoCallback callback, void * userdata) const { - wgpuShaderModuleGetCompilationInfo(Get(), callback, userdata); - } - void ShaderModule::SetLabel(char const * label) const { - wgpuShaderModuleSetLabel(Get(), reinterpret_cast(label)); - } - void ShaderModule::WGPUReference(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleReference(handle); - } - } - void ShaderModule::WGPURelease(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleRelease(handle); - } - } - - // Surface - - static_assert(sizeof(Surface) == sizeof(WGPUSurface), "sizeof mismatch for Surface"); - static_assert(alignof(Surface) == alignof(WGPUSurface), "alignof mismatch for Surface"); - - void Surface::Configure(SurfaceConfiguration const * config) const { - wgpuSurfaceConfigure(Get(), reinterpret_cast(config)); - } - void Surface::GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const { - *capabilities = SurfaceCapabilities(); - wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast(capabilities)); - } - void Surface::GetCurrentTexture(SurfaceTexture * surfaceTexture) const { - wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast(surfaceTexture)); - } - TextureFormat Surface::GetPreferredFormat(Adapter const& adapter) const { - auto result = wgpuSurfaceGetPreferredFormat(Get(), adapter.Get()); - return static_cast(result); - } - void Surface::Present() const { - wgpuSurfacePresent(Get()); - } - void Surface::Unconfigure() const { - wgpuSurfaceUnconfigure(Get()); - } - void Surface::WGPUReference(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceReference(handle); - } - } - void Surface::WGPURelease(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceRelease(handle); - } - } - - // SwapChain - - static_assert(sizeof(SwapChain) == sizeof(WGPUSwapChain), "sizeof mismatch for SwapChain"); - static_assert(alignof(SwapChain) == alignof(WGPUSwapChain), "alignof mismatch for SwapChain"); - - Texture SwapChain::GetCurrentTexture() const { - auto result = wgpuSwapChainGetCurrentTexture(Get()); - return Texture::Acquire(result); - } - TextureView SwapChain::GetCurrentTextureView() const { - auto result = wgpuSwapChainGetCurrentTextureView(Get()); - return TextureView::Acquire(result); - } - void SwapChain::Present() const { - wgpuSwapChainPresent(Get()); - } - void SwapChain::WGPUReference(WGPUSwapChain handle) { - if (handle != nullptr) { - wgpuSwapChainReference(handle); - } - } - void SwapChain::WGPURelease(WGPUSwapChain handle) { - if (handle != nullptr) { - wgpuSwapChainRelease(handle); - } - } - - // Texture - - static_assert(sizeof(Texture) == sizeof(WGPUTexture), "sizeof mismatch for Texture"); - static_assert(alignof(Texture) == alignof(WGPUTexture), "alignof mismatch for Texture"); - - TextureView Texture::CreateView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuTextureCreateView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); - } - void Texture::Destroy() const { - wgpuTextureDestroy(Get()); - } - uint32_t Texture::GetDepthOrArrayLayers() const { - auto result = wgpuTextureGetDepthOrArrayLayers(Get()); - return result; - } - TextureDimension Texture::GetDimension() const { - auto result = wgpuTextureGetDimension(Get()); - return static_cast(result); - } - TextureFormat Texture::GetFormat() const { - auto result = wgpuTextureGetFormat(Get()); - return static_cast(result); - } - uint32_t Texture::GetHeight() const { - auto result = wgpuTextureGetHeight(Get()); - return result; - } - uint32_t Texture::GetMipLevelCount() const { - auto result = wgpuTextureGetMipLevelCount(Get()); - return result; - } - uint32_t Texture::GetSampleCount() const { - auto result = wgpuTextureGetSampleCount(Get()); - return result; - } - TextureUsage Texture::GetUsage() const { - auto result = wgpuTextureGetUsage(Get()); - return static_cast(result); - } - uint32_t Texture::GetWidth() const { - auto result = wgpuTextureGetWidth(Get()); - return result; - } - void Texture::SetLabel(char const * label) const { - wgpuTextureSetLabel(Get(), reinterpret_cast(label)); - } - void Texture::WGPUReference(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureReference(handle); - } - } - void Texture::WGPURelease(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureRelease(handle); - } - } - - // TextureView - - static_assert(sizeof(TextureView) == sizeof(WGPUTextureView), "sizeof mismatch for TextureView"); - static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatch for TextureView"); - - void TextureView::SetLabel(char const * label) const { - wgpuTextureViewSetLabel(Get(), reinterpret_cast(label)); - } - void TextureView::WGPUReference(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewReference(handle); - } - } - void TextureView::WGPURelease(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewRelease(handle); - } - } - - // Function - - Instance CreateInstance(InstanceDescriptor const * descriptor) { - auto result = wgpuCreateInstance(reinterpret_cast(descriptor)); - return Instance::Acquire(result); - } - Bool GetInstanceFeatures(InstanceFeatures * features) { - auto result = wgpuGetInstanceFeatures(reinterpret_cast(features)); - return result; - } - Proc GetProcAddress(Device device, char const * procName) { - auto result = wgpuGetProcAddress(device.Get(), reinterpret_cast(procName)); - return reinterpret_cast(result); - } - -} diff --git a/renderer/src/webgpu/wagyu-port/old/webgpu-port.py b/renderer/src/webgpu/wagyu-port/old/webgpu-port.py deleted file mode 100644 index 9bbf72d26..000000000 --- a/renderer/src/webgpu/wagyu-port/old/webgpu-port.py +++ /dev/null @@ -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') ] diff --git a/renderer/src/webgpu/wagyu-port/new/src/library_webgpu_stubs.js b/renderer/src/webgpu/wagyu-port/src/library_webgpu_stubs.js similarity index 96% rename from renderer/src/webgpu/wagyu-port/new/src/library_webgpu_stubs.js rename to renderer/src/webgpu/wagyu-port/src/library_webgpu_stubs.js index fe7a404ec..215433df5 100644 --- a/renderer/src/webgpu/wagyu-port/new/src/library_webgpu_stubs.js +++ b/renderer/src/webgpu/wagyu-port/src/library_webgpu_stubs.js @@ -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, diff --git a/renderer/src/webgpu/wagyu-port/new/src/library_webgpu_wagyu_stubs.js b/renderer/src/webgpu/wagyu-port/src/library_webgpu_wagyu_stubs.js similarity index 77% rename from renderer/src/webgpu/wagyu-port/new/src/library_webgpu_wagyu_stubs.js rename to renderer/src/webgpu/wagyu-port/src/library_webgpu_wagyu_stubs.js index c8020715a..ec5da52b3 100644 --- a/renderer/src/webgpu/wagyu-port/new/src/library_webgpu_wagyu_stubs.js +++ b/renderer/src/webgpu/wagyu-port/src/library_webgpu_wagyu_stubs.js @@ -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 }; diff --git a/renderer/src/webgpu/wagyu-port/src/webgpu.c b/renderer/src/webgpu/wagyu-port/src/webgpu.c new file mode 100644 index 000000000..0c1924d2b --- /dev/null +++ b/renderer/src/webgpu/wagyu-port/src/webgpu.c @@ -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; + } +} diff --git a/renderer/src/webgpu/wagyu-port/new/webgpu-port.py b/renderer/src/webgpu/wagyu-port/webgpu-port.py similarity index 93% rename from renderer/src/webgpu/wagyu-port/new/webgpu-port.py rename to renderer/src/webgpu/wagyu-port/webgpu-port.py index 3fd393281..cb91db092 100644 --- a/renderer/src/webgpu/wagyu-port/new/webgpu-port.py +++ b/renderer/src/webgpu/wagyu-port/webgpu-port.py @@ -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') ]