From 49b972218e5ec233f0efcb53226d8962102d0c5c Mon Sep 17 00:00:00 2001 From: soywiz Date: Sat, 29 Jun 2024 15:35:04 +0200 Subject: [PATCH] Initial WebGPU bindings for the JVM --- korge-core/src@jvm/korlibs/webgpu/WebGPU.kt | 841 +++++++ .../korlibs/webgpu/WebGPUStructures.kt | 582 +++++ .../korlibs/webgpu/WebGPUStructuresTypedef.kt | 77 + webgpu.h | 2091 +++++++++++++++++ 4 files changed, 3591 insertions(+) create mode 100644 korge-core/src@jvm/korlibs/webgpu/WebGPU.kt create mode 100644 korge-core/src@jvm/korlibs/webgpu/WebGPUStructures.kt create mode 100644 korge-core/src@jvm/korlibs/webgpu/WebGPUStructuresTypedef.kt create mode 100644 webgpu.h diff --git a/korge-core/src@jvm/korlibs/webgpu/WebGPU.kt b/korge-core/src@jvm/korlibs/webgpu/WebGPU.kt new file mode 100644 index 0000000000..1ee424216b --- /dev/null +++ b/korge-core/src@jvm/korlibs/webgpu/WebGPU.kt @@ -0,0 +1,841 @@ +package korlibs.webgpu + +import korlibs.ffi.* + +typealias float = Float +typealias size_t = Int +typealias int16_t = Short +typealias uint16_t = Short +typealias int32_t = Int +typealias uint32_t = Int +typealias WGPUBool = Boolean +typealias uint64_t = Long + +typealias VoidPointer = FFIPointer +typealias IntPointer = FFIPointer + +typealias WGPUChainedStruct = FFIPointer +typealias WGPUChainedStructOut = FFIPointer + +typealias WGPUDevice = FFIPointer +typealias WGPUInstance = FFIPointer +typealias WGPUAdapter = FFIPointer +typealias WGPUBindGroup = FFIPointer +typealias WGPUPipelineLayout = FFIPointer +typealias WGPUTexture = FFIPointer +typealias WGPUTextureView = FFIPointer +typealias WGPUSurface = FFIPointer +typealias WGPUShaderModule = FFIPointer +typealias WGPUSampler = FFIPointer +typealias WGPURenderPipeline = FFIPointer +typealias WGPUBindGroupLayout = FFIPointer +typealias WGPURenderPassEncoder = FFIPointer +typealias WGPURenderBundleEncoder = FFIPointer +typealias WGPUBuffer = FFIPointer +typealias WGPURenderBundle = FFIPointer +typealias WGPUComputePassEncoder = FFIPointer +typealias WGPUComputePipeline = FFIPointer +typealias WGPUCommandEncoder = FFIPointer +typealias WGPUQuerySet = FFIPointer +typealias WGPUCommandBuffer = FFIPointer +typealias WGPUQueue = FFIPointer +typealias WGPUProc = FFIPointer + +typealias WGPUErrorCallback = FFIPointer +typealias WGPUShaderModuleGetCompilationInfoCallback = FFIPointer +typealias WGPUQueueOnSubmittedWorkDoneCallback = FFIPointer +typealias WGPUDeviceLostCallback = FFIPointer +typealias WGPUAdapterRequestDeviceCallback = FFIPointer +typealias WGPUBufferMapAsyncCallback = FFIPointer +typealias WGPUDeviceCreateComputePipelineAsyncCallback = FFIPointer +typealias WGPUDeviceCreateRenderPipelineAsyncCallback = FFIPointer +typealias WGPUInstanceRequestAdapterCallback = FFIPointer + +//inline class WGPUAdapterType(val value: Int) +//inline class WGPUAddressMode(val value: Int) +//inline class WGPUBackendType(val value: Int) +//inline class WGPUBlendFactor(val value: Int) +//inline class WGPUBlendOperation(val value: Int) +//inline class WGPUBufferBindingType(val value: Int) +//inline class WGPUBufferMapAsyncStatus(val value: Int) +//inline class WGPUBufferMapState(val value: Int) +//inline class WGPUCompareFunction(val value: Int) +//inline class WGPUCompilationInfoRequestStatus(val value: Int) +//inline class WGPUCompilationMessageType(val value: Int) +//inline class WGPUCompositeAlphaMode(val value: Int) +//inline class WGPUCreatePipelineAsyncStatus(val value: Int) +//inline class WGPUCullMode(val value: Int) +//inline class WGPUDeviceLostReason(val value: Int) +//inline class WGPUErrorFilter(val value: Int) +//inline class WGPUErrorType(val value: Int) +//inline class WGPUFeatureName(val value: Int) +//inline class WGPUFilterMode(val value: Int) +//inline class WGPUFrontFace(val value: Int) +//inline class WGPUIndexFormat(val value: Int) +//inline class WGPULoadOp(val value: Int) +//inline class WGPUMipmapFilterMode(val value: Int) +//inline class WGPUPowerPreference(val value: Int) +//inline class WGPUPresentMode(val value: Int) +//inline class WGPUPrimitiveTopology(val value: Int) +//inline class WGPUQueryType(val value: Int) +//inline class WGPUQueueWorkDoneStatus(val value: Int) +//inline class WGPURequestAdapterStatus(val value: Int) +//inline class WGPURequestDeviceStatus(val value: Int) +//inline class WGPUSType(val value: Int) +//inline class WGPUSamplerBindingType(val value: Int) +//inline class WGPUStencilOperation(val value: Int) +//inline class WGPUStorageTextureAccess(val value: Int) +//inline class WGPUStoreOp(val value: Int) +//inline class WGPUSurfaceGetCurrentTextureStatus(val value: Int) +//inline class WGPUTextureAspect(val value: Int) +//inline class WGPUTextureDimension(val value: Int) +//inline class WGPUTextureFormat(val value: Int) +//inline class WGPUTextureSampleType(val value: Int) +//inline class WGPUTextureViewDimension(val value: Int) +//inline class WGPUVertexFormat(val value: Int) +//inline class WGPUVertexStepMode(val value: Int) +//inline class WGPUWGSLFeatureName(val value: Int) +//inline class WGPUBufferUsage(val value: Int) +//inline class WGPUColorWriteMask(val value: Int) +//inline class WGPUMapMode(val value: Int) +//inline class WGPUShaderStage(val value: Int) +//inline class WGPUTextureUsage(val value: Int) + +typealias WGPUAdapterType = Int +typealias WGPUAddressMode = Int +typealias WGPUBackendType = Int +typealias WGPUBlendFactor = Int +typealias WGPUBlendOperation = Int +typealias WGPUBufferBindingType = Int +typealias WGPUBufferMapAsyncStatus = Int +typealias WGPUBufferMapState = Int +typealias WGPUCompareFunction = Int +typealias WGPUCompilationInfoRequestStatus = Int +typealias WGPUCompilationMessageType = Int +typealias WGPUCompositeAlphaMode = Int +typealias WGPUCreatePipelineAsyncStatus = Int +typealias WGPUCullMode = Int +typealias WGPUDeviceLostReason = Int +typealias WGPUErrorFilter = Int +typealias WGPUErrorType = Int +typealias WGPUFeatureName = Int +typealias WGPUFilterMode = Int +typealias WGPUFrontFace = Int +typealias WGPUIndexFormat = Int +typealias WGPULoadOp = Int +typealias WGPUMipmapFilterMode = Int +typealias WGPUPowerPreference = Int +typealias WGPUPresentMode = Int +typealias WGPUPrimitiveTopology = Int +typealias WGPUQueryType = Int +typealias WGPUQueueWorkDoneStatus = Int +typealias WGPURequestAdapterStatus = Int +typealias WGPURequestDeviceStatus = Int +typealias WGPUSType = Int +typealias WGPUSamplerBindingType = Int +typealias WGPUStencilOperation = Int +typealias WGPUStorageTextureAccess = Int +typealias WGPUStoreOp = Int +typealias WGPUSurfaceGetCurrentTextureStatus = Int +typealias WGPUTextureAspect = Int +typealias WGPUTextureDimension = Int +typealias WGPUTextureFormat = Int +typealias WGPUTextureSampleType = Int +typealias WGPUTextureViewDimension = Int +typealias WGPUVertexFormat = Int +typealias WGPUVertexStepMode = Int +typealias WGPUWGSLFeatureName = Int +typealias WGPUBufferUsage = Int +typealias WGPUColorWriteMask = Int +typealias WGPUMapMode = Int +typealias WGPUShaderStage = Int +typealias WGPUTextureUsage = Int + +typealias WGPUBufferUsageFlags = WGPUBufferUsage +typealias WGPUTextureUsageFlags = WGPUTextureUsage +typealias WGPUMapModeFlags = WGPUMapMode + + +// https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.h +object WebGPU { + // Constants + const val WGPUAdapterType_DiscreteGPU = 0x00000000 + const val WGPUAdapterType_IntegratedGPU = 0x00000001 + const val WGPUAdapterType_CPU = 0x00000002 + const val WGPUAdapterType_Unknown = 0x00000003 + const val WGPUAdapterType_Force32 = 0x7FFFFFFF + + const val WGPUAddressMode_Repeat = 0x00000000 + const val WGPUAddressMode_MirrorRepeat = 0x00000001 + const val WGPUAddressMode_ClampToEdge = 0x00000002 + const val WGPUAddressMode_Force32 = 0x7FFFFFFF + + const val WGPUBackendType_Undefined = 0x00000000 + const val WGPUBackendType_Null = 0x00000001 + const val WGPUBackendType_WebGPU = 0x00000002 + const val WGPUBackendType_D3D11 = 0x00000003 + const val WGPUBackendType_D3D12 = 0x00000004 + const val WGPUBackendType_Metal = 0x00000005 + const val WGPUBackendType_Vulkan = 0x00000006 + const val WGPUBackendType_OpenGL = 0x00000007 + const val WGPUBackendType_OpenGLES = 0x00000008 + const val WGPUBackendType_Force32 = 0x7FFFFFFF + + const val WGPUBlendFactor_Zero = 0x00000000 + const val WGPUBlendFactor_One = 0x00000001 + const val WGPUBlendFactor_Src = 0x00000002 + const val WGPUBlendFactor_OneMinusSrc = 0x00000003 + const val WGPUBlendFactor_SrcAlpha = 0x00000004 + const val WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005 + const val WGPUBlendFactor_Dst = 0x00000006 + const val WGPUBlendFactor_OneMinusDst = 0x00000007 + const val WGPUBlendFactor_DstAlpha = 0x00000008 + const val WGPUBlendFactor_OneMinusDstAlpha = 0x00000009 + const val WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A + const val WGPUBlendFactor_Constant = 0x0000000B + const val WGPUBlendFactor_OneMinusConstant = 0x0000000C + const val WGPUBlendFactor_Force32 = 0x7FFFFFFF + + const val WGPUBlendOperation_Add = 0x00000000 + const val WGPUBlendOperation_Subtract = 0x00000001 + const val WGPUBlendOperation_ReverseSubtract = 0x00000002 + const val WGPUBlendOperation_Min = 0x00000003 + const val WGPUBlendOperation_Max = 0x00000004 + const val WGPUBlendOperation_Force32 = 0x7FFFFFFF + + const val WGPUBufferBindingType_Undefined = 0x00000000 + const val WGPUBufferBindingType_Uniform = 0x00000001 + const val WGPUBufferBindingType_Storage = 0x00000002 + const val WGPUBufferBindingType_ReadOnlyStorage = 0x00000003 + const val WGPUBufferBindingType_Force32 = 0x7FFFFFFF + + const val WGPUBufferMapAsyncStatus_Success = 0x00000000 + const val WGPUBufferMapAsyncStatus_ValidationError = 0x00000001 + const val WGPUBufferMapAsyncStatus_Unknown = 0x00000002 + const val WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003 + const val WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004 + const val WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005 + const val WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000006 + const val WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000007 + const val WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000008 + const val WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF + + const val WGPUBufferMapState_Unmapped = 0x00000000 + const val WGPUBufferMapState_Pending = 0x00000001 + const val WGPUBufferMapState_Mapped = 0x00000002 + const val WGPUBufferMapState_Force32 = 0x7FFFFFFF + + const val WGPUCompareFunction_Undefined = 0x00000000 + const val WGPUCompareFunction_Never = 0x00000001 + const val WGPUCompareFunction_Less = 0x00000002 + const val WGPUCompareFunction_LessEqual = 0x00000003 + const val WGPUCompareFunction_Greater = 0x00000004 + const val WGPUCompareFunction_GreaterEqual = 0x00000005 + const val WGPUCompareFunction_Equal = 0x00000006 + const val WGPUCompareFunction_NotEqual = 0x00000007 + const val WGPUCompareFunction_Always = 0x00000008 + const val WGPUCompareFunction_Force32 = 0x7FFFFFFF + + const val WGPUCompilationInfoRequestStatus_Success = 0x00000000 + const val WGPUCompilationInfoRequestStatus_Error = 0x00000001 + const val WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002 + const val WGPUCompilationInfoRequestStatus_Unknown = 0x00000003 + const val WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF + + const val WGPUCompilationMessageType_Error = 0x00000000 + const val WGPUCompilationMessageType_Warning = 0x00000001 + const val WGPUCompilationMessageType_Info = 0x00000002 + const val WGPUCompilationMessageType_Force32 = 0x7FFFFFFF + + const val WGPUCompositeAlphaMode_Auto = 0x00000000 + const val WGPUCompositeAlphaMode_Opaque = 0x00000001 + const val WGPUCompositeAlphaMode_Premultiplied = 0x00000002 + const val WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003 + const val WGPUCompositeAlphaMode_Inherit = 0x00000004 + const val WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF + + const val WGPUCreatePipelineAsyncStatus_Success = 0x00000000 + const val WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000001 + const val WGPUCreatePipelineAsyncStatus_InternalError = 0x00000002 + const val WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000003 + const val WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000004 + const val WGPUCreatePipelineAsyncStatus_Unknown = 0x00000005 + const val WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF + + const val WGPUCullMode_None = 0x00000000 + const val WGPUCullMode_Front = 0x00000001 + const val WGPUCullMode_Back = 0x00000002 + const val WGPUCullMode_Force32 = 0x7FFFFFFF + + const val WGPUDeviceLostReason_Unknown = 0x00000001 + const val WGPUDeviceLostReason_Destroyed = 0x00000002 + const val WGPUDeviceLostReason_Force32 = 0x7FFFFFFF + + const val WGPUErrorFilter_Validation = 0x00000000 + const val WGPUErrorFilter_OutOfMemory = 0x00000001 + const val WGPUErrorFilter_Internal = 0x00000002 + const val WGPUErrorFilter_Force32 = 0x7FFFFFFF + + const val WGPUErrorType_NoError = 0x00000000 + const val WGPUErrorType_Validation = 0x00000001 + const val WGPUErrorType_OutOfMemory = 0x00000002 + const val WGPUErrorType_Internal = 0x00000003 + const val WGPUErrorType_Unknown = 0x00000004 + const val WGPUErrorType_DeviceLost = 0x00000005 + const val WGPUErrorType_Force32 = 0x7FFFFFFF + + const val WGPUFeatureName_Undefined = 0x00000000 + const val WGPUFeatureName_DepthClipControl = 0x00000001 + const val WGPUFeatureName_Depth32FloatStencil8 = 0x00000002 + const val WGPUFeatureName_TimestampQuery = 0x00000003 + const val WGPUFeatureName_TextureCompressionBC = 0x00000004 + const val WGPUFeatureName_TextureCompressionETC2 = 0x00000005 + const val WGPUFeatureName_TextureCompressionASTC = 0x00000006 + const val WGPUFeatureName_IndirectFirstInstance = 0x00000007 + const val WGPUFeatureName_ShaderF16 = 0x00000008 + const val WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009 + const val WGPUFeatureName_BGRA8UnormStorage = 0x0000000A + const val WGPUFeatureName_Float32Filterable = 0x0000000B + const val WGPUFeatureName_Force32 = 0x7FFFFFFF + + const val WGPUFilterMode_Nearest = 0x00000000 + const val WGPUFilterMode_Linear = 0x00000001 + const val WGPUFilterMode_Force32 = 0x7FFFFFFF + + const val WGPUFrontFace_CCW = 0x00000000 + const val WGPUFrontFace_CW = 0x00000001 + const val WGPUFrontFace_Force32 = 0x7FFFFFFF + + const val WGPUIndexFormat_Undefined = 0x00000000 + const val WGPUIndexFormat_Uint16 = 0x00000001 + const val WGPUIndexFormat_Uint32 = 0x00000002 + const val WGPUIndexFormat_Force32 = 0x7FFFFFFF + + const val WGPULoadOp_Undefined = 0x00000000 + const val WGPULoadOp_Clear = 0x00000001 + const val WGPULoadOp_Load = 0x00000002 + const val WGPULoadOp_Force32 = 0x7FFFFFFF + + const val WGPUMipmapFilterMode_Nearest = 0x00000000 + const val WGPUMipmapFilterMode_Linear = 0x00000001 + const val WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF + + const val WGPUPowerPreference_Undefined = 0x00000000 + const val WGPUPowerPreference_LowPower = 0x00000001 + const val WGPUPowerPreference_HighPerformance = 0x00000002 + const val WGPUPowerPreference_Force32 = 0x7FFFFFFF + + const val WGPUPresentMode_Fifo = 0x00000000 + const val WGPUPresentMode_FifoRelaxed = 0x00000001 + const val WGPUPresentMode_Immediate = 0x00000002 + const val WGPUPresentMode_Mailbox = 0x00000003 + const val WGPUPresentMode_Force32 = 0x7FFFFFFF + + const val WGPUPrimitiveTopology_PointList = 0x00000000 + const val WGPUPrimitiveTopology_LineList = 0x00000001 + const val WGPUPrimitiveTopology_LineStrip = 0x00000002 + const val WGPUPrimitiveTopology_TriangleList = 0x00000003 + const val WGPUPrimitiveTopology_TriangleStrip = 0x00000004 + const val WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF + + const val WGPUQueryType_Occlusion = 0x00000000 + const val WGPUQueryType_Timestamp = 0x00000001 + const val WGPUQueryType_Force32 = 0x7FFFFFFF + + const val WGPUQueueWorkDoneStatus_Success = 0x00000000 + const val WGPUQueueWorkDoneStatus_Error = 0x00000001 + const val WGPUQueueWorkDoneStatus_Unknown = 0x00000002 + const val WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003 + const val WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF + + const val WGPURequestAdapterStatus_Success = 0x00000000 + const val WGPURequestAdapterStatus_Unavailable = 0x00000001 + const val WGPURequestAdapterStatus_Error = 0x00000002 + const val WGPURequestAdapterStatus_Unknown = 0x00000003 + const val WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF + + const val WGPURequestDeviceStatus_Success = 0x00000000 + const val WGPURequestDeviceStatus_Error = 0x00000001 + const val WGPURequestDeviceStatus_Unknown = 0x00000002 + const val WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF + + const val WGPUSType_Invalid = 0x00000000 + const val WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001 + const val WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002 + const val WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003 + const val WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004 + const val WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005 + const val WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006 + const val WGPUSType_PrimitiveDepthClipControl = 0x00000007 + const val WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008 + const val WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009 + const val WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A + const val WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F + const val WGPUSType_Force32 = 0x7FFFFFFF + + const val WGPUSamplerBindingType_Undefined = 0x00000000 + const val WGPUSamplerBindingType_Filtering = 0x00000001 + const val WGPUSamplerBindingType_NonFiltering = 0x00000002 + const val WGPUSamplerBindingType_Comparison = 0x00000003 + const val WGPUSamplerBindingType_Force32 = 0x7FFFFFFF + + const val WGPUStencilOperation_Keep = 0x00000000 + const val WGPUStencilOperation_Zero = 0x00000001 + const val WGPUStencilOperation_Replace = 0x00000002 + const val WGPUStencilOperation_Invert = 0x00000003 + const val WGPUStencilOperation_IncrementClamp = 0x00000004 + const val WGPUStencilOperation_DecrementClamp = 0x00000005 + const val WGPUStencilOperation_IncrementWrap = 0x00000006 + const val WGPUStencilOperation_DecrementWrap = 0x00000007 + const val WGPUStencilOperation_Force32 = 0x7FFFFFFF + + const val WGPUStorageTextureAccess_Undefined = 0x00000000 + const val WGPUStorageTextureAccess_WriteOnly = 0x00000001 + const val WGPUStorageTextureAccess_ReadOnly = 0x00000002 + const val WGPUStorageTextureAccess_ReadWrite = 0x00000003 + const val WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF + + const val WGPUStoreOp_Undefined = 0x00000000 + const val WGPUStoreOp_Store = 0x00000001 + const val WGPUStoreOp_Discard = 0x00000002 + const val WGPUStoreOp_Force32 = 0x7FFFFFFF + + const val WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000 + const val WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001 + const val WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002 + const val WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003 + const val WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004 + const val WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005 + const val WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF + + const val WGPUTextureAspect_All = 0x00000000 + const val WGPUTextureAspect_StencilOnly = 0x00000001 + const val WGPUTextureAspect_DepthOnly = 0x00000002 + const val WGPUTextureAspect_Force32 = 0x7FFFFFFF + + const val WGPUTextureDimension_1D = 0x00000000 + const val WGPUTextureDimension_2D = 0x00000001 + const val WGPUTextureDimension_3D = 0x00000002 + const val WGPUTextureDimension_Force32 = 0x7FFFFFFF + + const val WGPUTextureFormat_Undefined = 0x00000000 + const val WGPUTextureFormat_R8Unorm = 0x00000001 + const val WGPUTextureFormat_R8Snorm = 0x00000002 + const val WGPUTextureFormat_R8Uint = 0x00000003 + const val WGPUTextureFormat_R8Sint = 0x00000004 + const val WGPUTextureFormat_R16Uint = 0x00000005 + const val WGPUTextureFormat_R16Sint = 0x00000006 + const val WGPUTextureFormat_R16Float = 0x00000007 + const val WGPUTextureFormat_RG8Unorm = 0x00000008 + const val WGPUTextureFormat_RG8Snorm = 0x00000009 + const val WGPUTextureFormat_RG8Uint = 0x0000000A + const val WGPUTextureFormat_RG8Sint = 0x0000000B + const val WGPUTextureFormat_R32Float = 0x0000000C + const val WGPUTextureFormat_R32Uint = 0x0000000D + const val WGPUTextureFormat_R32Sint = 0x0000000E + const val WGPUTextureFormat_RG16Uint = 0x0000000F + const val WGPUTextureFormat_RG16Sint = 0x00000010 + const val WGPUTextureFormat_RG16Float = 0x00000011 + const val WGPUTextureFormat_RGBA8Unorm = 0x00000012 + const val WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013 + const val WGPUTextureFormat_RGBA8Snorm = 0x00000014 + const val WGPUTextureFormat_RGBA8Uint = 0x00000015 + const val WGPUTextureFormat_RGBA8Sint = 0x00000016 + const val WGPUTextureFormat_BGRA8Unorm = 0x00000017 + const val WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018 + const val WGPUTextureFormat_RGB10A2Uint = 0x00000019 + const val WGPUTextureFormat_RGB10A2Unorm = 0x0000001A + const val WGPUTextureFormat_RG11B10Ufloat = 0x0000001B + const val WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C + const val WGPUTextureFormat_RG32Float = 0x0000001D + const val WGPUTextureFormat_RG32Uint = 0x0000001E + const val WGPUTextureFormat_RG32Sint = 0x0000001F + const val WGPUTextureFormat_RGBA16Uint = 0x00000020 + const val WGPUTextureFormat_RGBA16Sint = 0x00000021 + const val WGPUTextureFormat_RGBA16Float = 0x00000022 + const val WGPUTextureFormat_RGBA32Float = 0x00000023 + const val WGPUTextureFormat_RGBA32Uint = 0x00000024 + const val WGPUTextureFormat_RGBA32Sint = 0x00000025 + const val WGPUTextureFormat_Stencil8 = 0x00000026 + const val WGPUTextureFormat_Depth16Unorm = 0x00000027 + const val WGPUTextureFormat_Depth24Plus = 0x00000028 + const val WGPUTextureFormat_Depth24PlusStencil8 = 0x00000029 + const val WGPUTextureFormat_Depth32Float = 0x0000002A + const val WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B + const val WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C + const val WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D + const val WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E + const val WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F + const val WGPUTextureFormat_BC3RGBAUnorm = 0x00000030 + const val WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031 + const val WGPUTextureFormat_BC4RUnorm = 0x00000032 + const val WGPUTextureFormat_BC4RSnorm = 0x00000033 + const val WGPUTextureFormat_BC5RGUnorm = 0x00000034 + const val WGPUTextureFormat_BC5RGSnorm = 0x00000035 + const val WGPUTextureFormat_BC6HRGBUfloat = 0x00000036 + const val WGPUTextureFormat_BC6HRGBFloat = 0x00000037 + const val WGPUTextureFormat_BC7RGBAUnorm = 0x00000038 + const val WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039 + const val WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A + const val WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B + const val WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C + const val WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D + const val WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E + const val WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F + const val WGPUTextureFormat_EACR11Unorm = 0x00000040 + const val WGPUTextureFormat_EACR11Snorm = 0x00000041 + const val WGPUTextureFormat_EACRG11Unorm = 0x00000042 + const val WGPUTextureFormat_EACRG11Snorm = 0x00000043 + const val WGPUTextureFormat_ASTC4x4Unorm = 0x00000044 + const val WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045 + const val WGPUTextureFormat_ASTC5x4Unorm = 0x00000046 + const val WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047 + const val WGPUTextureFormat_ASTC5x5Unorm = 0x00000048 + const val WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049 + const val WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A + const val WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B + const val WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C + const val WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D + const val WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E + const val WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F + const val WGPUTextureFormat_ASTC8x6Unorm = 0x00000050 + const val WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051 + const val WGPUTextureFormat_ASTC8x8Unorm = 0x00000052 + const val WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053 + const val WGPUTextureFormat_ASTC10x5Unorm = 0x00000054 + const val WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055 + const val WGPUTextureFormat_ASTC10x6Unorm = 0x00000056 + const val WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057 + const val WGPUTextureFormat_ASTC10x8Unorm = 0x00000058 + const val WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059 + const val WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A + const val WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B + const val WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C + const val WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D + const val WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E + const val WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F + const val WGPUTextureFormat_Force32 = 0x7FFFFFFF + + const val WGPUTextureSampleType_Undefined = 0x00000000 + const val WGPUTextureSampleType_Float = 0x00000001 + const val WGPUTextureSampleType_UnfilterableFloat = 0x00000002 + const val WGPUTextureSampleType_Depth = 0x00000003 + const val WGPUTextureSampleType_Sint = 0x00000004 + const val WGPUTextureSampleType_Uint = 0x00000005 + const val WGPUTextureSampleType_Force32 = 0x7FFFFFFF + + const val WGPUTextureViewDimension_Undefined = 0x00000000 + const val WGPUTextureViewDimension_1D = 0x00000001 + const val WGPUTextureViewDimension_2D = 0x00000002 + const val WGPUTextureViewDimension_2DArray = 0x00000003 + const val WGPUTextureViewDimension_Cube = 0x00000004 + const val WGPUTextureViewDimension_CubeArray = 0x00000005 + const val WGPUTextureViewDimension_3D = 0x00000006 + const val WGPUTextureViewDimension_Force32 = 0x7FFFFFFF + + const val WGPUVertexFormat_Undefined = 0x00000000 + const val WGPUVertexFormat_Uint8x2 = 0x00000001 + const val WGPUVertexFormat_Uint8x4 = 0x00000002 + const val WGPUVertexFormat_Sint8x2 = 0x00000003 + const val WGPUVertexFormat_Sint8x4 = 0x00000004 + const val WGPUVertexFormat_Unorm8x2 = 0x00000005 + const val WGPUVertexFormat_Unorm8x4 = 0x00000006 + const val WGPUVertexFormat_Snorm8x2 = 0x00000007 + const val WGPUVertexFormat_Snorm8x4 = 0x00000008 + const val WGPUVertexFormat_Uint16x2 = 0x00000009 + const val WGPUVertexFormat_Uint16x4 = 0x0000000A + const val WGPUVertexFormat_Sint16x2 = 0x0000000B + const val WGPUVertexFormat_Sint16x4 = 0x0000000C + const val WGPUVertexFormat_Unorm16x2 = 0x0000000D + const val WGPUVertexFormat_Unorm16x4 = 0x0000000E + const val WGPUVertexFormat_Snorm16x2 = 0x0000000F + const val WGPUVertexFormat_Snorm16x4 = 0x00000010 + const val WGPUVertexFormat_Float16x2 = 0x00000011 + const val WGPUVertexFormat_Float16x4 = 0x00000012 + const val WGPUVertexFormat_Float32 = 0x00000013 + const val WGPUVertexFormat_Float32x2 = 0x00000014 + const val WGPUVertexFormat_Float32x3 = 0x00000015 + const val WGPUVertexFormat_Float32x4 = 0x00000016 + const val WGPUVertexFormat_Uint32 = 0x00000017 + const val WGPUVertexFormat_Uint32x2 = 0x00000018 + const val WGPUVertexFormat_Uint32x3 = 0x00000019 + const val WGPUVertexFormat_Uint32x4 = 0x0000001A + const val WGPUVertexFormat_Sint32 = 0x0000001B + const val WGPUVertexFormat_Sint32x2 = 0x0000001C + const val WGPUVertexFormat_Sint32x3 = 0x0000001D + const val WGPUVertexFormat_Sint32x4 = 0x0000001E + const val WGPUVertexFormat_Force32 = 0x7FFFFFFF + + const val WGPUVertexStepMode_Vertex = 0x00000000 + const val WGPUVertexStepMode_Instance = 0x00000001 + const val WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002 + const val WGPUVertexStepMode_Force32 = 0x7FFFFFFF + + const val WGPUWGSLFeatureName_Undefined = 0x00000000 + const val WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001 + const val WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002 + const val WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003 + const val WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004 + const val WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF + + const val WGPUBufferUsage_None = 0x00000000 + const val WGPUBufferUsage_MapRead = 0x00000001 + const val WGPUBufferUsage_MapWrite = 0x00000002 + const val WGPUBufferUsage_CopySrc = 0x00000004 + const val WGPUBufferUsage_CopyDst = 0x00000008 + const val WGPUBufferUsage_Index = 0x00000010 + const val WGPUBufferUsage_Vertex = 0x00000020 + const val WGPUBufferUsage_Uniform = 0x00000040 + const val WGPUBufferUsage_Storage = 0x00000080 + const val WGPUBufferUsage_Indirect = 0x00000100 + const val WGPUBufferUsage_QueryResolve = 0x00000200 + const val WGPUBufferUsage_Force32 = 0x7FFFFFFF + + const val WGPUColorWriteMask_None = 0x00000000 + const val WGPUColorWriteMask_Red = 0x00000001 + const val WGPUColorWriteMask_Green = 0x00000002 + const val WGPUColorWriteMask_Blue = 0x00000004 + const val WGPUColorWriteMask_Alpha = 0x00000008 + const val WGPUColorWriteMask_All = WGPUColorWriteMask_None or WGPUColorWriteMask_Red or WGPUColorWriteMask_Green or WGPUColorWriteMask_Blue or WGPUColorWriteMask_Alpha + const val WGPUColorWriteMask_Force32 = 0x7FFFFFFF + + const val WGPUMapMode_None = 0x00000000 + const val WGPUMapMode_Read = 0x00000001 + const val WGPUMapMode_Write = 0x00000002 + const val WGPUMapMode_Force32 = 0x7FFFFFFF + + const val WGPUShaderStage_None = 0x00000000 + const val WGPUShaderStage_Vertex = 0x00000001 + const val WGPUShaderStage_Fragment = 0x00000002 + const val WGPUShaderStage_Compute = 0x00000004 + const val WGPUShaderStage_Force32 = 0x7FFFFFFF + + const val WGPUTextureUsage_None = 0x00000000 + const val WGPUTextureUsage_CopySrc = 0x00000001 + const val WGPUTextureUsage_CopyDst = 0x00000002 + const val WGPUTextureUsage_TextureBinding = 0x00000004 + const val WGPUTextureUsage_StorageBinding = 0x00000008 + const val WGPUTextureUsage_RenderAttachment = 0x00000010 + const val WGPUTextureUsage_Force32 = 0x7FFFFFFF + + // Functions + external fun wgpuCreateInstance(descriptor: WGPUInstanceDescriptor): WGPUInstance + external fun wgpuGetProcAddress(device: WGPUDevice, procName: String): WGPUProc + + external fun wgpuAdapterEnumerateFeatures(adapter: WGPUAdapter, features: WGPUFeatureName): size_t + external fun wgpuAdapterGetInfo(adapter: WGPUAdapter, info: WGPUAdapterInfo) + external fun wgpuAdapterGetLimits(adapter: WGPUAdapter, limits: WGPUSupportedLimits): WGPUBool + external fun wgpuAdapterHasFeature(adapter: WGPUAdapter, feature: WGPUFeatureName): WGPUBool + external fun wgpuAdapterRequestDevice(adapter: WGPUAdapter, descriptor: WGPUDeviceDescriptor, callback: WGPUAdapterRequestDeviceCallback, userdata: FFIPointer?) + external fun wgpuAdapterReference(adapter: WGPUAdapter) + external fun wgpuAdapterRelease(adapter: WGPUAdapter) + + external fun wgpuAdapterInfoFreeMembers(adapterInfo: WGPUAdapterInfo) + external fun wgpuBindGroupSetLabel(bindGroup: WGPUBindGroup, label: String) + + external fun wgpuBindGroupReference(bindGroup: WGPUBindGroup) + external fun wgpuBindGroupRelease(bindGroup: WGPUBindGroup) + + external fun wgpuBindGroupLayoutSetLabel(bindGroupLayout: WGPUBindGroupLayout, label: String) + external fun wgpuBindGroupLayoutReference(bindGroupLayout: WGPUBindGroupLayout) + external fun wgpuBindGroupLayoutRelease(bindGroupLayout: WGPUBindGroupLayout) + + external fun wgpuBufferDestroy(buffer: WGPUBuffer) + external fun wgpuBufferGetConstMappedRange(buffer: WGPUBuffer, offset: size_t, size: size_t): FFIPointer + external fun wgpuBufferGetMapState(buffer: WGPUBuffer): WGPUBufferMapState + external fun wgpuBufferGetMappedRange(buffer: WGPUBuffer, offset: size_t, size: size_t): FFIPointer + external fun wgpuBufferGetSize(buffer: WGPUBuffer): uint64_t + external fun wgpuBufferGetUsage(buffer: WGPUBuffer): WGPUBufferUsageFlags + external fun wgpuBufferMapAsync(buffer: WGPUBuffer, mode: WGPUMapModeFlags, offset: size_t, size: size_t, callback: WGPUBufferMapAsyncCallback, userdata: FFIPointer??) + external fun wgpuBufferSetLabel(buffer: WGPUBuffer, label: String) + external fun wgpuBufferUnmap(buffer: WGPUBuffer) + external fun wgpuBufferReference(buffer: WGPUBuffer) + external fun wgpuBufferRelease(buffer: WGPUBuffer) + + external fun wgpuCommandBufferSetLabel(commandBuffer: WGPUCommandBuffer, label: String) + external fun wgpuCommandBufferReference(commandBuffer: WGPUCommandBuffer) + external fun wgpuCommandBufferRelease(commandBuffer: WGPUCommandBuffer) + + external fun wgpuCommandEncoderBeginComputePass(commandEncoder: WGPUCommandEncoder, descriptor: WGPUComputePassDescriptor): WGPUComputePassEncoder + external fun wgpuCommandEncoderBeginRenderPass(commandEncoder: WGPUCommandEncoder, descriptor: WGPURenderPassDescriptor): WGPURenderPassEncoder + external fun wgpuCommandEncoderClearBuffer(commandEncoder: WGPUCommandEncoder, buffer: WGPUBuffer, offset: uint64_t, size: uint64_t) + external fun wgpuCommandEncoderCopyBufferToBuffer(commandEncoder: WGPUCommandEncoder, source: WGPUBuffer, sourceOffset: uint64_t, destination: WGPUBuffer, destinationOffset: uint64_t, size: uint64_t) + external fun wgpuCommandEncoderCopyBufferToTexture(commandEncoder: WGPUCommandEncoder, source: WGPUImageCopyBuffer, destination: WGPUImageCopyTexture, copySize: WGPUExtent3D) + external fun wgpuCommandEncoderCopyTextureToBuffer(commandEncoder: WGPUCommandEncoder, source: WGPUImageCopyTexture, destination: WGPUImageCopyBuffer, copySize: WGPUExtent3D) + external fun wgpuCommandEncoderCopyTextureToTexture(commandEncoder: WGPUCommandEncoder, source: WGPUImageCopyTexture, destination: WGPUImageCopyTexture, copySize: WGPUExtent3D) + external fun wgpuCommandEncoderFinish(commandEncoder: WGPUCommandEncoder, descriptor: WGPUCommandBufferDescriptor?): WGPUCommandBuffer + external fun wgpuCommandEncoderInsertDebugMarker(commandEncoder: WGPUCommandEncoder, markerLabel: String) + external fun wgpuCommandEncoderPopDebugGroup(commandEncoder: WGPUCommandEncoder) + external fun wgpuCommandEncoderPushDebugGroup(commandEncoder: WGPUCommandEncoder, groupLabel: String) + external fun wgpuCommandEncoderResolveQuerySet(commandEncoder: WGPUCommandEncoder, querySet: WGPUQuerySet, firstQuery: uint32_t, queryCount: uint32_t, destination: WGPUBuffer, destinationOffset: uint64_t) + external fun wgpuCommandEncoderSetLabel(commandEncoder: WGPUCommandEncoder, label: String) + external fun wgpuCommandEncoderWriteTimestamp(commandEncoder: WGPUCommandEncoder, querySet: WGPUQuerySet, queryIndex: uint32_t) + external fun wgpuCommandEncoderReference(commandEncoder: WGPUCommandEncoder) + external fun wgpuCommandEncoderRelease(commandEncoder: WGPUCommandEncoder) + + external fun wgpuComputePassEncoderDispatchWorkgroups(computePassEncoder: WGPUComputePassEncoder, workgroupCountX: uint32_t, workgroupCountY: uint32_t, workgroupCountZ: uint32_t) + external fun wgpuComputePassEncoderDispatchWorkgroupsIndirect(computePassEncoder: WGPUComputePassEncoder, indirectBuffer: WGPUBuffer, indirectOffset: uint64_t) + external fun wgpuComputePassEncoderEnd(computePassEncoder: WGPUComputePassEncoder) + external fun wgpuComputePassEncoderInsertDebugMarker(computePassEncoder: WGPUComputePassEncoder, markerLabel: String) + external fun wgpuComputePassEncoderPopDebugGroup(computePassEncoder: WGPUComputePassEncoder) + external fun wgpuComputePassEncoderPushDebugGroup(computePassEncoder: WGPUComputePassEncoder, groupLabel: String) + external fun wgpuComputePassEncoderSetBindGroup(computePassEncoder: WGPUComputePassEncoder, groupIndex: uint32_t, group: WGPUBindGroup?, dynamicOffsetCount: size_t, dynamicOffsets: IntArray) + external fun wgpuComputePassEncoderSetLabel(computePassEncoder: WGPUComputePassEncoder, label: String) + external fun wgpuComputePassEncoderSetPipeline(computePassEncoder: WGPUComputePassEncoder, pipeline: WGPUComputePipeline) + external fun wgpuComputePassEncoderReference(computePassEncoder: WGPUComputePassEncoder) + external fun wgpuComputePassEncoderRelease(computePassEncoder: WGPUComputePassEncoder) + + external fun wgpuComputePipelineGetBindGroupLayout(computePipeline: WGPUComputePipeline, groupIndex: uint32_t): WGPUBindGroupLayout + external fun wgpuComputePipelineSetLabel(computePipeline: WGPUComputePipeline, label: String) + external fun wgpuComputePipelineReference(computePipeline: WGPUComputePipeline) + external fun wgpuComputePipelineRelease(computePipeline: WGPUComputePipeline) + + external fun wgpuDeviceCreateBindGroup(device: WGPUDevice, descriptor: WGPUBindGroupDescriptor): WGPUBindGroup + external fun wgpuDeviceCreateBindGroupLayout(device: WGPUDevice, descriptor: WGPUBindGroupLayoutDescriptor): WGPUBindGroupLayout + external fun wgpuDeviceCreateBuffer(device: WGPUDevice, descriptor: WGPUBufferDescriptor): WGPUBuffer + external fun wgpuDeviceCreateCommandEncoder(device: WGPUDevice, descriptor: WGPUCommandEncoderDescriptor?): WGPUCommandEncoder + external fun wgpuDeviceCreateComputePipeline(device: WGPUDevice, descriptor: WGPUComputePipelineDescriptor): WGPUComputePipeline + external fun wgpuDeviceCreateComputePipelineAsync(device: WGPUDevice, descriptor: WGPUComputePipelineDescriptor, callback: WGPUDeviceCreateComputePipelineAsyncCallback, userdata: FFIPointer?) + external fun wgpuDeviceCreatePipelineLayout(device: WGPUDevice, descriptor: WGPUPipelineLayoutDescriptor): WGPUPipelineLayout + external fun wgpuDeviceCreateQuerySet(device: WGPUDevice, descriptor: WGPUQuerySetDescriptor): WGPUQuerySet + external fun wgpuDeviceCreateRenderBundleEncoder(device: WGPUDevice, descriptor: WGPURenderBundleEncoderDescriptor): WGPURenderBundleEncoder + external fun wgpuDeviceCreateRenderPipeline(device: WGPUDevice, descriptor: WGPURenderPipelineDescriptor): WGPURenderPipeline + external fun wgpuDeviceCreateRenderPipelineAsync(device: WGPUDevice, descriptor: WGPURenderPipelineDescriptor, callback: WGPUDeviceCreateRenderPipelineAsyncCallback, userdata: FFIPointer?) + external fun wgpuDeviceCreateSampler(device: WGPUDevice, descriptor: WGPUSamplerDescriptor?): WGPUSampler + external fun wgpuDeviceCreateShaderModule(device: WGPUDevice, descriptor: WGPUShaderModuleDescriptor): WGPUShaderModule + external fun wgpuDeviceCreateTexture(device: WGPUDevice, descriptor: WGPUTextureDescriptor): WGPUTexture + external fun wgpuDeviceDestroy(device: WGPUDevice) + external fun wgpuDeviceEnumerateFeatures(device: WGPUDevice, features: WGPUFeatureName): size_t + external fun wgpuDeviceGetLimits(device: WGPUDevice, limits: WGPUSupportedLimits): WGPUBool + external fun wgpuDeviceGetQueue(device: WGPUDevice): WGPUQueue + external fun wgpuDeviceHasFeature(device: WGPUDevice, feature: WGPUFeatureName): WGPUBool + external fun wgpuDevicePopErrorScope(device: WGPUDevice, callback: WGPUErrorCallback, userdata: FFIPointer?) + external fun wgpuDevicePushErrorScope(device: WGPUDevice, filter: WGPUErrorFilter) + external fun wgpuDeviceSetLabel(device: WGPUDevice, label: String) + external fun wgpuDeviceReference(device: WGPUDevice) + external fun wgpuDeviceRelease(device: WGPUDevice) + + external fun wgpuInstanceCreateSurface(instance: WGPUInstance, descriptor: WGPUSurfaceDescriptor): WGPUSurface + external fun wgpuInstanceHasWGSLLanguageFeature(instance: WGPUInstance, feature: WGPUWGSLFeatureName): WGPUBool + external fun wgpuInstanceProcessEvents(instance: WGPUInstance) + external fun wgpuInstanceRequestAdapter(instance: WGPUInstance, options: WGPURequestAdapterOptions?, callback: WGPUInstanceRequestAdapterCallback, userdata: FFIPointer?) + external fun wgpuInstanceReference(instance: WGPUInstance) + external fun wgpuInstanceRelease(instance: WGPUInstance) + + external fun wgpuPipelineLayoutSetLabel(pipelineLayout: WGPUPipelineLayout, label: String) + external fun wgpuPipelineLayoutReference(pipelineLayout: WGPUPipelineLayout) + external fun wgpuPipelineLayoutRelease(pipelineLayout: WGPUPipelineLayout) + + external fun wgpuQuerySetDestroy(querySet: WGPUQuerySet) + external fun wgpuQuerySetGetCount(querySet: WGPUQuerySet): uint32_t + external fun wgpuQuerySetGetType(querySet: WGPUQuerySet): WGPUQueryType + external fun wgpuQuerySetSetLabel(querySet: WGPUQuerySet, label: String) + external fun wgpuQuerySetReference(querySet: WGPUQuerySet) + external fun wgpuQuerySetRelease(querySet: WGPUQuerySet) + + external fun wgpuQueueOnSubmittedWorkDone(queue: WGPUQueue, callback: WGPUQueueOnSubmittedWorkDoneCallback, userdata: FFIPointer?) + external fun wgpuQueueSetLabel(queue: WGPUQueue, label: String) + external fun wgpuQueueSubmit(queue: WGPUQueue, commandCount: size_t, commands: WGPUCommandBuffer) + external fun wgpuQueueWriteBuffer(queue: WGPUQueue, buffer: WGPUBuffer, bufferOffset: uint64_t, data: FFIPointer, size: size_t) + external fun wgpuQueueWriteTexture(queue: WGPUQueue, destination: WGPUImageCopyTexture, data: FFIPointer, dataSize: size_t, dataLayout: WGPUTextureDataLayout, writeSize: WGPUExtent3D) + external fun wgpuQueueReference(queue: WGPUQueue) + external fun wgpuQueueRelease(queue: WGPUQueue) + + external fun wgpuRenderBundleSetLabel(renderBundle: WGPURenderBundle, label: String) + external fun wgpuRenderBundleReference(renderBundle: WGPURenderBundle) + external fun wgpuRenderBundleRelease(renderBundle: WGPURenderBundle) + + external fun wgpuRenderBundleEncoderDraw(renderBundleEncoder: WGPURenderBundleEncoder, vertexCount: uint32_t, instanceCount: uint32_t, firstVertex: uint32_t, firstInstance: uint32_t) + external fun wgpuRenderBundleEncoderDrawIndexed(renderBundleEncoder: WGPURenderBundleEncoder, indexCount: uint32_t, instanceCount: uint32_t, firstIndex: uint32_t, baseVertex: int32_t, firstInstance: uint32_t) + external fun wgpuRenderBundleEncoderDrawIndexedIndirect(renderBundleEncoder: WGPURenderBundleEncoder, indirectBuffer: WGPUBuffer, indirectOffset: uint64_t) + external fun wgpuRenderBundleEncoderDrawIndirect(renderBundleEncoder: WGPURenderBundleEncoder, indirectBuffer: WGPUBuffer, indirectOffset: uint64_t) + external fun wgpuRenderBundleEncoderFinish(renderBundleEncoder: WGPURenderBundleEncoder, descriptor: WGPURenderBundleDescriptor?): WGPURenderBundle + external fun wgpuRenderBundleEncoderInsertDebugMarker(renderBundleEncoder: WGPURenderBundleEncoder, markerLabel: String) + external fun wgpuRenderBundleEncoderPopDebugGroup(renderBundleEncoder: WGPURenderBundleEncoder) + external fun wgpuRenderBundleEncoderPushDebugGroup(renderBundleEncoder: WGPURenderBundleEncoder, groupLabel: String) + external fun wgpuRenderBundleEncoderSetBindGroup(renderBundleEncoder: WGPURenderBundleEncoder, groupIndex: uint32_t, group: WGPUBindGroup?, dynamicOffsetCount: size_t, dynamicOffsets: IntArray) + external fun wgpuRenderBundleEncoderSetIndexBuffer(renderBundleEncoder: WGPURenderBundleEncoder, buffer: WGPUBuffer, format: WGPUIndexFormat, offset: uint64_t, size: uint64_t) + external fun wgpuRenderBundleEncoderSetLabel(renderBundleEncoder: WGPURenderBundleEncoder, label: String) + external fun wgpuRenderBundleEncoderSetPipeline(renderBundleEncoder: WGPURenderBundleEncoder, pipeline: WGPURenderPipeline) + external fun wgpuRenderBundleEncoderSetVertexBuffer(renderBundleEncoder: WGPURenderBundleEncoder, slot: uint32_t, buffer: WGPUBuffer?, offset: uint64_t, size: uint64_t) + external fun wgpuRenderBundleEncoderReference(renderBundleEncoder: WGPURenderBundleEncoder) + external fun wgpuRenderBundleEncoderRelease(renderBundleEncoder: WGPURenderBundleEncoder) + + external fun wgpuRenderPassEncoderBeginOcclusionQuery(renderPassEncoder: WGPURenderPassEncoder, queryIndex: uint32_t) + external fun wgpuRenderPassEncoderDraw(renderPassEncoder: WGPURenderPassEncoder, vertexCount: uint32_t, instanceCount: uint32_t, firstVertex: uint32_t, firstInstance: uint32_t) + external fun wgpuRenderPassEncoderDrawIndexed(renderPassEncoder: WGPURenderPassEncoder, indexCount: uint32_t, instanceCount: uint32_t, firstIndex: uint32_t, baseVertex: int32_t, firstInstance: uint32_t) + external fun wgpuRenderPassEncoderDrawIndexedIndirect(renderPassEncoder: WGPURenderPassEncoder, indirectBuffer: WGPUBuffer, indirectOffset: uint64_t) + external fun wgpuRenderPassEncoderDrawIndirect(renderPassEncoder: WGPURenderPassEncoder, indirectBuffer: WGPUBuffer, indirectOffset: uint64_t) + external fun wgpuRenderPassEncoderEnd(renderPassEncoder: WGPURenderPassEncoder) + external fun wgpuRenderPassEncoderEndOcclusionQuery(renderPassEncoder: WGPURenderPassEncoder) + external fun wgpuRenderPassEncoderExecuteBundles(renderPassEncoder: WGPURenderPassEncoder, bundleCount: size_t, bundles: WGPURenderBundle) + external fun wgpuRenderPassEncoderInsertDebugMarker(renderPassEncoder: WGPURenderPassEncoder, markerLabel: String) + external fun wgpuRenderPassEncoderPopDebugGroup(renderPassEncoder: WGPURenderPassEncoder) + external fun wgpuRenderPassEncoderPushDebugGroup(renderPassEncoder: WGPURenderPassEncoder, groupLabel: String) + external fun wgpuRenderPassEncoderSetBindGroup(renderPassEncoder: WGPURenderPassEncoder, groupIndex: uint32_t, group: WGPUBindGroup?, dynamicOffsetCount: size_t, dynamicOffsets: IntArray) + external fun wgpuRenderPassEncoderSetBlendConstant(renderPassEncoder: WGPURenderPassEncoder, color: WGPUColor) + external fun wgpuRenderPassEncoderSetIndexBuffer(renderPassEncoder: WGPURenderPassEncoder, buffer: WGPUBuffer, format: WGPUIndexFormat, offset: uint64_t, size: uint64_t) + external fun wgpuRenderPassEncoderSetLabel(renderPassEncoder: WGPURenderPassEncoder, label: String) + external fun wgpuRenderPassEncoderSetPipeline(renderPassEncoder: WGPURenderPassEncoder, pipeline: WGPURenderPipeline) + external fun wgpuRenderPassEncoderSetScissorRect(renderPassEncoder: WGPURenderPassEncoder, x: uint32_t, y: uint32_t, width: uint32_t, height: uint32_t) + external fun wgpuRenderPassEncoderSetStencilReference(renderPassEncoder: WGPURenderPassEncoder, reference: uint32_t) + external fun wgpuRenderPassEncoderSetVertexBuffer(renderPassEncoder: WGPURenderPassEncoder, slot: uint32_t, buffer: WGPUBuffer?, offset: uint64_t, size: uint64_t) + external fun wgpuRenderPassEncoderSetViewport(renderPassEncoder: WGPURenderPassEncoder, x: Float, y: Float, width: Float, height: Float, minDepth: Float, maxDepth: Float) + external fun wgpuRenderPassEncoderReference(renderPassEncoder: WGPURenderPassEncoder) + external fun wgpuRenderPassEncoderRelease(renderPassEncoder: WGPURenderPassEncoder) + + external fun wgpuRenderPipelineGetBindGroupLayout(renderPipeline: WGPURenderPipeline, groupIndex: uint32_t): WGPUBindGroupLayout + external fun wgpuRenderPipelineSetLabel(renderPipeline: WGPURenderPipeline, label: String) + external fun wgpuRenderPipelineReference(renderPipeline: WGPURenderPipeline) + external fun wgpuRenderPipelineRelease(renderPipeline: WGPURenderPipeline) + + external fun wgpuSamplerSetLabel(sampler: WGPUSampler, label: String) + external fun wgpuSamplerReference(sampler: WGPUSampler) + external fun wgpuSamplerRelease(sampler: WGPUSampler) + + external fun wgpuShaderModuleGetCompilationInfo(shaderModule: WGPUShaderModule, callback: WGPUShaderModuleGetCompilationInfoCallback, userdata: FFIPointer?) + external fun wgpuShaderModuleSetLabel(shaderModule: WGPUShaderModule, label: String) + external fun wgpuShaderModuleReference(shaderModule: WGPUShaderModule) + external fun wgpuShaderModuleRelease(shaderModule: WGPUShaderModule) + + external fun wgpuSurfaceConfigure(surface: WGPUSurface, config: WGPUSurfaceConfiguration) + external fun wgpuSurfaceGetCapabilities(surface: WGPUSurface, adapter: WGPUAdapter, capabilities: WGPUSurfaceCapabilities) + external fun wgpuSurfaceGetCurrentTexture(surface: WGPUSurface, surfaceTexture: WGPUSurfaceTexture) + external fun wgpuSurfacePresent(surface: WGPUSurface) + external fun wgpuSurfaceSetLabel(surface: WGPUSurface, label: String) + external fun wgpuSurfaceUnconfigure(surface: WGPUSurface) + external fun wgpuSurfaceReference(surface: WGPUSurface) + external fun wgpuSurfaceRelease(surface: WGPUSurface) + + external fun wgpuSurfaceCapabilitiesFreeMembers(surfaceCapabilities: WGPUSurfaceCapabilities) + + external fun wgpuTextureCreateView(texture: WGPUTexture, descriptor: WGPUTextureViewDescriptor): WGPUTextureView + external fun wgpuTextureDestroy(texture: WGPUTexture) + external fun wgpuTextureGetDepthOrArrayLayers(texture: WGPUTexture): uint32_t + external fun wgpuTextureGetDimension(texture: WGPUTexture): WGPUTextureDimension + external fun wgpuTextureGetFormat(texture: WGPUTexture): WGPUTextureFormat + external fun wgpuTextureGetHeight(texture: WGPUTexture): uint32_t + external fun wgpuTextureGetMipLevelCount(texture: WGPUTexture): uint32_t + external fun wgpuTextureGetSampleCount(texture: WGPUTexture): uint32_t + external fun wgpuTextureGetUsage(texture: WGPUTexture): WGPUTextureUsageFlags + external fun wgpuTextureGetWidth(texture: WGPUTexture): uint32_t + external fun wgpuTextureSetLabel(texture: WGPUTexture, label: String) + external fun wgpuTextureReference(texture: WGPUTexture) + external fun wgpuTextureRelease(texture: WGPUTexture) + + external fun wgpuTextureViewSetLabel(textureView: WGPUTextureView, label: String) + external fun wgpuTextureViewReference(textureView: WGPUTextureView) + external fun wgpuTextureViewRelease(textureView: WGPUTextureView) +} + +/* +inline class WGPUAdapterType(val value: Int) { + companion object { + val DiscreteGPU = WGPUAdapterType(0x00000000) + val IntegratedGPU = WGPUAdapterType(0x00000001) + val CPU = WGPUAdapterType(0x00000002) + val Unknown = WGPUAdapterType(0x00000003) + val Force32 = WGPUAdapterType(0x7FFFFFFF) + } +} +*/ diff --git a/korge-core/src@jvm/korlibs/webgpu/WebGPUStructures.kt b/korge-core/src@jvm/korlibs/webgpu/WebGPUStructures.kt new file mode 100644 index 0000000000..1ab26a8593 --- /dev/null +++ b/korge-core/src@jvm/korlibs/webgpu/WebGPUStructures.kt @@ -0,0 +1,582 @@ +package korlibs.webgpu + +import korlibs.ffi.* + +/* +class WGPUAdapterInfo { + var nextInChain: WGPUChainedStructOut + var vendor: String + var architecture: String + var device: String + var description: String + var backendType: WGPUBackendType + var adapterType: WGPUAdapterType + var vendorID: uint32_t + var deviceID: uint32_t +} + +class WGPUBindGroupEntry { + var nextInChain: WGPUChainedStruct + var binding: uint32_t + var buffer: WGPUBuffer? + var offset: uint64_t + var size: uint64_t + var sampler: WGPUSampler? + var textureView: WGPUTextureView? +} + +class WGPUBlendComponent { + lateinit var operation: WGPUBlendOperation + lateinit var srcFactor: WGPUBlendFactor + lateinit var dstFactor: WGPUBlendFactor +} + +class WGPUBufferBindingLayout { + var nextInChain: WGPUChainedStruct + var type: WGPUBufferBindingType + var hasDynamicOffset: WGPUBool + var minBindingSize: uint64_t +} + +class WGPUBufferDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var usage: WGPUBufferUsageFlags + var size: uint64_t + var mappedAtCreation: WGPUBool +} + +class WGPUColor { + var r: Double + var g: Double + var b: Double + var a: Double +} + +class WGPUCommandBufferDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? +} + +class WGPUCommandEncoderDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? +} + +class WGPUCompilationMessage { + var nextInChain: WGPUChainedStruct + var message: String? + var type: WGPUCompilationMessageType + var lineNum: uint64_t + var linePos: uint64_t + var offset: uint64_t + var length: uint64_t + var utf16LinePos: uint64_t + var utf16Offset: uint64_t + var utf16Length: uint64_t +} + +class WGPUComputePassTimestampWrites { + var querySet: WGPUQuerySet + var beginningOfPassWriteIndex: uint32_t + var endOfPassWriteIndex: uint32_t +} + +class WGPUConstantEntry { + var nextInChain: WGPUChainedStruct + var key: String + var value: Double +} + +class WGPUExtent3D { + var width: uint32_t + var height: uint32_t + var depthOrArrayLayers: uint32_t +} + +class WGPUInstanceDescriptor { + var nextInChain: WGPUChainedStruct +} + +class WGPULimits { + var maxTextureDimension1D: uint32_t + var maxTextureDimension2D: uint32_t + var maxTextureDimension3D: uint32_t + var maxTextureArrayLayers: uint32_t + var maxBindGroups: uint32_t + var maxBindGroupsPlusVertexBuffers: uint32_t + var maxBindingsPerBindGroup: uint32_t + var maxDynamicUniformBuffersPerPipelineLayout: uint32_t + var maxDynamicStorageBuffersPerPipelineLayout: uint32_t + var maxSampledTexturesPerShaderStage: uint32_t + var maxSamplersPerShaderStage: uint32_t + var maxStorageBuffersPerShaderStage: uint32_t + var maxStorageTexturesPerShaderStage: uint32_t + var maxUniformBuffersPerShaderStage: uint32_t + var maxUniformBufferBindingSize: uint64_t + var maxStorageBufferBindingSize: uint64_t + var minUniformBufferOffsetAlignment: uint32_t + var minStorageBufferOffsetAlignment: uint32_t + var maxVertexBuffers: uint32_t + var maxBufferSize: uint64_t + var maxVertexAttributes: uint32_t + var maxVertexBufferArrayStride: uint32_t + var maxInterStageShaderComponents: uint32_t + var maxInterStageShaderVariables: uint32_t + var maxColorAttachments: uint32_t + var maxColorAttachmentBytesPerSample: uint32_t + var maxComputeWorkgroupStorageSize: uint32_t + var maxComputeInvocationsPerWorkgroup: uint32_t + var maxComputeWorkgroupSizeX: uint32_t + var maxComputeWorkgroupSizeY: uint32_t + var maxComputeWorkgroupSizeZ: uint32_t + var maxComputeWorkgroupsPerDimension: uint32_t +} + +class WGPUMultisampleState { + var nextInChain: WGPUChainedStruct + var count: uint32_t + var mask: uint32_t + var alphaToCoverageEnabled: WGPUBool +} + +class WGPUOrigin3D { + var x: uint32_t = 0 + var y: uint32_t = 0 + var z: uint32_t = 0 +} + +class WGPUPipelineLayoutDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var bindGroupLayoutCount: size_t + var bindGroupLayouts: WGPUBindGroupLayout +} + +class WGPUPrimitiveDepthClipControl { + var chain: WGPUChainedStruct + var unclippedDepth: WGPUBool +} + +class WGPUPrimitiveState { + var nextInChain: WGPUChainedStruct + var topology: WGPUPrimitiveTopology + var stripIndexFormat: WGPUIndexFormat + var frontFace: WGPUFrontFace + var cullMode: WGPUCullMode +} + +class WGPUQuerySetDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var type: WGPUQueryType + var count: uint32_t +} + +class WGPUQueueDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? +} + +class WGPURenderBundleDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? +} + +class WGPURenderBundleEncoderDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var colorFormatCount: size_t + var colorFormats: FFITypedPointer + var depthStencilFormat: WGPUTextureFormat + var sampleCount: uint32_t + var depthReadOnly: WGPUBool + var stencilReadOnly: WGPUBool +} + +class WGPURenderPassDepthStencilAttachment { + var view: WGPUTextureView + var depthLoadOp: WGPULoadOp + var depthStoreOp: WGPUStoreOp + var depthClearValue: Float + var depthReadOnly: WGPUBool + var stencilLoadOp: WGPULoadOp + var stencilStoreOp: WGPUStoreOp + var stencilClearValue: uint32_t + var stencilReadOnly: WGPUBool +} + +class WGPURenderPassDescriptorMaxDrawCount { + var chain: WGPUChainedStruct + var maxDrawCount: uint64_t +} + +class WGPURenderPassTimestampWrites { + var querySet: WGPUQuerySet + var beginningOfPassWriteIndex: uint32_t + var endOfPassWriteIndex: uint32_t +} + +class WGPURequestAdapterOptions { + var nextInChain: WGPUChainedStruct + var compatibleSurface: WGPUSurface? + var powerPreference: WGPUPowerPreference + var backendType: WGPUBackendType + var forceFallbackAdapter: WGPUBool +} + +class WGPUSamplerBindingLayout { + var nextInChain: WGPUChainedStruct + var type: WGPUSamplerBindingType +} + +class WGPUSamplerDescriptor : FFIStructure() { + var nextInChain: WGPUChainedStruct + var label: String? + var addressModeU: WGPUAddressMode + var addressModeV: WGPUAddressMode + var addressModeW: WGPUAddressMode + var magFilter: WGPUFilterMode + var minFilter: WGPUFilterMode + var mipmapFilter: WGPUMipmapFilterMode + var lodMinClamp: float + var lodMaxClamp: float + var compare: WGPUCompareFunction + var maxAnisotropy: uint16_t +} + +class WGPUShaderModuleCompilationHint { + var nextInChain: WGPUChainedStruct + var entryPoint: String + var layout: WGPUPipelineLayout +} + +class WGPUShaderModuleSPIRVDescriptor { + var chain: WGPUChainedStruct + var codeSize: uint32_t + var code: IntArray +} + +class WGPUShaderModuleWGSLDescriptor { + var chain: WGPUChainedStruct + var code: String +} + +class WGPUStencilFaceState { + var compare: WGPUCompareFunction + var failOp: WGPUStencilOperation + var depthFailOp: WGPUStencilOperation + var passOp: WGPUStencilOperation +} + +class WGPUStorageTextureBindingLayout { + var nextInChain: WGPUChainedStruct + var access: WGPUStorageTextureAccess + var format: WGPUTextureFormat + var viewDimension: WGPUTextureViewDimension +} + +class WGPUSurfaceCapabilities { + var nextInChain: WGPUChainedStructOut + var usages: WGPUTextureUsageFlags + var formatCount: size_t + WGPUTextureFormat const * formats; + var presentModeCount: size_t + WGPUPresentMode const * presentModes; + var alphaModeCount: size_t + WGPUCompositeAlphaMode const * alphaModes; +} + +class WGPUSurfaceConfiguration { + var nextInChain: WGPUChainedStruct + var device: WGPUDevice + var format: WGPUTextureFormat + var usage: WGPUTextureUsageFlags + var viewFormatCount: size_t + WGPUTextureFormat const * viewFormats; + var alphaMode: WGPUCompositeAlphaMode + var width: uint32_t + var height: uint32_t + var presentMode: WGPUPresentMode +} + +class WGPUSurfaceDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? +} + +class WGPUSurfaceDescriptorFromAndroidNativeWindow { + var chain: WGPUChainedStruct + var window: FFIPointer? +} + +class WGPUSurfaceDescriptorFromCanvasHTMLSelector { + var chain: WGPUChainedStruct + var selector: String +} + +class WGPUSurfaceDescriptorFromMetalLayer { + var chain: WGPUChainedStruct + var layer: FFIPointer +} + +class WGPUSurfaceDescriptorFromWaylandSurface { + var chain: WGPUChainedStruct + var display: FFIPointer + var surface: FFIPointer +} + +class WGPUSurfaceDescriptorFromWindowsHWND { + chain: WGPUChainedStruct + var hinstance: FFIPointer + var hwnd: FFIPointer +} + +class WGPUSurfaceDescriptorFromXcbWindow { + var chain: WGPUChainedStruct + var connection: VoidPointer + var window: uint32_t +} + +class WGPUSurfaceDescriptorFromXlibWindow { + var chain: WGPUChainedStruct + var display: VoidPointer + var window: uint64_t +} + +class WGPUSurfaceTexture { + var texture: WGPUTexture + var suboptimal: WGPUBool + var status: WGPUSurfaceGetCurrentTextureStatus +} + +class WGPUTextureBindingLayout { + var nextInChain: WGPUChainedStruct + var sampleType: WGPUTextureSampleType + var viewDimension: WGPUTextureViewDimension + var multisampled: WGPUBool +} + +class WGPUTextureDataLayout { + var nextInChain: WGPUChainedStruct + var offset: uint64_t + var bytesPerRow: uint32_t + var rowsPerImage: uint32_t +} + +class WGPUTextureViewDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var format: WGPUTextureFormat + var dimension: WGPUTextureViewDimension + var baseMipLevel: uint32_t + var mipLevelCount: uint32_t + var baseArrayLayer: uint32_t + var arrayLayerCount: uint32_t + var aspect: WGPUTextureAspect +} + +class WGPUUncapturedErrorCallbackInfo { + var nextInChain: WGPUChainedStruct + var callback: WGPUErrorCallback + var userdata: VoidPointer +} + +class WGPUVertexAttribute { + var format: WGPUVertexFormat + var offset: uint64_t + var shaderLocation: uint32_t +} + +class WGPUBindGroupDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var layout: WGPUBindGroupLayout + var entryCount: size_t + var entries: FFITypedPointer +} + +class WGPUBindGroupLayoutEntry { + var nextInChain: WGPUChainedStruct + var binding: uint32_t + var visibility: WGPUShaderStageFlags + var buffer: WGPUBufferBindingLayout + var sampler: WGPUSamplerBindingLayout + var texture: WGPUTextureBindingLayout + var storageTexture: WGPUStorageTextureBindingLayout +} + +class WGPUBlendState { + var color: WGPUBlendComponent + var alpha: WGPUBlendComponent +} + +class WGPUCompilationInfo { + var nextInChain: WGPUChainedStruct + var messageCount: size_t + var messages: FFITypedPointer +} + +class WGPUComputePassDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var timestampWrites: WGPUComputePassTimestampWrites? +} + +class WGPUDepthStencilState { + var nextInChain: WGPUChainedStruct + var format: WGPUTextureFormat + var depthWriteEnabled: WGPUBool + var depthCompare: WGPUCompareFunction + var stencilFront: WGPUStencilFaceState + var stencilBack: WGPUStencilFaceState + var stencilReadMask: uint32_t + var stencilWriteMask: uint32_t + var depthBias: int32_t + var depthBiasSlopeScale: float + var depthBiasClamp: float +} + +class WGPUImageCopyBuffer { + var nextInChain: WGPUChainedStruct + var layout: WGPUTextureDataLayout + var buffer: WGPUBuffer +} + +class WGPUImageCopyTexture { + var nextInChain: WGPUChainedStruct + var texture: WGPUTexture + var mipLevel: uint32_t + var origin: WGPUOrigin3D + var aspect: WGPUTextureAspect +} + +class WGPUProgrammableStageDescriptor { + var nextInChain: WGPUChainedStruct + var module: WGPUShaderModule + var entryPoint: String? + var constantCount: size_t + var constants: FFITypedPointer +} + +class WGPURenderPassColorAttachment { + var nextInChain: WGPUChainedStruct + var view: WGPUTextureView? + var depthSlice: uint32_t + var resolveTarget: WGPUTextureView? + var loadOp: WGPULoadOp + var storeOp: WGPUStoreOp + var clearValue: WGPUColor +} + +class WGPURequiredLimits { + var nextInChain: WGPUChainedStruct + var limits: WGPULimits +} + +class WGPUShaderModuleDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var hintCount: size_t + var hints: FFITypedPointer +} + +class WGPUSupportedLimits { + var nextInChain: WGPUChainedStructOut + var limits: WGPULimits +} + +class WGPUTextureDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var usage: WGPUTextureUsageFlags + var dimension: WGPUTextureDimension + var size: WGPUExtent3D + var format: WGPUTextureFormat + var mipLevelCount: uint32_t + var sampleCount: uint32_t + var viewFormatCount: size_t + var viewFormats: FFITypedPointer +} + +class WGPUVertexBufferLayout { + var arrayStride: uint64_t + var stepMode: WGPUVertexStepMode + var attributeCount: size_t + var attributes: FFITypedPointer +} + +class WGPUBindGroupLayoutDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var entryCount: size_t + var entries: FFITypedPointer +} + +class WGPUColorTargetState { + var nextInChain: WGPUChainedStruct + var format: WGPUTextureFormat + var blend: WGPUBlendState? + var writeMask: WGPUColorWriteMaskFlags +} + +class WGPUComputePipelineDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var layout: WGPUPipelineLayout? + var compute: WGPUProgrammableStageDescriptor +} + +class WGPUDeviceDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var requiredFeatureCount: size_t + var requiredFeatures: FFITypedPointer + var requiredLimits: FFITypedPointer + var defaultQueue: WGPUQueueDescriptor + var deviceLostCallback: WGPUDeviceLostCallback + var deviceLostUserdata: FFIPointer + var uncapturedErrorCallbackInfo: WGPUUncapturedErrorCallbackInfo +} + +class WGPURenderPassDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var colorAttachmentCount: size_t + var colorAttachments: FFITypedPointer + var depthStencilAttachment: WGPURenderPassDepthStencilAttachment? + var occlusionQuerySet: WGPUQuerySet? + var timestampWrites: WGPURenderPassTimestampWrites? +} + +class WGPUVertexState { + var nextInChain: WGPUChainedStruct + var module: WGPUShaderModule + var entryPoint: String? + var constantCount: size_t + var constants: FFITypedPointer + var bufferCount: size_t + var buffers: FFITypedPointer +} + +class WGPUFragmentState { + var nextInChain: WGPUChainedStruct + var module: WGPUShaderModule + var entryPoint: String? + var constantCount: size_t + var constants: FFITypedPointer + var targetCount: size_t + var targets: WGPUColorTargetState +} + +class WGPURenderPipelineDescriptor { + var nextInChain: WGPUChainedStruct + var label: String? + var layout: WGPUPipelineLayout? + var vertex: WGPUVertexState + var primitive: WGPUPrimitiveState + var depthStencil: WGPUDepthStencilState? + var multisample: WGPUMultisampleState + var fragment: WGPUFragmentState? +} +*/ diff --git a/korge-core/src@jvm/korlibs/webgpu/WebGPUStructuresTypedef.kt b/korge-core/src@jvm/korlibs/webgpu/WebGPUStructuresTypedef.kt new file mode 100644 index 0000000000..a94e7e1c03 --- /dev/null +++ b/korge-core/src@jvm/korlibs/webgpu/WebGPUStructuresTypedef.kt @@ -0,0 +1,77 @@ +package korlibs.webgpu + +import korlibs.ffi.* + +typealias WGPUAdapterInfo = FFIPointer +typealias WGPUBindGroupEntry = FFIPointer +typealias WGPUBlendComponent = FFIPointer +typealias WGPUBufferBindingLayout = FFIPointer +typealias WGPUBufferDescriptor = FFIPointer +typealias WGPUColor = FFIPointer +typealias WGPUCommandBufferDescriptor = FFIPointer +typealias WGPUCommandEncoderDescriptor = FFIPointer +typealias WGPUCompilationMessage = FFIPointer +typealias WGPUComputePassTimestampWrites = FFIPointer +typealias WGPUConstantEntry = FFIPointer +typealias WGPUExtent3D = FFIPointer +typealias WGPUInstanceDescriptor = FFIPointer +typealias WGPULimits = FFIPointer +typealias WGPUMultisampleState = FFIPointer +typealias WGPUOrigin3D = FFIPointer +typealias WGPUPipelineLayoutDescriptor = FFIPointer +typealias WGPUPrimitiveDepthClipControl = FFIPointer +typealias WGPUPrimitiveState = FFIPointer +typealias WGPUQuerySetDescriptor = FFIPointer +typealias WGPUQueueDescriptor = FFIPointer +typealias WGPURenderBundleDescriptor = FFIPointer +typealias WGPURenderBundleEncoderDescriptor = FFIPointer +typealias WGPURenderPassDepthStencilAttachment = FFIPointer +typealias WGPURenderPassDescriptorMaxDrawCount = FFIPointer +typealias WGPURenderPassTimestampWrites = FFIPointer +typealias WGPURequestAdapterOptions = FFIPointer +typealias WGPUSamplerBindingLayout = FFIPointer +typealias WGPUSamplerDescriptor = FFIPointer +typealias WGPUShaderModuleCompilationHint = FFIPointer +typealias WGPUShaderModuleSPIRVDescriptor = FFIPointer +typealias WGPUShaderModuleWGSLDescriptor = FFIPointer +typealias WGPUStencilFaceState = FFIPointer +typealias WGPUStorageTextureBindingLayout = FFIPointer +typealias WGPUSurfaceCapabilities = FFIPointer +typealias WGPUSurfaceConfiguration = FFIPointer +typealias WGPUSurfaceDescriptor = FFIPointer +typealias WGPUSurfaceDescriptorFromAndroidNativeWindow = FFIPointer +typealias WGPUSurfaceDescriptorFromCanvasHTMLSelector = FFIPointer +typealias WGPUSurfaceDescriptorFromMetalLayer = FFIPointer +typealias WGPUSurfaceDescriptorFromWaylandSurface = FFIPointer +typealias WGPUSurfaceDescriptorFromWindowsHWND = FFIPointer +typealias WGPUSurfaceDescriptorFromXcbWindow = FFIPointer +typealias WGPUSurfaceDescriptorFromXlibWindow = FFIPointer +typealias WGPUSurfaceTexture = FFIPointer +typealias WGPUTextureBindingLayout = FFIPointer +typealias WGPUTextureDataLayout = FFIPointer +typealias WGPUTextureViewDescriptor = FFIPointer +typealias WGPUUncapturedErrorCallbackInfo = FFIPointer +typealias WGPUVertexAttribute = FFIPointer +typealias WGPUBindGroupDescriptor = FFIPointer +typealias WGPUBindGroupLayoutEntry = FFIPointer +typealias WGPUBlendState = FFIPointer +typealias WGPUCompilationInfo = FFIPointer +typealias WGPUComputePassDescriptor = FFIPointer +typealias WGPUDepthStencilState = FFIPointer +typealias WGPUImageCopyBuffer = FFIPointer +typealias WGPUImageCopyTexture = FFIPointer +typealias WGPUProgrammableStageDescriptor = FFIPointer +typealias WGPURenderPassColorAttachment = FFIPointer +typealias WGPURequiredLimits = FFIPointer +typealias WGPUShaderModuleDescriptor = FFIPointer +typealias WGPUSupportedLimits = FFIPointer +typealias WGPUTextureDescriptor = FFIPointer +typealias WGPUVertexBufferLayout = FFIPointer +typealias WGPUBindGroupLayoutDescriptor = FFIPointer +typealias WGPUColorTargetState = FFIPointer +typealias WGPUComputePipelineDescriptor = FFIPointer +typealias WGPUDeviceDescriptor = FFIPointer +typealias WGPURenderPassDescriptor = FFIPointer +typealias WGPUVertexState = FFIPointer +typealias WGPUFragmentState = FFIPointer +typealias WGPURenderPipelineDescriptor = FFIPointer diff --git a/webgpu.h b/webgpu.h new file mode 100644 index 0000000000..cb423fc074 --- /dev/null +++ b/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_