diff --git a/dawn/CMakeLists.txt b/dawn/CMakeLists.txt index fa175c9..d0e479b 100644 --- a/dawn/CMakeLists.txt +++ b/dawn/CMakeLists.txt @@ -26,7 +26,7 @@ include(FetchContent) set(DAWN_LINK_TYPE "SHARED" CACHE STRING "Whether the wgpu-native WebGPU implementation must be statically or dynamically linked. Possible values are STATIC and SHARED in theory, though only SHARED is really supported upstream for now") set_property(CACHE DAWN_LINK_TYPE PROPERTY STRINGS SHARED STATIC) -set(DAWN_VERSION "6720.1" CACHE STRING "Version of the Dawn release to use. Must correspond to the number after 'chromium/' in the tag name of an existing release on https://github.com/eliemichel/dawn-prebuilt/releases. Warning: The webgpu.hpp file provided in include/ may not be compatible with other versions.") +set(DAWN_VERSION "6734" CACHE STRING "Version of the Dawn release to use. Must correspond to the number after 'chromium/' in the tag name of an existing release on https://github.com/eliemichel/dawn-prebuilt/releases. Warning: The webgpu.hpp file provided in include/ may not be compatible with other versions.") set(DAWN_MIRROR "https://github.com/eliemichel/dawn-prebuilt" CACHE STRING "This is ultimately supposed to be https://github.com/google/dawn, where official binaries will be auto-released, but in the meantime we use a different mirror.") # Not using emscripten, so we download binaries. There are many different diff --git a/dawn/dawn-git-tag.txt b/dawn/dawn-git-tag.txt index 2a5c90e..34378b3 100644 --- a/dawn/dawn-git-tag.txt +++ b/dawn/dawn-git-tag.txt @@ -1 +1 @@ -chromium/6719 +chromium/6734 diff --git a/dawn/include/webgpu/webgpu.hpp b/dawn/include/webgpu/webgpu.hpp index bf2c84e..b160b9f 100644 --- a/dawn/include/webgpu/webgpu.hpp +++ b/dawn/include/webgpu/webgpu.hpp @@ -155,697 +155,697 @@ using SurfaceDescriptorFromXlibWindow = WGPUSurfaceSourceXlibWindow; // Enumerations ENUM(WGSLFeatureName) - ENUM_ENTRY(ReadonlyAndReadwriteStorageTextures, 0x00000001) - ENUM_ENTRY(Packed4x8IntegerDotProduct, 0x00000002) - ENUM_ENTRY(UnrestrictedPointerParameters, 0x00000003) - ENUM_ENTRY(PointerCompositeAccess, 0x00000004) - ENUM_ENTRY(ChromiumTestingUnimplemented, 0x00050000) - ENUM_ENTRY(ChromiumTestingUnsafeExperimental, 0x00050001) - ENUM_ENTRY(ChromiumTestingExperimental, 0x00050002) - ENUM_ENTRY(ChromiumTestingShippedWithKillswitch, 0x00050003) - ENUM_ENTRY(ChromiumTestingShipped, 0x00050004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(ReadonlyAndReadwriteStorageTextures, WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures) + ENUM_ENTRY(Packed4x8IntegerDotProduct, WGPUWGSLFeatureName_Packed4x8IntegerDotProduct) + ENUM_ENTRY(UnrestrictedPointerParameters, WGPUWGSLFeatureName_UnrestrictedPointerParameters) + ENUM_ENTRY(PointerCompositeAccess, WGPUWGSLFeatureName_PointerCompositeAccess) + ENUM_ENTRY(ChromiumTestingUnimplemented, WGPUWGSLFeatureName_ChromiumTestingUnimplemented) + ENUM_ENTRY(ChromiumTestingUnsafeExperimental, WGPUWGSLFeatureName_ChromiumTestingUnsafeExperimental) + ENUM_ENTRY(ChromiumTestingExperimental, WGPUWGSLFeatureName_ChromiumTestingExperimental) + ENUM_ENTRY(ChromiumTestingShippedWithKillswitch, WGPUWGSLFeatureName_ChromiumTestingShippedWithKillswitch) + ENUM_ENTRY(ChromiumTestingShipped, WGPUWGSLFeatureName_ChromiumTestingShipped) + ENUM_ENTRY(Force32, WGPUWGSLFeatureName_Force32) END ENUM(AdapterType) - ENUM_ENTRY(DiscreteGPU, 0x00000001) - ENUM_ENTRY(IntegratedGPU, 0x00000002) - ENUM_ENTRY(CPU, 0x00000003) - ENUM_ENTRY(Unknown, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(DiscreteGPU, WGPUAdapterType_DiscreteGPU) + ENUM_ENTRY(IntegratedGPU, WGPUAdapterType_IntegratedGPU) + ENUM_ENTRY(CPU, WGPUAdapterType_CPU) + ENUM_ENTRY(Unknown, WGPUAdapterType_Unknown) + ENUM_ENTRY(Force32, WGPUAdapterType_Force32) END ENUM(AddressMode) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(ClampToEdge, 0x00000001) - ENUM_ENTRY(Repeat, 0x00000002) - ENUM_ENTRY(MirrorRepeat, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUAddressMode_Undefined) + ENUM_ENTRY(ClampToEdge, WGPUAddressMode_ClampToEdge) + ENUM_ENTRY(Repeat, WGPUAddressMode_Repeat) + ENUM_ENTRY(MirrorRepeat, WGPUAddressMode_MirrorRepeat) + ENUM_ENTRY(Force32, WGPUAddressMode_Force32) END ENUM(AlphaMode) - ENUM_ENTRY(Opaque, 0x00000001) - ENUM_ENTRY(Premultiplied, 0x00000002) - ENUM_ENTRY(Unpremultiplied, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Opaque, WGPUAlphaMode_Opaque) + ENUM_ENTRY(Premultiplied, WGPUAlphaMode_Premultiplied) + ENUM_ENTRY(Unpremultiplied, WGPUAlphaMode_Unpremultiplied) + ENUM_ENTRY(Force32, WGPUAlphaMode_Force32) END ENUM(BackendType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Null, 0x00000001) - ENUM_ENTRY(WebGPU, 0x00000002) - ENUM_ENTRY(D3D11, 0x00000003) - ENUM_ENTRY(D3D12, 0x00000004) - ENUM_ENTRY(Metal, 0x00000005) - ENUM_ENTRY(Vulkan, 0x00000006) - ENUM_ENTRY(OpenGL, 0x00000007) - ENUM_ENTRY(OpenGLES, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUBackendType_Undefined) + ENUM_ENTRY(Null, WGPUBackendType_Null) + ENUM_ENTRY(WebGPU, WGPUBackendType_WebGPU) + ENUM_ENTRY(D3D11, WGPUBackendType_D3D11) + ENUM_ENTRY(D3D12, WGPUBackendType_D3D12) + ENUM_ENTRY(Metal, WGPUBackendType_Metal) + ENUM_ENTRY(Vulkan, WGPUBackendType_Vulkan) + ENUM_ENTRY(OpenGL, WGPUBackendType_OpenGL) + ENUM_ENTRY(OpenGLES, WGPUBackendType_OpenGLES) + ENUM_ENTRY(Force32, WGPUBackendType_Force32) END ENUM(BlendFactor) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Zero, 0x00000001) - ENUM_ENTRY(One, 0x00000002) - ENUM_ENTRY(Src, 0x00000003) - ENUM_ENTRY(OneMinusSrc, 0x00000004) - ENUM_ENTRY(SrcAlpha, 0x00000005) - ENUM_ENTRY(OneMinusSrcAlpha, 0x00000006) - ENUM_ENTRY(Dst, 0x00000007) - ENUM_ENTRY(OneMinusDst, 0x00000008) - ENUM_ENTRY(DstAlpha, 0x00000009) - ENUM_ENTRY(OneMinusDstAlpha, 0x0000000A) - ENUM_ENTRY(SrcAlphaSaturated, 0x0000000B) - ENUM_ENTRY(Constant, 0x0000000C) - ENUM_ENTRY(OneMinusConstant, 0x0000000D) - ENUM_ENTRY(Src1, 0x0000000E) - ENUM_ENTRY(OneMinusSrc1, 0x0000000F) - ENUM_ENTRY(Src1Alpha, 0x00000010) - ENUM_ENTRY(OneMinusSrc1Alpha, 0x00000011) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUBlendFactor_Undefined) + ENUM_ENTRY(Zero, WGPUBlendFactor_Zero) + ENUM_ENTRY(One, WGPUBlendFactor_One) + ENUM_ENTRY(Src, WGPUBlendFactor_Src) + ENUM_ENTRY(OneMinusSrc, WGPUBlendFactor_OneMinusSrc) + ENUM_ENTRY(SrcAlpha, WGPUBlendFactor_SrcAlpha) + ENUM_ENTRY(OneMinusSrcAlpha, WGPUBlendFactor_OneMinusSrcAlpha) + ENUM_ENTRY(Dst, WGPUBlendFactor_Dst) + ENUM_ENTRY(OneMinusDst, WGPUBlendFactor_OneMinusDst) + ENUM_ENTRY(DstAlpha, WGPUBlendFactor_DstAlpha) + ENUM_ENTRY(OneMinusDstAlpha, WGPUBlendFactor_OneMinusDstAlpha) + ENUM_ENTRY(SrcAlphaSaturated, WGPUBlendFactor_SrcAlphaSaturated) + ENUM_ENTRY(Constant, WGPUBlendFactor_Constant) + ENUM_ENTRY(OneMinusConstant, WGPUBlendFactor_OneMinusConstant) + ENUM_ENTRY(Src1, WGPUBlendFactor_Src1) + ENUM_ENTRY(OneMinusSrc1, WGPUBlendFactor_OneMinusSrc1) + ENUM_ENTRY(Src1Alpha, WGPUBlendFactor_Src1Alpha) + ENUM_ENTRY(OneMinusSrc1Alpha, WGPUBlendFactor_OneMinusSrc1Alpha) + ENUM_ENTRY(Force32, WGPUBlendFactor_Force32) END ENUM(BlendOperation) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Add, 0x00000001) - ENUM_ENTRY(Subtract, 0x00000002) - ENUM_ENTRY(ReverseSubtract, 0x00000003) - ENUM_ENTRY(Min, 0x00000004) - ENUM_ENTRY(Max, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUBlendOperation_Undefined) + ENUM_ENTRY(Add, WGPUBlendOperation_Add) + ENUM_ENTRY(Subtract, WGPUBlendOperation_Subtract) + ENUM_ENTRY(ReverseSubtract, WGPUBlendOperation_ReverseSubtract) + ENUM_ENTRY(Min, WGPUBlendOperation_Min) + ENUM_ENTRY(Max, WGPUBlendOperation_Max) + ENUM_ENTRY(Force32, WGPUBlendOperation_Force32) END ENUM(BufferBindingType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Uniform, 0x00000001) - ENUM_ENTRY(Storage, 0x00000002) - ENUM_ENTRY(ReadOnlyStorage, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUBufferBindingType_Undefined) + ENUM_ENTRY(Uniform, WGPUBufferBindingType_Uniform) + ENUM_ENTRY(Storage, WGPUBufferBindingType_Storage) + ENUM_ENTRY(ReadOnlyStorage, WGPUBufferBindingType_ReadOnlyStorage) + ENUM_ENTRY(Force32, WGPUBufferBindingType_Force32) END ENUM(BufferMapAsyncStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(ValidationError, 0x00000003) - ENUM_ENTRY(Unknown, 0x00000004) - ENUM_ENTRY(DeviceLost, 0x00000005) - ENUM_ENTRY(DestroyedBeforeCallback, 0x00000006) - ENUM_ENTRY(UnmappedBeforeCallback, 0x00000007) - ENUM_ENTRY(MappingAlreadyPending, 0x00000008) - ENUM_ENTRY(OffsetOutOfRange, 0x00000009) - ENUM_ENTRY(SizeOutOfRange, 0x0000000A) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUBufferMapAsyncStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUBufferMapAsyncStatus_InstanceDropped) + ENUM_ENTRY(ValidationError, WGPUBufferMapAsyncStatus_ValidationError) + ENUM_ENTRY(Unknown, WGPUBufferMapAsyncStatus_Unknown) + ENUM_ENTRY(DeviceLost, WGPUBufferMapAsyncStatus_DeviceLost) + ENUM_ENTRY(DestroyedBeforeCallback, WGPUBufferMapAsyncStatus_DestroyedBeforeCallback) + ENUM_ENTRY(UnmappedBeforeCallback, WGPUBufferMapAsyncStatus_UnmappedBeforeCallback) + ENUM_ENTRY(MappingAlreadyPending, WGPUBufferMapAsyncStatus_MappingAlreadyPending) + ENUM_ENTRY(OffsetOutOfRange, WGPUBufferMapAsyncStatus_OffsetOutOfRange) + ENUM_ENTRY(SizeOutOfRange, WGPUBufferMapAsyncStatus_SizeOutOfRange) + ENUM_ENTRY(Force32, WGPUBufferMapAsyncStatus_Force32) END ENUM(BufferMapState) - ENUM_ENTRY(Unmapped, 0x00000001) - ENUM_ENTRY(Pending, 0x00000002) - ENUM_ENTRY(Mapped, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Unmapped, WGPUBufferMapState_Unmapped) + ENUM_ENTRY(Pending, WGPUBufferMapState_Pending) + ENUM_ENTRY(Mapped, WGPUBufferMapState_Mapped) + ENUM_ENTRY(Force32, WGPUBufferMapState_Force32) END ENUM(CallbackMode) - ENUM_ENTRY(WaitAnyOnly, 0x00000001) - ENUM_ENTRY(AllowProcessEvents, 0x00000002) - ENUM_ENTRY(AllowSpontaneous, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(WaitAnyOnly, WGPUCallbackMode_WaitAnyOnly) + ENUM_ENTRY(AllowProcessEvents, WGPUCallbackMode_AllowProcessEvents) + ENUM_ENTRY(AllowSpontaneous, WGPUCallbackMode_AllowSpontaneous) + ENUM_ENTRY(Force32, WGPUCallbackMode_Force32) END ENUM(CompareFunction) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Never, 0x00000001) - ENUM_ENTRY(Less, 0x00000002) - ENUM_ENTRY(Equal, 0x00000003) - ENUM_ENTRY(LessEqual, 0x00000004) - ENUM_ENTRY(Greater, 0x00000005) - ENUM_ENTRY(NotEqual, 0x00000006) - ENUM_ENTRY(GreaterEqual, 0x00000007) - ENUM_ENTRY(Always, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUCompareFunction_Undefined) + ENUM_ENTRY(Never, WGPUCompareFunction_Never) + ENUM_ENTRY(Less, WGPUCompareFunction_Less) + ENUM_ENTRY(Equal, WGPUCompareFunction_Equal) + ENUM_ENTRY(LessEqual, WGPUCompareFunction_LessEqual) + ENUM_ENTRY(Greater, WGPUCompareFunction_Greater) + ENUM_ENTRY(NotEqual, WGPUCompareFunction_NotEqual) + ENUM_ENTRY(GreaterEqual, WGPUCompareFunction_GreaterEqual) + ENUM_ENTRY(Always, WGPUCompareFunction_Always) + ENUM_ENTRY(Force32, WGPUCompareFunction_Force32) END ENUM(CompilationInfoRequestStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Error, 0x00000003) - ENUM_ENTRY(DeviceLost, 0x00000004) - ENUM_ENTRY(Unknown, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUCompilationInfoRequestStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUCompilationInfoRequestStatus_InstanceDropped) + ENUM_ENTRY(Error, WGPUCompilationInfoRequestStatus_Error) + ENUM_ENTRY(DeviceLost, WGPUCompilationInfoRequestStatus_DeviceLost) + ENUM_ENTRY(Unknown, WGPUCompilationInfoRequestStatus_Unknown) + ENUM_ENTRY(Force32, WGPUCompilationInfoRequestStatus_Force32) END ENUM(CompilationMessageType) - ENUM_ENTRY(Error, 0x00000001) - ENUM_ENTRY(Warning, 0x00000002) - ENUM_ENTRY(Info, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Error, WGPUCompilationMessageType_Error) + ENUM_ENTRY(Warning, WGPUCompilationMessageType_Warning) + ENUM_ENTRY(Info, WGPUCompilationMessageType_Info) + ENUM_ENTRY(Force32, WGPUCompilationMessageType_Force32) END ENUM(CompositeAlphaMode) - ENUM_ENTRY(Auto, 0x00000000) - ENUM_ENTRY(Opaque, 0x00000001) - ENUM_ENTRY(Premultiplied, 0x00000002) - ENUM_ENTRY(Unpremultiplied, 0x00000003) - ENUM_ENTRY(Inherit, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Auto, WGPUCompositeAlphaMode_Auto) + ENUM_ENTRY(Opaque, WGPUCompositeAlphaMode_Opaque) + ENUM_ENTRY(Premultiplied, WGPUCompositeAlphaMode_Premultiplied) + ENUM_ENTRY(Unpremultiplied, WGPUCompositeAlphaMode_Unpremultiplied) + ENUM_ENTRY(Inherit, WGPUCompositeAlphaMode_Inherit) + ENUM_ENTRY(Force32, WGPUCompositeAlphaMode_Force32) END ENUM(CreatePipelineAsyncStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(ValidationError, 0x00000003) - ENUM_ENTRY(InternalError, 0x00000004) - ENUM_ENTRY(DeviceLost, 0x00000005) - ENUM_ENTRY(DeviceDestroyed, 0x00000006) - ENUM_ENTRY(Unknown, 0x00000007) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUCreatePipelineAsyncStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUCreatePipelineAsyncStatus_InstanceDropped) + ENUM_ENTRY(ValidationError, WGPUCreatePipelineAsyncStatus_ValidationError) + ENUM_ENTRY(InternalError, WGPUCreatePipelineAsyncStatus_InternalError) + ENUM_ENTRY(DeviceLost, WGPUCreatePipelineAsyncStatus_DeviceLost) + ENUM_ENTRY(DeviceDestroyed, WGPUCreatePipelineAsyncStatus_DeviceDestroyed) + ENUM_ENTRY(Unknown, WGPUCreatePipelineAsyncStatus_Unknown) + ENUM_ENTRY(Force32, WGPUCreatePipelineAsyncStatus_Force32) END ENUM(CullMode) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(None, 0x00000001) - ENUM_ENTRY(Front, 0x00000002) - ENUM_ENTRY(Back, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUCullMode_Undefined) + ENUM_ENTRY(None, WGPUCullMode_None) + ENUM_ENTRY(Front, WGPUCullMode_Front) + ENUM_ENTRY(Back, WGPUCullMode_Back) + ENUM_ENTRY(Force32, WGPUCullMode_Force32) END ENUM(DeviceLostReason) - ENUM_ENTRY(Unknown, 0x00000001) - ENUM_ENTRY(Destroyed, 0x00000002) - ENUM_ENTRY(InstanceDropped, 0x00000003) - ENUM_ENTRY(FailedCreation, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Unknown, WGPUDeviceLostReason_Unknown) + ENUM_ENTRY(Destroyed, WGPUDeviceLostReason_Destroyed) + ENUM_ENTRY(InstanceDropped, WGPUDeviceLostReason_InstanceDropped) + ENUM_ENTRY(FailedCreation, WGPUDeviceLostReason_FailedCreation) + ENUM_ENTRY(Force32, WGPUDeviceLostReason_Force32) END ENUM(ErrorFilter) - ENUM_ENTRY(Validation, 0x00000001) - ENUM_ENTRY(OutOfMemory, 0x00000002) - ENUM_ENTRY(Internal, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Validation, WGPUErrorFilter_Validation) + ENUM_ENTRY(OutOfMemory, WGPUErrorFilter_OutOfMemory) + ENUM_ENTRY(Internal, WGPUErrorFilter_Internal) + ENUM_ENTRY(Force32, WGPUErrorFilter_Force32) END ENUM(ErrorType) - ENUM_ENTRY(NoError, 0x00000001) - ENUM_ENTRY(Validation, 0x00000002) - ENUM_ENTRY(OutOfMemory, 0x00000003) - ENUM_ENTRY(Internal, 0x00000004) - ENUM_ENTRY(Unknown, 0x00000005) - ENUM_ENTRY(DeviceLost, 0x00000006) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(NoError, WGPUErrorType_NoError) + ENUM_ENTRY(Validation, WGPUErrorType_Validation) + ENUM_ENTRY(OutOfMemory, WGPUErrorType_OutOfMemory) + ENUM_ENTRY(Internal, WGPUErrorType_Internal) + ENUM_ENTRY(Unknown, WGPUErrorType_Unknown) + ENUM_ENTRY(DeviceLost, WGPUErrorType_DeviceLost) + ENUM_ENTRY(Force32, WGPUErrorType_Force32) END ENUM(ExternalTextureRotation) - ENUM_ENTRY(Rotate0Degrees, 0x00000001) - ENUM_ENTRY(Rotate90Degrees, 0x00000002) - ENUM_ENTRY(Rotate180Degrees, 0x00000003) - ENUM_ENTRY(Rotate270Degrees, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Rotate0Degrees, WGPUExternalTextureRotation_Rotate0Degrees) + ENUM_ENTRY(Rotate90Degrees, WGPUExternalTextureRotation_Rotate90Degrees) + ENUM_ENTRY(Rotate180Degrees, WGPUExternalTextureRotation_Rotate180Degrees) + ENUM_ENTRY(Rotate270Degrees, WGPUExternalTextureRotation_Rotate270Degrees) + ENUM_ENTRY(Force32, WGPUExternalTextureRotation_Force32) END ENUM(FeatureName) - ENUM_ENTRY(DepthClipControl, 0x00000001) - ENUM_ENTRY(Depth32FloatStencil8, 0x00000002) - ENUM_ENTRY(TimestampQuery, 0x00000003) - ENUM_ENTRY(TextureCompressionBC, 0x00000004) - ENUM_ENTRY(TextureCompressionETC2, 0x00000005) - ENUM_ENTRY(TextureCompressionASTC, 0x00000006) - ENUM_ENTRY(IndirectFirstInstance, 0x00000007) - ENUM_ENTRY(ShaderF16, 0x00000008) - ENUM_ENTRY(RG11B10UfloatRenderable, 0x00000009) - ENUM_ENTRY(BGRA8UnormStorage, 0x0000000A) - ENUM_ENTRY(Float32Filterable, 0x0000000B) - ENUM_ENTRY(Subgroups, 0x0000000C) - ENUM_ENTRY(SubgroupsF16, 0x0000000D) - ENUM_ENTRY(DawnInternalUsages, 0x00050000) - ENUM_ENTRY(DawnMultiPlanarFormats, 0x00050001) - ENUM_ENTRY(DawnNative, 0x00050002) - ENUM_ENTRY(ChromiumExperimentalTimestampQueryInsidePasses, 0x00050003) - ENUM_ENTRY(ImplicitDeviceSynchronization, 0x00050004) - ENUM_ENTRY(SurfaceCapabilities, 0x00050005) - ENUM_ENTRY(TransientAttachments, 0x00050006) - ENUM_ENTRY(MSAARenderToSingleSampled, 0x00050007) - ENUM_ENTRY(DualSourceBlending, 0x00050008) - ENUM_ENTRY(D3D11MultithreadProtected, 0x00050009) - ENUM_ENTRY(ANGLETextureSharing, 0x0005000A) - ENUM_ENTRY(ChromiumExperimentalSubgroups, 0x0005000B) - ENUM_ENTRY(ChromiumExperimentalSubgroupUniformControlFlow, 0x0005000C) - ENUM_ENTRY(PixelLocalStorageCoherent, 0x0005000D) - ENUM_ENTRY(PixelLocalStorageNonCoherent, 0x0005000E) - ENUM_ENTRY(Unorm16TextureFormats, 0x0005000F) - ENUM_ENTRY(Snorm16TextureFormats, 0x00050010) - ENUM_ENTRY(MultiPlanarFormatExtendedUsages, 0x00050011) - ENUM_ENTRY(MultiPlanarFormatP010, 0x00050012) - ENUM_ENTRY(HostMappedPointer, 0x00050013) - ENUM_ENTRY(MultiPlanarRenderTargets, 0x00050014) - ENUM_ENTRY(MultiPlanarFormatNv12a, 0x00050015) - ENUM_ENTRY(FramebufferFetch, 0x00050016) - ENUM_ENTRY(BufferMapExtendedUsages, 0x00050017) - ENUM_ENTRY(AdapterPropertiesMemoryHeaps, 0x00050018) - ENUM_ENTRY(AdapterPropertiesD3D, 0x00050019) - ENUM_ENTRY(AdapterPropertiesVk, 0x0005001A) - ENUM_ENTRY(R8UnormStorage, 0x0005001B) - ENUM_ENTRY(FormatCapabilities, 0x0005001C) - ENUM_ENTRY(DrmFormatCapabilities, 0x0005001D) - ENUM_ENTRY(Norm16TextureFormats, 0x0005001E) - ENUM_ENTRY(MultiPlanarFormatNv16, 0x0005001F) - ENUM_ENTRY(MultiPlanarFormatNv24, 0x00050020) - ENUM_ENTRY(MultiPlanarFormatP210, 0x00050021) - ENUM_ENTRY(MultiPlanarFormatP410, 0x00050022) - ENUM_ENTRY(SharedTextureMemoryVkDedicatedAllocation, 0x00050023) - ENUM_ENTRY(SharedTextureMemoryAHardwareBuffer, 0x00050024) - ENUM_ENTRY(SharedTextureMemoryDmaBuf, 0x00050025) - ENUM_ENTRY(SharedTextureMemoryOpaqueFD, 0x00050026) - ENUM_ENTRY(SharedTextureMemoryZirconHandle, 0x00050027) - ENUM_ENTRY(SharedTextureMemoryDXGISharedHandle, 0x00050028) - ENUM_ENTRY(SharedTextureMemoryD3D11Texture2D, 0x00050029) - ENUM_ENTRY(SharedTextureMemoryIOSurface, 0x0005002A) - ENUM_ENTRY(SharedTextureMemoryEGLImage, 0x0005002B) - ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFD, 0x0005002C) - ENUM_ENTRY(SharedFenceVkSemaphoreSyncFD, 0x0005002D) - ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandle, 0x0005002E) - ENUM_ENTRY(SharedFenceDXGISharedHandle, 0x0005002F) - ENUM_ENTRY(SharedFenceMTLSharedEvent, 0x00050030) - ENUM_ENTRY(SharedBufferMemoryD3D12Resource, 0x00050031) - ENUM_ENTRY(StaticSamplers, 0x00050032) - ENUM_ENTRY(YCbCrVulkanSamplers, 0x00050033) - ENUM_ENTRY(ShaderModuleCompilationOptions, 0x00050034) - ENUM_ENTRY(DawnLoadResolveTexture, 0x00050035) - ENUM_ENTRY(DawnPartialLoadResolveTexture, 0x00050036) - ENUM_ENTRY(MultiDrawIndirect, 0x00050037) - ENUM_ENTRY(ClipDistances, 0x00050038) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(DepthClipControl, WGPUFeatureName_DepthClipControl) + ENUM_ENTRY(Depth32FloatStencil8, WGPUFeatureName_Depth32FloatStencil8) + ENUM_ENTRY(TimestampQuery, WGPUFeatureName_TimestampQuery) + ENUM_ENTRY(TextureCompressionBC, WGPUFeatureName_TextureCompressionBC) + ENUM_ENTRY(TextureCompressionETC2, WGPUFeatureName_TextureCompressionETC2) + ENUM_ENTRY(TextureCompressionASTC, WGPUFeatureName_TextureCompressionASTC) + ENUM_ENTRY(IndirectFirstInstance, WGPUFeatureName_IndirectFirstInstance) + ENUM_ENTRY(ShaderF16, WGPUFeatureName_ShaderF16) + ENUM_ENTRY(RG11B10UfloatRenderable, WGPUFeatureName_RG11B10UfloatRenderable) + ENUM_ENTRY(BGRA8UnormStorage, WGPUFeatureName_BGRA8UnormStorage) + ENUM_ENTRY(Float32Filterable, WGPUFeatureName_Float32Filterable) + ENUM_ENTRY(Subgroups, WGPUFeatureName_Subgroups) + ENUM_ENTRY(SubgroupsF16, WGPUFeatureName_SubgroupsF16) + ENUM_ENTRY(DawnInternalUsages, WGPUFeatureName_DawnInternalUsages) + ENUM_ENTRY(DawnMultiPlanarFormats, WGPUFeatureName_DawnMultiPlanarFormats) + ENUM_ENTRY(DawnNative, WGPUFeatureName_DawnNative) + ENUM_ENTRY(ChromiumExperimentalTimestampQueryInsidePasses, WGPUFeatureName_ChromiumExperimentalTimestampQueryInsidePasses) + ENUM_ENTRY(ImplicitDeviceSynchronization, WGPUFeatureName_ImplicitDeviceSynchronization) + ENUM_ENTRY(SurfaceCapabilities, WGPUFeatureName_SurfaceCapabilities) + ENUM_ENTRY(TransientAttachments, WGPUFeatureName_TransientAttachments) + ENUM_ENTRY(MSAARenderToSingleSampled, WGPUFeatureName_MSAARenderToSingleSampled) + ENUM_ENTRY(DualSourceBlending, WGPUFeatureName_DualSourceBlending) + ENUM_ENTRY(D3D11MultithreadProtected, WGPUFeatureName_D3D11MultithreadProtected) + ENUM_ENTRY(ANGLETextureSharing, WGPUFeatureName_ANGLETextureSharing) + ENUM_ENTRY(ChromiumExperimentalSubgroups, WGPUFeatureName_ChromiumExperimentalSubgroups) + ENUM_ENTRY(ChromiumExperimentalSubgroupUniformControlFlow, WGPUFeatureName_ChromiumExperimentalSubgroupUniformControlFlow) + ENUM_ENTRY(PixelLocalStorageCoherent, WGPUFeatureName_PixelLocalStorageCoherent) + ENUM_ENTRY(PixelLocalStorageNonCoherent, WGPUFeatureName_PixelLocalStorageNonCoherent) + ENUM_ENTRY(Unorm16TextureFormats, WGPUFeatureName_Unorm16TextureFormats) + ENUM_ENTRY(Snorm16TextureFormats, WGPUFeatureName_Snorm16TextureFormats) + ENUM_ENTRY(MultiPlanarFormatExtendedUsages, WGPUFeatureName_MultiPlanarFormatExtendedUsages) + ENUM_ENTRY(MultiPlanarFormatP010, WGPUFeatureName_MultiPlanarFormatP010) + ENUM_ENTRY(HostMappedPointer, WGPUFeatureName_HostMappedPointer) + ENUM_ENTRY(MultiPlanarRenderTargets, WGPUFeatureName_MultiPlanarRenderTargets) + ENUM_ENTRY(MultiPlanarFormatNv12a, WGPUFeatureName_MultiPlanarFormatNv12a) + ENUM_ENTRY(FramebufferFetch, WGPUFeatureName_FramebufferFetch) + ENUM_ENTRY(BufferMapExtendedUsages, WGPUFeatureName_BufferMapExtendedUsages) + ENUM_ENTRY(AdapterPropertiesMemoryHeaps, WGPUFeatureName_AdapterPropertiesMemoryHeaps) + ENUM_ENTRY(AdapterPropertiesD3D, WGPUFeatureName_AdapterPropertiesD3D) + ENUM_ENTRY(AdapterPropertiesVk, WGPUFeatureName_AdapterPropertiesVk) + ENUM_ENTRY(R8UnormStorage, WGPUFeatureName_R8UnormStorage) + ENUM_ENTRY(FormatCapabilities, WGPUFeatureName_FormatCapabilities) + ENUM_ENTRY(DrmFormatCapabilities, WGPUFeatureName_DrmFormatCapabilities) + ENUM_ENTRY(Norm16TextureFormats, WGPUFeatureName_Norm16TextureFormats) + ENUM_ENTRY(MultiPlanarFormatNv16, WGPUFeatureName_MultiPlanarFormatNv16) + ENUM_ENTRY(MultiPlanarFormatNv24, WGPUFeatureName_MultiPlanarFormatNv24) + ENUM_ENTRY(MultiPlanarFormatP210, WGPUFeatureName_MultiPlanarFormatP210) + ENUM_ENTRY(MultiPlanarFormatP410, WGPUFeatureName_MultiPlanarFormatP410) + ENUM_ENTRY(SharedTextureMemoryVkDedicatedAllocation, WGPUFeatureName_SharedTextureMemoryVkDedicatedAllocation) + ENUM_ENTRY(SharedTextureMemoryAHardwareBuffer, WGPUFeatureName_SharedTextureMemoryAHardwareBuffer) + ENUM_ENTRY(SharedTextureMemoryDmaBuf, WGPUFeatureName_SharedTextureMemoryDmaBuf) + ENUM_ENTRY(SharedTextureMemoryOpaqueFD, WGPUFeatureName_SharedTextureMemoryOpaqueFD) + ENUM_ENTRY(SharedTextureMemoryZirconHandle, WGPUFeatureName_SharedTextureMemoryZirconHandle) + ENUM_ENTRY(SharedTextureMemoryDXGISharedHandle, WGPUFeatureName_SharedTextureMemoryDXGISharedHandle) + ENUM_ENTRY(SharedTextureMemoryD3D11Texture2D, WGPUFeatureName_SharedTextureMemoryD3D11Texture2D) + ENUM_ENTRY(SharedTextureMemoryIOSurface, WGPUFeatureName_SharedTextureMemoryIOSurface) + ENUM_ENTRY(SharedTextureMemoryEGLImage, WGPUFeatureName_SharedTextureMemoryEGLImage) + ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFD, WGPUFeatureName_SharedFenceVkSemaphoreOpaqueFD) + ENUM_ENTRY(SharedFenceVkSemaphoreSyncFD, WGPUFeatureName_SharedFenceVkSemaphoreSyncFD) + ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandle, WGPUFeatureName_SharedFenceVkSemaphoreZirconHandle) + ENUM_ENTRY(SharedFenceDXGISharedHandle, WGPUFeatureName_SharedFenceDXGISharedHandle) + ENUM_ENTRY(SharedFenceMTLSharedEvent, WGPUFeatureName_SharedFenceMTLSharedEvent) + ENUM_ENTRY(SharedBufferMemoryD3D12Resource, WGPUFeatureName_SharedBufferMemoryD3D12Resource) + ENUM_ENTRY(StaticSamplers, WGPUFeatureName_StaticSamplers) + ENUM_ENTRY(YCbCrVulkanSamplers, WGPUFeatureName_YCbCrVulkanSamplers) + ENUM_ENTRY(ShaderModuleCompilationOptions, WGPUFeatureName_ShaderModuleCompilationOptions) + ENUM_ENTRY(DawnLoadResolveTexture, WGPUFeatureName_DawnLoadResolveTexture) + ENUM_ENTRY(DawnPartialLoadResolveTexture, WGPUFeatureName_DawnPartialLoadResolveTexture) + ENUM_ENTRY(MultiDrawIndirect, WGPUFeatureName_MultiDrawIndirect) + ENUM_ENTRY(ClipDistances, WGPUFeatureName_ClipDistances) + ENUM_ENTRY(Force32, WGPUFeatureName_Force32) END ENUM(FilterMode) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Nearest, 0x00000001) - ENUM_ENTRY(Linear, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUFilterMode_Undefined) + ENUM_ENTRY(Nearest, WGPUFilterMode_Nearest) + ENUM_ENTRY(Linear, WGPUFilterMode_Linear) + ENUM_ENTRY(Force32, WGPUFilterMode_Force32) END ENUM(FrontFace) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(CCW, 0x00000001) - ENUM_ENTRY(CW, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUFrontFace_Undefined) + ENUM_ENTRY(CCW, WGPUFrontFace_CCW) + ENUM_ENTRY(CW, WGPUFrontFace_CW) + ENUM_ENTRY(Force32, WGPUFrontFace_Force32) END ENUM(IndexFormat) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Uint16, 0x00000001) - ENUM_ENTRY(Uint32, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUIndexFormat_Undefined) + ENUM_ENTRY(Uint16, WGPUIndexFormat_Uint16) + ENUM_ENTRY(Uint32, WGPUIndexFormat_Uint32) + ENUM_ENTRY(Force32, WGPUIndexFormat_Force32) END ENUM(LoadOp) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Load, 0x00000001) - ENUM_ENTRY(Clear, 0x00000002) - ENUM_ENTRY(ExpandResolveTexture, 0x00050003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPULoadOp_Undefined) + ENUM_ENTRY(Load, WGPULoadOp_Load) + ENUM_ENTRY(Clear, WGPULoadOp_Clear) + ENUM_ENTRY(ExpandResolveTexture, WGPULoadOp_ExpandResolveTexture) + ENUM_ENTRY(Force32, WGPULoadOp_Force32) END ENUM(LoggingType) - ENUM_ENTRY(Verbose, 0x00000001) - ENUM_ENTRY(Info, 0x00000002) - ENUM_ENTRY(Warning, 0x00000003) - ENUM_ENTRY(Error, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Verbose, WGPULoggingType_Verbose) + ENUM_ENTRY(Info, WGPULoggingType_Info) + ENUM_ENTRY(Warning, WGPULoggingType_Warning) + ENUM_ENTRY(Error, WGPULoggingType_Error) + ENUM_ENTRY(Force32, WGPULoggingType_Force32) END ENUM(MapAsyncStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Error, 0x00000003) - ENUM_ENTRY(Aborted, 0x00000004) - ENUM_ENTRY(Unknown, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUMapAsyncStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUMapAsyncStatus_InstanceDropped) + ENUM_ENTRY(Error, WGPUMapAsyncStatus_Error) + ENUM_ENTRY(Aborted, WGPUMapAsyncStatus_Aborted) + ENUM_ENTRY(Unknown, WGPUMapAsyncStatus_Unknown) + ENUM_ENTRY(Force32, WGPUMapAsyncStatus_Force32) END ENUM(MipmapFilterMode) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Nearest, 0x00000001) - ENUM_ENTRY(Linear, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUMipmapFilterMode_Undefined) + ENUM_ENTRY(Nearest, WGPUMipmapFilterMode_Nearest) + ENUM_ENTRY(Linear, WGPUMipmapFilterMode_Linear) + ENUM_ENTRY(Force32, WGPUMipmapFilterMode_Force32) END ENUM(OptionalBool) - ENUM_ENTRY(False, 0x00000000) - ENUM_ENTRY(True, 0x00000001) - ENUM_ENTRY(Undefined, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(False, WGPUOptionalBool_False) + ENUM_ENTRY(True, WGPUOptionalBool_True) + ENUM_ENTRY(Undefined, WGPUOptionalBool_Undefined) + ENUM_ENTRY(Force32, WGPUOptionalBool_Force32) END ENUM(PopErrorScopeStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUPopErrorScopeStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUPopErrorScopeStatus_InstanceDropped) + ENUM_ENTRY(Force32, WGPUPopErrorScopeStatus_Force32) END ENUM(PowerPreference) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(LowPower, 0x00000001) - ENUM_ENTRY(HighPerformance, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUPowerPreference_Undefined) + ENUM_ENTRY(LowPower, WGPUPowerPreference_LowPower) + ENUM_ENTRY(HighPerformance, WGPUPowerPreference_HighPerformance) + ENUM_ENTRY(Force32, WGPUPowerPreference_Force32) END ENUM(PresentMode) - ENUM_ENTRY(Fifo, 0x00000001) - ENUM_ENTRY(FifoRelaxed, 0x00000002) - ENUM_ENTRY(Immediate, 0x00000003) - ENUM_ENTRY(Mailbox, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Fifo, WGPUPresentMode_Fifo) + ENUM_ENTRY(FifoRelaxed, WGPUPresentMode_FifoRelaxed) + ENUM_ENTRY(Immediate, WGPUPresentMode_Immediate) + ENUM_ENTRY(Mailbox, WGPUPresentMode_Mailbox) + ENUM_ENTRY(Force32, WGPUPresentMode_Force32) END ENUM(PrimitiveTopology) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(PointList, 0x00000001) - ENUM_ENTRY(LineList, 0x00000002) - ENUM_ENTRY(LineStrip, 0x00000003) - ENUM_ENTRY(TriangleList, 0x00000004) - ENUM_ENTRY(TriangleStrip, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUPrimitiveTopology_Undefined) + ENUM_ENTRY(PointList, WGPUPrimitiveTopology_PointList) + ENUM_ENTRY(LineList, WGPUPrimitiveTopology_LineList) + ENUM_ENTRY(LineStrip, WGPUPrimitiveTopology_LineStrip) + ENUM_ENTRY(TriangleList, WGPUPrimitiveTopology_TriangleList) + ENUM_ENTRY(TriangleStrip, WGPUPrimitiveTopology_TriangleStrip) + ENUM_ENTRY(Force32, WGPUPrimitiveTopology_Force32) END ENUM(QueryType) - ENUM_ENTRY(Occlusion, 0x00000001) - ENUM_ENTRY(Timestamp, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Occlusion, WGPUQueryType_Occlusion) + ENUM_ENTRY(Timestamp, WGPUQueryType_Timestamp) + ENUM_ENTRY(Force32, WGPUQueryType_Force32) END ENUM(QueueWorkDoneStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Error, 0x00000003) - ENUM_ENTRY(Unknown, 0x00000004) - ENUM_ENTRY(DeviceLost, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUQueueWorkDoneStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPUQueueWorkDoneStatus_InstanceDropped) + ENUM_ENTRY(Error, WGPUQueueWorkDoneStatus_Error) + ENUM_ENTRY(Unknown, WGPUQueueWorkDoneStatus_Unknown) + ENUM_ENTRY(DeviceLost, WGPUQueueWorkDoneStatus_DeviceLost) + ENUM_ENTRY(Force32, WGPUQueueWorkDoneStatus_Force32) END ENUM(RequestAdapterStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Unavailable, 0x00000003) - ENUM_ENTRY(Error, 0x00000004) - ENUM_ENTRY(Unknown, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPURequestAdapterStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPURequestAdapterStatus_InstanceDropped) + ENUM_ENTRY(Unavailable, WGPURequestAdapterStatus_Unavailable) + ENUM_ENTRY(Error, WGPURequestAdapterStatus_Error) + ENUM_ENTRY(Unknown, WGPURequestAdapterStatus_Unknown) + ENUM_ENTRY(Force32, WGPURequestAdapterStatus_Force32) END ENUM(RequestDeviceStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(InstanceDropped, 0x00000002) - ENUM_ENTRY(Error, 0x00000003) - ENUM_ENTRY(Unknown, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPURequestDeviceStatus_Success) + ENUM_ENTRY(InstanceDropped, WGPURequestDeviceStatus_InstanceDropped) + ENUM_ENTRY(Error, WGPURequestDeviceStatus_Error) + ENUM_ENTRY(Unknown, WGPURequestDeviceStatus_Unknown) + ENUM_ENTRY(Force32, WGPURequestDeviceStatus_Force32) END ENUM(SType) - ENUM_ENTRY(ShaderSourceSPIRV, 0x00000001) - ENUM_ENTRY(ShaderSourceWGSL, 0x00000002) - ENUM_ENTRY(RenderPassMaxDrawCount, 0x00000003) - ENUM_ENTRY(SurfaceSourceMetalLayer, 0x00000004) - ENUM_ENTRY(SurfaceSourceWindowsHWND, 0x00000005) - ENUM_ENTRY(SurfaceSourceXlibWindow, 0x00000006) - ENUM_ENTRY(SurfaceSourceWaylandSurface, 0x00000007) - ENUM_ENTRY(SurfaceSourceAndroidNativeWindow, 0x00000008) - ENUM_ENTRY(SurfaceSourceXCBWindow, 0x00000009) - ENUM_ENTRY(TextureBindingViewDimensionDescriptor, 0x00020000) - ENUM_ENTRY(SurfaceSourceCanvasHTMLSelector_Emscripten, 0x00040000) - ENUM_ENTRY(SurfaceDescriptorFromWindowsCoreWindow, 0x00050000) - ENUM_ENTRY(ExternalTextureBindingEntry, 0x00050001) - ENUM_ENTRY(ExternalTextureBindingLayout, 0x00050002) - ENUM_ENTRY(SurfaceDescriptorFromWindowsSwapChainPanel, 0x00050003) - ENUM_ENTRY(DawnTextureInternalUsageDescriptor, 0x00050004) - ENUM_ENTRY(DawnEncoderInternalUsageDescriptor, 0x00050005) - ENUM_ENTRY(DawnInstanceDescriptor, 0x00050006) - ENUM_ENTRY(DawnCacheDeviceDescriptor, 0x00050007) - ENUM_ENTRY(DawnAdapterPropertiesPowerPreference, 0x00050008) - ENUM_ENTRY(DawnBufferDescriptorErrorInfoFromWireClient, 0x00050009) - ENUM_ENTRY(DawnTogglesDescriptor, 0x0005000A) - ENUM_ENTRY(DawnShaderModuleSPIRVOptionsDescriptor, 0x0005000B) - ENUM_ENTRY(RequestAdapterOptionsLUID, 0x0005000C) - ENUM_ENTRY(RequestAdapterOptionsGetGLProc, 0x0005000D) - ENUM_ENTRY(RequestAdapterOptionsD3D11Device, 0x0005000E) - ENUM_ENTRY(DawnRenderPassColorAttachmentRenderToSingleSampled, 0x0005000F) - ENUM_ENTRY(RenderPassPixelLocalStorage, 0x00050010) - ENUM_ENTRY(PipelineLayoutPixelLocalStorage, 0x00050011) - ENUM_ENTRY(BufferHostMappedPointer, 0x00050012) - ENUM_ENTRY(DawnExperimentalSubgroupLimits, 0x00050013) - ENUM_ENTRY(AdapterPropertiesMemoryHeaps, 0x00050014) - ENUM_ENTRY(AdapterPropertiesD3D, 0x00050015) - ENUM_ENTRY(AdapterPropertiesVk, 0x00050016) - ENUM_ENTRY(DawnComputePipelineFullSubgroups, 0x00050017) - ENUM_ENTRY(DawnWireWGSLControl, 0x00050018) - ENUM_ENTRY(DawnWGSLBlocklist, 0x00050019) - ENUM_ENTRY(DrmFormatCapabilities, 0x0005001A) - ENUM_ENTRY(ShaderModuleCompilationOptions, 0x0005001B) - ENUM_ENTRY(ColorTargetStateExpandResolveTextureDawn, 0x0005001C) - ENUM_ENTRY(RenderPassDescriptorExpandResolveRect, 0x0005001D) - ENUM_ENTRY(SharedTextureMemoryVkDedicatedAllocationDescriptor, 0x0005001E) - ENUM_ENTRY(SharedTextureMemoryAHardwareBufferDescriptor, 0x0005001F) - ENUM_ENTRY(SharedTextureMemoryDmaBufDescriptor, 0x00050020) - ENUM_ENTRY(SharedTextureMemoryOpaqueFDDescriptor, 0x00050021) - ENUM_ENTRY(SharedTextureMemoryZirconHandleDescriptor, 0x00050022) - ENUM_ENTRY(SharedTextureMemoryDXGISharedHandleDescriptor, 0x00050023) - ENUM_ENTRY(SharedTextureMemoryD3D11Texture2DDescriptor, 0x00050024) - ENUM_ENTRY(SharedTextureMemoryIOSurfaceDescriptor, 0x00050025) - ENUM_ENTRY(SharedTextureMemoryEGLImageDescriptor, 0x00050026) - ENUM_ENTRY(SharedTextureMemoryInitializedBeginState, 0x00050027) - ENUM_ENTRY(SharedTextureMemoryInitializedEndState, 0x00050028) - ENUM_ENTRY(SharedTextureMemoryVkImageLayoutBeginState, 0x00050029) - ENUM_ENTRY(SharedTextureMemoryVkImageLayoutEndState, 0x0005002A) - ENUM_ENTRY(SharedTextureMemoryD3DSwapchainBeginState, 0x0005002B) - ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFDDescriptor, 0x0005002C) - ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFDExportInfo, 0x0005002D) - ENUM_ENTRY(SharedFenceVkSemaphoreSyncFDDescriptor, 0x0005002E) - ENUM_ENTRY(SharedFenceVkSemaphoreSyncFDExportInfo, 0x0005002F) - ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandleDescriptor, 0x00050030) - ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandleExportInfo, 0x00050031) - ENUM_ENTRY(SharedFenceDXGISharedHandleDescriptor, 0x00050032) - ENUM_ENTRY(SharedFenceDXGISharedHandleExportInfo, 0x00050033) - ENUM_ENTRY(SharedFenceMTLSharedEventDescriptor, 0x00050034) - ENUM_ENTRY(SharedFenceMTLSharedEventExportInfo, 0x00050035) - ENUM_ENTRY(SharedBufferMemoryD3D12ResourceDescriptor, 0x00050036) - ENUM_ENTRY(StaticSamplerBindingLayout, 0x00050037) - ENUM_ENTRY(YCbCrVkDescriptor, 0x00050038) - ENUM_ENTRY(SharedTextureMemoryAHardwareBufferProperties, 0x00050039) - ENUM_ENTRY(AHardwareBufferProperties, 0x0005003A) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(ShaderSourceSPIRV, WGPUSType_ShaderSourceSPIRV) + ENUM_ENTRY(ShaderSourceWGSL, WGPUSType_ShaderSourceWGSL) + ENUM_ENTRY(RenderPassMaxDrawCount, WGPUSType_RenderPassMaxDrawCount) + ENUM_ENTRY(SurfaceSourceMetalLayer, WGPUSType_SurfaceSourceMetalLayer) + ENUM_ENTRY(SurfaceSourceWindowsHWND, WGPUSType_SurfaceSourceWindowsHWND) + ENUM_ENTRY(SurfaceSourceXlibWindow, WGPUSType_SurfaceSourceXlibWindow) + ENUM_ENTRY(SurfaceSourceWaylandSurface, WGPUSType_SurfaceSourceWaylandSurface) + ENUM_ENTRY(SurfaceSourceAndroidNativeWindow, WGPUSType_SurfaceSourceAndroidNativeWindow) + ENUM_ENTRY(SurfaceSourceXCBWindow, WGPUSType_SurfaceSourceXCBWindow) + ENUM_ENTRY(TextureBindingViewDimensionDescriptor, WGPUSType_TextureBindingViewDimensionDescriptor) + ENUM_ENTRY(Emscripten, WGPUSType_SurfaceSourceCanvasHTMLSelector_Emscripten) + ENUM_ENTRY(SurfaceDescriptorFromWindowsCoreWindow, WGPUSType_SurfaceDescriptorFromWindowsCoreWindow) + ENUM_ENTRY(ExternalTextureBindingEntry, WGPUSType_ExternalTextureBindingEntry) + ENUM_ENTRY(ExternalTextureBindingLayout, WGPUSType_ExternalTextureBindingLayout) + ENUM_ENTRY(SurfaceDescriptorFromWindowsSwapChainPanel, WGPUSType_SurfaceDescriptorFromWindowsSwapChainPanel) + ENUM_ENTRY(DawnTextureInternalUsageDescriptor, WGPUSType_DawnTextureInternalUsageDescriptor) + ENUM_ENTRY(DawnEncoderInternalUsageDescriptor, WGPUSType_DawnEncoderInternalUsageDescriptor) + ENUM_ENTRY(DawnInstanceDescriptor, WGPUSType_DawnInstanceDescriptor) + ENUM_ENTRY(DawnCacheDeviceDescriptor, WGPUSType_DawnCacheDeviceDescriptor) + ENUM_ENTRY(DawnAdapterPropertiesPowerPreference, WGPUSType_DawnAdapterPropertiesPowerPreference) + ENUM_ENTRY(DawnBufferDescriptorErrorInfoFromWireClient, WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient) + ENUM_ENTRY(DawnTogglesDescriptor, WGPUSType_DawnTogglesDescriptor) + ENUM_ENTRY(DawnShaderModuleSPIRVOptionsDescriptor, WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor) + ENUM_ENTRY(RequestAdapterOptionsLUID, WGPUSType_RequestAdapterOptionsLUID) + ENUM_ENTRY(RequestAdapterOptionsGetGLProc, WGPUSType_RequestAdapterOptionsGetGLProc) + ENUM_ENTRY(RequestAdapterOptionsD3D11Device, WGPUSType_RequestAdapterOptionsD3D11Device) + ENUM_ENTRY(DawnRenderPassColorAttachmentRenderToSingleSampled, WGPUSType_DawnRenderPassColorAttachmentRenderToSingleSampled) + ENUM_ENTRY(RenderPassPixelLocalStorage, WGPUSType_RenderPassPixelLocalStorage) + ENUM_ENTRY(PipelineLayoutPixelLocalStorage, WGPUSType_PipelineLayoutPixelLocalStorage) + ENUM_ENTRY(BufferHostMappedPointer, WGPUSType_BufferHostMappedPointer) + ENUM_ENTRY(DawnExperimentalSubgroupLimits, WGPUSType_DawnExperimentalSubgroupLimits) + ENUM_ENTRY(AdapterPropertiesMemoryHeaps, WGPUSType_AdapterPropertiesMemoryHeaps) + ENUM_ENTRY(AdapterPropertiesD3D, WGPUSType_AdapterPropertiesD3D) + ENUM_ENTRY(AdapterPropertiesVk, WGPUSType_AdapterPropertiesVk) + ENUM_ENTRY(DawnComputePipelineFullSubgroups, WGPUSType_DawnComputePipelineFullSubgroups) + ENUM_ENTRY(DawnWireWGSLControl, WGPUSType_DawnWireWGSLControl) + ENUM_ENTRY(DawnWGSLBlocklist, WGPUSType_DawnWGSLBlocklist) + ENUM_ENTRY(DrmFormatCapabilities, WGPUSType_DrmFormatCapabilities) + ENUM_ENTRY(ShaderModuleCompilationOptions, WGPUSType_ShaderModuleCompilationOptions) + ENUM_ENTRY(ColorTargetStateExpandResolveTextureDawn, WGPUSType_ColorTargetStateExpandResolveTextureDawn) + ENUM_ENTRY(RenderPassDescriptorExpandResolveRect, WGPUSType_RenderPassDescriptorExpandResolveRect) + ENUM_ENTRY(SharedTextureMemoryVkDedicatedAllocationDescriptor, WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor) + ENUM_ENTRY(SharedTextureMemoryAHardwareBufferDescriptor, WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor) + ENUM_ENTRY(SharedTextureMemoryDmaBufDescriptor, WGPUSType_SharedTextureMemoryDmaBufDescriptor) + ENUM_ENTRY(SharedTextureMemoryOpaqueFDDescriptor, WGPUSType_SharedTextureMemoryOpaqueFDDescriptor) + ENUM_ENTRY(SharedTextureMemoryZirconHandleDescriptor, WGPUSType_SharedTextureMemoryZirconHandleDescriptor) + ENUM_ENTRY(SharedTextureMemoryDXGISharedHandleDescriptor, WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor) + ENUM_ENTRY(SharedTextureMemoryD3D11Texture2DDescriptor, WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor) + ENUM_ENTRY(SharedTextureMemoryIOSurfaceDescriptor, WGPUSType_SharedTextureMemoryIOSurfaceDescriptor) + ENUM_ENTRY(SharedTextureMemoryEGLImageDescriptor, WGPUSType_SharedTextureMemoryEGLImageDescriptor) + ENUM_ENTRY(SharedTextureMemoryInitializedBeginState, WGPUSType_SharedTextureMemoryInitializedBeginState) + ENUM_ENTRY(SharedTextureMemoryInitializedEndState, WGPUSType_SharedTextureMemoryInitializedEndState) + ENUM_ENTRY(SharedTextureMemoryVkImageLayoutBeginState, WGPUSType_SharedTextureMemoryVkImageLayoutBeginState) + ENUM_ENTRY(SharedTextureMemoryVkImageLayoutEndState, WGPUSType_SharedTextureMemoryVkImageLayoutEndState) + ENUM_ENTRY(SharedTextureMemoryD3DSwapchainBeginState, WGPUSType_SharedTextureMemoryD3DSwapchainBeginState) + ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFDDescriptor, WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor) + ENUM_ENTRY(SharedFenceVkSemaphoreOpaqueFDExportInfo, WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo) + ENUM_ENTRY(SharedFenceVkSemaphoreSyncFDDescriptor, WGPUSType_SharedFenceVkSemaphoreSyncFDDescriptor) + ENUM_ENTRY(SharedFenceVkSemaphoreSyncFDExportInfo, WGPUSType_SharedFenceVkSemaphoreSyncFDExportInfo) + ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandleDescriptor, WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor) + ENUM_ENTRY(SharedFenceVkSemaphoreZirconHandleExportInfo, WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo) + ENUM_ENTRY(SharedFenceDXGISharedHandleDescriptor, WGPUSType_SharedFenceDXGISharedHandleDescriptor) + ENUM_ENTRY(SharedFenceDXGISharedHandleExportInfo, WGPUSType_SharedFenceDXGISharedHandleExportInfo) + ENUM_ENTRY(SharedFenceMTLSharedEventDescriptor, WGPUSType_SharedFenceMTLSharedEventDescriptor) + ENUM_ENTRY(SharedFenceMTLSharedEventExportInfo, WGPUSType_SharedFenceMTLSharedEventExportInfo) + ENUM_ENTRY(SharedBufferMemoryD3D12ResourceDescriptor, WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor) + ENUM_ENTRY(StaticSamplerBindingLayout, WGPUSType_StaticSamplerBindingLayout) + ENUM_ENTRY(YCbCrVkDescriptor, WGPUSType_YCbCrVkDescriptor) + ENUM_ENTRY(SharedTextureMemoryAHardwareBufferProperties, WGPUSType_SharedTextureMemoryAHardwareBufferProperties) + ENUM_ENTRY(AHardwareBufferProperties, WGPUSType_AHardwareBufferProperties) + ENUM_ENTRY(Force32, WGPUSType_Force32) END ENUM(SamplerBindingType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Filtering, 0x00000001) - ENUM_ENTRY(NonFiltering, 0x00000002) - ENUM_ENTRY(Comparison, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUSamplerBindingType_Undefined) + ENUM_ENTRY(Filtering, WGPUSamplerBindingType_Filtering) + ENUM_ENTRY(NonFiltering, WGPUSamplerBindingType_NonFiltering) + ENUM_ENTRY(Comparison, WGPUSamplerBindingType_Comparison) + ENUM_ENTRY(Force32, WGPUSamplerBindingType_Force32) END ENUM(SharedFenceType) - ENUM_ENTRY(VkSemaphoreOpaqueFD, 0x00000001) - ENUM_ENTRY(VkSemaphoreSyncFD, 0x00000002) - ENUM_ENTRY(VkSemaphoreZirconHandle, 0x00000003) - ENUM_ENTRY(DXGISharedHandle, 0x00000004) - ENUM_ENTRY(MTLSharedEvent, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(VkSemaphoreOpaqueFD, WGPUSharedFenceType_VkSemaphoreOpaqueFD) + ENUM_ENTRY(VkSemaphoreSyncFD, WGPUSharedFenceType_VkSemaphoreSyncFD) + ENUM_ENTRY(VkSemaphoreZirconHandle, WGPUSharedFenceType_VkSemaphoreZirconHandle) + ENUM_ENTRY(DXGISharedHandle, WGPUSharedFenceType_DXGISharedHandle) + ENUM_ENTRY(MTLSharedEvent, WGPUSharedFenceType_MTLSharedEvent) + ENUM_ENTRY(Force32, WGPUSharedFenceType_Force32) END ENUM(Status) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(Error, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUStatus_Success) + ENUM_ENTRY(Error, WGPUStatus_Error) + ENUM_ENTRY(Force32, WGPUStatus_Force32) END ENUM(StencilOperation) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Keep, 0x00000001) - ENUM_ENTRY(Zero, 0x00000002) - ENUM_ENTRY(Replace, 0x00000003) - ENUM_ENTRY(Invert, 0x00000004) - ENUM_ENTRY(IncrementClamp, 0x00000005) - ENUM_ENTRY(DecrementClamp, 0x00000006) - ENUM_ENTRY(IncrementWrap, 0x00000007) - ENUM_ENTRY(DecrementWrap, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUStencilOperation_Undefined) + ENUM_ENTRY(Keep, WGPUStencilOperation_Keep) + ENUM_ENTRY(Zero, WGPUStencilOperation_Zero) + ENUM_ENTRY(Replace, WGPUStencilOperation_Replace) + ENUM_ENTRY(Invert, WGPUStencilOperation_Invert) + ENUM_ENTRY(IncrementClamp, WGPUStencilOperation_IncrementClamp) + ENUM_ENTRY(DecrementClamp, WGPUStencilOperation_DecrementClamp) + ENUM_ENTRY(IncrementWrap, WGPUStencilOperation_IncrementWrap) + ENUM_ENTRY(DecrementWrap, WGPUStencilOperation_DecrementWrap) + ENUM_ENTRY(Force32, WGPUStencilOperation_Force32) END ENUM(StorageTextureAccess) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(WriteOnly, 0x00000001) - ENUM_ENTRY(ReadOnly, 0x00000002) - ENUM_ENTRY(ReadWrite, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUStorageTextureAccess_Undefined) + ENUM_ENTRY(WriteOnly, WGPUStorageTextureAccess_WriteOnly) + ENUM_ENTRY(ReadOnly, WGPUStorageTextureAccess_ReadOnly) + ENUM_ENTRY(ReadWrite, WGPUStorageTextureAccess_ReadWrite) + ENUM_ENTRY(Force32, WGPUStorageTextureAccess_Force32) END ENUM(StoreOp) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Store, 0x00000001) - ENUM_ENTRY(Discard, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUStoreOp_Undefined) + ENUM_ENTRY(Store, WGPUStoreOp_Store) + ENUM_ENTRY(Discard, WGPUStoreOp_Discard) + ENUM_ENTRY(Force32, WGPUStoreOp_Force32) END ENUM(SurfaceGetCurrentTextureStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(Timeout, 0x00000002) - ENUM_ENTRY(Outdated, 0x00000003) - ENUM_ENTRY(Lost, 0x00000004) - ENUM_ENTRY(OutOfMemory, 0x00000005) - ENUM_ENTRY(DeviceLost, 0x00000006) - ENUM_ENTRY(Error, 0x00000007) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUSurfaceGetCurrentTextureStatus_Success) + ENUM_ENTRY(Timeout, WGPUSurfaceGetCurrentTextureStatus_Timeout) + ENUM_ENTRY(Outdated, WGPUSurfaceGetCurrentTextureStatus_Outdated) + ENUM_ENTRY(Lost, WGPUSurfaceGetCurrentTextureStatus_Lost) + ENUM_ENTRY(OutOfMemory, WGPUSurfaceGetCurrentTextureStatus_OutOfMemory) + ENUM_ENTRY(DeviceLost, WGPUSurfaceGetCurrentTextureStatus_DeviceLost) + ENUM_ENTRY(Error, WGPUSurfaceGetCurrentTextureStatus_Error) + ENUM_ENTRY(Force32, WGPUSurfaceGetCurrentTextureStatus_Force32) END ENUM(TextureAspect) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(All, 0x00000001) - ENUM_ENTRY(StencilOnly, 0x00000002) - ENUM_ENTRY(DepthOnly, 0x00000003) - ENUM_ENTRY(Plane0Only, 0x00050000) - ENUM_ENTRY(Plane1Only, 0x00050001) - ENUM_ENTRY(Plane2Only, 0x00050002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUTextureAspect_Undefined) + ENUM_ENTRY(All, WGPUTextureAspect_All) + ENUM_ENTRY(StencilOnly, WGPUTextureAspect_StencilOnly) + ENUM_ENTRY(DepthOnly, WGPUTextureAspect_DepthOnly) + ENUM_ENTRY(Plane0Only, WGPUTextureAspect_Plane0Only) + ENUM_ENTRY(Plane1Only, WGPUTextureAspect_Plane1Only) + ENUM_ENTRY(Plane2Only, WGPUTextureAspect_Plane2Only) + ENUM_ENTRY(Force32, WGPUTextureAspect_Force32) END ENUM(TextureDimension) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(_1D, 0x00000001) - ENUM_ENTRY(_2D, 0x00000002) - ENUM_ENTRY(_3D, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUTextureDimension_Undefined) + ENUM_ENTRY(_1D, WGPUTextureDimension_1D) + ENUM_ENTRY(_2D, WGPUTextureDimension_2D) + ENUM_ENTRY(_3D, WGPUTextureDimension_3D) + ENUM_ENTRY(Force32, WGPUTextureDimension_Force32) END ENUM(TextureFormat) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(R8Unorm, 0x00000001) - ENUM_ENTRY(R8Snorm, 0x00000002) - ENUM_ENTRY(R8Uint, 0x00000003) - ENUM_ENTRY(R8Sint, 0x00000004) - ENUM_ENTRY(R16Uint, 0x00000005) - ENUM_ENTRY(R16Sint, 0x00000006) - ENUM_ENTRY(R16Float, 0x00000007) - ENUM_ENTRY(RG8Unorm, 0x00000008) - ENUM_ENTRY(RG8Snorm, 0x00000009) - ENUM_ENTRY(RG8Uint, 0x0000000A) - ENUM_ENTRY(RG8Sint, 0x0000000B) - ENUM_ENTRY(R32Float, 0x0000000C) - ENUM_ENTRY(R32Uint, 0x0000000D) - ENUM_ENTRY(R32Sint, 0x0000000E) - ENUM_ENTRY(RG16Uint, 0x0000000F) - ENUM_ENTRY(RG16Sint, 0x00000010) - ENUM_ENTRY(RG16Float, 0x00000011) - ENUM_ENTRY(RGBA8Unorm, 0x00000012) - ENUM_ENTRY(RGBA8UnormSrgb, 0x00000013) - ENUM_ENTRY(RGBA8Snorm, 0x00000014) - ENUM_ENTRY(RGBA8Uint, 0x00000015) - ENUM_ENTRY(RGBA8Sint, 0x00000016) - ENUM_ENTRY(BGRA8Unorm, 0x00000017) - ENUM_ENTRY(BGRA8UnormSrgb, 0x00000018) - ENUM_ENTRY(RGB10A2Uint, 0x00000019) - ENUM_ENTRY(RGB10A2Unorm, 0x0000001A) - ENUM_ENTRY(RG11B10Ufloat, 0x0000001B) - ENUM_ENTRY(RGB9E5Ufloat, 0x0000001C) - ENUM_ENTRY(RG32Float, 0x0000001D) - ENUM_ENTRY(RG32Uint, 0x0000001E) - ENUM_ENTRY(RG32Sint, 0x0000001F) - ENUM_ENTRY(RGBA16Uint, 0x00000020) - ENUM_ENTRY(RGBA16Sint, 0x00000021) - ENUM_ENTRY(RGBA16Float, 0x00000022) - ENUM_ENTRY(RGBA32Float, 0x00000023) - ENUM_ENTRY(RGBA32Uint, 0x00000024) - ENUM_ENTRY(RGBA32Sint, 0x00000025) - ENUM_ENTRY(Stencil8, 0x00000026) - ENUM_ENTRY(Depth16Unorm, 0x00000027) - ENUM_ENTRY(Depth24Plus, 0x00000028) - ENUM_ENTRY(Depth24PlusStencil8, 0x00000029) - ENUM_ENTRY(Depth32Float, 0x0000002A) - ENUM_ENTRY(Depth32FloatStencil8, 0x0000002B) - ENUM_ENTRY(BC1RGBAUnorm, 0x0000002C) - ENUM_ENTRY(BC1RGBAUnormSrgb, 0x0000002D) - ENUM_ENTRY(BC2RGBAUnorm, 0x0000002E) - ENUM_ENTRY(BC2RGBAUnormSrgb, 0x0000002F) - ENUM_ENTRY(BC3RGBAUnorm, 0x00000030) - ENUM_ENTRY(BC3RGBAUnormSrgb, 0x00000031) - ENUM_ENTRY(BC4RUnorm, 0x00000032) - ENUM_ENTRY(BC4RSnorm, 0x00000033) - ENUM_ENTRY(BC5RGUnorm, 0x00000034) - ENUM_ENTRY(BC5RGSnorm, 0x00000035) - ENUM_ENTRY(BC6HRGBUfloat, 0x00000036) - ENUM_ENTRY(BC6HRGBFloat, 0x00000037) - ENUM_ENTRY(BC7RGBAUnorm, 0x00000038) - ENUM_ENTRY(BC7RGBAUnormSrgb, 0x00000039) - ENUM_ENTRY(ETC2RGB8Unorm, 0x0000003A) - ENUM_ENTRY(ETC2RGB8UnormSrgb, 0x0000003B) - ENUM_ENTRY(ETC2RGB8A1Unorm, 0x0000003C) - ENUM_ENTRY(ETC2RGB8A1UnormSrgb, 0x0000003D) - ENUM_ENTRY(ETC2RGBA8Unorm, 0x0000003E) - ENUM_ENTRY(ETC2RGBA8UnormSrgb, 0x0000003F) - ENUM_ENTRY(EACR11Unorm, 0x00000040) - ENUM_ENTRY(EACR11Snorm, 0x00000041) - ENUM_ENTRY(EACRG11Unorm, 0x00000042) - ENUM_ENTRY(EACRG11Snorm, 0x00000043) - ENUM_ENTRY(ASTC4x4Unorm, 0x00000044) - ENUM_ENTRY(ASTC4x4UnormSrgb, 0x00000045) - ENUM_ENTRY(ASTC5x4Unorm, 0x00000046) - ENUM_ENTRY(ASTC5x4UnormSrgb, 0x00000047) - ENUM_ENTRY(ASTC5x5Unorm, 0x00000048) - ENUM_ENTRY(ASTC5x5UnormSrgb, 0x00000049) - ENUM_ENTRY(ASTC6x5Unorm, 0x0000004A) - ENUM_ENTRY(ASTC6x5UnormSrgb, 0x0000004B) - ENUM_ENTRY(ASTC6x6Unorm, 0x0000004C) - ENUM_ENTRY(ASTC6x6UnormSrgb, 0x0000004D) - ENUM_ENTRY(ASTC8x5Unorm, 0x0000004E) - ENUM_ENTRY(ASTC8x5UnormSrgb, 0x0000004F) - ENUM_ENTRY(ASTC8x6Unorm, 0x00000050) - ENUM_ENTRY(ASTC8x6UnormSrgb, 0x00000051) - ENUM_ENTRY(ASTC8x8Unorm, 0x00000052) - ENUM_ENTRY(ASTC8x8UnormSrgb, 0x00000053) - ENUM_ENTRY(ASTC10x5Unorm, 0x00000054) - ENUM_ENTRY(ASTC10x5UnormSrgb, 0x00000055) - ENUM_ENTRY(ASTC10x6Unorm, 0x00000056) - ENUM_ENTRY(ASTC10x6UnormSrgb, 0x00000057) - ENUM_ENTRY(ASTC10x8Unorm, 0x00000058) - ENUM_ENTRY(ASTC10x8UnormSrgb, 0x00000059) - ENUM_ENTRY(ASTC10x10Unorm, 0x0000005A) - ENUM_ENTRY(ASTC10x10UnormSrgb, 0x0000005B) - ENUM_ENTRY(ASTC12x10Unorm, 0x0000005C) - ENUM_ENTRY(ASTC12x10UnormSrgb, 0x0000005D) - ENUM_ENTRY(ASTC12x12Unorm, 0x0000005E) - ENUM_ENTRY(ASTC12x12UnormSrgb, 0x0000005F) - ENUM_ENTRY(R16Unorm, 0x00050000) - ENUM_ENTRY(RG16Unorm, 0x00050001) - ENUM_ENTRY(RGBA16Unorm, 0x00050002) - ENUM_ENTRY(R16Snorm, 0x00050003) - ENUM_ENTRY(RG16Snorm, 0x00050004) - ENUM_ENTRY(RGBA16Snorm, 0x00050005) - ENUM_ENTRY(R8BG8Biplanar420Unorm, 0x00050006) - ENUM_ENTRY(R10X6BG10X6Biplanar420Unorm, 0x00050007) - ENUM_ENTRY(R8BG8A8Triplanar420Unorm, 0x00050008) - ENUM_ENTRY(R8BG8Biplanar422Unorm, 0x00050009) - ENUM_ENTRY(R8BG8Biplanar444Unorm, 0x0005000A) - ENUM_ENTRY(R10X6BG10X6Biplanar422Unorm, 0x0005000B) - ENUM_ENTRY(R10X6BG10X6Biplanar444Unorm, 0x0005000C) - ENUM_ENTRY(External, 0x0005000D) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUTextureFormat_Undefined) + ENUM_ENTRY(R8Unorm, WGPUTextureFormat_R8Unorm) + ENUM_ENTRY(R8Snorm, WGPUTextureFormat_R8Snorm) + ENUM_ENTRY(R8Uint, WGPUTextureFormat_R8Uint) + ENUM_ENTRY(R8Sint, WGPUTextureFormat_R8Sint) + ENUM_ENTRY(R16Uint, WGPUTextureFormat_R16Uint) + ENUM_ENTRY(R16Sint, WGPUTextureFormat_R16Sint) + ENUM_ENTRY(R16Float, WGPUTextureFormat_R16Float) + ENUM_ENTRY(RG8Unorm, WGPUTextureFormat_RG8Unorm) + ENUM_ENTRY(RG8Snorm, WGPUTextureFormat_RG8Snorm) + ENUM_ENTRY(RG8Uint, WGPUTextureFormat_RG8Uint) + ENUM_ENTRY(RG8Sint, WGPUTextureFormat_RG8Sint) + ENUM_ENTRY(R32Float, WGPUTextureFormat_R32Float) + ENUM_ENTRY(R32Uint, WGPUTextureFormat_R32Uint) + ENUM_ENTRY(R32Sint, WGPUTextureFormat_R32Sint) + ENUM_ENTRY(RG16Uint, WGPUTextureFormat_RG16Uint) + ENUM_ENTRY(RG16Sint, WGPUTextureFormat_RG16Sint) + ENUM_ENTRY(RG16Float, WGPUTextureFormat_RG16Float) + ENUM_ENTRY(RGBA8Unorm, WGPUTextureFormat_RGBA8Unorm) + ENUM_ENTRY(RGBA8UnormSrgb, WGPUTextureFormat_RGBA8UnormSrgb) + ENUM_ENTRY(RGBA8Snorm, WGPUTextureFormat_RGBA8Snorm) + ENUM_ENTRY(RGBA8Uint, WGPUTextureFormat_RGBA8Uint) + ENUM_ENTRY(RGBA8Sint, WGPUTextureFormat_RGBA8Sint) + ENUM_ENTRY(BGRA8Unorm, WGPUTextureFormat_BGRA8Unorm) + ENUM_ENTRY(BGRA8UnormSrgb, WGPUTextureFormat_BGRA8UnormSrgb) + ENUM_ENTRY(RGB10A2Uint, WGPUTextureFormat_RGB10A2Uint) + ENUM_ENTRY(RGB10A2Unorm, WGPUTextureFormat_RGB10A2Unorm) + ENUM_ENTRY(RG11B10Ufloat, WGPUTextureFormat_RG11B10Ufloat) + ENUM_ENTRY(RGB9E5Ufloat, WGPUTextureFormat_RGB9E5Ufloat) + ENUM_ENTRY(RG32Float, WGPUTextureFormat_RG32Float) + ENUM_ENTRY(RG32Uint, WGPUTextureFormat_RG32Uint) + ENUM_ENTRY(RG32Sint, WGPUTextureFormat_RG32Sint) + ENUM_ENTRY(RGBA16Uint, WGPUTextureFormat_RGBA16Uint) + ENUM_ENTRY(RGBA16Sint, WGPUTextureFormat_RGBA16Sint) + ENUM_ENTRY(RGBA16Float, WGPUTextureFormat_RGBA16Float) + ENUM_ENTRY(RGBA32Float, WGPUTextureFormat_RGBA32Float) + ENUM_ENTRY(RGBA32Uint, WGPUTextureFormat_RGBA32Uint) + ENUM_ENTRY(RGBA32Sint, WGPUTextureFormat_RGBA32Sint) + ENUM_ENTRY(Stencil8, WGPUTextureFormat_Stencil8) + ENUM_ENTRY(Depth16Unorm, WGPUTextureFormat_Depth16Unorm) + ENUM_ENTRY(Depth24Plus, WGPUTextureFormat_Depth24Plus) + ENUM_ENTRY(Depth24PlusStencil8, WGPUTextureFormat_Depth24PlusStencil8) + ENUM_ENTRY(Depth32Float, WGPUTextureFormat_Depth32Float) + ENUM_ENTRY(Depth32FloatStencil8, WGPUTextureFormat_Depth32FloatStencil8) + ENUM_ENTRY(BC1RGBAUnorm, WGPUTextureFormat_BC1RGBAUnorm) + ENUM_ENTRY(BC1RGBAUnormSrgb, WGPUTextureFormat_BC1RGBAUnormSrgb) + ENUM_ENTRY(BC2RGBAUnorm, WGPUTextureFormat_BC2RGBAUnorm) + ENUM_ENTRY(BC2RGBAUnormSrgb, WGPUTextureFormat_BC2RGBAUnormSrgb) + ENUM_ENTRY(BC3RGBAUnorm, WGPUTextureFormat_BC3RGBAUnorm) + ENUM_ENTRY(BC3RGBAUnormSrgb, WGPUTextureFormat_BC3RGBAUnormSrgb) + ENUM_ENTRY(BC4RUnorm, WGPUTextureFormat_BC4RUnorm) + ENUM_ENTRY(BC4RSnorm, WGPUTextureFormat_BC4RSnorm) + ENUM_ENTRY(BC5RGUnorm, WGPUTextureFormat_BC5RGUnorm) + ENUM_ENTRY(BC5RGSnorm, WGPUTextureFormat_BC5RGSnorm) + ENUM_ENTRY(BC6HRGBUfloat, WGPUTextureFormat_BC6HRGBUfloat) + ENUM_ENTRY(BC6HRGBFloat, WGPUTextureFormat_BC6HRGBFloat) + ENUM_ENTRY(BC7RGBAUnorm, WGPUTextureFormat_BC7RGBAUnorm) + ENUM_ENTRY(BC7RGBAUnormSrgb, WGPUTextureFormat_BC7RGBAUnormSrgb) + ENUM_ENTRY(ETC2RGB8Unorm, WGPUTextureFormat_ETC2RGB8Unorm) + ENUM_ENTRY(ETC2RGB8UnormSrgb, WGPUTextureFormat_ETC2RGB8UnormSrgb) + ENUM_ENTRY(ETC2RGB8A1Unorm, WGPUTextureFormat_ETC2RGB8A1Unorm) + ENUM_ENTRY(ETC2RGB8A1UnormSrgb, WGPUTextureFormat_ETC2RGB8A1UnormSrgb) + ENUM_ENTRY(ETC2RGBA8Unorm, WGPUTextureFormat_ETC2RGBA8Unorm) + ENUM_ENTRY(ETC2RGBA8UnormSrgb, WGPUTextureFormat_ETC2RGBA8UnormSrgb) + ENUM_ENTRY(EACR11Unorm, WGPUTextureFormat_EACR11Unorm) + ENUM_ENTRY(EACR11Snorm, WGPUTextureFormat_EACR11Snorm) + ENUM_ENTRY(EACRG11Unorm, WGPUTextureFormat_EACRG11Unorm) + ENUM_ENTRY(EACRG11Snorm, WGPUTextureFormat_EACRG11Snorm) + ENUM_ENTRY(ASTC4x4Unorm, WGPUTextureFormat_ASTC4x4Unorm) + ENUM_ENTRY(ASTC4x4UnormSrgb, WGPUTextureFormat_ASTC4x4UnormSrgb) + ENUM_ENTRY(ASTC5x4Unorm, WGPUTextureFormat_ASTC5x4Unorm) + ENUM_ENTRY(ASTC5x4UnormSrgb, WGPUTextureFormat_ASTC5x4UnormSrgb) + ENUM_ENTRY(ASTC5x5Unorm, WGPUTextureFormat_ASTC5x5Unorm) + ENUM_ENTRY(ASTC5x5UnormSrgb, WGPUTextureFormat_ASTC5x5UnormSrgb) + ENUM_ENTRY(ASTC6x5Unorm, WGPUTextureFormat_ASTC6x5Unorm) + ENUM_ENTRY(ASTC6x5UnormSrgb, WGPUTextureFormat_ASTC6x5UnormSrgb) + ENUM_ENTRY(ASTC6x6Unorm, WGPUTextureFormat_ASTC6x6Unorm) + ENUM_ENTRY(ASTC6x6UnormSrgb, WGPUTextureFormat_ASTC6x6UnormSrgb) + ENUM_ENTRY(ASTC8x5Unorm, WGPUTextureFormat_ASTC8x5Unorm) + ENUM_ENTRY(ASTC8x5UnormSrgb, WGPUTextureFormat_ASTC8x5UnormSrgb) + ENUM_ENTRY(ASTC8x6Unorm, WGPUTextureFormat_ASTC8x6Unorm) + ENUM_ENTRY(ASTC8x6UnormSrgb, WGPUTextureFormat_ASTC8x6UnormSrgb) + ENUM_ENTRY(ASTC8x8Unorm, WGPUTextureFormat_ASTC8x8Unorm) + ENUM_ENTRY(ASTC8x8UnormSrgb, WGPUTextureFormat_ASTC8x8UnormSrgb) + ENUM_ENTRY(ASTC10x5Unorm, WGPUTextureFormat_ASTC10x5Unorm) + ENUM_ENTRY(ASTC10x5UnormSrgb, WGPUTextureFormat_ASTC10x5UnormSrgb) + ENUM_ENTRY(ASTC10x6Unorm, WGPUTextureFormat_ASTC10x6Unorm) + ENUM_ENTRY(ASTC10x6UnormSrgb, WGPUTextureFormat_ASTC10x6UnormSrgb) + ENUM_ENTRY(ASTC10x8Unorm, WGPUTextureFormat_ASTC10x8Unorm) + ENUM_ENTRY(ASTC10x8UnormSrgb, WGPUTextureFormat_ASTC10x8UnormSrgb) + ENUM_ENTRY(ASTC10x10Unorm, WGPUTextureFormat_ASTC10x10Unorm) + ENUM_ENTRY(ASTC10x10UnormSrgb, WGPUTextureFormat_ASTC10x10UnormSrgb) + ENUM_ENTRY(ASTC12x10Unorm, WGPUTextureFormat_ASTC12x10Unorm) + ENUM_ENTRY(ASTC12x10UnormSrgb, WGPUTextureFormat_ASTC12x10UnormSrgb) + ENUM_ENTRY(ASTC12x12Unorm, WGPUTextureFormat_ASTC12x12Unorm) + ENUM_ENTRY(ASTC12x12UnormSrgb, WGPUTextureFormat_ASTC12x12UnormSrgb) + ENUM_ENTRY(R16Unorm, WGPUTextureFormat_R16Unorm) + ENUM_ENTRY(RG16Unorm, WGPUTextureFormat_RG16Unorm) + ENUM_ENTRY(RGBA16Unorm, WGPUTextureFormat_RGBA16Unorm) + ENUM_ENTRY(R16Snorm, WGPUTextureFormat_R16Snorm) + ENUM_ENTRY(RG16Snorm, WGPUTextureFormat_RG16Snorm) + ENUM_ENTRY(RGBA16Snorm, WGPUTextureFormat_RGBA16Snorm) + ENUM_ENTRY(R8BG8Biplanar420Unorm, WGPUTextureFormat_R8BG8Biplanar420Unorm) + ENUM_ENTRY(R10X6BG10X6Biplanar420Unorm, WGPUTextureFormat_R10X6BG10X6Biplanar420Unorm) + ENUM_ENTRY(R8BG8A8Triplanar420Unorm, WGPUTextureFormat_R8BG8A8Triplanar420Unorm) + ENUM_ENTRY(R8BG8Biplanar422Unorm, WGPUTextureFormat_R8BG8Biplanar422Unorm) + ENUM_ENTRY(R8BG8Biplanar444Unorm, WGPUTextureFormat_R8BG8Biplanar444Unorm) + ENUM_ENTRY(R10X6BG10X6Biplanar422Unorm, WGPUTextureFormat_R10X6BG10X6Biplanar422Unorm) + ENUM_ENTRY(R10X6BG10X6Biplanar444Unorm, WGPUTextureFormat_R10X6BG10X6Biplanar444Unorm) + ENUM_ENTRY(External, WGPUTextureFormat_External) + ENUM_ENTRY(Force32, WGPUTextureFormat_Force32) END ENUM(TextureSampleType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Float, 0x00000001) - ENUM_ENTRY(UnfilterableFloat, 0x00000002) - ENUM_ENTRY(Depth, 0x00000003) - ENUM_ENTRY(Sint, 0x00000004) - ENUM_ENTRY(Uint, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUTextureSampleType_Undefined) + ENUM_ENTRY(Float, WGPUTextureSampleType_Float) + ENUM_ENTRY(UnfilterableFloat, WGPUTextureSampleType_UnfilterableFloat) + ENUM_ENTRY(Depth, WGPUTextureSampleType_Depth) + ENUM_ENTRY(Sint, WGPUTextureSampleType_Sint) + ENUM_ENTRY(Uint, WGPUTextureSampleType_Uint) + ENUM_ENTRY(Force32, WGPUTextureSampleType_Force32) END ENUM(TextureViewDimension) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(_1D, 0x00000001) - ENUM_ENTRY(_2D, 0x00000002) - ENUM_ENTRY(_2DArray, 0x00000003) - ENUM_ENTRY(Cube, 0x00000004) - ENUM_ENTRY(CubeArray, 0x00000005) - ENUM_ENTRY(_3D, 0x00000006) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUTextureViewDimension_Undefined) + ENUM_ENTRY(_1D, WGPUTextureViewDimension_1D) + ENUM_ENTRY(_2D, WGPUTextureViewDimension_2D) + ENUM_ENTRY(_2DArray, WGPUTextureViewDimension_2DArray) + ENUM_ENTRY(Cube, WGPUTextureViewDimension_Cube) + ENUM_ENTRY(CubeArray, WGPUTextureViewDimension_CubeArray) + ENUM_ENTRY(_3D, WGPUTextureViewDimension_3D) + ENUM_ENTRY(Force32, WGPUTextureViewDimension_Force32) END ENUM(VertexFormat) - ENUM_ENTRY(Uint8x2, 0x00000001) - ENUM_ENTRY(Uint8x4, 0x00000002) - ENUM_ENTRY(Sint8x2, 0x00000003) - ENUM_ENTRY(Sint8x4, 0x00000004) - ENUM_ENTRY(Unorm8x2, 0x00000005) - ENUM_ENTRY(Unorm8x4, 0x00000006) - ENUM_ENTRY(Snorm8x2, 0x00000007) - ENUM_ENTRY(Snorm8x4, 0x00000008) - ENUM_ENTRY(Uint16x2, 0x00000009) - ENUM_ENTRY(Uint16x4, 0x0000000A) - ENUM_ENTRY(Sint16x2, 0x0000000B) - ENUM_ENTRY(Sint16x4, 0x0000000C) - ENUM_ENTRY(Unorm16x2, 0x0000000D) - ENUM_ENTRY(Unorm16x4, 0x0000000E) - ENUM_ENTRY(Snorm16x2, 0x0000000F) - ENUM_ENTRY(Snorm16x4, 0x00000010) - ENUM_ENTRY(Float16x2, 0x00000011) - ENUM_ENTRY(Float16x4, 0x00000012) - ENUM_ENTRY(Float32, 0x00000013) - ENUM_ENTRY(Float32x2, 0x00000014) - ENUM_ENTRY(Float32x3, 0x00000015) - ENUM_ENTRY(Float32x4, 0x00000016) - ENUM_ENTRY(Uint32, 0x00000017) - ENUM_ENTRY(Uint32x2, 0x00000018) - ENUM_ENTRY(Uint32x3, 0x00000019) - ENUM_ENTRY(Uint32x4, 0x0000001A) - ENUM_ENTRY(Sint32, 0x0000001B) - ENUM_ENTRY(Sint32x2, 0x0000001C) - ENUM_ENTRY(Sint32x3, 0x0000001D) - ENUM_ENTRY(Sint32x4, 0x0000001E) - ENUM_ENTRY(Unorm10_10_10_2, 0x0000001F) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Uint8x2, WGPUVertexFormat_Uint8x2) + ENUM_ENTRY(Uint8x4, WGPUVertexFormat_Uint8x4) + ENUM_ENTRY(Sint8x2, WGPUVertexFormat_Sint8x2) + ENUM_ENTRY(Sint8x4, WGPUVertexFormat_Sint8x4) + ENUM_ENTRY(Unorm8x2, WGPUVertexFormat_Unorm8x2) + ENUM_ENTRY(Unorm8x4, WGPUVertexFormat_Unorm8x4) + ENUM_ENTRY(Snorm8x2, WGPUVertexFormat_Snorm8x2) + ENUM_ENTRY(Snorm8x4, WGPUVertexFormat_Snorm8x4) + ENUM_ENTRY(Uint16x2, WGPUVertexFormat_Uint16x2) + ENUM_ENTRY(Uint16x4, WGPUVertexFormat_Uint16x4) + ENUM_ENTRY(Sint16x2, WGPUVertexFormat_Sint16x2) + ENUM_ENTRY(Sint16x4, WGPUVertexFormat_Sint16x4) + ENUM_ENTRY(Unorm16x2, WGPUVertexFormat_Unorm16x2) + ENUM_ENTRY(Unorm16x4, WGPUVertexFormat_Unorm16x4) + ENUM_ENTRY(Snorm16x2, WGPUVertexFormat_Snorm16x2) + ENUM_ENTRY(Snorm16x4, WGPUVertexFormat_Snorm16x4) + ENUM_ENTRY(Float16x2, WGPUVertexFormat_Float16x2) + ENUM_ENTRY(Float16x4, WGPUVertexFormat_Float16x4) + ENUM_ENTRY(Float32, WGPUVertexFormat_Float32) + ENUM_ENTRY(Float32x2, WGPUVertexFormat_Float32x2) + ENUM_ENTRY(Float32x3, WGPUVertexFormat_Float32x3) + ENUM_ENTRY(Float32x4, WGPUVertexFormat_Float32x4) + ENUM_ENTRY(Uint32, WGPUVertexFormat_Uint32) + ENUM_ENTRY(Uint32x2, WGPUVertexFormat_Uint32x2) + ENUM_ENTRY(Uint32x3, WGPUVertexFormat_Uint32x3) + ENUM_ENTRY(Uint32x4, WGPUVertexFormat_Uint32x4) + ENUM_ENTRY(Sint32, WGPUVertexFormat_Sint32) + ENUM_ENTRY(Sint32x2, WGPUVertexFormat_Sint32x2) + ENUM_ENTRY(Sint32x3, WGPUVertexFormat_Sint32x3) + ENUM_ENTRY(Sint32x4, WGPUVertexFormat_Sint32x4) + ENUM_ENTRY(_2, WGPUVertexFormat_Unorm10_10_10_2) + ENUM_ENTRY(Force32, WGPUVertexFormat_Force32) END ENUM(VertexStepMode) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(VertexBufferNotUsed, 0x00000001) - ENUM_ENTRY(Vertex, 0x00000002) - ENUM_ENTRY(Instance, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Undefined, WGPUVertexStepMode_Undefined) + ENUM_ENTRY(VertexBufferNotUsed, WGPUVertexStepMode_VertexBufferNotUsed) + ENUM_ENTRY(Vertex, WGPUVertexStepMode_Vertex) + ENUM_ENTRY(Instance, WGPUVertexStepMode_Instance) + ENUM_ENTRY(Force32, WGPUVertexStepMode_Force32) END ENUM(WaitStatus) - ENUM_ENTRY(Success, 0x00000001) - ENUM_ENTRY(TimedOut, 0x00000002) - ENUM_ENTRY(UnsupportedTimeout, 0x00000003) - ENUM_ENTRY(UnsupportedCount, 0x00000004) - ENUM_ENTRY(UnsupportedMixedSources, 0x00000005) - ENUM_ENTRY(Unknown, 0x00000006) - ENUM_ENTRY(Force32, 0x7FFFFFFF) + ENUM_ENTRY(Success, WGPUWaitStatus_Success) + ENUM_ENTRY(TimedOut, WGPUWaitStatus_TimedOut) + ENUM_ENTRY(UnsupportedTimeout, WGPUWaitStatus_UnsupportedTimeout) + ENUM_ENTRY(UnsupportedCount, WGPUWaitStatus_UnsupportedCount) + ENUM_ENTRY(UnsupportedMixedSources, WGPUWaitStatus_UnsupportedMixedSources) + ENUM_ENTRY(Unknown, WGPUWaitStatus_Unknown) + ENUM_ENTRY(Force32, WGPUWaitStatus_Force32) END ENUM(BufferUsage) ENUM_ENTRY(None, 0x0000000000000000) @@ -1053,10 +1053,6 @@ STRUCT(ShaderSourceSPIRV) void setDefault(); END -STRUCT(ShaderSourceWGSL) - void setDefault(); -END - STRUCT(SharedFenceDXGISharedHandleDescriptor) void setDefault(); END @@ -1239,6 +1235,10 @@ STRUCT(PipelineLayoutPixelLocalStorage) void setDefault(); END +STRUCT(ShaderSourceWGSL) + void setDefault(); +END + STRUCT(SharedTextureMemoryAHardwareBufferProperties) void setDefault(); END @@ -2578,13 +2578,6 @@ void ShaderSourceSPIRV::setDefault() { } -// Methods of ShaderSourceWGSL -void ShaderSourceWGSL::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::ShaderSourceWGSL; -} - - // Methods of SharedBufferMemoryBeginAccessDescriptor void SharedBufferMemoryBeginAccessDescriptor::setDefault() { } @@ -2860,7 +2853,6 @@ void SurfaceSourceAndroidNativeWindow::setDefault() { // Methods of SurfaceSourceCanvasHTMLSelector_Emscripten void SurfaceSourceCanvasHTMLSelector_Emscripten::setDefault() { ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceSourceCanvasHTMLSelector_Emscripten; } @@ -3102,6 +3094,14 @@ void RequiredLimits::setDefault() { } +// Methods of ShaderSourceWGSL +void ShaderSourceWGSL::setDefault() { + ((ChainedStruct*)&chain)->setDefault(); + ((StringView*)&code)->setDefault(); + chain.sType = SType::ShaderSourceWGSL; +} + + // Methods of SharedTextureMemoryAHardwareBufferProperties void SharedTextureMemoryAHardwareBufferProperties::setDefault() { ((ChainedStructOut*)&chain)->setDefault(); diff --git a/wgpu-native/include/webgpu/webgpu.h b/wgpu-native/include/webgpu/webgpu.h new file mode 100644 index 0000000..cb423fc --- /dev/null +++ b/wgpu-native/include/webgpu/webgpu.h @@ -0,0 +1,2091 @@ +/** + * Copyright 2019-2023 WebGPU-Native developers + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** @file */ + +/** + * \mainpage + * + * **Important:** *This documentation is a Work In Progress.* + * + * This is the home of WebGPU C API specification. We define here the standard + * `webgpu.h` header that all implementations should provide. + */ + +#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 + + +/** + * \defgroup Constants + * \brief Constants. + * + * @{ + */ +#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) +#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) +#define WGPU_DEPTH_SLICE_UNDEFINED (0xffffffffUL) +#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) +#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) +#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) +#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL) +#define WGPU_WHOLE_MAP_SIZE (SIZE_MAX) +#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) + + +/** @} */ + +/** + * \defgroup Typedefs + * \brief Utility typedefs. + * + * @{ + */ +typedef uint32_t WGPUFlags; +typedef uint32_t WGPUBool; + + +/** @} */ + +/** + * \defgroup Objects + * \brief Opaque, non-dispatchable handles to WebGPU objects. + * + * @{ + */ +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 WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; + + +/** @} */ +// Structure forward declarations +struct WGPUAdapterInfo; +struct WGPUBindGroupEntry; +struct WGPUBlendComponent; +struct WGPUBufferBindingLayout; +struct WGPUBufferDescriptor; +struct WGPUColor; +struct WGPUCommandBufferDescriptor; +struct WGPUCommandEncoderDescriptor; +struct WGPUCompilationMessage; +struct WGPUComputePassTimestampWrites; +struct WGPUConstantEntry; +struct WGPUExtent3D; +struct WGPUInstanceDescriptor; +struct WGPULimits; +struct WGPUMultisampleState; +struct WGPUOrigin3D; +struct WGPUPipelineLayoutDescriptor; +struct WGPUPrimitiveDepthClipControl; +struct WGPUPrimitiveState; +struct WGPUQuerySetDescriptor; +struct WGPUQueueDescriptor; +struct WGPURenderBundleDescriptor; +struct WGPURenderBundleEncoderDescriptor; +struct WGPURenderPassDepthStencilAttachment; +struct WGPURenderPassDescriptorMaxDrawCount; +struct WGPURenderPassTimestampWrites; +struct WGPURequestAdapterOptions; +struct WGPUSamplerBindingLayout; +struct WGPUSamplerDescriptor; +struct WGPUShaderModuleCompilationHint; +struct WGPUShaderModuleSPIRVDescriptor; +struct WGPUShaderModuleWGSLDescriptor; +struct WGPUStencilFaceState; +struct WGPUStorageTextureBindingLayout; +struct WGPUSurfaceCapabilities; +struct WGPUSurfaceConfiguration; +struct WGPUSurfaceDescriptor; +struct WGPUSurfaceDescriptorFromAndroidNativeWindow; +struct WGPUSurfaceDescriptorFromCanvasHTMLSelector; +struct WGPUSurfaceDescriptorFromMetalLayer; +struct WGPUSurfaceDescriptorFromWaylandSurface; +struct WGPUSurfaceDescriptorFromWindowsHWND; +struct WGPUSurfaceDescriptorFromXcbWindow; +struct WGPUSurfaceDescriptorFromXlibWindow; +struct WGPUSurfaceTexture; +struct WGPUTextureBindingLayout; +struct WGPUTextureDataLayout; +struct WGPUTextureViewDescriptor; +struct WGPUUncapturedErrorCallbackInfo; +struct WGPUVertexAttribute; +struct WGPUBindGroupDescriptor; +struct WGPUBindGroupLayoutEntry; +struct WGPUBlendState; +struct WGPUCompilationInfo; +struct WGPUComputePassDescriptor; +struct WGPUDepthStencilState; +struct WGPUImageCopyBuffer; +struct WGPUImageCopyTexture; +struct WGPUProgrammableStageDescriptor; +struct WGPURenderPassColorAttachment; +struct WGPURequiredLimits; +struct WGPUShaderModuleDescriptor; +struct WGPUSupportedLimits; +struct WGPUTextureDescriptor; +struct WGPUVertexBufferLayout; +struct WGPUBindGroupLayoutDescriptor; +struct WGPUColorTargetState; +struct WGPUComputePipelineDescriptor; +struct WGPUDeviceDescriptor; +struct WGPURenderPassDescriptor; +struct WGPUVertexState; +struct WGPUFragmentState; +struct WGPURenderPipelineDescriptor; + + +/** + * \defgroup Enumerations + * \brief Enums. + * + * @{ + */ +typedef enum WGPUAdapterType { + WGPUAdapterType_DiscreteGPU = 0x00000000, + WGPUAdapterType_IntegratedGPU = 0x00000001, + WGPUAdapterType_CPU = 0x00000002, + WGPUAdapterType_Unknown = 0x00000003, + WGPUAdapterType_Force32 = 0x7FFFFFFF +} WGPUAdapterType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUAddressMode { + WGPUAddressMode_Repeat = 0x00000000, + WGPUAddressMode_MirrorRepeat = 0x00000001, + WGPUAddressMode_ClampToEdge = 0x00000002, + 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_Zero = 0x00000000, + WGPUBlendFactor_One = 0x00000001, + WGPUBlendFactor_Src = 0x00000002, + WGPUBlendFactor_OneMinusSrc = 0x00000003, + WGPUBlendFactor_SrcAlpha = 0x00000004, + WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005, + WGPUBlendFactor_Dst = 0x00000006, + WGPUBlendFactor_OneMinusDst = 0x00000007, + WGPUBlendFactor_DstAlpha = 0x00000008, + WGPUBlendFactor_OneMinusDstAlpha = 0x00000009, + WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A, + WGPUBlendFactor_Constant = 0x0000000B, + WGPUBlendFactor_OneMinusConstant = 0x0000000C, + WGPUBlendFactor_Force32 = 0x7FFFFFFF +} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBlendOperation { + WGPUBlendOperation_Add = 0x00000000, + WGPUBlendOperation_Subtract = 0x00000001, + WGPUBlendOperation_ReverseSubtract = 0x00000002, + WGPUBlendOperation_Min = 0x00000003, + WGPUBlendOperation_Max = 0x00000004, + 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 = 0x00000000, + WGPUBufferMapState_Pending = 0x00000001, + WGPUBufferMapState_Mapped = 0x00000002, + WGPUBufferMapState_Force32 = 0x7FFFFFFF +} WGPUBufferMapState WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCompareFunction { + WGPUCompareFunction_Undefined = 0x00000000, + WGPUCompareFunction_Never = 0x00000001, + WGPUCompareFunction_Less = 0x00000002, + WGPUCompareFunction_LessEqual = 0x00000003, + WGPUCompareFunction_Greater = 0x00000004, + WGPUCompareFunction_GreaterEqual = 0x00000005, + WGPUCompareFunction_Equal = 0x00000006, + WGPUCompareFunction_NotEqual = 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 = 0x00000000, + WGPUCompilationMessageType_Warning = 0x00000001, + WGPUCompilationMessageType_Info = 0x00000002, + 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_None = 0x00000000, + WGPUCullMode_Front = 0x00000001, + WGPUCullMode_Back = 0x00000002, + WGPUCullMode_Force32 = 0x7FFFFFFF +} WGPUCullMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUDeviceLostReason { + WGPUDeviceLostReason_Unknown = 0x00000001, + WGPUDeviceLostReason_Destroyed = 0x00000002, + WGPUDeviceLostReason_Force32 = 0x7FFFFFFF +} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUErrorFilter { + WGPUErrorFilter_Validation = 0x00000000, + WGPUErrorFilter_OutOfMemory = 0x00000001, + WGPUErrorFilter_Internal = 0x00000002, + 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_Nearest = 0x00000000, + WGPUFilterMode_Linear = 0x00000001, + WGPUFilterMode_Force32 = 0x7FFFFFFF +} WGPUFilterMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUFrontFace { + WGPUFrontFace_CCW = 0x00000000, + WGPUFrontFace_CW = 0x00000001, + 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_Nearest = 0x00000000, + WGPUMipmapFilterMode_Linear = 0x00000001, + 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 = 0x00000000, + WGPUPresentMode_FifoRelaxed = 0x00000001, + WGPUPresentMode_Immediate = 0x00000002, + WGPUPresentMode_Mailbox = 0x00000003, + WGPUPresentMode_Force32 = 0x7FFFFFFF +} WGPUPresentMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUPrimitiveTopology { + WGPUPrimitiveTopology_PointList = 0x00000000, + WGPUPrimitiveTopology_LineList = 0x00000001, + WGPUPrimitiveTopology_LineStrip = 0x00000002, + WGPUPrimitiveTopology_TriangleList = 0x00000003, + WGPUPrimitiveTopology_TriangleStrip = 0x00000004, + WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF +} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUQueryType { + WGPUQueryType_Occlusion = 0x00000000, + WGPUQueryType_Timestamp = 0x00000001, + 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_SurfaceDescriptorFromMetalLayer = 0x00000001, + WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002, + WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003, + WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, + WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, + WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, + WGPUSType_PrimitiveDepthClipControl = 0x00000007, + WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008, + WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009, + WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A, + WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, + 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_Keep = 0x00000000, + WGPUStencilOperation_Zero = 0x00000001, + WGPUStencilOperation_Replace = 0x00000002, + WGPUStencilOperation_Invert = 0x00000003, + WGPUStencilOperation_IncrementClamp = 0x00000004, + WGPUStencilOperation_DecrementClamp = 0x00000005, + WGPUStencilOperation_IncrementWrap = 0x00000006, + WGPUStencilOperation_DecrementWrap = 0x00000007, + 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_All = 0x00000000, + WGPUTextureAspect_StencilOnly = 0x00000001, + WGPUTextureAspect_DepthOnly = 0x00000002, + WGPUTextureAspect_Force32 = 0x7FFFFFFF +} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureDimension { + WGPUTextureDimension_1D = 0x00000000, + WGPUTextureDimension_2D = 0x00000001, + WGPUTextureDimension_3D = 0x00000002, + 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_Force32 = 0x7FFFFFFF +} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUVertexStepMode { + WGPUVertexStepMode_Vertex = 0x00000000, + WGPUVertexStepMode_Instance = 0x00000001, + WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002, + WGPUVertexStepMode_Force32 = 0x7FFFFFFF +} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; + +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; + + +/** @} */ + +/** + * \defgroup Bitflags + * \brief Enum used as bit flags. + * + * @{ + */ +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 = WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha, + 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 (*WGPUProc)(void) 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; + +/** + * \defgroup Callbacks + * \brief Callbacks through which asynchronous functions return. + * + * @{ + */ + +typedef void (*WGPUAdapterRequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUBufferMapAsyncCallback)(WGPUBufferMapAsyncStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUInstanceRequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUQueueOnSubmittedWorkDoneCallback)(WGPUQueueWorkDoneStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUShaderModuleGetCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; + + +/** @} */ +/** + * \defgroup ChainedStructures Chained Structures + * \brief Structures used to extend descriptors. + * + * @{ + */ + +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; + +/** @} */ + + +/** + * \defgroup Structures + * \brief Descriptors and other transparent structures. + * + * @{ + */ +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 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 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 WGPUInstanceDescriptor { + WGPUChainedStruct const * nextInChain; +} WGPUInstanceDescriptor 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; + +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 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; + +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 WGPURequestAdapterOptions { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE WGPUSurface compatibleSurface; + WGPUPowerPreference powerPreference; + WGPUBackendType backendType; + WGPUBool forceFallbackAdapter; +} 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; + +typedef struct WGPUShaderModuleCompilationHint { + WGPUChainedStruct const * nextInChain; + char const * entryPoint; + WGPUPipelineLayout layout; +} WGPUShaderModuleCompilationHint WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderModuleSPIRVDescriptor { + WGPUChainedStruct chain; + uint32_t codeSize; + uint32_t const * code; +} WGPUShaderModuleSPIRVDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderModuleWGSLDescriptor { + WGPUChainedStruct chain; + char const * code; +} WGPUShaderModuleWGSLDescriptor 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; + WGPUTextureUsageFlags usages; + 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; + +typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { + WGPUChainedStruct chain; + void * window; +} WGPUSurfaceDescriptorFromAndroidNativeWindow WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { + WGPUChainedStruct chain; + char const * selector; +} WGPUSurfaceDescriptorFromCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromMetalLayer { + WGPUChainedStruct chain; + void * layer; +} WGPUSurfaceDescriptorFromMetalLayer WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromWaylandSurface { + WGPUChainedStruct chain; + void * display; + void * surface; +} WGPUSurfaceDescriptorFromWaylandSurface WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromWindowsHWND { + WGPUChainedStruct chain; + void * hinstance; + void * hwnd; +} WGPUSurfaceDescriptorFromWindowsHWND WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromXcbWindow { + WGPUChainedStruct chain; + void * connection; + uint32_t window; +} WGPUSurfaceDescriptorFromXcbWindow WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptorFromXlibWindow { + WGPUChainedStruct chain; + void * display; + uint64_t window; +} WGPUSurfaceDescriptorFromXlibWindow WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceTexture { + WGPUTexture texture; + WGPUBool suboptimal; + WGPUSurfaceGetCurrentTextureStatus status; +} WGPUSurfaceTexture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUTextureBindingLayout { + WGPUChainedStruct const * nextInChain; + WGPUTextureSampleType sampleType; + WGPUTextureViewDimension viewDimension; + WGPUBool multisampled; +} WGPUTextureBindingLayout 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 WGPUUncapturedErrorCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUErrorCallback callback; + void * userdata; +} WGPUUncapturedErrorCallbackInfo 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 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 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 WGPUShaderModuleDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t hintCount; + WGPUShaderModuleCompilationHint const * hints; +} WGPUShaderModuleDescriptor 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; + WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo; +} 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; + +/** @} */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(WGPU_SKIP_PROCS) + +typedef WGPUInstance (*WGPUProcCreateInstance)(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) 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 WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPUAdapterRequestDeviceCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of AdapterInfo +typedef void (*WGPUProcAdapterInfoFreeMembers)(WGPUAdapterInfo adapterInfo) 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, WGPUBufferMapAsyncCallback callback, WGPU_NULLABLE 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 (*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, WGPUDeviceCreateComputePipelineAsyncCallback callback, WGPU_NULLABLE 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, WGPUDeviceCreateRenderPipelineAsyncCallback callback, WGPU_NULLABLE 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 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 (*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, WGPUInstanceRequestAdapterCallback callback, WGPU_NULLABLE void * userdata) 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, WGPUQueueOnSubmittedWorkDoneCallback callback, WGPU_NULLABLE 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 (*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, WGPUShaderModuleGetCompilationInfoCallback callback, WGPU_NULLABLE 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 void (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, char const * label) 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 SurfaceCapabilities +typedef void (*WGPUProcSurfaceCapabilitiesFreeMembers)(WGPUSurfaceCapabilities surfaceCapabilities) 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) +/** + * \defgroup GlobalFunctions Global Functions + * \brief Functions that are not specific to an object. + * + * @{ + */ +WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; + + +/** @} */ + +/** + * \defgroup Methods + * \brief Functions that are relative to a specific object. + * + * @{ + */ + +/** + * \defgroup WGPUAdapterMethods WGPUAdapter methods + * \brief Functions whose first argument has type WGPUAdapter. + * + * @{ + */ +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 WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPUAdapterRequestDeviceCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUAdapterInfoMethods WGPUAdapterInfo methods + * \brief Functions whose first argument has type WGPUAdapterInfo. + * + * @{ + */ +WGPU_EXPORT void wgpuAdapterInfoFreeMembers(WGPUAdapterInfo adapterInfo) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUBindGroupMethods WGPUBindGroup methods + * \brief Functions whose first argument has type WGPUBindGroup. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUBindGroupLayoutMethods WGPUBindGroupLayout methods + * \brief Functions whose first argument has type WGPUBindGroupLayout. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUBufferMethods WGPUBuffer methods + * \brief Functions whose first argument has type WGPUBuffer. + * + * @{ + */ +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, WGPUBufferMapAsyncCallback callback, WGPU_NULLABLE 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; +/** @} */ + + + +/** + * \defgroup WGPUCommandBufferMethods WGPUCommandBuffer methods + * \brief Functions whose first argument has type WGPUCommandBuffer. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUCommandEncoderMethods WGPUCommandEncoder methods + * \brief Functions whose first argument has type WGPUCommandEncoder. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUComputePassEncoderMethods WGPUComputePassEncoder methods + * \brief Functions whose first argument has type WGPUComputePassEncoder. + * + * @{ + */ +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 wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUComputePipelineMethods WGPUComputePipeline methods + * \brief Functions whose first argument has type WGPUComputePipeline. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUDeviceMethods WGPUDevice methods + * \brief Functions whose first argument has type WGPUDevice. + * + * @{ + */ +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, WGPUDeviceCreateComputePipelineAsyncCallback callback, WGPU_NULLABLE 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, WGPUDeviceCreateRenderPipelineAsyncCallback callback, WGPU_NULLABLE 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 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 wgpuDeviceReference(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUInstanceMethods WGPUInstance methods + * \brief Functions whose first argument has type WGPUInstance. + * + * @{ + */ +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, WGPUInstanceRequestAdapterCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUPipelineLayoutMethods WGPUPipelineLayout methods + * \brief Functions whose first argument has type WGPUPipelineLayout. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUQuerySetMethods WGPUQuerySet methods + * \brief Functions whose first argument has type WGPUQuerySet. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUQueueMethods WGPUQueue methods + * \brief Functions whose first argument has type WGPUQueue. + * + * @{ + */ +WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueOnSubmittedWorkDoneCallback callback, WGPU_NULLABLE 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; +/** @} */ + + + +/** + * \defgroup WGPURenderBundleMethods WGPURenderBundle methods + * \brief Functions whose first argument has type WGPURenderBundle. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPURenderBundleEncoderMethods WGPURenderBundleEncoder methods + * \brief Functions whose first argument has type WGPURenderBundleEncoder. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPURenderPassEncoderMethods WGPURenderPassEncoder methods + * \brief Functions whose first argument has type WGPURenderPassEncoder. + * + * @{ + */ +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 wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPURenderPipelineMethods WGPURenderPipeline methods + * \brief Functions whose first argument has type WGPURenderPipeline. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUSamplerMethods WGPUSampler methods + * \brief Functions whose first argument has type WGPUSampler. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUShaderModuleMethods WGPUShaderModule methods + * \brief Functions whose first argument has type WGPUShaderModule. + * + * @{ + */ +WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUShaderModuleGetCompilationInfoCallback callback, WGPU_NULLABLE 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; +/** @} */ + + + +/** + * \defgroup WGPUSurfaceMethods WGPUSurface methods + * \brief Functions whose first argument has type WGPUSurface. + * + * @{ + */ +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 void wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceSetLabel(WGPUSurface surface, char const * label) 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; +/** @} */ + + + +/** + * \defgroup WGPUSurfaceCapabilitiesMethods WGPUSurfaceCapabilities methods + * \brief Functions whose first argument has type WGPUSurfaceCapabilities. + * + * @{ + */ +WGPU_EXPORT void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities) WGPU_FUNCTION_ATTRIBUTE; +/** @} */ + + + +/** + * \defgroup WGPUTextureMethods WGPUTexture methods + * \brief Functions whose first argument has type WGPUTexture. + * + * @{ + */ +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; +/** @} */ + + + +/** + * \defgroup WGPUTextureViewMethods WGPUTextureView methods + * \brief Functions whose first argument has type WGPUTextureView. + * + * @{ + */ +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) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBGPU_H_ diff --git a/wgpu-native/include/webgpu/webgpu.hpp b/wgpu-native/include/webgpu/webgpu.hpp deleted file mode 100644 index 3fab28f..0000000 --- a/wgpu-native/include/webgpu/webgpu.hpp +++ /dev/null @@ -1,2962 +0,0 @@ -/** - * This file is part of the "Learn WebGPU for C++" book. - * https://github.com/eliemichel/LearnWebGPU - * - * MIT License - * Copyright (c) 2022 Elie Michel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - * Exactly one of your source files must #define WEBGPU_CPP_IMPLEMENTATION - * before including this header. - * - * NB: This file has been generated by the webgpu-cpp generator - * (see https://github.com/eliemichel/webgpu-cpp ) - */ - -#pragma once - -#include -#include - -#include -#include -#include -#include -#include - -#if __EMSCRIPTEN__ -#include -#endif - -#ifdef _MSVC_LANG -# if _MSVC_LANG >= 202002L -# define NO_DISCARD [[nodiscard("You should keep this handle alive for as long as the callback may get invoked.")]] -# elif _MSVC_LANG >= 201703L -# define NO_DISCARD [[nodiscard]] -# else -# define NO_DISCARD -# endif -#else -# if __cplusplus >= 202002L -# define NO_DISCARD [[nodiscard("You should keep this handle alive for as long as the callback may get invoked.")]] -# elif __cplusplus >= 201703L -# define NO_DISCARD [[nodiscard]] -# else -# define NO_DISCARD -# endif -#endif - -/** - * A namespace providing a more C++ idiomatic API to WebGPU. - */ -namespace wgpu { - -struct DefaultFlag {}; -constexpr DefaultFlag Default; - -#define HANDLE(Type) \ -class Type { \ -public: \ - typedef Type S; /* S == Self */ \ - typedef WGPU ## Type W; /* W == WGPU Type */ \ - Type() : m_raw(nullptr) {} \ - Type(const W& w) : m_raw(w) {} \ - operator W&() { return m_raw; } \ - operator const W&() const { return m_raw; } \ - operator bool() const { return m_raw != nullptr; } \ - bool operator==(const Type& other) const { return m_raw == other.m_raw; } \ - bool operator!=(const Type& other) const { return m_raw != other.m_raw; } \ - bool operator==(const W& other) const { return m_raw == other; } \ - bool operator!=(const W& other) const { return m_raw != other; } \ - friend auto operator<<(std::ostream &stream, const S& self) -> std::ostream & { \ - return stream << ""; \ - } \ -private: \ - W m_raw; \ -public: - -#define DESCRIPTOR(Type) \ -struct Type : public WGPU ## Type { \ -public: \ - typedef Type S; /* S == Self */ \ - typedef WGPU ## Type W; /* W == WGPU Type */ \ - Type() : W() { nextInChain = nullptr; } \ - Type(const W &other) : W(other) { nextInChain = nullptr; } \ - Type(const DefaultFlag &) : W() { setDefault(); } \ - Type& operator=(const DefaultFlag &) { setDefault(); return *this; } \ - friend auto operator<<(std::ostream &stream, const S&) -> std::ostream & { \ - return stream << ""; \ - } \ -public: - -#define STRUCT(Type) \ -struct Type : public WGPU ## Type { \ -public: \ - typedef Type S; /* S == Self */ \ - typedef WGPU ## Type W; /* W == WGPU Type */ \ - Type() : W() {} \ - Type(const W &other) : W(other) {} \ - Type(const DefaultFlag &) : W() { setDefault(); } \ - Type& operator=(const DefaultFlag &) { setDefault(); return *this; } \ - friend auto operator<<(std::ostream &stream, const S&) -> std::ostream & { \ - return stream << ""; \ - } \ -public: - -#define ENUM(Type) \ -class Type { \ -public: \ - typedef Type S; /* S == Self */ \ - typedef WGPU ## Type W; /* W == WGPU Type */ \ - Type(const W& w) : m_raw(w) {} \ - operator W() const { return m_raw; } \ -private: \ - W m_raw; \ -public: - -#define ENUM_ENTRY(Name, Value) \ - static constexpr W Name = (W)Value; - -#define END }; - - - -// Other type aliases -using Flags = uint32_t; -using Bool = uint32_t; -using BufferUsageFlags = WGPUFlags; -using ColorWriteMaskFlags = WGPUFlags; -using MapModeFlags = WGPUFlags; -using ShaderStageFlags = WGPUFlags; -using TextureUsageFlags = WGPUFlags; -using InstanceBackendFlags = WGPUFlags; -using InstanceFlags = WGPUFlags; -using SubmissionIndex = uint64_t; - -// Enumerations -ENUM(AdapterType) - ENUM_ENTRY(DiscreteGPU, 0x00000000) - ENUM_ENTRY(IntegratedGPU, 0x00000001) - ENUM_ENTRY(CPU, 0x00000002) - ENUM_ENTRY(Unknown, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(AddressMode) - ENUM_ENTRY(Repeat, 0x00000000) - ENUM_ENTRY(MirrorRepeat, 0x00000001) - ENUM_ENTRY(ClampToEdge, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BackendType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Null, 0x00000001) - ENUM_ENTRY(WebGPU, 0x00000002) - ENUM_ENTRY(D3D11, 0x00000003) - ENUM_ENTRY(D3D12, 0x00000004) - ENUM_ENTRY(Metal, 0x00000005) - ENUM_ENTRY(Vulkan, 0x00000006) - ENUM_ENTRY(OpenGL, 0x00000007) - ENUM_ENTRY(OpenGLES, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BlendFactor) - ENUM_ENTRY(Zero, 0x00000000) - ENUM_ENTRY(One, 0x00000001) - ENUM_ENTRY(Src, 0x00000002) - ENUM_ENTRY(OneMinusSrc, 0x00000003) - ENUM_ENTRY(SrcAlpha, 0x00000004) - ENUM_ENTRY(OneMinusSrcAlpha, 0x00000005) - ENUM_ENTRY(Dst, 0x00000006) - ENUM_ENTRY(OneMinusDst, 0x00000007) - ENUM_ENTRY(DstAlpha, 0x00000008) - ENUM_ENTRY(OneMinusDstAlpha, 0x00000009) - ENUM_ENTRY(SrcAlphaSaturated, 0x0000000A) - ENUM_ENTRY(Constant, 0x0000000B) - ENUM_ENTRY(OneMinusConstant, 0x0000000C) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BlendOperation) - ENUM_ENTRY(Add, 0x00000000) - ENUM_ENTRY(Subtract, 0x00000001) - ENUM_ENTRY(ReverseSubtract, 0x00000002) - ENUM_ENTRY(Min, 0x00000003) - ENUM_ENTRY(Max, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BufferBindingType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Uniform, 0x00000001) - ENUM_ENTRY(Storage, 0x00000002) - ENUM_ENTRY(ReadOnlyStorage, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BufferMapAsyncStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(ValidationError, 0x00000001) - ENUM_ENTRY(Unknown, 0x00000002) - ENUM_ENTRY(DeviceLost, 0x00000003) - ENUM_ENTRY(DestroyedBeforeCallback, 0x00000004) - ENUM_ENTRY(UnmappedBeforeCallback, 0x00000005) - ENUM_ENTRY(MappingAlreadyPending, 0x00000006) - ENUM_ENTRY(OffsetOutOfRange, 0x00000007) - ENUM_ENTRY(SizeOutOfRange, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BufferMapState) - ENUM_ENTRY(Unmapped, 0x00000000) - ENUM_ENTRY(Pending, 0x00000001) - ENUM_ENTRY(Mapped, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CompareFunction) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Never, 0x00000001) - ENUM_ENTRY(Less, 0x00000002) - ENUM_ENTRY(LessEqual, 0x00000003) - ENUM_ENTRY(Greater, 0x00000004) - ENUM_ENTRY(GreaterEqual, 0x00000005) - ENUM_ENTRY(Equal, 0x00000006) - ENUM_ENTRY(NotEqual, 0x00000007) - ENUM_ENTRY(Always, 0x00000008) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CompilationInfoRequestStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(Error, 0x00000001) - ENUM_ENTRY(DeviceLost, 0x00000002) - ENUM_ENTRY(Unknown, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CompilationMessageType) - ENUM_ENTRY(Error, 0x00000000) - ENUM_ENTRY(Warning, 0x00000001) - ENUM_ENTRY(Info, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CompositeAlphaMode) - ENUM_ENTRY(Auto, 0x00000000) - ENUM_ENTRY(Opaque, 0x00000001) - ENUM_ENTRY(Premultiplied, 0x00000002) - ENUM_ENTRY(Unpremultiplied, 0x00000003) - ENUM_ENTRY(Inherit, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CreatePipelineAsyncStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(ValidationError, 0x00000001) - ENUM_ENTRY(InternalError, 0x00000002) - ENUM_ENTRY(DeviceLost, 0x00000003) - ENUM_ENTRY(DeviceDestroyed, 0x00000004) - ENUM_ENTRY(Unknown, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(CullMode) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(Front, 0x00000001) - ENUM_ENTRY(Back, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(DeviceLostReason) - ENUM_ENTRY(Unknown, 0x00000001) - ENUM_ENTRY(Destroyed, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(ErrorFilter) - ENUM_ENTRY(Validation, 0x00000000) - ENUM_ENTRY(OutOfMemory, 0x00000001) - ENUM_ENTRY(Internal, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(ErrorType) - ENUM_ENTRY(NoError, 0x00000000) - ENUM_ENTRY(Validation, 0x00000001) - ENUM_ENTRY(OutOfMemory, 0x00000002) - ENUM_ENTRY(Internal, 0x00000003) - ENUM_ENTRY(Unknown, 0x00000004) - ENUM_ENTRY(DeviceLost, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(FeatureName) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(DepthClipControl, 0x00000001) - ENUM_ENTRY(Depth32FloatStencil8, 0x00000002) - ENUM_ENTRY(TimestampQuery, 0x00000003) - ENUM_ENTRY(TextureCompressionBC, 0x00000004) - ENUM_ENTRY(TextureCompressionETC2, 0x00000005) - ENUM_ENTRY(TextureCompressionASTC, 0x00000006) - ENUM_ENTRY(IndirectFirstInstance, 0x00000007) - ENUM_ENTRY(ShaderF16, 0x00000008) - ENUM_ENTRY(RG11B10UfloatRenderable, 0x00000009) - ENUM_ENTRY(BGRA8UnormStorage, 0x0000000A) - ENUM_ENTRY(Float32Filterable, 0x0000000B) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(FilterMode) - ENUM_ENTRY(Nearest, 0x00000000) - ENUM_ENTRY(Linear, 0x00000001) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(FrontFace) - ENUM_ENTRY(CCW, 0x00000000) - ENUM_ENTRY(CW, 0x00000001) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(IndexFormat) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Uint16, 0x00000001) - ENUM_ENTRY(Uint32, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(LoadOp) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Clear, 0x00000001) - ENUM_ENTRY(Load, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(MipmapFilterMode) - ENUM_ENTRY(Nearest, 0x00000000) - ENUM_ENTRY(Linear, 0x00000001) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(PowerPreference) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(LowPower, 0x00000001) - ENUM_ENTRY(HighPerformance, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(PresentMode) - ENUM_ENTRY(Fifo, 0x00000000) - ENUM_ENTRY(FifoRelaxed, 0x00000001) - ENUM_ENTRY(Immediate, 0x00000002) - ENUM_ENTRY(Mailbox, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(PrimitiveTopology) - ENUM_ENTRY(PointList, 0x00000000) - ENUM_ENTRY(LineList, 0x00000001) - ENUM_ENTRY(LineStrip, 0x00000002) - ENUM_ENTRY(TriangleList, 0x00000003) - ENUM_ENTRY(TriangleStrip, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(QueryType) - ENUM_ENTRY(Occlusion, 0x00000000) - ENUM_ENTRY(Timestamp, 0x00000001) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(QueueWorkDoneStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(Error, 0x00000001) - ENUM_ENTRY(Unknown, 0x00000002) - ENUM_ENTRY(DeviceLost, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(RequestAdapterStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(Unavailable, 0x00000001) - ENUM_ENTRY(Error, 0x00000002) - ENUM_ENTRY(Unknown, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(RequestDeviceStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(Error, 0x00000001) - ENUM_ENTRY(Unknown, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(SType) - ENUM_ENTRY(Invalid, 0x00000000) - ENUM_ENTRY(SurfaceDescriptorFromMetalLayer, 0x00000001) - ENUM_ENTRY(SurfaceDescriptorFromWindowsHWND, 0x00000002) - ENUM_ENTRY(SurfaceDescriptorFromXlibWindow, 0x00000003) - ENUM_ENTRY(SurfaceDescriptorFromCanvasHTMLSelector, 0x00000004) - ENUM_ENTRY(ShaderModuleSPIRVDescriptor, 0x00000005) - ENUM_ENTRY(ShaderModuleWGSLDescriptor, 0x00000006) - ENUM_ENTRY(PrimitiveDepthClipControl, 0x00000007) - ENUM_ENTRY(SurfaceDescriptorFromWaylandSurface, 0x00000008) - ENUM_ENTRY(SurfaceDescriptorFromAndroidNativeWindow, 0x00000009) - ENUM_ENTRY(SurfaceDescriptorFromXcbWindow, 0x0000000A) - ENUM_ENTRY(RenderPassDescriptorMaxDrawCount, 0x0000000F) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(SamplerBindingType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Filtering, 0x00000001) - ENUM_ENTRY(NonFiltering, 0x00000002) - ENUM_ENTRY(Comparison, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(StencilOperation) - ENUM_ENTRY(Keep, 0x00000000) - ENUM_ENTRY(Zero, 0x00000001) - ENUM_ENTRY(Replace, 0x00000002) - ENUM_ENTRY(Invert, 0x00000003) - ENUM_ENTRY(IncrementClamp, 0x00000004) - ENUM_ENTRY(DecrementClamp, 0x00000005) - ENUM_ENTRY(IncrementWrap, 0x00000006) - ENUM_ENTRY(DecrementWrap, 0x00000007) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(StorageTextureAccess) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(WriteOnly, 0x00000001) - ENUM_ENTRY(ReadOnly, 0x00000002) - ENUM_ENTRY(ReadWrite, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(StoreOp) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Store, 0x00000001) - ENUM_ENTRY(Discard, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(SurfaceGetCurrentTextureStatus) - ENUM_ENTRY(Success, 0x00000000) - ENUM_ENTRY(Timeout, 0x00000001) - ENUM_ENTRY(Outdated, 0x00000002) - ENUM_ENTRY(Lost, 0x00000003) - ENUM_ENTRY(OutOfMemory, 0x00000004) - ENUM_ENTRY(DeviceLost, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureAspect) - ENUM_ENTRY(All, 0x00000000) - ENUM_ENTRY(StencilOnly, 0x00000001) - ENUM_ENTRY(DepthOnly, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureDimension) - ENUM_ENTRY(_1D, 0x00000000) - ENUM_ENTRY(_2D, 0x00000001) - ENUM_ENTRY(_3D, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureFormat) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(R8Unorm, 0x00000001) - ENUM_ENTRY(R8Snorm, 0x00000002) - ENUM_ENTRY(R8Uint, 0x00000003) - ENUM_ENTRY(R8Sint, 0x00000004) - ENUM_ENTRY(R16Uint, 0x00000005) - ENUM_ENTRY(R16Sint, 0x00000006) - ENUM_ENTRY(R16Float, 0x00000007) - ENUM_ENTRY(RG8Unorm, 0x00000008) - ENUM_ENTRY(RG8Snorm, 0x00000009) - ENUM_ENTRY(RG8Uint, 0x0000000A) - ENUM_ENTRY(RG8Sint, 0x0000000B) - ENUM_ENTRY(R32Float, 0x0000000C) - ENUM_ENTRY(R32Uint, 0x0000000D) - ENUM_ENTRY(R32Sint, 0x0000000E) - ENUM_ENTRY(RG16Uint, 0x0000000F) - ENUM_ENTRY(RG16Sint, 0x00000010) - ENUM_ENTRY(RG16Float, 0x00000011) - ENUM_ENTRY(RGBA8Unorm, 0x00000012) - ENUM_ENTRY(RGBA8UnormSrgb, 0x00000013) - ENUM_ENTRY(RGBA8Snorm, 0x00000014) - ENUM_ENTRY(RGBA8Uint, 0x00000015) - ENUM_ENTRY(RGBA8Sint, 0x00000016) - ENUM_ENTRY(BGRA8Unorm, 0x00000017) - ENUM_ENTRY(BGRA8UnormSrgb, 0x00000018) - ENUM_ENTRY(RGB10A2Uint, 0x00000019) - ENUM_ENTRY(RGB10A2Unorm, 0x0000001A) - ENUM_ENTRY(RG11B10Ufloat, 0x0000001B) - ENUM_ENTRY(RGB9E5Ufloat, 0x0000001C) - ENUM_ENTRY(RG32Float, 0x0000001D) - ENUM_ENTRY(RG32Uint, 0x0000001E) - ENUM_ENTRY(RG32Sint, 0x0000001F) - ENUM_ENTRY(RGBA16Uint, 0x00000020) - ENUM_ENTRY(RGBA16Sint, 0x00000021) - ENUM_ENTRY(RGBA16Float, 0x00000022) - ENUM_ENTRY(RGBA32Float, 0x00000023) - ENUM_ENTRY(RGBA32Uint, 0x00000024) - ENUM_ENTRY(RGBA32Sint, 0x00000025) - ENUM_ENTRY(Stencil8, 0x00000026) - ENUM_ENTRY(Depth16Unorm, 0x00000027) - ENUM_ENTRY(Depth24Plus, 0x00000028) - ENUM_ENTRY(Depth24PlusStencil8, 0x00000029) - ENUM_ENTRY(Depth32Float, 0x0000002A) - ENUM_ENTRY(Depth32FloatStencil8, 0x0000002B) - ENUM_ENTRY(BC1RGBAUnorm, 0x0000002C) - ENUM_ENTRY(BC1RGBAUnormSrgb, 0x0000002D) - ENUM_ENTRY(BC2RGBAUnorm, 0x0000002E) - ENUM_ENTRY(BC2RGBAUnormSrgb, 0x0000002F) - ENUM_ENTRY(BC3RGBAUnorm, 0x00000030) - ENUM_ENTRY(BC3RGBAUnormSrgb, 0x00000031) - ENUM_ENTRY(BC4RUnorm, 0x00000032) - ENUM_ENTRY(BC4RSnorm, 0x00000033) - ENUM_ENTRY(BC5RGUnorm, 0x00000034) - ENUM_ENTRY(BC5RGSnorm, 0x00000035) - ENUM_ENTRY(BC6HRGBUfloat, 0x00000036) - ENUM_ENTRY(BC6HRGBFloat, 0x00000037) - ENUM_ENTRY(BC7RGBAUnorm, 0x00000038) - ENUM_ENTRY(BC7RGBAUnormSrgb, 0x00000039) - ENUM_ENTRY(ETC2RGB8Unorm, 0x0000003A) - ENUM_ENTRY(ETC2RGB8UnormSrgb, 0x0000003B) - ENUM_ENTRY(ETC2RGB8A1Unorm, 0x0000003C) - ENUM_ENTRY(ETC2RGB8A1UnormSrgb, 0x0000003D) - ENUM_ENTRY(ETC2RGBA8Unorm, 0x0000003E) - ENUM_ENTRY(ETC2RGBA8UnormSrgb, 0x0000003F) - ENUM_ENTRY(EACR11Unorm, 0x00000040) - ENUM_ENTRY(EACR11Snorm, 0x00000041) - ENUM_ENTRY(EACRG11Unorm, 0x00000042) - ENUM_ENTRY(EACRG11Snorm, 0x00000043) - ENUM_ENTRY(ASTC4x4Unorm, 0x00000044) - ENUM_ENTRY(ASTC4x4UnormSrgb, 0x00000045) - ENUM_ENTRY(ASTC5x4Unorm, 0x00000046) - ENUM_ENTRY(ASTC5x4UnormSrgb, 0x00000047) - ENUM_ENTRY(ASTC5x5Unorm, 0x00000048) - ENUM_ENTRY(ASTC5x5UnormSrgb, 0x00000049) - ENUM_ENTRY(ASTC6x5Unorm, 0x0000004A) - ENUM_ENTRY(ASTC6x5UnormSrgb, 0x0000004B) - ENUM_ENTRY(ASTC6x6Unorm, 0x0000004C) - ENUM_ENTRY(ASTC6x6UnormSrgb, 0x0000004D) - ENUM_ENTRY(ASTC8x5Unorm, 0x0000004E) - ENUM_ENTRY(ASTC8x5UnormSrgb, 0x0000004F) - ENUM_ENTRY(ASTC8x6Unorm, 0x00000050) - ENUM_ENTRY(ASTC8x6UnormSrgb, 0x00000051) - ENUM_ENTRY(ASTC8x8Unorm, 0x00000052) - ENUM_ENTRY(ASTC8x8UnormSrgb, 0x00000053) - ENUM_ENTRY(ASTC10x5Unorm, 0x00000054) - ENUM_ENTRY(ASTC10x5UnormSrgb, 0x00000055) - ENUM_ENTRY(ASTC10x6Unorm, 0x00000056) - ENUM_ENTRY(ASTC10x6UnormSrgb, 0x00000057) - ENUM_ENTRY(ASTC10x8Unorm, 0x00000058) - ENUM_ENTRY(ASTC10x8UnormSrgb, 0x00000059) - ENUM_ENTRY(ASTC10x10Unorm, 0x0000005A) - ENUM_ENTRY(ASTC10x10UnormSrgb, 0x0000005B) - ENUM_ENTRY(ASTC12x10Unorm, 0x0000005C) - ENUM_ENTRY(ASTC12x10UnormSrgb, 0x0000005D) - ENUM_ENTRY(ASTC12x12Unorm, 0x0000005E) - ENUM_ENTRY(ASTC12x12UnormSrgb, 0x0000005F) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureSampleType) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Float, 0x00000001) - ENUM_ENTRY(UnfilterableFloat, 0x00000002) - ENUM_ENTRY(Depth, 0x00000003) - ENUM_ENTRY(Sint, 0x00000004) - ENUM_ENTRY(Uint, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureViewDimension) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(_1D, 0x00000001) - ENUM_ENTRY(_2D, 0x00000002) - ENUM_ENTRY(_2DArray, 0x00000003) - ENUM_ENTRY(Cube, 0x00000004) - ENUM_ENTRY(CubeArray, 0x00000005) - ENUM_ENTRY(_3D, 0x00000006) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(VertexFormat) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Uint8x2, 0x00000001) - ENUM_ENTRY(Uint8x4, 0x00000002) - ENUM_ENTRY(Sint8x2, 0x00000003) - ENUM_ENTRY(Sint8x4, 0x00000004) - ENUM_ENTRY(Unorm8x2, 0x00000005) - ENUM_ENTRY(Unorm8x4, 0x00000006) - ENUM_ENTRY(Snorm8x2, 0x00000007) - ENUM_ENTRY(Snorm8x4, 0x00000008) - ENUM_ENTRY(Uint16x2, 0x00000009) - ENUM_ENTRY(Uint16x4, 0x0000000A) - ENUM_ENTRY(Sint16x2, 0x0000000B) - ENUM_ENTRY(Sint16x4, 0x0000000C) - ENUM_ENTRY(Unorm16x2, 0x0000000D) - ENUM_ENTRY(Unorm16x4, 0x0000000E) - ENUM_ENTRY(Snorm16x2, 0x0000000F) - ENUM_ENTRY(Snorm16x4, 0x00000010) - ENUM_ENTRY(Float16x2, 0x00000011) - ENUM_ENTRY(Float16x4, 0x00000012) - ENUM_ENTRY(Float32, 0x00000013) - ENUM_ENTRY(Float32x2, 0x00000014) - ENUM_ENTRY(Float32x3, 0x00000015) - ENUM_ENTRY(Float32x4, 0x00000016) - ENUM_ENTRY(Uint32, 0x00000017) - ENUM_ENTRY(Uint32x2, 0x00000018) - ENUM_ENTRY(Uint32x3, 0x00000019) - ENUM_ENTRY(Uint32x4, 0x0000001A) - ENUM_ENTRY(Sint32, 0x0000001B) - ENUM_ENTRY(Sint32x2, 0x0000001C) - ENUM_ENTRY(Sint32x3, 0x0000001D) - ENUM_ENTRY(Sint32x4, 0x0000001E) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(VertexStepMode) - ENUM_ENTRY(Vertex, 0x00000000) - ENUM_ENTRY(Instance, 0x00000001) - ENUM_ENTRY(VertexBufferNotUsed, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(WGSLFeatureName) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(ReadonlyAndReadwriteStorageTextures, 0x00000001) - ENUM_ENTRY(Packed4x8IntegerDotProduct, 0x00000002) - ENUM_ENTRY(UnrestrictedPointerParameters, 0x00000003) - ENUM_ENTRY(PointerCompositeAccess, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(BufferUsage) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(MapRead, 0x00000001) - ENUM_ENTRY(MapWrite, 0x00000002) - ENUM_ENTRY(CopySrc, 0x00000004) - ENUM_ENTRY(CopyDst, 0x00000008) - ENUM_ENTRY(Index, 0x00000010) - ENUM_ENTRY(Vertex, 0x00000020) - ENUM_ENTRY(Uniform, 0x00000040) - ENUM_ENTRY(Storage, 0x00000080) - ENUM_ENTRY(Indirect, 0x00000100) - ENUM_ENTRY(QueryResolve, 0x00000200) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(ColorWriteMask) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(Red, 0x00000001) - ENUM_ENTRY(Green, 0x00000002) - ENUM_ENTRY(Blue, 0x00000004) - ENUM_ENTRY(Alpha, 0x00000008) - ENUM_ENTRY(All, WGPUColorWriteMask_None) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(MapMode) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(Read, 0x00000001) - ENUM_ENTRY(Write, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(ShaderStage) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(Vertex, 0x00000001) - ENUM_ENTRY(Fragment, 0x00000002) - ENUM_ENTRY(Compute, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(TextureUsage) - ENUM_ENTRY(None, 0x00000000) - ENUM_ENTRY(CopySrc, 0x00000001) - ENUM_ENTRY(CopyDst, 0x00000002) - ENUM_ENTRY(TextureBinding, 0x00000004) - ENUM_ENTRY(StorageBinding, 0x00000008) - ENUM_ENTRY(RenderAttachment, 0x00000010) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(NativeSType) - ENUM_ENTRY(DeviceExtras, 0x00030001) - ENUM_ENTRY(RequiredLimitsExtras, 0x00030002) - ENUM_ENTRY(PipelineLayoutExtras, 0x00030003) - ENUM_ENTRY(ShaderModuleGLSLDescriptor, 0x00030004) - ENUM_ENTRY(SupportedLimitsExtras, 0x00030005) - ENUM_ENTRY(InstanceExtras, 0x00030006) - ENUM_ENTRY(BindGroupEntryExtras, 0x00030007) - ENUM_ENTRY(BindGroupLayoutEntryExtras, 0x00030008) - ENUM_ENTRY(QuerySetDescriptorExtras, 0x00030009) - ENUM_ENTRY(SurfaceConfigurationExtras, 0x0003000A) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(NativeFeature) - ENUM_ENTRY(PushConstants, 0x00030001) - ENUM_ENTRY(TextureAdapterSpecificFormatFeatures, 0x00030002) - ENUM_ENTRY(MultiDrawIndirect, 0x00030003) - ENUM_ENTRY(MultiDrawIndirectCount, 0x00030004) - ENUM_ENTRY(VertexWritableStorage, 0x00030005) - ENUM_ENTRY(TextureBindingArray, 0x00030006) - ENUM_ENTRY(SampledTextureAndStorageBufferArrayNonUniformIndexing, 0x00030007) - ENUM_ENTRY(PipelineStatisticsQuery, 0x00030008) - ENUM_ENTRY(StorageResourceBindingArray, 0x00030009) - ENUM_ENTRY(PartiallyBoundBindingArray, 0x0003000A) - ENUM_ENTRY(TextureFormat16bitNorm, 0x0003000B) - ENUM_ENTRY(TextureCompressionAstcHdr, 0x0003000C) - ENUM_ENTRY(TimestampQueryInsidePasses, 0x0003000D) - ENUM_ENTRY(MappablePrimaryBuffers, 0x0003000E) - ENUM_ENTRY(BufferBindingArray, 0x0003000F) - ENUM_ENTRY(UniformBufferAndStorageTextureArrayNonUniformIndexing, 0x00030010) - ENUM_ENTRY(AddressModeClampToZero, 0x00030011) - ENUM_ENTRY(AddressModeClampToBorder, 0x00030012) - ENUM_ENTRY(PolygonModeLine, 0x00030013) - ENUM_ENTRY(PolygonModePoint, 0x00030014) - ENUM_ENTRY(ConservativeRasterization, 0x00030015) - ENUM_ENTRY(ClearTexture, 0x00030016) - ENUM_ENTRY(SpirvShaderPassthrough, 0x00030017) - ENUM_ENTRY(Multiview, 0x00030018) - ENUM_ENTRY(VertexAttribute64bit, 0x00030019) - ENUM_ENTRY(TextureFormatNv12, 0x0003001A) - ENUM_ENTRY(RayTracingAccelerationStructure, 0x0003001B) - ENUM_ENTRY(RayQuery, 0x0003001C) - ENUM_ENTRY(ShaderF64, 0x0003001D) - ENUM_ENTRY(ShaderI16, 0x0003001E) - ENUM_ENTRY(ShaderPrimitiveIndex, 0x0003001F) - ENUM_ENTRY(ShaderEarlyDepthTest, 0x00030020) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(LogLevel) - ENUM_ENTRY(Off, 0x00000000) - ENUM_ENTRY(Error, 0x00000001) - ENUM_ENTRY(Warn, 0x00000002) - ENUM_ENTRY(Info, 0x00000003) - ENUM_ENTRY(Debug, 0x00000004) - ENUM_ENTRY(Trace, 0x00000005) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(InstanceBackend) - ENUM_ENTRY(All, 0x00000000) - ENUM_ENTRY(Vulkan, 1) - ENUM_ENTRY(GL, 1) - ENUM_ENTRY(Metal, 1) - ENUM_ENTRY(DX12, 1) - ENUM_ENTRY(DX11, 1) - ENUM_ENTRY(BrowserWebGPU, 1) - ENUM_ENTRY(Primary, WGPUInstanceBackend_Vulkan) - ENUM_ENTRY(Secondary, WGPUInstanceBackend_GL) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(InstanceFlag) - ENUM_ENTRY(Default, 0x00000000) - ENUM_ENTRY(Debug, 1) - ENUM_ENTRY(Validation, 1) - ENUM_ENTRY(DiscardHalLabels, 1) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(Dx12Compiler) - ENUM_ENTRY(Undefined, 0x00000000) - ENUM_ENTRY(Fxc, 0x00000001) - ENUM_ENTRY(Dxc, 0x00000002) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(Gles3MinorVersion) - ENUM_ENTRY(Automatic, 0x00000000) - ENUM_ENTRY(Version0, 0x00000001) - ENUM_ENTRY(Version1, 0x00000002) - ENUM_ENTRY(Version2, 0x00000003) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(PipelineStatisticName) - ENUM_ENTRY(VertexShaderInvocations, 0x00000000) - ENUM_ENTRY(ClipperInvocations, 0x00000001) - ENUM_ENTRY(ClipperPrimitivesOut, 0x00000002) - ENUM_ENTRY(FragmentShaderInvocations, 0x00000003) - ENUM_ENTRY(ComputeShaderInvocations, 0x00000004) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(NativeQueryType) - ENUM_ENTRY(PipelineStatistics, 0x00030000) - ENUM_ENTRY(Force32, 0x7FFFFFFF) -END -ENUM(NativeTextureFormat) - ENUM_ENTRY(R16Unorm, 0x00030001) - ENUM_ENTRY(R16Snorm, 0x00030002) - ENUM_ENTRY(Rg16Unorm, 0x00030003) - ENUM_ENTRY(Rg16Snorm, 0x00030004) - ENUM_ENTRY(Rgba16Unorm, 0x00030005) - ENUM_ENTRY(Rgba16Snorm, 0x00030006) - ENUM_ENTRY(NV12, 0x00030007) -END - -// Structs -STRUCT(ChainedStruct) - void setDefault(); -END - -STRUCT(ChainedStructOut) - void setDefault(); -END - -STRUCT(BlendComponent) - void setDefault(); -END - -STRUCT(Color) - void setDefault(); - Color(double r, double g, double b, double a) : WGPUColor{ r, g, b, a } {} -END - -STRUCT(ComputePassTimestampWrites) - void setDefault(); -END - -STRUCT(Extent3D) - void setDefault(); - Extent3D(uint32_t width, uint32_t height, uint32_t depthOrArrayLayers) : WGPUExtent3D{ width, height, depthOrArrayLayers } {} -END - -STRUCT(Limits) - void setDefault(); -END - -STRUCT(Origin3D) - void setDefault(); - Origin3D(uint32_t x, uint32_t y, uint32_t z) : WGPUOrigin3D{ x, y, z } {} -END - -STRUCT(PrimitiveDepthClipControl) - void setDefault(); -END - -STRUCT(RenderPassDepthStencilAttachment) - void setDefault(); -END - -STRUCT(RenderPassDescriptorMaxDrawCount) - void setDefault(); -END - -STRUCT(RenderPassTimestampWrites) - void setDefault(); -END - -STRUCT(ShaderModuleSPIRVDescriptor) - void setDefault(); -END - -STRUCT(ShaderModuleWGSLDescriptor) - void setDefault(); -END - -STRUCT(StencilFaceState) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromAndroidNativeWindow) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromCanvasHTMLSelector) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromMetalLayer) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromWaylandSurface) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromWindowsHWND) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromXcbWindow) - void setDefault(); -END - -STRUCT(SurfaceDescriptorFromXlibWindow) - void setDefault(); -END - -STRUCT(SurfaceTexture) - void setDefault(); -END - -STRUCT(VertexAttribute) - void setDefault(); -END - -STRUCT(BlendState) - void setDefault(); -END - -STRUCT(VertexBufferLayout) - void setDefault(); -END - -STRUCT(InstanceExtras) - void setDefault(); -END - -STRUCT(DeviceExtras) - void setDefault(); -END - -STRUCT(NativeLimits) - void setDefault(); -END - -STRUCT(RequiredLimitsExtras) - void setDefault(); -END - -STRUCT(SupportedLimitsExtras) - void setDefault(); -END - -STRUCT(PushConstantRange) - void setDefault(); -END - -STRUCT(PipelineLayoutExtras) - void setDefault(); -END - -STRUCT(WrappedSubmissionIndex) - void setDefault(); -END - -STRUCT(ShaderDefine) - void setDefault(); -END - -STRUCT(ShaderModuleGLSLDescriptor) - void setDefault(); -END - -STRUCT(RegistryReport) - void setDefault(); -END - -STRUCT(HubReport) - void setDefault(); -END - -STRUCT(GlobalReport) - void setDefault(); -END - -STRUCT(BindGroupEntryExtras) - void setDefault(); -END - -STRUCT(BindGroupLayoutEntryExtras) - void setDefault(); -END - -STRUCT(QuerySetDescriptorExtras) - void setDefault(); -END - -STRUCT(SurfaceConfigurationExtras) - void setDefault(); -END - - -// Descriptors -DESCRIPTOR(AdapterInfo) - void setDefault(); - void freeMembers(); -END - -DESCRIPTOR(BindGroupEntry) - void setDefault(); -END - -DESCRIPTOR(BufferBindingLayout) - void setDefault(); -END - -DESCRIPTOR(BufferDescriptor) - void setDefault(); -END - -DESCRIPTOR(CommandBufferDescriptor) - void setDefault(); -END - -DESCRIPTOR(CommandEncoderDescriptor) - void setDefault(); -END - -DESCRIPTOR(CompilationMessage) - void setDefault(); -END - -DESCRIPTOR(ConstantEntry) - void setDefault(); -END - -DESCRIPTOR(InstanceDescriptor) - void setDefault(); -END - -DESCRIPTOR(MultisampleState) - void setDefault(); -END - -DESCRIPTOR(PipelineLayoutDescriptor) - void setDefault(); -END - -DESCRIPTOR(PrimitiveState) - void setDefault(); -END - -DESCRIPTOR(QuerySetDescriptor) - void setDefault(); -END - -DESCRIPTOR(QueueDescriptor) - void setDefault(); -END - -DESCRIPTOR(RenderBundleDescriptor) - void setDefault(); -END - -DESCRIPTOR(RenderBundleEncoderDescriptor) - void setDefault(); -END - -DESCRIPTOR(RequestAdapterOptions) - void setDefault(); -END - -DESCRIPTOR(SamplerBindingLayout) - void setDefault(); -END - -DESCRIPTOR(SamplerDescriptor) - void setDefault(); -END - -DESCRIPTOR(ShaderModuleCompilationHint) - void setDefault(); -END - -DESCRIPTOR(StorageTextureBindingLayout) - void setDefault(); -END - -DESCRIPTOR(SurfaceCapabilities) - void setDefault(); - void freeMembers(); -END - -DESCRIPTOR(SurfaceConfiguration) - void setDefault(); -END - -DESCRIPTOR(SurfaceDescriptor) - void setDefault(); -END - -DESCRIPTOR(TextureBindingLayout) - void setDefault(); -END - -DESCRIPTOR(TextureDataLayout) - void setDefault(); -END - -DESCRIPTOR(TextureViewDescriptor) - void setDefault(); -END - -DESCRIPTOR(UncapturedErrorCallbackInfo) - void setDefault(); -END - -DESCRIPTOR(BindGroupDescriptor) - void setDefault(); -END - -DESCRIPTOR(BindGroupLayoutEntry) - void setDefault(); -END - -DESCRIPTOR(CompilationInfo) - void setDefault(); -END - -DESCRIPTOR(ComputePassDescriptor) - void setDefault(); -END - -DESCRIPTOR(DepthStencilState) - void setDefault(); -END - -DESCRIPTOR(ImageCopyBuffer) - void setDefault(); -END - -DESCRIPTOR(ImageCopyTexture) - void setDefault(); -END - -DESCRIPTOR(ProgrammableStageDescriptor) - void setDefault(); -END - -DESCRIPTOR(RenderPassColorAttachment) - void setDefault(); -END - -DESCRIPTOR(RequiredLimits) - void setDefault(); -END - -DESCRIPTOR(ShaderModuleDescriptor) - void setDefault(); -END - -DESCRIPTOR(SupportedLimits) - void setDefault(); -END - -DESCRIPTOR(TextureDescriptor) - void setDefault(); -END - -DESCRIPTOR(BindGroupLayoutDescriptor) - void setDefault(); -END - -DESCRIPTOR(ColorTargetState) - void setDefault(); -END - -DESCRIPTOR(ComputePipelineDescriptor) - void setDefault(); -END - -DESCRIPTOR(DeviceDescriptor) - void setDefault(); -END - -DESCRIPTOR(RenderPassDescriptor) - void setDefault(); -END - -DESCRIPTOR(VertexState) - void setDefault(); -END - -DESCRIPTOR(FragmentState) - void setDefault(); -END - -DESCRIPTOR(RenderPipelineDescriptor) - void setDefault(); -END - -DESCRIPTOR(InstanceEnumerateAdapterOptions) - void setDefault(); -END - - -// Handles forward declarations -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 Texture; -class TextureView; - -// Callback types -using DeviceLostCallback = std::function; -using ErrorCallback = std::function; -using AdapterRequestDeviceCallback = std::function; -using BufferMapAsyncCallback = std::function; -using DeviceCreateComputePipelineAsyncCallback = std::function; -using DeviceCreateRenderPipelineAsyncCallback = std::function; -using InstanceRequestAdapterCallback = std::function; -using QueueOnSubmittedWorkDoneCallback = std::function; -using ShaderModuleGetCompilationInfoCallback = std::function; -using LogCallback = std::function; - -// Handles detailed declarations -HANDLE(Adapter) - size_t enumerateFeatures(FeatureName * features); - void getInfo(AdapterInfo * info); - Bool getLimits(SupportedLimits * limits); - Bool hasFeature(FeatureName feature); - NO_DISCARD std::unique_ptr requestDevice(const DeviceDescriptor& descriptor, AdapterRequestDeviceCallback&& callback); - void reference(); - void release(); - Device requestDevice(const DeviceDescriptor& descriptor); -END - -HANDLE(BindGroup) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(BindGroupLayout) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(Buffer) - void destroy(); - void const * getConstMappedRange(size_t offset, size_t size); - BufferMapState getMapState(); - void * getMappedRange(size_t offset, size_t size); - uint64_t getSize(); - BufferUsageFlags getUsage(); - NO_DISCARD std::unique_ptr mapAsync(MapModeFlags mode, size_t offset, size_t size, BufferMapAsyncCallback&& callback); - void setLabel(char const * label); - void unmap(); - void reference(); - void release(); -END - -HANDLE(CommandBuffer) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(CommandEncoder) - ComputePassEncoder beginComputePass(const ComputePassDescriptor& descriptor); - ComputePassEncoder beginComputePass(); - RenderPassEncoder beginRenderPass(const RenderPassDescriptor& descriptor); - void clearBuffer(Buffer buffer, uint64_t offset, uint64_t size); - void copyBufferToBuffer(Buffer source, uint64_t sourceOffset, Buffer destination, uint64_t destinationOffset, uint64_t size); - void copyBufferToTexture(const ImageCopyBuffer& source, const ImageCopyTexture& destination, const Extent3D& copySize); - void copyTextureToBuffer(const ImageCopyTexture& source, const ImageCopyBuffer& destination, const Extent3D& copySize); - void copyTextureToTexture(const ImageCopyTexture& source, const ImageCopyTexture& destination, const Extent3D& copySize); - CommandBuffer finish(const CommandBufferDescriptor& descriptor); - CommandBuffer finish(); - void insertDebugMarker(char const * markerLabel); - void popDebugGroup(); - void pushDebugGroup(char const * groupLabel); - void resolveQuerySet(QuerySet querySet, uint32_t firstQuery, uint32_t queryCount, Buffer destination, uint64_t destinationOffset); - void setLabel(char const * label); - void writeTimestamp(QuerySet querySet, uint32_t queryIndex); - void reference(); - void release(); -END - -HANDLE(ComputePassEncoder) - void dispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); - void dispatchWorkgroupsIndirect(Buffer indirectBuffer, uint64_t indirectOffset); - void end(); - void insertDebugMarker(char const * markerLabel); - void popDebugGroup(); - void pushDebugGroup(char const * groupLabel); - void setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets); - void setLabel(char const * label); - void setPipeline(ComputePipeline pipeline); - void reference(); - void release(); - void beginPipelineStatisticsQuery(QuerySet querySet, uint32_t queryIndex); - void endPipelineStatisticsQuery(); -END - -HANDLE(ComputePipeline) - BindGroupLayout getBindGroupLayout(uint32_t groupIndex); - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(Device) - BindGroup createBindGroup(const BindGroupDescriptor& descriptor); - BindGroupLayout createBindGroupLayout(const BindGroupLayoutDescriptor& descriptor); - Buffer createBuffer(const BufferDescriptor& descriptor); - CommandEncoder createCommandEncoder(const CommandEncoderDescriptor& descriptor); - CommandEncoder createCommandEncoder(); - ComputePipeline createComputePipeline(const ComputePipelineDescriptor& descriptor); - NO_DISCARD std::unique_ptr createComputePipelineAsync(const ComputePipelineDescriptor& descriptor, DeviceCreateComputePipelineAsyncCallback&& callback); - PipelineLayout createPipelineLayout(const PipelineLayoutDescriptor& descriptor); - QuerySet createQuerySet(const QuerySetDescriptor& descriptor); - RenderBundleEncoder createRenderBundleEncoder(const RenderBundleEncoderDescriptor& descriptor); - RenderPipeline createRenderPipeline(const RenderPipelineDescriptor& descriptor); - NO_DISCARD std::unique_ptr createRenderPipelineAsync(const RenderPipelineDescriptor& descriptor, DeviceCreateRenderPipelineAsyncCallback&& callback); - Sampler createSampler(const SamplerDescriptor& descriptor); - Sampler createSampler(); - ShaderModule createShaderModule(const ShaderModuleDescriptor& descriptor); - Texture createTexture(const TextureDescriptor& descriptor); - void destroy(); - size_t enumerateFeatures(FeatureName * features); - Bool getLimits(SupportedLimits * limits); - Queue getQueue(); - Bool hasFeature(FeatureName feature); - NO_DISCARD std::unique_ptr popErrorScope(ErrorCallback&& callback); - void pushErrorScope(ErrorFilter filter); - void setLabel(char const * label); - void reference(); - void release(); - Bool poll(Bool wait, const WrappedSubmissionIndex& wrappedSubmissionIndex); - Bool poll(Bool wait); -END - -HANDLE(Instance) - Surface createSurface(const SurfaceDescriptor& descriptor); - Bool hasWGSLLanguageFeature(WGSLFeatureName feature); - void processEvents(); - NO_DISCARD std::unique_ptr requestAdapter(const RequestAdapterOptions& options, InstanceRequestAdapterCallback&& callback); - void reference(); - void release(); - size_t enumerateAdapters(const InstanceEnumerateAdapterOptions& options, Adapter * adapters); - Adapter requestAdapter(const RequestAdapterOptions& options); -END - -HANDLE(PipelineLayout) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(QuerySet) - void destroy(); - uint32_t getCount(); - QueryType getType(); - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(Queue) - NO_DISCARD std::unique_ptr onSubmittedWorkDone(QueueOnSubmittedWorkDoneCallback&& callback); - void setLabel(char const * label); - void submit(size_t commandCount, CommandBuffer const * commands); - void submit(const std::vector& commands); - void submit(const WGPUCommandBuffer& commands); - void writeBuffer(Buffer buffer, uint64_t bufferOffset, void const * data, size_t size); - void writeTexture(const ImageCopyTexture& destination, void const * data, size_t dataSize, const TextureDataLayout& dataLayout, const Extent3D& writeSize); - void reference(); - void release(); - SubmissionIndex submitForIndex(size_t commandCount, CommandBuffer const * commands); - SubmissionIndex submitForIndex(const std::vector& commands); - SubmissionIndex submitForIndex(const WGPUCommandBuffer& commands); -END - -HANDLE(RenderBundle) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(RenderBundleEncoder) - void draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); - void drawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); - void drawIndexedIndirect(Buffer indirectBuffer, uint64_t indirectOffset); - void drawIndirect(Buffer indirectBuffer, uint64_t indirectOffset); - RenderBundle finish(const RenderBundleDescriptor& descriptor); - RenderBundle finish(); - void insertDebugMarker(char const * markerLabel); - void popDebugGroup(); - void pushDebugGroup(char const * groupLabel); - void setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets); - void setIndexBuffer(Buffer buffer, IndexFormat format, uint64_t offset, uint64_t size); - void setLabel(char const * label); - void setPipeline(RenderPipeline pipeline); - void setVertexBuffer(uint32_t slot, Buffer buffer, uint64_t offset, uint64_t size); - void reference(); - void release(); -END - -HANDLE(RenderPassEncoder) - void beginOcclusionQuery(uint32_t queryIndex); - void draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); - void drawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); - void drawIndexedIndirect(Buffer indirectBuffer, uint64_t indirectOffset); - void drawIndirect(Buffer indirectBuffer, uint64_t indirectOffset); - void end(); - void endOcclusionQuery(); - void executeBundles(size_t bundleCount, RenderBundle const * bundles); - void executeBundles(const std::vector& bundles); - void executeBundles(const WGPURenderBundle& bundles); - void insertDebugMarker(char const * markerLabel); - void popDebugGroup(); - void pushDebugGroup(char const * groupLabel); - void setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets); - void setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets); - void setBlendConstant(const Color& color); - void setIndexBuffer(Buffer buffer, IndexFormat format, uint64_t offset, uint64_t size); - void setLabel(char const * label); - void setPipeline(RenderPipeline pipeline); - void setScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height); - void setStencilReference(uint32_t reference); - void setVertexBuffer(uint32_t slot, Buffer buffer, uint64_t offset, uint64_t size); - void setViewport(float x, float y, float width, float height, float minDepth, float maxDepth); - void reference(); - void release(); - void setPushConstants(ShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const * data); - void multiDrawIndirect(Buffer buffer, uint64_t offset, uint32_t count); - void multiDrawIndexedIndirect(Buffer buffer, uint64_t offset, uint32_t count); - void multiDrawIndirectCount(Buffer buffer, uint64_t offset, Buffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); - void multiDrawIndexedIndirectCount(Buffer buffer, uint64_t offset, Buffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); - void beginPipelineStatisticsQuery(QuerySet querySet, uint32_t queryIndex); - void endPipelineStatisticsQuery(); -END - -HANDLE(RenderPipeline) - BindGroupLayout getBindGroupLayout(uint32_t groupIndex); - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(Sampler) - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(ShaderModule) - NO_DISCARD std::unique_ptr getCompilationInfo(ShaderModuleGetCompilationInfoCallback&& callback); - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(Surface) - void configure(const SurfaceConfiguration& config); - void getCapabilities(Adapter adapter, SurfaceCapabilities * capabilities); - void getCurrentTexture(SurfaceTexture * surfaceTexture); - void present(); - void setLabel(char const * label); - void unconfigure(); - void reference(); - void release(); -END - -HANDLE(Texture) - TextureView createView(const TextureViewDescriptor& descriptor); - TextureView createView(); - void destroy(); - uint32_t getDepthOrArrayLayers(); - TextureDimension getDimension(); - TextureFormat getFormat(); - uint32_t getHeight(); - uint32_t getMipLevelCount(); - uint32_t getSampleCount(); - TextureUsageFlags getUsage(); - uint32_t getWidth(); - void setLabel(char const * label); - void reference(); - void release(); -END - -HANDLE(TextureView) - void setLabel(char const * label); - void reference(); - void release(); -END - - -// Non-member procedures - - -Instance createInstance(const InstanceDescriptor& descriptor); - -#ifdef WEBGPU_CPP_IMPLEMENTATION - -Instance createInstance(const InstanceDescriptor& descriptor) { - return wgpuCreateInstance(&descriptor); -} - -// Handles members implementation -// Methods of ChainedStruct -void ChainedStruct::setDefault() { -} - - -// Methods of ChainedStructOut -void ChainedStructOut::setDefault() { -} - - -// Methods of AdapterInfo -void AdapterInfo::setDefault() { - backendType = BackendType::Undefined; -} -void AdapterInfo::freeMembers() { - return wgpuAdapterInfoFreeMembers(*this); -} - - -// Methods of BindGroupEntry -void BindGroupEntry::setDefault() { - offset = 0; -} - - -// Methods of BlendComponent -void BlendComponent::setDefault() { - operation = BlendOperation::Add; - srcFactor = BlendFactor::One; - dstFactor = BlendFactor::Zero; -} - - -// Methods of BufferBindingLayout -void BufferBindingLayout::setDefault() { - type = BufferBindingType::Uniform; - hasDynamicOffset = false; - minBindingSize = 0; -} - - -// Methods of BufferDescriptor -void BufferDescriptor::setDefault() { - mappedAtCreation = false; -} - - -// Methods of Color -void Color::setDefault() { -} - - -// Methods of CommandBufferDescriptor -void CommandBufferDescriptor::setDefault() { -} - - -// Methods of CommandEncoderDescriptor -void CommandEncoderDescriptor::setDefault() { -} - - -// Methods of CompilationMessage -void CompilationMessage::setDefault() { -} - - -// Methods of ComputePassTimestampWrites -void ComputePassTimestampWrites::setDefault() { -} - - -// Methods of ConstantEntry -void ConstantEntry::setDefault() { -} - - -// Methods of Extent3D -void Extent3D::setDefault() { - height = 1; - depthOrArrayLayers = 1; -} - - -// Methods of InstanceDescriptor -void InstanceDescriptor::setDefault() { -} - - -// Methods of Limits -void Limits::setDefault() { - maxTextureDimension1D = WGPU_LIMIT_U32_UNDEFINED; - maxTextureDimension2D = WGPU_LIMIT_U32_UNDEFINED; - maxTextureDimension3D = WGPU_LIMIT_U32_UNDEFINED; - maxTextureArrayLayers = WGPU_LIMIT_U32_UNDEFINED; - maxBindGroups = WGPU_LIMIT_U32_UNDEFINED; - maxBindGroupsPlusVertexBuffers = WGPU_LIMIT_U32_UNDEFINED; - maxBindingsPerBindGroup = WGPU_LIMIT_U32_UNDEFINED; - maxDynamicUniformBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; - maxDynamicStorageBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; - maxSampledTexturesPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - maxSamplersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - maxStorageBuffersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - maxStorageTexturesPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - maxUniformBuffersPerShaderStage = WGPU_LIMIT_U32_UNDEFINED; - maxUniformBufferBindingSize = WGPU_LIMIT_U64_UNDEFINED; - maxStorageBufferBindingSize = WGPU_LIMIT_U64_UNDEFINED; - minUniformBufferOffsetAlignment = WGPU_LIMIT_U32_UNDEFINED; - minStorageBufferOffsetAlignment = WGPU_LIMIT_U32_UNDEFINED; - maxVertexBuffers = WGPU_LIMIT_U32_UNDEFINED; - maxBufferSize = WGPU_LIMIT_U64_UNDEFINED; - maxVertexAttributes = WGPU_LIMIT_U32_UNDEFINED; - maxVertexBufferArrayStride = WGPU_LIMIT_U32_UNDEFINED; - maxInterStageShaderComponents = WGPU_LIMIT_U32_UNDEFINED; - maxInterStageShaderVariables = WGPU_LIMIT_U32_UNDEFINED; - maxColorAttachments = WGPU_LIMIT_U32_UNDEFINED; - maxColorAttachmentBytesPerSample = WGPU_LIMIT_U32_UNDEFINED; - maxComputeWorkgroupStorageSize = WGPU_LIMIT_U32_UNDEFINED; - maxComputeInvocationsPerWorkgroup = WGPU_LIMIT_U32_UNDEFINED; - maxComputeWorkgroupSizeX = WGPU_LIMIT_U32_UNDEFINED; - maxComputeWorkgroupSizeY = WGPU_LIMIT_U32_UNDEFINED; - maxComputeWorkgroupSizeZ = WGPU_LIMIT_U32_UNDEFINED; - maxComputeWorkgroupsPerDimension = WGPU_LIMIT_U32_UNDEFINED; -} - - -// Methods of MultisampleState -void MultisampleState::setDefault() { - count = 1; - mask = 0xFFFFFFFF; - alphaToCoverageEnabled = false; -} - - -// Methods of Origin3D -void Origin3D::setDefault() { - x = 0; - y = 0; - z = 0; -} - - -// Methods of PipelineLayoutDescriptor -void PipelineLayoutDescriptor::setDefault() { -} - - -// Methods of PrimitiveDepthClipControl -void PrimitiveDepthClipControl::setDefault() { - unclippedDepth = false; - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::PrimitiveDepthClipControl; -} - - -// Methods of PrimitiveState -void PrimitiveState::setDefault() { - topology = PrimitiveTopology::TriangleList; - stripIndexFormat = IndexFormat::Undefined; - frontFace = FrontFace::CCW; - cullMode = CullMode::None; -} - - -// Methods of QuerySetDescriptor -void QuerySetDescriptor::setDefault() { -} - - -// Methods of QueueDescriptor -void QueueDescriptor::setDefault() { -} - - -// Methods of RenderBundleDescriptor -void RenderBundleDescriptor::setDefault() { -} - - -// Methods of RenderBundleEncoderDescriptor -void RenderBundleEncoderDescriptor::setDefault() { - depthStencilFormat = TextureFormat::Undefined; - depthReadOnly = false; - stencilReadOnly = false; - sampleCount = 1; -} - - -// Methods of RenderPassDepthStencilAttachment -void RenderPassDepthStencilAttachment::setDefault() { - depthLoadOp = LoadOp::Undefined; - depthStoreOp = StoreOp::Undefined; - depthReadOnly = false; - stencilLoadOp = LoadOp::Undefined; - stencilStoreOp = StoreOp::Undefined; - stencilClearValue = 0; - stencilReadOnly = false; -} - - -// Methods of RenderPassDescriptorMaxDrawCount -void RenderPassDescriptorMaxDrawCount::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::RenderPassDescriptorMaxDrawCount; -} - - -// Methods of RenderPassTimestampWrites -void RenderPassTimestampWrites::setDefault() { -} - - -// Methods of RequestAdapterOptions -void RequestAdapterOptions::setDefault() { - powerPreference = PowerPreference::Undefined; - backendType = BackendType::Undefined; - forceFallbackAdapter = false; -} - - -// Methods of SamplerBindingLayout -void SamplerBindingLayout::setDefault() { - type = SamplerBindingType::Filtering; -} - - -// Methods of SamplerDescriptor -void SamplerDescriptor::setDefault() { - addressModeU = AddressMode::ClampToEdge; - addressModeV = AddressMode::ClampToEdge; - addressModeW = AddressMode::ClampToEdge; - magFilter = FilterMode::Nearest; - minFilter = FilterMode::Nearest; - mipmapFilter = MipmapFilterMode::Nearest; - lodMinClamp = 0; - lodMaxClamp = 32; - compare = CompareFunction::Undefined; -} - - -// Methods of ShaderModuleCompilationHint -void ShaderModuleCompilationHint::setDefault() { -} - - -// Methods of ShaderModuleSPIRVDescriptor -void ShaderModuleSPIRVDescriptor::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::ShaderModuleSPIRVDescriptor; -} - - -// Methods of ShaderModuleWGSLDescriptor -void ShaderModuleWGSLDescriptor::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::ShaderModuleWGSLDescriptor; -} - - -// Methods of StencilFaceState -void StencilFaceState::setDefault() { - compare = CompareFunction::Always; - failOp = StencilOperation::Keep; - depthFailOp = StencilOperation::Keep; - passOp = StencilOperation::Keep; -} - - -// Methods of StorageTextureBindingLayout -void StorageTextureBindingLayout::setDefault() { - access = StorageTextureAccess::WriteOnly; - format = TextureFormat::Undefined; - viewDimension = TextureViewDimension::_2D; -} - - -// Methods of SurfaceCapabilities -void SurfaceCapabilities::setDefault() { -} -void SurfaceCapabilities::freeMembers() { - return wgpuSurfaceCapabilitiesFreeMembers(*this); -} - - -// Methods of SurfaceConfiguration -void SurfaceConfiguration::setDefault() { - format = TextureFormat::Undefined; -} - - -// Methods of SurfaceDescriptor -void SurfaceDescriptor::setDefault() { -} - - -// Methods of SurfaceDescriptorFromAndroidNativeWindow -void SurfaceDescriptorFromAndroidNativeWindow::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromAndroidNativeWindow; -} - - -// Methods of SurfaceDescriptorFromCanvasHTMLSelector -void SurfaceDescriptorFromCanvasHTMLSelector::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromCanvasHTMLSelector; -} - - -// Methods of SurfaceDescriptorFromMetalLayer -void SurfaceDescriptorFromMetalLayer::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromMetalLayer; -} - - -// Methods of SurfaceDescriptorFromWaylandSurface -void SurfaceDescriptorFromWaylandSurface::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromWaylandSurface; -} - - -// Methods of SurfaceDescriptorFromWindowsHWND -void SurfaceDescriptorFromWindowsHWND::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromWindowsHWND; -} - - -// Methods of SurfaceDescriptorFromXcbWindow -void SurfaceDescriptorFromXcbWindow::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromXcbWindow; -} - - -// Methods of SurfaceDescriptorFromXlibWindow -void SurfaceDescriptorFromXlibWindow::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = SType::SurfaceDescriptorFromXlibWindow; -} - - -// Methods of SurfaceTexture -void SurfaceTexture::setDefault() { -} - - -// Methods of TextureBindingLayout -void TextureBindingLayout::setDefault() { - sampleType = TextureSampleType::Float; - viewDimension = TextureViewDimension::_2D; - multisampled = false; -} - - -// Methods of TextureDataLayout -void TextureDataLayout::setDefault() { -} - - -// Methods of TextureViewDescriptor -void TextureViewDescriptor::setDefault() { - format = TextureFormat::Undefined; - dimension = TextureViewDimension::Undefined; - baseMipLevel = 0; - baseArrayLayer = 0; - aspect = TextureAspect::All; -} - - -// Methods of UncapturedErrorCallbackInfo -void UncapturedErrorCallbackInfo::setDefault() { -} - - -// Methods of VertexAttribute -void VertexAttribute::setDefault() { - format = VertexFormat::Undefined; -} - - -// Methods of BindGroupDescriptor -void BindGroupDescriptor::setDefault() { -} - - -// Methods of BindGroupLayoutEntry -void BindGroupLayoutEntry::setDefault() { - ((BufferBindingLayout*)&buffer)->setDefault(); - ((SamplerBindingLayout*)&sampler)->setDefault(); - ((TextureBindingLayout*)&texture)->setDefault(); - ((StorageTextureBindingLayout*)&storageTexture)->setDefault(); - buffer.type = BufferBindingType::Undefined; - sampler.type = SamplerBindingType::Undefined; - storageTexture.access = StorageTextureAccess::Undefined; - texture.sampleType = TextureSampleType::Undefined; -} - - -// Methods of BlendState -void BlendState::setDefault() { - ((BlendComponent*)&color)->setDefault(); - ((BlendComponent*)&alpha)->setDefault(); -} - - -// Methods of CompilationInfo -void CompilationInfo::setDefault() { -} - - -// Methods of ComputePassDescriptor -void ComputePassDescriptor::setDefault() { -} - - -// Methods of DepthStencilState -void DepthStencilState::setDefault() { - format = TextureFormat::Undefined; - depthCompare = CompareFunction::Undefined; - stencilReadMask = 0xFFFFFFFF; - stencilWriteMask = 0xFFFFFFFF; - depthBias = 0; - depthBiasSlopeScale = 0; - depthBiasClamp = 0; - ((StencilFaceState*)&stencilFront)->setDefault(); - ((StencilFaceState*)&stencilBack)->setDefault(); -} - - -// Methods of ImageCopyBuffer -void ImageCopyBuffer::setDefault() { - ((TextureDataLayout*)&layout)->setDefault(); -} - - -// Methods of ImageCopyTexture -void ImageCopyTexture::setDefault() { - mipLevel = 0; - aspect = TextureAspect::All; - ((Origin3D*)&origin)->setDefault(); -} - - -// Methods of ProgrammableStageDescriptor -void ProgrammableStageDescriptor::setDefault() { -} - - -// Methods of RenderPassColorAttachment -void RenderPassColorAttachment::setDefault() { - loadOp = LoadOp::Undefined; - storeOp = StoreOp::Undefined; - ((Color*)&clearValue)->setDefault(); -} - - -// Methods of RequiredLimits -void RequiredLimits::setDefault() { - ((Limits*)&limits)->setDefault(); -} - - -// Methods of ShaderModuleDescriptor -void ShaderModuleDescriptor::setDefault() { -} - - -// Methods of SupportedLimits -void SupportedLimits::setDefault() { - ((Limits*)&limits)->setDefault(); -} - - -// Methods of TextureDescriptor -void TextureDescriptor::setDefault() { - dimension = TextureDimension::_2D; - format = TextureFormat::Undefined; - mipLevelCount = 1; - sampleCount = 1; - ((Extent3D*)&size)->setDefault(); -} - - -// Methods of VertexBufferLayout -void VertexBufferLayout::setDefault() { - stepMode = VertexStepMode::Vertex; -} - - -// Methods of BindGroupLayoutDescriptor -void BindGroupLayoutDescriptor::setDefault() { -} - - -// Methods of ColorTargetState -void ColorTargetState::setDefault() { - format = TextureFormat::Undefined; -} - - -// Methods of ComputePipelineDescriptor -void ComputePipelineDescriptor::setDefault() { - ((ProgrammableStageDescriptor*)&compute)->setDefault(); -} - - -// Methods of DeviceDescriptor -void DeviceDescriptor::setDefault() { - ((QueueDescriptor*)&defaultQueue)->setDefault(); - ((UncapturedErrorCallbackInfo*)&uncapturedErrorCallbackInfo)->setDefault(); -} - - -// Methods of RenderPassDescriptor -void RenderPassDescriptor::setDefault() { -} - - -// Methods of VertexState -void VertexState::setDefault() { -} - - -// Methods of FragmentState -void FragmentState::setDefault() { -} - - -// Methods of RenderPipelineDescriptor -void RenderPipelineDescriptor::setDefault() { - ((VertexState*)&vertex)->setDefault(); - ((PrimitiveState*)&primitive)->setDefault(); - ((MultisampleState*)&multisample)->setDefault(); -} - - -// Methods of InstanceExtras -void InstanceExtras::setDefault() { - dx12ShaderCompiler = Dx12Compiler::Undefined; - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::InstanceExtras; -} - - -// Methods of DeviceExtras -void DeviceExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::DeviceExtras; -} - - -// Methods of NativeLimits -void NativeLimits::setDefault() { -} - - -// Methods of RequiredLimitsExtras -void RequiredLimitsExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - ((NativeLimits*)&limits)->setDefault(); - chain.sType = (WGPUSType)NativeSType::RequiredLimitsExtras; -} - - -// Methods of SupportedLimitsExtras -void SupportedLimitsExtras::setDefault() { - ((ChainedStructOut*)&chain)->setDefault(); - ((NativeLimits*)&limits)->setDefault(); - chain.sType = (WGPUSType)NativeSType::SupportedLimitsExtras; -} - - -// Methods of PushConstantRange -void PushConstantRange::setDefault() { -} - - -// Methods of PipelineLayoutExtras -void PipelineLayoutExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::PipelineLayoutExtras; -} - - -// Methods of WrappedSubmissionIndex -void WrappedSubmissionIndex::setDefault() { -} - - -// Methods of ShaderDefine -void ShaderDefine::setDefault() { -} - - -// Methods of ShaderModuleGLSLDescriptor -void ShaderModuleGLSLDescriptor::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::ShaderModuleGLSLDescriptor; -} - - -// Methods of RegistryReport -void RegistryReport::setDefault() { -} - - -// Methods of HubReport -void HubReport::setDefault() { - ((RegistryReport*)&adapters)->setDefault(); - ((RegistryReport*)&devices)->setDefault(); - ((RegistryReport*)&queues)->setDefault(); - ((RegistryReport*)&pipelineLayouts)->setDefault(); - ((RegistryReport*)&shaderModules)->setDefault(); - ((RegistryReport*)&bindGroupLayouts)->setDefault(); - ((RegistryReport*)&bindGroups)->setDefault(); - ((RegistryReport*)&commandBuffers)->setDefault(); - ((RegistryReport*)&renderBundles)->setDefault(); - ((RegistryReport*)&renderPipelines)->setDefault(); - ((RegistryReport*)&computePipelines)->setDefault(); - ((RegistryReport*)&querySets)->setDefault(); - ((RegistryReport*)&buffers)->setDefault(); - ((RegistryReport*)&textures)->setDefault(); - ((RegistryReport*)&textureViews)->setDefault(); - ((RegistryReport*)&samplers)->setDefault(); -} - - -// Methods of GlobalReport -void GlobalReport::setDefault() { - backendType = BackendType::Undefined; - ((RegistryReport*)&surfaces)->setDefault(); - ((HubReport*)&vulkan)->setDefault(); - ((HubReport*)&metal)->setDefault(); - ((HubReport*)&dx12)->setDefault(); - ((HubReport*)&gl)->setDefault(); -} - - -// Methods of InstanceEnumerateAdapterOptions -void InstanceEnumerateAdapterOptions::setDefault() { -} - - -// Methods of BindGroupEntryExtras -void BindGroupEntryExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::BindGroupEntryExtras; -} - - -// Methods of BindGroupLayoutEntryExtras -void BindGroupLayoutEntryExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::BindGroupLayoutEntryExtras; -} - - -// Methods of QuerySetDescriptorExtras -void QuerySetDescriptorExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::QuerySetDescriptorExtras; -} - - -// Methods of SurfaceConfigurationExtras -void SurfaceConfigurationExtras::setDefault() { - ((ChainedStruct*)&chain)->setDefault(); - chain.sType = (WGPUSType)NativeSType::SurfaceConfigurationExtras; -} - - -// Methods of Adapter -size_t Adapter::enumerateFeatures(FeatureName * features) { - return wgpuAdapterEnumerateFeatures(m_raw, reinterpret_cast(features)); -} -void Adapter::getInfo(AdapterInfo * info) { - return wgpuAdapterGetInfo(m_raw, info); -} -Bool Adapter::getLimits(SupportedLimits * limits) { - return wgpuAdapterGetLimits(m_raw, limits); -} -Bool Adapter::hasFeature(FeatureName feature) { - return wgpuAdapterHasFeature(m_raw, static_cast(feature)); -} -std::unique_ptr Adapter::requestDevice(const DeviceDescriptor& descriptor, AdapterRequestDeviceCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPURequestDeviceStatus status, WGPUDevice device, char const * message, WGPU_NULLABLE void * userdata) -> void { - AdapterRequestDeviceCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status), device, message); - }; - wgpuAdapterRequestDevice(m_raw, &descriptor, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void Adapter::reference() { - return wgpuAdapterReference(m_raw); -} -void Adapter::release() { - return wgpuAdapterRelease(m_raw); -} - - -// Methods of BindGroup -void BindGroup::setLabel(char const * label) { - return wgpuBindGroupSetLabel(m_raw, label); -} -void BindGroup::reference() { - return wgpuBindGroupReference(m_raw); -} -void BindGroup::release() { - return wgpuBindGroupRelease(m_raw); -} - - -// Methods of BindGroupLayout -void BindGroupLayout::setLabel(char const * label) { - return wgpuBindGroupLayoutSetLabel(m_raw, label); -} -void BindGroupLayout::reference() { - return wgpuBindGroupLayoutReference(m_raw); -} -void BindGroupLayout::release() { - return wgpuBindGroupLayoutRelease(m_raw); -} - - -// Methods of Buffer -void Buffer::destroy() { - return wgpuBufferDestroy(m_raw); -} -void const * Buffer::getConstMappedRange(size_t offset, size_t size) { - return wgpuBufferGetConstMappedRange(m_raw, offset, size); -} -BufferMapState Buffer::getMapState() { - return static_cast(wgpuBufferGetMapState(m_raw)); -} -void * Buffer::getMappedRange(size_t offset, size_t size) { - return wgpuBufferGetMappedRange(m_raw, offset, size); -} -uint64_t Buffer::getSize() { - return wgpuBufferGetSize(m_raw); -} -BufferUsageFlags Buffer::getUsage() { - return wgpuBufferGetUsage(m_raw); -} -std::unique_ptr Buffer::mapAsync(MapModeFlags mode, size_t offset, size_t size, BufferMapAsyncCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUBufferMapAsyncStatus status, WGPU_NULLABLE void * userdata) -> void { - BufferMapAsyncCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status)); - }; - wgpuBufferMapAsync(m_raw, mode, offset, size, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void Buffer::setLabel(char const * label) { - return wgpuBufferSetLabel(m_raw, label); -} -void Buffer::unmap() { - return wgpuBufferUnmap(m_raw); -} -void Buffer::reference() { - return wgpuBufferReference(m_raw); -} -void Buffer::release() { - return wgpuBufferRelease(m_raw); -} - - -// Methods of CommandBuffer -void CommandBuffer::setLabel(char const * label) { - return wgpuCommandBufferSetLabel(m_raw, label); -} -void CommandBuffer::reference() { - return wgpuCommandBufferReference(m_raw); -} -void CommandBuffer::release() { - return wgpuCommandBufferRelease(m_raw); -} - - -// Methods of CommandEncoder -ComputePassEncoder CommandEncoder::beginComputePass(const ComputePassDescriptor& descriptor) { - return wgpuCommandEncoderBeginComputePass(m_raw, &descriptor); -} -ComputePassEncoder CommandEncoder::beginComputePass() { - return wgpuCommandEncoderBeginComputePass(m_raw, nullptr); -} -RenderPassEncoder CommandEncoder::beginRenderPass(const RenderPassDescriptor& descriptor) { - return wgpuCommandEncoderBeginRenderPass(m_raw, &descriptor); -} -void CommandEncoder::clearBuffer(Buffer buffer, uint64_t offset, uint64_t size) { - return wgpuCommandEncoderClearBuffer(m_raw, buffer, offset, size); -} -void CommandEncoder::copyBufferToBuffer(Buffer source, uint64_t sourceOffset, Buffer destination, uint64_t destinationOffset, uint64_t size) { - return wgpuCommandEncoderCopyBufferToBuffer(m_raw, source, sourceOffset, destination, destinationOffset, size); -} -void CommandEncoder::copyBufferToTexture(const ImageCopyBuffer& source, const ImageCopyTexture& destination, const Extent3D& copySize) { - return wgpuCommandEncoderCopyBufferToTexture(m_raw, &source, &destination, ©Size); -} -void CommandEncoder::copyTextureToBuffer(const ImageCopyTexture& source, const ImageCopyBuffer& destination, const Extent3D& copySize) { - return wgpuCommandEncoderCopyTextureToBuffer(m_raw, &source, &destination, ©Size); -} -void CommandEncoder::copyTextureToTexture(const ImageCopyTexture& source, const ImageCopyTexture& destination, const Extent3D& copySize) { - return wgpuCommandEncoderCopyTextureToTexture(m_raw, &source, &destination, ©Size); -} -CommandBuffer CommandEncoder::finish(const CommandBufferDescriptor& descriptor) { - return wgpuCommandEncoderFinish(m_raw, &descriptor); -} -CommandBuffer CommandEncoder::finish() { - return wgpuCommandEncoderFinish(m_raw, nullptr); -} -void CommandEncoder::insertDebugMarker(char const * markerLabel) { - return wgpuCommandEncoderInsertDebugMarker(m_raw, markerLabel); -} -void CommandEncoder::popDebugGroup() { - return wgpuCommandEncoderPopDebugGroup(m_raw); -} -void CommandEncoder::pushDebugGroup(char const * groupLabel) { - return wgpuCommandEncoderPushDebugGroup(m_raw, groupLabel); -} -void CommandEncoder::resolveQuerySet(QuerySet querySet, uint32_t firstQuery, uint32_t queryCount, Buffer destination, uint64_t destinationOffset) { - return wgpuCommandEncoderResolveQuerySet(m_raw, querySet, firstQuery, queryCount, destination, destinationOffset); -} -void CommandEncoder::setLabel(char const * label) { - return wgpuCommandEncoderSetLabel(m_raw, label); -} -void CommandEncoder::writeTimestamp(QuerySet querySet, uint32_t queryIndex) { - return wgpuCommandEncoderWriteTimestamp(m_raw, querySet, queryIndex); -} -void CommandEncoder::reference() { - return wgpuCommandEncoderReference(m_raw); -} -void CommandEncoder::release() { - return wgpuCommandEncoderRelease(m_raw); -} - - -// Methods of ComputePassEncoder -void ComputePassEncoder::dispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) { - return wgpuComputePassEncoderDispatchWorkgroups(m_raw, workgroupCountX, workgroupCountY, workgroupCountZ); -} -void ComputePassEncoder::dispatchWorkgroupsIndirect(Buffer indirectBuffer, uint64_t indirectOffset) { - return wgpuComputePassEncoderDispatchWorkgroupsIndirect(m_raw, indirectBuffer, indirectOffset); -} -void ComputePassEncoder::end() { - return wgpuComputePassEncoderEnd(m_raw); -} -void ComputePassEncoder::insertDebugMarker(char const * markerLabel) { - return wgpuComputePassEncoderInsertDebugMarker(m_raw, markerLabel); -} -void ComputePassEncoder::popDebugGroup() { - return wgpuComputePassEncoderPopDebugGroup(m_raw); -} -void ComputePassEncoder::pushDebugGroup(char const * groupLabel) { - return wgpuComputePassEncoderPushDebugGroup(m_raw, groupLabel); -} -void ComputePassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { - return wgpuComputePassEncoderSetBindGroup(m_raw, groupIndex, group, dynamicOffsetCount, dynamicOffsets); -} -void ComputePassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets) { - return wgpuComputePassEncoderSetBindGroup(m_raw, groupIndex, group, static_cast(dynamicOffsets.size()), dynamicOffsets.data()); -} -void ComputePassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets) { - return wgpuComputePassEncoderSetBindGroup(m_raw, groupIndex, group, 1, &dynamicOffsets); -} -void ComputePassEncoder::setLabel(char const * label) { - return wgpuComputePassEncoderSetLabel(m_raw, label); -} -void ComputePassEncoder::setPipeline(ComputePipeline pipeline) { - return wgpuComputePassEncoderSetPipeline(m_raw, pipeline); -} -void ComputePassEncoder::reference() { - return wgpuComputePassEncoderReference(m_raw); -} -void ComputePassEncoder::release() { - return wgpuComputePassEncoderRelease(m_raw); -} -void ComputePassEncoder::beginPipelineStatisticsQuery(QuerySet querySet, uint32_t queryIndex) { - return wgpuComputePassEncoderBeginPipelineStatisticsQuery(m_raw, querySet, queryIndex); -} -void ComputePassEncoder::endPipelineStatisticsQuery() { - return wgpuComputePassEncoderEndPipelineStatisticsQuery(m_raw); -} - - -// Methods of ComputePipeline -BindGroupLayout ComputePipeline::getBindGroupLayout(uint32_t groupIndex) { - return wgpuComputePipelineGetBindGroupLayout(m_raw, groupIndex); -} -void ComputePipeline::setLabel(char const * label) { - return wgpuComputePipelineSetLabel(m_raw, label); -} -void ComputePipeline::reference() { - return wgpuComputePipelineReference(m_raw); -} -void ComputePipeline::release() { - return wgpuComputePipelineRelease(m_raw); -} - - -// Methods of Device -BindGroup Device::createBindGroup(const BindGroupDescriptor& descriptor) { - return wgpuDeviceCreateBindGroup(m_raw, &descriptor); -} -BindGroupLayout Device::createBindGroupLayout(const BindGroupLayoutDescriptor& descriptor) { - return wgpuDeviceCreateBindGroupLayout(m_raw, &descriptor); -} -Buffer Device::createBuffer(const BufferDescriptor& descriptor) { - return wgpuDeviceCreateBuffer(m_raw, &descriptor); -} -CommandEncoder Device::createCommandEncoder(const CommandEncoderDescriptor& descriptor) { - return wgpuDeviceCreateCommandEncoder(m_raw, &descriptor); -} -CommandEncoder Device::createCommandEncoder() { - return wgpuDeviceCreateCommandEncoder(m_raw, nullptr); -} -ComputePipeline Device::createComputePipeline(const ComputePipelineDescriptor& descriptor) { - return wgpuDeviceCreateComputePipeline(m_raw, &descriptor); -} -std::unique_ptr Device::createComputePipelineAsync(const ComputePipelineDescriptor& descriptor, DeviceCreateComputePipelineAsyncCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) -> void { - DeviceCreateComputePipelineAsyncCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status), pipeline, message); - }; - wgpuDeviceCreateComputePipelineAsync(m_raw, &descriptor, cCallback, reinterpret_cast(handle.get())); - return handle; -} -PipelineLayout Device::createPipelineLayout(const PipelineLayoutDescriptor& descriptor) { - return wgpuDeviceCreatePipelineLayout(m_raw, &descriptor); -} -QuerySet Device::createQuerySet(const QuerySetDescriptor& descriptor) { - return wgpuDeviceCreateQuerySet(m_raw, &descriptor); -} -RenderBundleEncoder Device::createRenderBundleEncoder(const RenderBundleEncoderDescriptor& descriptor) { - return wgpuDeviceCreateRenderBundleEncoder(m_raw, &descriptor); -} -RenderPipeline Device::createRenderPipeline(const RenderPipelineDescriptor& descriptor) { - return wgpuDeviceCreateRenderPipeline(m_raw, &descriptor); -} -std::unique_ptr Device::createRenderPipelineAsync(const RenderPipelineDescriptor& descriptor, DeviceCreateRenderPipelineAsyncCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) -> void { - DeviceCreateRenderPipelineAsyncCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status), pipeline, message); - }; - wgpuDeviceCreateRenderPipelineAsync(m_raw, &descriptor, cCallback, reinterpret_cast(handle.get())); - return handle; -} -Sampler Device::createSampler(const SamplerDescriptor& descriptor) { - return wgpuDeviceCreateSampler(m_raw, &descriptor); -} -Sampler Device::createSampler() { - return wgpuDeviceCreateSampler(m_raw, nullptr); -} -ShaderModule Device::createShaderModule(const ShaderModuleDescriptor& descriptor) { - return wgpuDeviceCreateShaderModule(m_raw, &descriptor); -} -Texture Device::createTexture(const TextureDescriptor& descriptor) { - return wgpuDeviceCreateTexture(m_raw, &descriptor); -} -void Device::destroy() { - return wgpuDeviceDestroy(m_raw); -} -size_t Device::enumerateFeatures(FeatureName * features) { - return wgpuDeviceEnumerateFeatures(m_raw, reinterpret_cast(features)); -} -Bool Device::getLimits(SupportedLimits * limits) { - return wgpuDeviceGetLimits(m_raw, limits); -} -Queue Device::getQueue() { - return wgpuDeviceGetQueue(m_raw); -} -Bool Device::hasFeature(FeatureName feature) { - return wgpuDeviceHasFeature(m_raw, static_cast(feature)); -} -std::unique_ptr Device::popErrorScope(ErrorCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUErrorType type, char const * message, void * userdata) -> void { - ErrorCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(type), message); - }; - wgpuDevicePopErrorScope(m_raw, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void Device::pushErrorScope(ErrorFilter filter) { - return wgpuDevicePushErrorScope(m_raw, static_cast(filter)); -} -void Device::setLabel(char const * label) { - return wgpuDeviceSetLabel(m_raw, label); -} -void Device::reference() { - return wgpuDeviceReference(m_raw); -} -void Device::release() { - return wgpuDeviceRelease(m_raw); -} -Bool Device::poll(Bool wait, const WrappedSubmissionIndex& wrappedSubmissionIndex) { - return wgpuDevicePoll(m_raw, wait, &wrappedSubmissionIndex); -} -Bool Device::poll(Bool wait) { - return wgpuDevicePoll(m_raw, wait, nullptr); -} - - -// Methods of Instance -Surface Instance::createSurface(const SurfaceDescriptor& descriptor) { - return wgpuInstanceCreateSurface(m_raw, &descriptor); -} -Bool Instance::hasWGSLLanguageFeature(WGSLFeatureName feature) { - return wgpuInstanceHasWGSLLanguageFeature(m_raw, static_cast(feature)); -} -void Instance::processEvents() { - return wgpuInstanceProcessEvents(m_raw); -} -std::unique_ptr Instance::requestAdapter(const RequestAdapterOptions& options, InstanceRequestAdapterCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, WGPU_NULLABLE void * userdata) -> void { - InstanceRequestAdapterCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status), adapter, message); - }; - wgpuInstanceRequestAdapter(m_raw, &options, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void Instance::reference() { - return wgpuInstanceReference(m_raw); -} -void Instance::release() { - return wgpuInstanceRelease(m_raw); -} -size_t Instance::enumerateAdapters(const InstanceEnumerateAdapterOptions& options, Adapter * adapters) { - return wgpuInstanceEnumerateAdapters(m_raw, &options, reinterpret_cast(adapters)); -} - - -// Methods of PipelineLayout -void PipelineLayout::setLabel(char const * label) { - return wgpuPipelineLayoutSetLabel(m_raw, label); -} -void PipelineLayout::reference() { - return wgpuPipelineLayoutReference(m_raw); -} -void PipelineLayout::release() { - return wgpuPipelineLayoutRelease(m_raw); -} - - -// Methods of QuerySet -void QuerySet::destroy() { - return wgpuQuerySetDestroy(m_raw); -} -uint32_t QuerySet::getCount() { - return wgpuQuerySetGetCount(m_raw); -} -QueryType QuerySet::getType() { - return static_cast(wgpuQuerySetGetType(m_raw)); -} -void QuerySet::setLabel(char const * label) { - return wgpuQuerySetSetLabel(m_raw, label); -} -void QuerySet::reference() { - return wgpuQuerySetReference(m_raw); -} -void QuerySet::release() { - return wgpuQuerySetRelease(m_raw); -} - - -// Methods of Queue -std::unique_ptr Queue::onSubmittedWorkDone(QueueOnSubmittedWorkDoneCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUQueueWorkDoneStatus status, WGPU_NULLABLE void * userdata) -> void { - QueueOnSubmittedWorkDoneCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status)); - }; - wgpuQueueOnSubmittedWorkDone(m_raw, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void Queue::setLabel(char const * label) { - return wgpuQueueSetLabel(m_raw, label); -} -void Queue::submit(size_t commandCount, CommandBuffer const * commands) { - return wgpuQueueSubmit(m_raw, commandCount, reinterpret_cast(commands)); -} -void Queue::submit(const std::vector& commands) { - return wgpuQueueSubmit(m_raw, static_cast(commands.size()), commands.data()); -} -void Queue::submit(const WGPUCommandBuffer& commands) { - return wgpuQueueSubmit(m_raw, 1, &commands); -} -void Queue::writeBuffer(Buffer buffer, uint64_t bufferOffset, void const * data, size_t size) { - return wgpuQueueWriteBuffer(m_raw, buffer, bufferOffset, data, size); -} -void Queue::writeTexture(const ImageCopyTexture& destination, void const * data, size_t dataSize, const TextureDataLayout& dataLayout, const Extent3D& writeSize) { - return wgpuQueueWriteTexture(m_raw, &destination, data, dataSize, &dataLayout, &writeSize); -} -void Queue::reference() { - return wgpuQueueReference(m_raw); -} -void Queue::release() { - return wgpuQueueRelease(m_raw); -} -SubmissionIndex Queue::submitForIndex(size_t commandCount, CommandBuffer const * commands) { - return wgpuQueueSubmitForIndex(m_raw, commandCount, reinterpret_cast(commands)); -} -SubmissionIndex Queue::submitForIndex(const std::vector& commands) { - return wgpuQueueSubmitForIndex(m_raw, static_cast(commands.size()), commands.data()); -} -SubmissionIndex Queue::submitForIndex(const WGPUCommandBuffer& commands) { - return wgpuQueueSubmitForIndex(m_raw, 1, &commands); -} - - -// Methods of RenderBundle -void RenderBundle::setLabel(char const * label) { - return wgpuRenderBundleSetLabel(m_raw, label); -} -void RenderBundle::reference() { - return wgpuRenderBundleReference(m_raw); -} -void RenderBundle::release() { - return wgpuRenderBundleRelease(m_raw); -} - - -// Methods of RenderBundleEncoder -void RenderBundleEncoder::draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) { - return wgpuRenderBundleEncoderDraw(m_raw, vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderBundleEncoder::drawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) { - return wgpuRenderBundleEncoderDrawIndexed(m_raw, indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderBundleEncoder::drawIndexedIndirect(Buffer indirectBuffer, uint64_t indirectOffset) { - return wgpuRenderBundleEncoderDrawIndexedIndirect(m_raw, indirectBuffer, indirectOffset); -} -void RenderBundleEncoder::drawIndirect(Buffer indirectBuffer, uint64_t indirectOffset) { - return wgpuRenderBundleEncoderDrawIndirect(m_raw, indirectBuffer, indirectOffset); -} -RenderBundle RenderBundleEncoder::finish(const RenderBundleDescriptor& descriptor) { - return wgpuRenderBundleEncoderFinish(m_raw, &descriptor); -} -RenderBundle RenderBundleEncoder::finish() { - return wgpuRenderBundleEncoderFinish(m_raw, nullptr); -} -void RenderBundleEncoder::insertDebugMarker(char const * markerLabel) { - return wgpuRenderBundleEncoderInsertDebugMarker(m_raw, markerLabel); -} -void RenderBundleEncoder::popDebugGroup() { - return wgpuRenderBundleEncoderPopDebugGroup(m_raw); -} -void RenderBundleEncoder::pushDebugGroup(char const * groupLabel) { - return wgpuRenderBundleEncoderPushDebugGroup(m_raw, groupLabel); -} -void RenderBundleEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { - return wgpuRenderBundleEncoderSetBindGroup(m_raw, groupIndex, group, dynamicOffsetCount, dynamicOffsets); -} -void RenderBundleEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets) { - return wgpuRenderBundleEncoderSetBindGroup(m_raw, groupIndex, group, static_cast(dynamicOffsets.size()), dynamicOffsets.data()); -} -void RenderBundleEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets) { - return wgpuRenderBundleEncoderSetBindGroup(m_raw, groupIndex, group, 1, &dynamicOffsets); -} -void RenderBundleEncoder::setIndexBuffer(Buffer buffer, IndexFormat format, uint64_t offset, uint64_t size) { - return wgpuRenderBundleEncoderSetIndexBuffer(m_raw, buffer, static_cast(format), offset, size); -} -void RenderBundleEncoder::setLabel(char const * label) { - return wgpuRenderBundleEncoderSetLabel(m_raw, label); -} -void RenderBundleEncoder::setPipeline(RenderPipeline pipeline) { - return wgpuRenderBundleEncoderSetPipeline(m_raw, pipeline); -} -void RenderBundleEncoder::setVertexBuffer(uint32_t slot, Buffer buffer, uint64_t offset, uint64_t size) { - return wgpuRenderBundleEncoderSetVertexBuffer(m_raw, slot, buffer, offset, size); -} -void RenderBundleEncoder::reference() { - return wgpuRenderBundleEncoderReference(m_raw); -} -void RenderBundleEncoder::release() { - return wgpuRenderBundleEncoderRelease(m_raw); -} - - -// Methods of RenderPassEncoder -void RenderPassEncoder::beginOcclusionQuery(uint32_t queryIndex) { - return wgpuRenderPassEncoderBeginOcclusionQuery(m_raw, queryIndex); -} -void RenderPassEncoder::draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) { - return wgpuRenderPassEncoderDraw(m_raw, vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderPassEncoder::drawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) { - return wgpuRenderPassEncoderDrawIndexed(m_raw, indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderPassEncoder::drawIndexedIndirect(Buffer indirectBuffer, uint64_t indirectOffset) { - return wgpuRenderPassEncoderDrawIndexedIndirect(m_raw, indirectBuffer, indirectOffset); -} -void RenderPassEncoder::drawIndirect(Buffer indirectBuffer, uint64_t indirectOffset) { - return wgpuRenderPassEncoderDrawIndirect(m_raw, indirectBuffer, indirectOffset); -} -void RenderPassEncoder::end() { - return wgpuRenderPassEncoderEnd(m_raw); -} -void RenderPassEncoder::endOcclusionQuery() { - return wgpuRenderPassEncoderEndOcclusionQuery(m_raw); -} -void RenderPassEncoder::executeBundles(size_t bundleCount, RenderBundle const * bundles) { - return wgpuRenderPassEncoderExecuteBundles(m_raw, bundleCount, reinterpret_cast(bundles)); -} -void RenderPassEncoder::executeBundles(const std::vector& bundles) { - return wgpuRenderPassEncoderExecuteBundles(m_raw, static_cast(bundles.size()), bundles.data()); -} -void RenderPassEncoder::executeBundles(const WGPURenderBundle& bundles) { - return wgpuRenderPassEncoderExecuteBundles(m_raw, 1, &bundles); -} -void RenderPassEncoder::insertDebugMarker(char const * markerLabel) { - return wgpuRenderPassEncoderInsertDebugMarker(m_raw, markerLabel); -} -void RenderPassEncoder::popDebugGroup() { - return wgpuRenderPassEncoderPopDebugGroup(m_raw); -} -void RenderPassEncoder::pushDebugGroup(char const * groupLabel) { - return wgpuRenderPassEncoderPushDebugGroup(m_raw, groupLabel); -} -void RenderPassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { - return wgpuRenderPassEncoderSetBindGroup(m_raw, groupIndex, group, dynamicOffsetCount, dynamicOffsets); -} -void RenderPassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const std::vector& dynamicOffsets) { - return wgpuRenderPassEncoderSetBindGroup(m_raw, groupIndex, group, static_cast(dynamicOffsets.size()), dynamicOffsets.data()); -} -void RenderPassEncoder::setBindGroup(uint32_t groupIndex, BindGroup group, const uint32_t& dynamicOffsets) { - return wgpuRenderPassEncoderSetBindGroup(m_raw, groupIndex, group, 1, &dynamicOffsets); -} -void RenderPassEncoder::setBlendConstant(const Color& color) { - return wgpuRenderPassEncoderSetBlendConstant(m_raw, &color); -} -void RenderPassEncoder::setIndexBuffer(Buffer buffer, IndexFormat format, uint64_t offset, uint64_t size) { - return wgpuRenderPassEncoderSetIndexBuffer(m_raw, buffer, static_cast(format), offset, size); -} -void RenderPassEncoder::setLabel(char const * label) { - return wgpuRenderPassEncoderSetLabel(m_raw, label); -} -void RenderPassEncoder::setPipeline(RenderPipeline pipeline) { - return wgpuRenderPassEncoderSetPipeline(m_raw, pipeline); -} -void RenderPassEncoder::setScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { - return wgpuRenderPassEncoderSetScissorRect(m_raw, x, y, width, height); -} -void RenderPassEncoder::setStencilReference(uint32_t reference) { - return wgpuRenderPassEncoderSetStencilReference(m_raw, reference); -} -void RenderPassEncoder::setVertexBuffer(uint32_t slot, Buffer buffer, uint64_t offset, uint64_t size) { - return wgpuRenderPassEncoderSetVertexBuffer(m_raw, slot, buffer, offset, size); -} -void RenderPassEncoder::setViewport(float x, float y, float width, float height, float minDepth, float maxDepth) { - return wgpuRenderPassEncoderSetViewport(m_raw, x, y, width, height, minDepth, maxDepth); -} -void RenderPassEncoder::reference() { - return wgpuRenderPassEncoderReference(m_raw); -} -void RenderPassEncoder::release() { - return wgpuRenderPassEncoderRelease(m_raw); -} -void RenderPassEncoder::setPushConstants(ShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const * data) { - return wgpuRenderPassEncoderSetPushConstants(m_raw, stages, offset, sizeBytes, data); -} -void RenderPassEncoder::multiDrawIndirect(Buffer buffer, uint64_t offset, uint32_t count) { - return wgpuRenderPassEncoderMultiDrawIndirect(m_raw, buffer, offset, count); -} -void RenderPassEncoder::multiDrawIndexedIndirect(Buffer buffer, uint64_t offset, uint32_t count) { - return wgpuRenderPassEncoderMultiDrawIndexedIndirect(m_raw, buffer, offset, count); -} -void RenderPassEncoder::multiDrawIndirectCount(Buffer buffer, uint64_t offset, Buffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count) { - return wgpuRenderPassEncoderMultiDrawIndirectCount(m_raw, buffer, offset, count_buffer, count_buffer_offset, max_count); -} -void RenderPassEncoder::multiDrawIndexedIndirectCount(Buffer buffer, uint64_t offset, Buffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count) { - return wgpuRenderPassEncoderMultiDrawIndexedIndirectCount(m_raw, buffer, offset, count_buffer, count_buffer_offset, max_count); -} -void RenderPassEncoder::beginPipelineStatisticsQuery(QuerySet querySet, uint32_t queryIndex) { - return wgpuRenderPassEncoderBeginPipelineStatisticsQuery(m_raw, querySet, queryIndex); -} -void RenderPassEncoder::endPipelineStatisticsQuery() { - return wgpuRenderPassEncoderEndPipelineStatisticsQuery(m_raw); -} - - -// Methods of RenderPipeline -BindGroupLayout RenderPipeline::getBindGroupLayout(uint32_t groupIndex) { - return wgpuRenderPipelineGetBindGroupLayout(m_raw, groupIndex); -} -void RenderPipeline::setLabel(char const * label) { - return wgpuRenderPipelineSetLabel(m_raw, label); -} -void RenderPipeline::reference() { - return wgpuRenderPipelineReference(m_raw); -} -void RenderPipeline::release() { - return wgpuRenderPipelineRelease(m_raw); -} - - -// Methods of Sampler -void Sampler::setLabel(char const * label) { - return wgpuSamplerSetLabel(m_raw, label); -} -void Sampler::reference() { - return wgpuSamplerReference(m_raw); -} -void Sampler::release() { - return wgpuSamplerRelease(m_raw); -} - - -// Methods of ShaderModule -std::unique_ptr ShaderModule::getCompilationInfo(ShaderModuleGetCompilationInfoCallback&& callback) { - auto handle = std::make_unique(callback); - static auto cCallback = [](WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void * userdata) -> void { - ShaderModuleGetCompilationInfoCallback& callback = *reinterpret_cast(userdata); - callback(static_cast(status), *reinterpret_cast(compilationInfo)); - }; - wgpuShaderModuleGetCompilationInfo(m_raw, cCallback, reinterpret_cast(handle.get())); - return handle; -} -void ShaderModule::setLabel(char const * label) { - return wgpuShaderModuleSetLabel(m_raw, label); -} -void ShaderModule::reference() { - return wgpuShaderModuleReference(m_raw); -} -void ShaderModule::release() { - return wgpuShaderModuleRelease(m_raw); -} - - -// Methods of Surface -void Surface::configure(const SurfaceConfiguration& config) { - return wgpuSurfaceConfigure(m_raw, &config); -} -void Surface::getCapabilities(Adapter adapter, SurfaceCapabilities * capabilities) { - return wgpuSurfaceGetCapabilities(m_raw, adapter, capabilities); -} -void Surface::getCurrentTexture(SurfaceTexture * surfaceTexture) { - return wgpuSurfaceGetCurrentTexture(m_raw, surfaceTexture); -} -void Surface::present() { - return wgpuSurfacePresent(m_raw); -} -void Surface::setLabel(char const * label) { - return wgpuSurfaceSetLabel(m_raw, label); -} -void Surface::unconfigure() { - return wgpuSurfaceUnconfigure(m_raw); -} -void Surface::reference() { - return wgpuSurfaceReference(m_raw); -} -void Surface::release() { - return wgpuSurfaceRelease(m_raw); -} - - -// Methods of Texture -TextureView Texture::createView(const TextureViewDescriptor& descriptor) { - return wgpuTextureCreateView(m_raw, &descriptor); -} -TextureView Texture::createView() { - return wgpuTextureCreateView(m_raw, nullptr); -} -void Texture::destroy() { - return wgpuTextureDestroy(m_raw); -} -uint32_t Texture::getDepthOrArrayLayers() { - return wgpuTextureGetDepthOrArrayLayers(m_raw); -} -TextureDimension Texture::getDimension() { - return static_cast(wgpuTextureGetDimension(m_raw)); -} -TextureFormat Texture::getFormat() { - return static_cast(wgpuTextureGetFormat(m_raw)); -} -uint32_t Texture::getHeight() { - return wgpuTextureGetHeight(m_raw); -} -uint32_t Texture::getMipLevelCount() { - return wgpuTextureGetMipLevelCount(m_raw); -} -uint32_t Texture::getSampleCount() { - return wgpuTextureGetSampleCount(m_raw); -} -TextureUsageFlags Texture::getUsage() { - return wgpuTextureGetUsage(m_raw); -} -uint32_t Texture::getWidth() { - return wgpuTextureGetWidth(m_raw); -} -void Texture::setLabel(char const * label) { - return wgpuTextureSetLabel(m_raw, label); -} -void Texture::reference() { - return wgpuTextureReference(m_raw); -} -void Texture::release() { - return wgpuTextureRelease(m_raw); -} - - -// Methods of TextureView -void TextureView::setLabel(char const * label) { - return wgpuTextureViewSetLabel(m_raw, label); -} -void TextureView::reference() { - return wgpuTextureViewReference(m_raw); -} -void TextureView::release() { - return wgpuTextureViewRelease(m_raw); -} - - - -// Extra implementations -Adapter Instance::requestAdapter(const RequestAdapterOptions& options) { - Adapter adapter = nullptr; - bool requestEnded = false; - - auto onAdapterRequestEnded = [&adapter, &requestEnded](RequestAdapterStatus status, Adapter _adapter, char const * message) { - if (status == RequestAdapterStatus::Success) { - adapter = _adapter; - } else { - std::cout << "Could not get WebGPU adapter: " << message << std::endl; - } - requestEnded = true; - }; - - auto h = requestAdapter(options, onAdapterRequestEnded); - -#if __EMSCRIPTEN__ - while (!requestEnded) { - emscripten_sleep(100); - } -#endif - - assert(requestEnded); - return adapter; -} - -Device Adapter::requestDevice(const DeviceDescriptor& descriptor) { - WGPUDevice device = nullptr; - bool requestEnded = false; - - auto onDeviceRequestEnded = [&device, &requestEnded](RequestDeviceStatus status, Device _device, char const * message) { - if (status == RequestDeviceStatus::Success) { - device = _device; - } else { - std::cout << "Could not get WebGPU adapter: " << message << std::endl; - } - requestEnded = true; - }; - - auto h = requestDevice(descriptor, onDeviceRequestEnded); - -#if __EMSCRIPTEN__ - while (!requestEnded) { - emscripten_sleep(100); - } -#endif - - assert(requestEnded); - return device; -} - -#endif // WEBGPU_CPP_IMPLEMENTATION - -#undef HANDLE -#undef DESCRIPTOR -#undef ENUM -#undef ENUM_ENTRY -#undef END - -} // namespace wgpu