diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll index 40f0e57..637a75d 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll and b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.exp b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.exp index 143f7b0..2d71513 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.exp and b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.lib b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.lib index e598827..6405ac6 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.lib and b/lib/dawn/bin/win/ARM64/Debug/dawn_native.dll.lib differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll index 33b6f8f..5d0b52d 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll and b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.exp b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.exp index 6d17ca2..4f5d0b9 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.exp and b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.lib b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.lib index 1deb54d..ed15fe7 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.lib and b/lib/dawn/bin/win/ARM64/Debug/dawn_platform.dll.lib differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll index af5efdb..b4f3978 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll and b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.exp b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.exp index d95b8c4..030dced 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.exp and b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.lib b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.lib index 5497bc6..31936dd 100644 Binary files a/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.lib and b/lib/dawn/bin/win/ARM64/Debug/dawn_proc.dll.lib differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll index fe97a32..ae5d31a 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll and b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.exp b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.exp index d7f66dc..91f7ff2 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.exp and b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.lib b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.lib index e598827..6405ac6 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.lib and b/lib/dawn/bin/win/ARM64/Release/dawn_native.dll.lib differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll index 6319329..1596ca2 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll and b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.exp b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.exp index 95d3f3c..00c07b3 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.exp and b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.lib b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.lib index 1deb54d..ed15fe7 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.lib and b/lib/dawn/bin/win/ARM64/Release/dawn_platform.dll.lib differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll index 31641a9..28a4dad 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll and b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.exp b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.exp index bd0a999..527641b 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.exp and b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.exp differ diff --git a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.lib b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.lib index 5497bc6..31936dd 100644 Binary files a/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.lib and b/lib/dawn/bin/win/ARM64/Release/dawn_proc.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_native.dll b/lib/dawn/bin/win/x64/Debug/dawn_native.dll index 2ca3ab2..768fa76 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_native.dll and b/lib/dawn/bin/win/x64/Debug/dawn_native.dll differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_native.dll.exp b/lib/dawn/bin/win/x64/Debug/dawn_native.dll.exp index e67ff63..e30d863 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_native.dll.exp and b/lib/dawn/bin/win/x64/Debug/dawn_native.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_native.dll.lib b/lib/dawn/bin/win/x64/Debug/dawn_native.dll.lib index 8694427..f6791d6 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_native.dll.lib and b/lib/dawn/bin/win/x64/Debug/dawn_native.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll index c0712ba..9548cde 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll and b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.exp b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.exp index 9a77a01..e032d04 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.exp and b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.lib b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.lib index ebd671f..3e9ea7d 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.lib and b/lib/dawn/bin/win/x64/Debug/dawn_platform.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll index 0c99b03..c5b07fc 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll and b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.exp b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.exp index e33676a..b950e48 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.exp and b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.lib b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.lib index 25f4c40..778835a 100644 Binary files a/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.lib and b/lib/dawn/bin/win/x64/Debug/dawn_proc.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_native.dll b/lib/dawn/bin/win/x64/Release/dawn_native.dll index 5041cc8..adeeb05 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_native.dll and b/lib/dawn/bin/win/x64/Release/dawn_native.dll differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_native.dll.exp b/lib/dawn/bin/win/x64/Release/dawn_native.dll.exp index 6cc7c5a..b99b5ca 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_native.dll.exp and b/lib/dawn/bin/win/x64/Release/dawn_native.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_native.dll.lib b/lib/dawn/bin/win/x64/Release/dawn_native.dll.lib index 8694427..f6791d6 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_native.dll.lib and b/lib/dawn/bin/win/x64/Release/dawn_native.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_platform.dll b/lib/dawn/bin/win/x64/Release/dawn_platform.dll index ba971f7..93f173b 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_platform.dll and b/lib/dawn/bin/win/x64/Release/dawn_platform.dll differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_platform.dll.exp b/lib/dawn/bin/win/x64/Release/dawn_platform.dll.exp index a6dbc7b..65a68f9 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_platform.dll.exp and b/lib/dawn/bin/win/x64/Release/dawn_platform.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_platform.dll.lib b/lib/dawn/bin/win/x64/Release/dawn_platform.dll.lib index ebd671f..3e9ea7d 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_platform.dll.lib and b/lib/dawn/bin/win/x64/Release/dawn_platform.dll.lib differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_proc.dll b/lib/dawn/bin/win/x64/Release/dawn_proc.dll index 4998ad2..1decbb3 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_proc.dll and b/lib/dawn/bin/win/x64/Release/dawn_proc.dll differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_proc.dll.exp b/lib/dawn/bin/win/x64/Release/dawn_proc.dll.exp index 8428f0b..1366083 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_proc.dll.exp and b/lib/dawn/bin/win/x64/Release/dawn_proc.dll.exp differ diff --git a/lib/dawn/bin/win/x64/Release/dawn_proc.dll.lib b/lib/dawn/bin/win/x64/Release/dawn_proc.dll.lib index 25f4c40..778835a 100644 Binary files a/lib/dawn/bin/win/x64/Release/dawn_proc.dll.lib and b/lib/dawn/bin/win/x64/Release/dawn_proc.dll.lib differ diff --git a/lib/dawn/inc/dawn/EnumClassBitmasks.h b/lib/dawn/inc/dawn/EnumClassBitmasks.h deleted file mode 100644 index 0dbe090..0000000 --- a/lib/dawn/inc/dawn/EnumClassBitmasks.h +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2017 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef INCLUDE_DAWN_ENUMCLASSBITMASKS_H_ -#define INCLUDE_DAWN_ENUMCLASSBITMASKS_H_ - -#include - -// The operators in dawn:: namespace need be introduced into other namespaces with -// using-declarations for C++ Argument Dependent Lookup to work. -#define DAWN_IMPORT_BITMASK_OPERATORS \ - using dawn::operator|; \ - using dawn::operator&; \ - using dawn::operator^; \ - using dawn::operator~; \ - using dawn::operator&=; \ - using dawn::operator|=; \ - using dawn::operator^=; \ - using dawn::HasZeroOrOneBits; - -namespace dawn { - -template -struct IsDawnBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask::enable>::type> { - static constexpr bool enable = true; - using type = T; - constexpr static T Lower(T t) { return t; } -}; - -template -struct BoolConvertible { - using Integral = typename std::underlying_type::type; - - // NOLINTNEXTLINE(runtime/explicit) - constexpr BoolConvertible(Integral value) : value(value) {} - constexpr operator bool() const { return value != 0; } - constexpr operator T() const { return static_cast(value); } - - Integral value; -}; - -template -struct LowerBitmask> { - static constexpr bool enable = true; - using type = T; - static constexpr type Lower(BoolConvertible t) { return t; } -}; - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator|(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) | - static_cast(LowerBitmask::Lower(right)); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator&(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) & - static_cast(LowerBitmask::Lower(right)); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator^(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) ^ - static_cast(LowerBitmask::Lower(right)); -} - -template -constexpr BoolConvertible::type> operator~(T1 t) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return ~static_cast(LowerBitmask::Lower(t)); -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator&=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l & r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator|=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l | r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator^=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l ^ r; - return l; -} - -template -constexpr bool HasZeroOrOneBits(T value) { - using Integral = typename std::underlying_type::type; - return (static_cast(value) & (static_cast(value) - 1)) == 0; -} - -} // namespace dawn - -#endif // INCLUDE_DAWN_ENUMCLASSBITMASKS_H_ diff --git a/lib/dawn/inc/dawn/dawn_proc.h b/lib/dawn/inc/dawn/dawn_proc.h index 94cc306..513b0bf 100644 --- a/lib/dawn/inc/dawn/dawn_proc.h +++ b/lib/dawn/inc/dawn/dawn_proc.h @@ -1,16 +1,29 @@ -// Copyright 2019 The Dawn Authors +// Copyright 2019 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_DAWN_PROC_H_ #define INCLUDE_DAWN_DAWN_PROC_H_ diff --git a/lib/dawn/inc/dawn/dawn_proc_table.h b/lib/dawn/inc/dawn/dawn_proc_table.h index 2d92d32..4d4d9f9 100644 --- a/lib/dawn/inc/dawn/dawn_proc_table.h +++ b/lib/dawn/inc/dawn/dawn_proc_table.h @@ -6,15 +6,22 @@ // Note: Often allocated as a static global. Do not add a complex constructor. typedef struct DawnProcTable { + WGPUProcAdapterPropertiesFreeMembers adapterPropertiesFreeMembers; + WGPUProcAdapterPropertiesMemoryHeapsFreeMembers adapterPropertiesMemoryHeapsFreeMembers; WGPUProcCreateInstance createInstance; + WGPUProcGetInstanceFeatures getInstanceFeatures; WGPUProcGetProcAddress getProcAddress; + WGPUProcSharedBufferMemoryEndAccessStateFreeMembers sharedBufferMemoryEndAccessStateFreeMembers; + WGPUProcSharedTextureMemoryEndAccessStateFreeMembers sharedTextureMemoryEndAccessStateFreeMembers; WGPUProcAdapterCreateDevice adapterCreateDevice; WGPUProcAdapterEnumerateFeatures adapterEnumerateFeatures; + WGPUProcAdapterGetInstance adapterGetInstance; WGPUProcAdapterGetLimits adapterGetLimits; WGPUProcAdapterGetProperties adapterGetProperties; WGPUProcAdapterHasFeature adapterHasFeature; WGPUProcAdapterRequestDevice adapterRequestDevice; + WGPUProcAdapterRequestDeviceF adapterRequestDeviceF; WGPUProcAdapterReference adapterReference; WGPUProcAdapterRelease adapterRelease; @@ -28,10 +35,12 @@ typedef struct DawnProcTable { WGPUProcBufferDestroy bufferDestroy; WGPUProcBufferGetConstMappedRange bufferGetConstMappedRange; + WGPUProcBufferGetMapState bufferGetMapState; WGPUProcBufferGetMappedRange bufferGetMappedRange; WGPUProcBufferGetSize bufferGetSize; WGPUProcBufferGetUsage bufferGetUsage; WGPUProcBufferMapAsync bufferMapAsync; + WGPUProcBufferMapAsyncF bufferMapAsyncF; WGPUProcBufferSetLabel bufferSetLabel; WGPUProcBufferUnmap bufferUnmap; WGPUProcBufferReference bufferReference; @@ -48,7 +57,6 @@ typedef struct DawnProcTable { WGPUProcCommandEncoderCopyBufferToTexture commandEncoderCopyBufferToTexture; WGPUProcCommandEncoderCopyTextureToBuffer commandEncoderCopyTextureToBuffer; WGPUProcCommandEncoderCopyTextureToTexture commandEncoderCopyTextureToTexture; - WGPUProcCommandEncoderCopyTextureToTextureInternal commandEncoderCopyTextureToTextureInternal; WGPUProcCommandEncoderFinish commandEncoderFinish; WGPUProcCommandEncoderInjectValidationError commandEncoderInjectValidationError; WGPUProcCommandEncoderInsertDebugMarker commandEncoderInsertDebugMarker; @@ -61,12 +69,9 @@ typedef struct DawnProcTable { WGPUProcCommandEncoderReference commandEncoderReference; WGPUProcCommandEncoderRelease commandEncoderRelease; - WGPUProcComputePassEncoderDispatch computePassEncoderDispatch; - WGPUProcComputePassEncoderDispatchIndirect computePassEncoderDispatchIndirect; WGPUProcComputePassEncoderDispatchWorkgroups computePassEncoderDispatchWorkgroups; WGPUProcComputePassEncoderDispatchWorkgroupsIndirect computePassEncoderDispatchWorkgroupsIndirect; WGPUProcComputePassEncoderEnd computePassEncoderEnd; - WGPUProcComputePassEncoderEndPass computePassEncoderEndPass; WGPUProcComputePassEncoderInsertDebugMarker computePassEncoderInsertDebugMarker; WGPUProcComputePassEncoderPopDebugGroup computePassEncoderPopDebugGroup; WGPUProcComputePassEncoderPushDebugGroup computePassEncoderPushDebugGroup; @@ -88,8 +93,10 @@ typedef struct DawnProcTable { WGPUProcDeviceCreateCommandEncoder deviceCreateCommandEncoder; WGPUProcDeviceCreateComputePipeline deviceCreateComputePipeline; WGPUProcDeviceCreateComputePipelineAsync deviceCreateComputePipelineAsync; + WGPUProcDeviceCreateComputePipelineAsyncF deviceCreateComputePipelineAsyncF; WGPUProcDeviceCreateErrorBuffer deviceCreateErrorBuffer; WGPUProcDeviceCreateErrorExternalTexture deviceCreateErrorExternalTexture; + WGPUProcDeviceCreateErrorShaderModule deviceCreateErrorShaderModule; WGPUProcDeviceCreateErrorTexture deviceCreateErrorTexture; WGPUProcDeviceCreateExternalTexture deviceCreateExternalTexture; WGPUProcDeviceCreatePipelineLayout deviceCreatePipelineLayout; @@ -97,6 +104,7 @@ typedef struct DawnProcTable { WGPUProcDeviceCreateRenderBundleEncoder deviceCreateRenderBundleEncoder; WGPUProcDeviceCreateRenderPipeline deviceCreateRenderPipeline; WGPUProcDeviceCreateRenderPipelineAsync deviceCreateRenderPipelineAsync; + WGPUProcDeviceCreateRenderPipelineAsyncF deviceCreateRenderPipelineAsyncF; WGPUProcDeviceCreateSampler deviceCreateSampler; WGPUProcDeviceCreateShaderModule deviceCreateShaderModule; WGPUProcDeviceCreateSwapChain deviceCreateSwapChain; @@ -107,25 +115,38 @@ typedef struct DawnProcTable { WGPUProcDeviceGetAdapter deviceGetAdapter; WGPUProcDeviceGetLimits deviceGetLimits; WGPUProcDeviceGetQueue deviceGetQueue; + WGPUProcDeviceGetSupportedSurfaceUsage deviceGetSupportedSurfaceUsage; WGPUProcDeviceHasFeature deviceHasFeature; + WGPUProcDeviceImportSharedBufferMemory deviceImportSharedBufferMemory; + WGPUProcDeviceImportSharedFence deviceImportSharedFence; + WGPUProcDeviceImportSharedTextureMemory deviceImportSharedTextureMemory; WGPUProcDeviceInjectError deviceInjectError; WGPUProcDevicePopErrorScope devicePopErrorScope; + WGPUProcDevicePopErrorScopeF devicePopErrorScopeF; WGPUProcDevicePushErrorScope devicePushErrorScope; WGPUProcDeviceSetDeviceLostCallback deviceSetDeviceLostCallback; WGPUProcDeviceSetLabel deviceSetLabel; WGPUProcDeviceSetLoggingCallback deviceSetLoggingCallback; WGPUProcDeviceSetUncapturedErrorCallback deviceSetUncapturedErrorCallback; WGPUProcDeviceTick deviceTick; + WGPUProcDeviceValidateTextureDescriptor deviceValidateTextureDescriptor; WGPUProcDeviceReference deviceReference; WGPUProcDeviceRelease deviceRelease; WGPUProcExternalTextureDestroy externalTextureDestroy; + WGPUProcExternalTextureExpire externalTextureExpire; + WGPUProcExternalTextureRefresh externalTextureRefresh; WGPUProcExternalTextureSetLabel externalTextureSetLabel; WGPUProcExternalTextureReference externalTextureReference; WGPUProcExternalTextureRelease externalTextureRelease; WGPUProcInstanceCreateSurface instanceCreateSurface; + WGPUProcInstanceEnumerateWGSLLanguageFeatures instanceEnumerateWGSLLanguageFeatures; + WGPUProcInstanceHasWGSLLanguageFeature instanceHasWGSLLanguageFeature; + WGPUProcInstanceProcessEvents instanceProcessEvents; WGPUProcInstanceRequestAdapter instanceRequestAdapter; + WGPUProcInstanceRequestAdapterF instanceRequestAdapterF; + WGPUProcInstanceWaitAny instanceWaitAny; WGPUProcInstanceReference instanceReference; WGPUProcInstanceRelease instanceRelease; @@ -143,6 +164,7 @@ typedef struct DawnProcTable { WGPUProcQueueCopyExternalTextureForBrowser queueCopyExternalTextureForBrowser; WGPUProcQueueCopyTextureForBrowser queueCopyTextureForBrowser; WGPUProcQueueOnSubmittedWorkDone queueOnSubmittedWorkDone; + WGPUProcQueueOnSubmittedWorkDoneF queueOnSubmittedWorkDoneF; WGPUProcQueueSetLabel queueSetLabel; WGPUProcQueueSubmit queueSubmit; WGPUProcQueueWriteBuffer queueWriteBuffer; @@ -150,6 +172,7 @@ typedef struct DawnProcTable { WGPUProcQueueReference queueReference; WGPUProcQueueRelease queueRelease; + WGPUProcRenderBundleSetLabel renderBundleSetLabel; WGPUProcRenderBundleReference renderBundleReference; WGPUProcRenderBundleRelease renderBundleRelease; @@ -176,9 +199,9 @@ typedef struct DawnProcTable { WGPUProcRenderPassEncoderDrawIndirect renderPassEncoderDrawIndirect; WGPUProcRenderPassEncoderEnd renderPassEncoderEnd; WGPUProcRenderPassEncoderEndOcclusionQuery renderPassEncoderEndOcclusionQuery; - WGPUProcRenderPassEncoderEndPass renderPassEncoderEndPass; WGPUProcRenderPassEncoderExecuteBundles renderPassEncoderExecuteBundles; WGPUProcRenderPassEncoderInsertDebugMarker renderPassEncoderInsertDebugMarker; + WGPUProcRenderPassEncoderPixelLocalStorageBarrier renderPassEncoderPixelLocalStorageBarrier; WGPUProcRenderPassEncoderPopDebugGroup renderPassEncoderPopDebugGroup; WGPUProcRenderPassEncoderPushDebugGroup renderPassEncoderPushDebugGroup; WGPUProcRenderPassEncoderSetBindGroup renderPassEncoderSetBindGroup; @@ -204,19 +227,44 @@ typedef struct DawnProcTable { WGPUProcSamplerRelease samplerRelease; WGPUProcShaderModuleGetCompilationInfo shaderModuleGetCompilationInfo; + WGPUProcShaderModuleGetCompilationInfoF shaderModuleGetCompilationInfoF; WGPUProcShaderModuleSetLabel shaderModuleSetLabel; WGPUProcShaderModuleReference shaderModuleReference; WGPUProcShaderModuleRelease shaderModuleRelease; + WGPUProcSharedBufferMemoryBeginAccess sharedBufferMemoryBeginAccess; + WGPUProcSharedBufferMemoryCreateBuffer sharedBufferMemoryCreateBuffer; + WGPUProcSharedBufferMemoryEndAccess sharedBufferMemoryEndAccess; + WGPUProcSharedBufferMemoryGetProperties sharedBufferMemoryGetProperties; + WGPUProcSharedBufferMemoryIsDeviceLost sharedBufferMemoryIsDeviceLost; + WGPUProcSharedBufferMemorySetLabel sharedBufferMemorySetLabel; + WGPUProcSharedBufferMemoryReference sharedBufferMemoryReference; + WGPUProcSharedBufferMemoryRelease sharedBufferMemoryRelease; + + WGPUProcSharedFenceExportInfo sharedFenceExportInfo; + WGPUProcSharedFenceReference sharedFenceReference; + WGPUProcSharedFenceRelease sharedFenceRelease; + + WGPUProcSharedTextureMemoryBeginAccess sharedTextureMemoryBeginAccess; + WGPUProcSharedTextureMemoryCreateTexture sharedTextureMemoryCreateTexture; + WGPUProcSharedTextureMemoryEndAccess sharedTextureMemoryEndAccess; + WGPUProcSharedTextureMemoryGetProperties sharedTextureMemoryGetProperties; + WGPUProcSharedTextureMemoryIsDeviceLost sharedTextureMemoryIsDeviceLost; + WGPUProcSharedTextureMemorySetLabel sharedTextureMemorySetLabel; + WGPUProcSharedTextureMemoryReference sharedTextureMemoryReference; + WGPUProcSharedTextureMemoryRelease sharedTextureMemoryRelease; + + WGPUProcSurfaceGetPreferredFormat surfaceGetPreferredFormat; WGPUProcSurfaceReference surfaceReference; WGPUProcSurfaceRelease surfaceRelease; - WGPUProcSwapChainConfigure swapChainConfigure; + WGPUProcSwapChainGetCurrentTexture swapChainGetCurrentTexture; WGPUProcSwapChainGetCurrentTextureView swapChainGetCurrentTextureView; WGPUProcSwapChainPresent swapChainPresent; WGPUProcSwapChainReference swapChainReference; WGPUProcSwapChainRelease swapChainRelease; + WGPUProcTextureCreateErrorView textureCreateErrorView; WGPUProcTextureCreateView textureCreateView; WGPUProcTextureDestroy textureDestroy; WGPUProcTextureGetDepthOrArrayLayers textureGetDepthOrArrayLayers; @@ -235,6 +283,7 @@ typedef struct DawnProcTable { WGPUProcTextureViewReference textureViewReference; WGPUProcTextureViewRelease textureViewRelease; + } DawnProcTable; #endif // DAWN_DAWN_PROC_TABLE_H_ diff --git a/lib/dawn/inc/dawn/dawn_thread_dispatch_proc.h b/lib/dawn/inc/dawn/dawn_thread_dispatch_proc.h index 7b12c67..ffa65b9 100644 --- a/lib/dawn/inc/dawn/dawn_thread_dispatch_proc.h +++ b/lib/dawn/inc/dawn/dawn_thread_dispatch_proc.h @@ -1,16 +1,29 @@ -// Copyright 2020 The Dawn Authors +// Copyright 2020 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_DAWN_THREAD_DISPATCH_PROC_H_ #define INCLUDE_DAWN_DAWN_THREAD_DISPATCH_PROC_H_ @@ -24,6 +37,7 @@ extern "C" { // Call dawnProcSetProcs(&dawnThreadDispatchProcTable) and then use dawnProcSetPerThreadProcs // to set per-thread procs. WGPU_EXPORT extern DawnProcTable dawnThreadDispatchProcTable; +WGPU_EXPORT void dawnProcSetDefaultThreadProcs(const DawnProcTable* procs); WGPU_EXPORT void dawnProcSetPerThreadProcs(const DawnProcTable* procs); #ifdef __cplusplus diff --git a/lib/dawn/inc/dawn/dawn_wsi.h b/lib/dawn/inc/dawn/dawn_wsi.h deleted file mode 100644 index aecb252..0000000 --- a/lib/dawn/inc/dawn/dawn_wsi.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2017 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef INCLUDE_DAWN_DAWN_WSI_H_ -#define INCLUDE_DAWN_DAWN_WSI_H_ - -#include "dawn/webgpu.h" - -// Error message (or nullptr if there was no error) -typedef const char* DawnSwapChainError; -constexpr DawnSwapChainError DAWN_SWAP_CHAIN_NO_ERROR = nullptr; - -typedef struct { - /// Backend-specific texture id/name/pointer - union { - void* ptr; - uint64_t u64; - uint32_t u32; - } texture; -} DawnSwapChainNextTexture; - -typedef struct { - /// Initialize the swap chain implementation. - /// (*wsiContext) is one of DawnWSIContext{D3D12,Metal,GL} - void (*Init)(void* userData, void* wsiContext); - - /// Destroy the swap chain implementation. - void (*Destroy)(void* userData); - - /// Configure/reconfigure the swap chain. - DawnSwapChainError (*Configure)(void* userData, - WGPUTextureFormat format, - WGPUTextureUsage allowedUsage, - uint32_t width, - uint32_t height); - - /// Acquire the next texture from the swap chain. - DawnSwapChainError (*GetNextTexture)(void* userData, DawnSwapChainNextTexture* nextTexture); - - /// Present the last acquired texture to the screen. - DawnSwapChainError (*Present)(void* userData); - - /// Each function is called with userData as its first argument. - void* userData; - - /// For use by the D3D12 and Vulkan backends: how the swapchain will use the texture. - WGPUTextureUsage textureUsage; -} DawnSwapChainImplementation; - -#if defined(DAWN_ENABLE_BACKEND_D3D12) && defined(__cplusplus) -struct DawnWSIContextD3D12 { - WGPUDevice device = nullptr; -}; -#endif - -#if defined(DAWN_ENABLE_BACKEND_METAL) && defined(__OBJC__) -#import - -struct DawnWSIContextMetal { - id device = nil; - id queue = nil; -}; -#endif - -#ifdef DAWN_ENABLE_BACKEND_OPENGL -typedef struct { -} DawnWSIContextGL; -#endif - -#ifdef DAWN_ENABLE_BACKEND_VULKAN -typedef struct { -} DawnWSIContextVulkan; -#endif - -#endif // INCLUDE_DAWN_DAWN_WSI_H_ diff --git a/lib/dawn/inc/dawn/native/D3D11Backend.h b/lib/dawn/inc/dawn/native/D3D11Backend.h new file mode 100644 index 0000000..cfcfb27 --- /dev/null +++ b/lib/dawn/inc/dawn/native/D3D11Backend.h @@ -0,0 +1,65 @@ +// Copyright 2023 The Dawn & Tint Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ +#define INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ + +#include +#include +#include + +#include + +#include "dawn/native/D3DBackend.h" + +namespace dawn::native::d3d11 { + +DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D11Device(WGPUDevice device); + +// May be chained on RequestAdapterOptions +struct DAWN_NATIVE_EXPORT RequestAdapterOptionsD3D11Device : wgpu::ChainedStruct { + RequestAdapterOptionsD3D11Device() { + sType = static_cast(WGPUSType_RequestAdapterOptionsD3D11Device); + } + + Microsoft::WRL::ComPtr device; +}; + +// May be chained on SharedTextureMemoryDescriptor +struct DAWN_NATIVE_EXPORT SharedTextureMemoryD3D11Texture2DDescriptor : wgpu::ChainedStruct { + SharedTextureMemoryD3D11Texture2DDescriptor() { + sType = static_cast(WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor); + } + + // This ID3D11Texture2D object must be created from the same ID3D11Device used in the + // WGPUDevice. + Microsoft::WRL::ComPtr texture; +}; + +} // namespace dawn::native::d3d11 + +#endif // INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ diff --git a/lib/dawn/inc/dawn/native/D3D12Backend.h b/lib/dawn/inc/dawn/native/D3D12Backend.h index 15a7e6f..31faf6c 100644 --- a/lib/dawn/inc/dawn/native/D3D12Backend.h +++ b/lib/dawn/inc/dawn/native/D3D12Backend.h @@ -1,136 +1,67 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_ #define INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_ -#include #include +#include #include #include -#include -#include - -#include "dawn/dawn_wsi.h" -#include "dawn/native/DawnNative.h" +#include "dawn/native/D3DBackend.h" struct ID3D12Device; struct ID3D12Resource; namespace dawn::native::d3d12 { -class D3D11on12ResourceCache; class Device; -class ExternalImageDXGIImpl; - -DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D12Device(WGPUDevice device); -DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(WGPUDevice device, - HWND window); -DAWN_NATIVE_EXPORT WGPUTextureFormat -GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain); enum MemorySegment { Local, NonLocal, }; +DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D12Device(WGPUDevice device); + DAWN_NATIVE_EXPORT uint64_t SetExternalMemoryReservation(WGPUDevice device, uint64_t requestedReservationSize, MemorySegment memorySegment); -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorDXGISharedHandle : ExternalImageDescriptor { - public: - ExternalImageDescriptorDXGISharedHandle(); - - // Note: SharedHandle must be a handle to a texture object. - HANDLE sharedHandle = nullptr; - - // Whether fence synchronization should be used instead of texture's keyed mutex. - bool useFenceSynchronization = false; -}; - -// Keyed mutex acquire/release uses a fixed key of 0 to match Chromium behavior. -constexpr UINT64 kDXGIKeyedMutexAcquireReleaseKey = 0; - -struct DAWN_NATIVE_EXPORT ExternalImageDXGIFenceDescriptor { - // Shared handle for the fence. This never passes ownership to the callee (when used as an input - // parameter) or to the caller (when used as a return value or output parameter). - HANDLE fenceHandle = nullptr; - - // The value that was previously signaled on this fence and should be waited on. - uint64_t fenceValue = 0; -}; - -struct DAWN_NATIVE_EXPORT ExternalImageDXGIBeginAccessDescriptor { - bool isInitialized = false; // Whether the texture is initialized on import - WGPUTextureUsageFlags usage = WGPUTextureUsage_None; - - // A list of fences to wait on before accessing the texture. - std::vector waitFences; - - // Whether the texture is for a WebGPU swap chain. - bool isSwapChainTexture = false; -}; - -// TODO(dawn:576): Remove after changing Chromium code to use the new struct name. -struct DAWN_NATIVE_EXPORT ExternalImageAccessDescriptorDXGIKeyedMutex - : ExternalImageDXGIBeginAccessDescriptor { - public: - // TODO(chromium:1241533): Remove deprecated keyed mutex params after removing associated - // code from Chromium - we use a fixed key of 0 for acquire and release everywhere now. - uint64_t acquireMutexKey; - uint64_t releaseMutexKey; -}; - -class DAWN_NATIVE_EXPORT ExternalImageDXGI { - public: - ~ExternalImageDXGI(); - - static std::unique_ptr Create( - WGPUDevice device, - const ExternalImageDescriptorDXGISharedHandle* descriptor); - - // Returns true if the external image resources are still valid, otherwise ProduceTexture() is - // guaranteed to fail e.g. after device destruction. - bool IsValid() const; - - // TODO(sunnyps): |device| is ignored - remove after Chromium migrates to BeginAccess(). - WGPUTexture ProduceTexture(WGPUDevice device, - const ExternalImageDXGIBeginAccessDescriptor* descriptor); - - // Creates WGPUTexture wrapping the DXGI shared handle. The provided wait fences or the - // texture's keyed mutex will be synchronized before using the texture in any command lists. - // Empty fences (nullptr handle) are ignored for convenience (EndAccess can return such fences). - WGPUTexture BeginAccess(const ExternalImageDXGIBeginAccessDescriptor* descriptor); - - // Returns the signalFence that the client must wait on for correct synchronization. Can return - // an empty fence (nullptr handle) if the texture wasn't accessed by Dawn. - // Note that merely calling Destroy() on the WGPUTexture does not ensure synchronization. - void EndAccess(WGPUTexture texture, ExternalImageDXGIFenceDescriptor* signalFence); - - private: - explicit ExternalImageDXGI(std::unique_ptr impl); - - std::unique_ptr mImpl; -}; - -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { - AdapterDiscoveryOptions(); - explicit AdapterDiscoveryOptions(Microsoft::WRL::ComPtr adapter); +// May be chained on SharedBufferMemoryDescriptor +struct DAWN_NATIVE_EXPORT SharedBufferMemoryD3D12ResourceDescriptor : wgpu::ChainedStruct { + SharedBufferMemoryD3D12ResourceDescriptor() { + sType = static_cast(WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor); + } - Microsoft::WRL::ComPtr dxgiAdapter; + // This ID3D12Resource object must be created from the same ID3D12Device used in the + // WGPUDevice. + Microsoft::WRL::ComPtr resource; }; } // namespace dawn::native::d3d12 diff --git a/lib/dawn/inc/dawn/native/D3DBackend.h b/lib/dawn/inc/dawn/native/D3DBackend.h new file mode 100644 index 0000000..d6bf080 --- /dev/null +++ b/lib/dawn/inc/dawn/native/D3DBackend.h @@ -0,0 +1,126 @@ +// Copyright 2023 The Dawn & Tint Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef INCLUDE_DAWN_NATIVE_D3DBACKEND_H_ +#define INCLUDE_DAWN_NATIVE_D3DBACKEND_H_ + +#include +#include +#include + +#include +#include + +#include "dawn/native/DawnNative.h" +#include "webgpu/webgpu_cpp_chained_struct.h" + +namespace dawn::native::d3d { + +class ExternalImageDXGIImpl; + +DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetDXGIAdapter(WGPUAdapter adapter); + +// Can be chained in WGPURequestAdapterOptions +struct DAWN_NATIVE_EXPORT RequestAdapterOptionsLUID : wgpu::ChainedStruct { + RequestAdapterOptionsLUID(); + + ::LUID adapterLUID; +}; + +// Chrome uses 0 as acquire key. +static constexpr UINT64 kDXGIKeyedMutexAcquireKey = 0; + +struct DAWN_NATIVE_EXPORT ExternalImageDescriptorDXGISharedHandle : ExternalImageDescriptor { + public: + ExternalImageDescriptorDXGISharedHandle(); + + // Note: SharedHandle must be a handle to a texture object. + HANDLE sharedHandle = nullptr; + + // Whether the underlying texture has a keyed mutex which should be used for synchronization. + bool useKeyedMutex = false; +}; + +struct DAWN_NATIVE_EXPORT ExternalImageDescriptorD3D11Texture : ExternalImageDescriptor { + public: + ExternalImageDescriptorD3D11Texture(); + + // Texture is used for creating ExternalImageDXGI with d3d11 backend. It must be an + // ID3D11Texture2D object and created from the same ID3D11Device used in the WGPUDevice. + Microsoft::WRL::ComPtr texture; +}; + +struct DAWN_NATIVE_EXPORT ExternalImageDXGIFenceDescriptor { + // Shared handle for the fence. This never passes ownership to the callee (when used as an input + // parameter) or to the caller (when used as a return value or output parameter). + HANDLE fenceHandle = nullptr; + + // The value that was previously signaled on this fence and should be waited on. + uint64_t fenceValue = 0; +}; + +struct DAWN_NATIVE_EXPORT ExternalImageDXGIBeginAccessDescriptor { + bool isInitialized = false; // Whether the texture is initialized on import + WGPUTextureUsageFlags usage = WGPUTextureUsage_None; + + // A list of fences to wait on before accessing the texture. + std::vector waitFences; + + // Whether the texture is for a WebGPU swap chain. + bool isSwapChainTexture = false; +}; + +class DAWN_NATIVE_EXPORT ExternalImageDXGI { + public: + ~ExternalImageDXGI(); + + static std::unique_ptr Create(WGPUDevice device, + const ExternalImageDescriptor* descriptor); + + // Returns true if the external image resources are still valid, otherwise BeginAccess() is + // guaranteed to fail e.g. after device destruction. + bool IsValid() const; + + // Creates WGPUTexture wrapping the DXGI shared handle. The provided wait fences will be + // synchronized before using the texture in any command lists. Empty fences (nullptr handle) are + // ignored for convenience (EndAccess can return such fences). + WGPUTexture BeginAccess(const ExternalImageDXGIBeginAccessDescriptor* descriptor); + + // Returns the signalFence that the client must wait on for correct synchronization. Can return + // an empty fence (nullptr handle) if the texture wasn't accessed by Dawn. + // Note that merely calling Destroy() on the WGPUTexture does not ensure synchronization. + void EndAccess(WGPUTexture texture, ExternalImageDXGIFenceDescriptor* signalFence); + + private: + explicit ExternalImageDXGI(std::unique_ptr impl); + + std::unique_ptr mImpl; +}; + +} // namespace dawn::native::d3d + +#endif // INCLUDE_DAWN_NATIVE_D3DBACKEND_H_ diff --git a/lib/dawn/inc/dawn/native/DawnNative.h b/lib/dawn/inc/dawn/native/DawnNative.h index 7964ce1..b6f2d99 100644 --- a/lib/dawn/inc/dawn/native/DawnNative.h +++ b/lib/dawn/inc/dawn/native/DawnNative.h @@ -1,53 +1,51 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_ #define INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_ -#include #include #include "dawn/dawn_proc_table.h" #include "dawn/native/dawn_native_export.h" -#include "dawn/webgpu.h" +#include "dawn/webgpu_cpp.h" namespace dawn::platform { class Platform; } // namespace dawn::platform -namespace wgpu { -struct AdapterProperties; -struct DeviceDescriptor; -} // namespace wgpu - namespace dawn::native { class InstanceBase; class AdapterBase; -// An optional parameter of Adapter::CreateDevice() to send additional information when creating -// a Device. For example, we can use it to enable a workaround, optimization or feature. -struct DAWN_NATIVE_EXPORT DawnDeviceDescriptor { - DawnDeviceDescriptor(); - ~DawnDeviceDescriptor(); - - std::vector requiredFeatures; - std::vector forceEnabledToggles; - std::vector forceDisabledToggles; - - const WGPURequiredLimits* requiredLimits = nullptr; -}; +// Each toggle is assigned with a TogglesStage, indicating the validation and earliest usage +// time of the toggle. +enum class ToggleStage { Instance, Adapter, Device }; // A struct to record the information of a toggle. A toggle is a code path in Dawn device that // can be manually configured to run or not outside Dawn, including workarounds, special @@ -56,6 +54,7 @@ struct ToggleInfo { const char* name; const char* description; const char* url; + ToggleStage stage; }; // A struct to record the information of a feature. A feature is a GPU feature that is not @@ -66,7 +65,7 @@ struct FeatureInfo { const char* description; const char* url; // The enum of feature state, could be stable or experimental. Using an experimental feature - // requires DisallowUnsafeAPIs toggle being disabled. + // requires the AllowUnsafeAPIs toggle to be enabled. enum class FeatureState { Stable = 0, Experimental }; FeatureState featureState; }; @@ -92,7 +91,6 @@ class DAWN_NATIVE_EXPORT Adapter { void GetProperties(wgpu::AdapterProperties* properties) const; void GetProperties(WGPUAdapterProperties* properties) const; - std::vector GetSupportedExtensions() const; std::vector GetSupportedFeatures() const; bool GetLimits(WGPUSupportedLimits* limits) const; @@ -105,19 +103,20 @@ class DAWN_NATIVE_EXPORT Adapter { explicit operator bool() const; // Create a device on this adapter. On an error, nullptr is returned. - WGPUDevice CreateDevice(const DawnDeviceDescriptor* deviceDescriptor); WGPUDevice CreateDevice(const wgpu::DeviceDescriptor* deviceDescriptor); WGPUDevice CreateDevice(const WGPUDeviceDescriptor* deviceDescriptor = nullptr); - void RequestDevice(const DawnDeviceDescriptor* descriptor, - WGPURequestDeviceCallback callback, - void* userdata); void RequestDevice(const wgpu::DeviceDescriptor* descriptor, WGPURequestDeviceCallback callback, void* userdata); void RequestDevice(const WGPUDeviceDescriptor* descriptor, WGPURequestDeviceCallback callback, void* userdata); + void RequestDevice(std::nullptr_t descriptor, + WGPURequestDeviceCallback callback, + void* userdata) { + RequestDevice(static_cast(descriptor), callback, userdata); + } // Returns the underlying WGPUAdapter object. WGPUAdapter Get() const; @@ -129,16 +128,26 @@ class DAWN_NATIVE_EXPORT Adapter { AdapterBase* mImpl = nullptr; }; -// Base class for options passed to Instance::DiscoverAdapters. -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptionsBase { - public: - const WGPUBackendType backendType; +enum BackendValidationLevel { Full, Partial, Disabled }; - protected: - explicit AdapterDiscoveryOptionsBase(WGPUBackendType type); -}; +// Can be chained in InstanceDescriptor +struct DAWN_NATIVE_EXPORT DawnInstanceDescriptor : wgpu::ChainedStruct { + DawnInstanceDescriptor(); + uint32_t additionalRuntimeSearchPathsCount = 0; + const char* const* additionalRuntimeSearchPaths; + dawn::platform::Platform* platform = nullptr; -enum BackendValidationLevel { Full, Partial, Disabled }; + BackendValidationLevel backendValidationLevel = BackendValidationLevel::Disabled; + bool beginCaptureOnStartup = false; + bool enableAdapterBlocklist = false; + + WGPULoggingCallback loggingCallback = nullptr; + void* loggingCallbackUserdata = nullptr; + + // Equality operators, mostly for testing. Note that this tests + // strict pointer-pointer equality if the struct contains member pointers. + bool operator==(const DawnInstanceDescriptor& rhs) const; +}; // Represents a connection to dawn_native and is used for dependency injection, discovering // system adapters and injecting custom adapters (like a Swiftshader Vulkan adapter). @@ -153,16 +162,13 @@ class DAWN_NATIVE_EXPORT Instance { Instance(const Instance& other) = delete; Instance& operator=(const Instance& other) = delete; - // Gather all adapters in the system that can be accessed with no special options. These - // adapters will later be returned by GetAdapters. - void DiscoverDefaultAdapters(); - - // Adds adapters that can be discovered with the options provided (like a getProcAddress). - // The backend is chosen based on the type of the options used. Returns true on success. - bool DiscoverAdapters(const AdapterDiscoveryOptionsBase* options); - - // Returns all the adapters that the instance knows about. - std::vector GetAdapters() const; + // Discovers and returns a vector of adapters. + // All systems adapters that can be found are returned if no options are passed. + // Otherwise, returns adapters based on the `options`. Adapter toggles descriptor can chained + // after options. + std::vector EnumerateAdapters(const WGPURequestAdapterOptions* options) const; + std::vector EnumerateAdapters( + const wgpu::RequestAdapterOptions* options = nullptr) const; const ToggleInfo* GetToggleInfo(const char* toggleName); const FeatureInfo* GetFeatureInfo(WGPUFeatureName feature); @@ -174,8 +180,8 @@ class DAWN_NATIVE_EXPORT Instance { // Enable debug capture on Dawn startup void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup); - // TODO(dawn:1374) Deprecate this once it is passed via the descriptor. - void SetPlatform(dawn::platform::Platform* platform); + // Enable / disable the adapter blocklist. + void EnableAdapterBlocklist(bool enable); uint64_t GetDeviceCountForTesting() const; @@ -198,8 +204,8 @@ DAWN_NATIVE_EXPORT size_t GetLazyClearCountForTesting(WGPUDevice device); // Backdoor to get the number of deprecation warnings for testing DAWN_NATIVE_EXPORT size_t GetDeprecationWarningCountForTesting(WGPUDevice device); -// Backdoor to get the number of adapters an instance knows about for testing -DAWN_NATIVE_EXPORT size_t GetAdapterCountForTesting(WGPUInstance instance); +// Backdoor to get the number of physical devices an instance knows about for testing +DAWN_NATIVE_EXPORT size_t GetPhysicalDeviceCountForTesting(WGPUInstance instance); // Query if texture has been initialized DAWN_NATIVE_EXPORT bool IsTextureSubresourceInitialized( @@ -215,6 +221,8 @@ DAWN_NATIVE_EXPORT std::vector GetProcMapNamesForTesting(); DAWN_NATIVE_EXPORT bool DeviceTick(WGPUDevice device); +DAWN_NATIVE_EXPORT bool InstanceProcessEvents(WGPUInstance instance); + // ErrorInjector functions used for testing only. Defined in dawn_native/ErrorInjector.cpp DAWN_NATIVE_EXPORT void EnableErrorInjector(); DAWN_NATIVE_EXPORT void DisableErrorInjector(); @@ -228,8 +236,11 @@ enum ExternalImageType { DmaBuf, IOSurface, DXGISharedHandle, + D3D11Texture, EGLImage, + GLTexture, AHardwareBuffer, + Last = AHardwareBuffer, }; // Common properties of external images @@ -264,12 +275,12 @@ DAWN_NATIVE_EXPORT const char* GetObjectLabelForTesting(void* objectHandle); DAWN_NATIVE_EXPORT uint64_t GetAllocatedSizeForTesting(WGPUBuffer buffer); -DAWN_NATIVE_EXPORT bool BindGroupLayoutBindingsEqualForTesting(WGPUBindGroupLayout a, - WGPUBindGroupLayout b); +DAWN_NATIVE_EXPORT std::vector AllToggleInfos(); -} // namespace dawn::native +// Used to query the details of an feature. Return nullptr if featureName is not a valid +// name of an feature supported in Dawn. +DAWN_NATIVE_EXPORT const FeatureInfo* GetFeatureInfo(wgpu::FeatureName feature); -// TODO(dawn:824): Remove once the deprecation period is passed. -namespace dawn_native = dawn::native; +} // namespace dawn::native #endif // INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_ diff --git a/lib/dawn/inc/dawn/native/MetalBackend.h b/lib/dawn/inc/dawn/native/MetalBackend.h index b9ab707..c07349a 100644 --- a/lib/dawn/inc/dawn/native/MetalBackend.h +++ b/lib/dawn/inc/dawn/native/MetalBackend.h @@ -1,23 +1,35 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_METALBACKEND_H_ #define INCLUDE_DAWN_NATIVE_METALBACKEND_H_ #include -#include "dawn/dawn_wsi.h" #include "dawn/native/DawnNative.h" // The specifics of the Metal backend expose types in function signatures that might not be @@ -36,10 +48,6 @@ typedef __IOSurface* IOSurfaceRef; namespace dawn::native::metal { -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { - AdapterDiscoveryOptions(); -}; - struct DAWN_NATIVE_EXPORT ExternalImageMTLSharedEventDescriptor { // Shared event handle `id`. // This never passes ownership to the callee (when used as an input @@ -63,9 +71,6 @@ struct DAWN_NATIVE_EXPORT ExternalImageDescriptorIOSurface : ExternalImageDescri IOSurfaceRef ioSurface; - // This has been deprecated. - uint32_t plane; - // A list of events to wait on before accessing the texture. std::vector waitEvents; }; @@ -75,9 +80,6 @@ struct DAWN_NATIVE_EXPORT ExternalImageIOSurfaceEndAccessDescriptor bool isInitialized; }; -DAWN_NATIVE_EXPORT WGPUTexture WrapIOSurface(WGPUDevice device, - const ExternalImageDescriptorIOSurface* descriptor); - DAWN_NATIVE_EXPORT void IOSurfaceEndAccess(WGPUTexture texture, ExternalImageIOSurfaceEndAccessDescriptor* descriptor); diff --git a/lib/dawn/inc/dawn/native/NullBackend.h b/lib/dawn/inc/dawn/native/NullBackend.h index bfa8a63..5de9920 100644 --- a/lib/dawn/inc/dawn/native/NullBackend.h +++ b/lib/dawn/inc/dawn/native/NullBackend.h @@ -1,25 +1,39 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_NULLBACKEND_H_ #define INCLUDE_DAWN_NATIVE_NULLBACKEND_H_ -#include "dawn/dawn_wsi.h" #include "dawn/native/DawnNative.h" namespace dawn::native::null { -DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(); + +// Nothing for now \o/ + } // namespace dawn::native::null #endif // INCLUDE_DAWN_NATIVE_NULLBACKEND_H_ diff --git a/lib/dawn/inc/dawn/native/OpenGLBackend.h b/lib/dawn/inc/dawn/native/OpenGLBackend.h index cceaab8..fb1eedb 100644 --- a/lib/dawn/inc/dawn/native/OpenGLBackend.h +++ b/lib/dawn/inc/dawn/native/OpenGLBackend.h @@ -1,45 +1,50 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_OPENGLBACKEND_H_ #define INCLUDE_DAWN_NATIVE_OPENGLBACKEND_H_ -typedef void* EGLImage; +using EGLDisplay = void*; +using EGLImage = void*; +using GLuint = unsigned int; -#include "dawn/dawn_wsi.h" #include "dawn/native/DawnNative.h" +#include "webgpu/webgpu_cpp_chained_struct.h" namespace dawn::native::opengl { -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { - explicit AdapterDiscoveryOptions(WGPUBackendType type); +// Can be chained in WGPURequestAdapterOptions +struct DAWN_NATIVE_EXPORT RequestAdapterOptionsGetGLProc : wgpu::ChainedStruct { + RequestAdapterOptionsGetGLProc(); void* (*getProc)(const char*); + EGLDisplay display; }; -// TODO(crbug.com/dawn/810): This struct can be removed once Chrome is no longer using it. -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptionsES : public AdapterDiscoveryOptions { - AdapterDiscoveryOptionsES(); -}; - -using PresentCallback = void (*)(void*); -DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(WGPUDevice device, - PresentCallback present, - void* presentUserdata); -DAWN_NATIVE_EXPORT WGPUTextureFormat -GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain); - struct DAWN_NATIVE_EXPORT ExternalImageDescriptorEGLImage : ExternalImageDescriptor { public: ExternalImageDescriptorEGLImage(); @@ -50,6 +55,16 @@ struct DAWN_NATIVE_EXPORT ExternalImageDescriptorEGLImage : ExternalImageDescrip DAWN_NATIVE_EXPORT WGPUTexture WrapExternalEGLImage(WGPUDevice device, const ExternalImageDescriptorEGLImage* descriptor); +struct DAWN_NATIVE_EXPORT ExternalImageDescriptorGLTexture : ExternalImageDescriptor { + public: + ExternalImageDescriptorGLTexture(); + + GLuint texture; +}; + +DAWN_NATIVE_EXPORT WGPUTexture +WrapExternalGLTexture(WGPUDevice device, const ExternalImageDescriptorGLTexture* descriptor); + } // namespace dawn::native::opengl #endif // INCLUDE_DAWN_NATIVE_OPENGLBACKEND_H_ diff --git a/lib/dawn/inc/dawn/native/VulkanBackend.h b/lib/dawn/inc/dawn/native/VulkanBackend.h index 68767b8..0ad734e 100644 --- a/lib/dawn/inc/dawn/native/VulkanBackend.h +++ b/lib/dawn/inc/dawn/native/VulkanBackend.h @@ -1,16 +1,29 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_VULKANBACKEND_H_ #define INCLUDE_DAWN_NATIVE_VULKANBACKEND_H_ @@ -20,7 +33,6 @@ #include #include -#include "dawn/dawn_wsi.h" #include "dawn/native/DawnNative.h" namespace dawn::native::vulkan { @@ -29,17 +41,6 @@ DAWN_NATIVE_EXPORT VkInstance GetInstance(WGPUDevice device); DAWN_NATIVE_EXPORT PFN_vkVoidFunction GetInstanceProcAddr(WGPUDevice device, const char* pName); -DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(WGPUDevice device, - ::VkSurfaceKHR surface); -DAWN_NATIVE_EXPORT WGPUTextureFormat -GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain); - -struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { - AdapterDiscoveryOptions(); - - bool forceSwiftShader = false; -}; - enum class NeedsDedicatedAllocation { Yes, No, diff --git a/lib/dawn/inc/dawn/native/dawn_native_export.h b/lib/dawn/inc/dawn/native/dawn_native_export.h index c237720..0dc6f63 100644 --- a/lib/dawn/inc/dawn/native/dawn_native_export.h +++ b/lib/dawn/inc/dawn/native/dawn_native_export.h @@ -1,16 +1,29 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_NATIVE_DAWN_NATIVE_EXPORT_H_ #define INCLUDE_DAWN_NATIVE_DAWN_NATIVE_EXPORT_H_ diff --git a/lib/dawn/inc/dawn/platform/DawnPlatform.h b/lib/dawn/inc/dawn/platform/DawnPlatform.h index 0645441..aacdf0c 100644 --- a/lib/dawn/inc/dawn/platform/DawnPlatform.h +++ b/lib/dawn/inc/dawn/platform/DawnPlatform.h @@ -1,16 +1,29 @@ -// Copyright 2019 The Dawn Authors +// Copyright 2019 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_PLATFORM_DAWNPLATFORM_H_ #define INCLUDE_DAWN_PLATFORM_DAWNPLATFORM_H_ @@ -73,6 +86,13 @@ class DAWN_PLATFORM_EXPORT WorkerTaskPool { void* userdata) = 0; }; +// These features map to similarly named ones in src/chromium/src/gpu/config/gpu_finch_features.h +// in `namespace features`. +enum class Features { + kWebGPUUseDXC, + kWebGPUUseTintIR, +}; + class DAWN_PLATFORM_EXPORT Platform { public: Platform(); @@ -93,12 +113,39 @@ class DAWN_PLATFORM_EXPORT Platform { const uint64_t* argValues, unsigned char flags); + // Invoked to add a UMA histogram count-based sample + virtual void HistogramCustomCounts(const char* name, + int sample, + int min, + int max, + int bucketCount); + + // Invoked to add a UMA histogram count-based sample that requires high-performance + // counter (HPC) support. + virtual void HistogramCustomCountsHPC(const char* name, + int sample, + int min, + int max, + int bucketCount); + + // Invoked to add a UMA histogram enumeration sample + virtual void HistogramEnumeration(const char* name, int sample, int boundaryValue); + + // Invoked to add a UMA histogram sparse sample + virtual void HistogramSparse(const char* name, int sample); + + // Invoked to add a UMA histogram boolean sample + virtual void HistogramBoolean(const char* name, bool sample); + // The returned CachingInterface is expected to outlive the device which uses it to persistently // cache objects. virtual CachingInterface* GetCachingInterface(); virtual std::unique_ptr CreateWorkerTaskPool(); + // Hook for querying if a Finch feature is enabled. + virtual bool IsFeatureEnabled(Features feature); + private: Platform(const Platform&) = delete; Platform& operator=(const Platform&) = delete; diff --git a/lib/dawn/inc/dawn/platform/dawn_platform_export.h b/lib/dawn/inc/dawn/platform/dawn_platform_export.h index fbdb33c..15e4a43 100644 --- a/lib/dawn/inc/dawn/platform/dawn_platform_export.h +++ b/lib/dawn/inc/dawn/platform/dawn_platform_export.h @@ -1,16 +1,29 @@ -// Copyright 2020 The Dawn Authors +// Copyright 2020 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_PLATFORM_DAWN_PLATFORM_EXPORT_H_ #define INCLUDE_DAWN_PLATFORM_DAWN_PLATFORM_EXPORT_H_ diff --git a/lib/dawn/inc/dawn/webgpu.h b/lib/dawn/inc/dawn/webgpu.h index 18200ca..dbae383 100644 --- a/lib/dawn/inc/dawn/webgpu.h +++ b/lib/dawn/inc/dawn/webgpu.h @@ -51,105 +51,292 @@ # 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 -#include - -#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) -#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_STRIDE_UNDEFINED (0xffffffffUL) + +#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED UINT32_MAX +#define WGPU_COPY_STRIDE_UNDEFINED UINT32_MAX +#define WGPU_DEPTH_SLICE_UNDEFINED UINT32_MAX +#define WGPU_LIMIT_U32_UNDEFINED UINT32_MAX +#define WGPU_LIMIT_U64_UNDEFINED UINT64_MAX +#define WGPU_MIP_LEVEL_COUNT_UNDEFINED UINT32_MAX +#define WGPU_QUERY_SET_INDEX_UNDEFINED UINT32_MAX #define WGPU_WHOLE_MAP_SIZE SIZE_MAX -#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) +#define WGPU_WHOLE_SIZE UINT64_MAX typedef uint32_t WGPUFlags; - -typedef struct WGPUAdapterImpl* WGPUAdapter; -typedef struct WGPUBindGroupImpl* WGPUBindGroup; -typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout; -typedef struct WGPUBufferImpl* WGPUBuffer; -typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer; -typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder; -typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder; -typedef struct WGPUComputePipelineImpl* WGPUComputePipeline; -typedef struct WGPUDeviceImpl* WGPUDevice; -typedef struct WGPUExternalTextureImpl* WGPUExternalTexture; -typedef struct WGPUInstanceImpl* WGPUInstance; -typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout; -typedef struct WGPUQuerySetImpl* WGPUQuerySet; -typedef struct WGPUQueueImpl* WGPUQueue; -typedef struct WGPURenderBundleImpl* WGPURenderBundle; -typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder; -typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder; -typedef struct WGPURenderPipelineImpl* WGPURenderPipeline; -typedef struct WGPUSamplerImpl* WGPUSampler; -typedef struct WGPUShaderModuleImpl* WGPUShaderModule; -typedef struct WGPUSurfaceImpl* WGPUSurface; -typedef struct WGPUSwapChainImpl* WGPUSwapChain; -typedef struct WGPUTextureImpl* WGPUTexture; -typedef struct WGPUTextureViewImpl* WGPUTextureView; +typedef uint32_t WGPUBool; + +typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBufferImpl* WGPUBuffer WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUComputePipelineImpl* WGPUComputePipeline WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUDeviceImpl* WGPUDevice WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUExternalTextureImpl* WGPUExternalTexture 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 WGPUSharedBufferMemoryImpl* WGPUSharedBufferMemory WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSharedFenceImpl* WGPUSharedFence WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSharedTextureMemoryImpl* WGPUSharedTextureMemory WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSurfaceImpl* WGPUSurface WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSwapChainImpl* WGPUSwapChain WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; + +// Structure forward declarations +struct WGPUAdapterProperties; +struct WGPUAdapterPropertiesD3D; +struct WGPUBindGroupEntry; +struct WGPUBlendComponent; +struct WGPUBufferBindingLayout; +struct WGPUBufferDescriptor; +struct WGPUBufferHostMappedPointer; +struct WGPUBufferMapCallbackInfo; +struct WGPUColor; +struct WGPUCommandBufferDescriptor; +struct WGPUCommandEncoderDescriptor; +struct WGPUCompilationInfoCallbackInfo; +struct WGPUCompilationMessage; +struct WGPUComputePassTimestampWrites; +struct WGPUConstantEntry; +struct WGPUCopyTextureForBrowserOptions; +struct WGPUCreateComputePipelineAsyncCallbackInfo; +struct WGPUCreateRenderPipelineAsyncCallbackInfo; +struct WGPUDawnWGSLBlocklist; +struct WGPUDawnAdapterPropertiesPowerPreference; +struct WGPUDawnBufferDescriptorErrorInfoFromWireClient; +struct WGPUDawnCacheDeviceDescriptor; +struct WGPUDawnComputePipelineFullSubgroups; +struct WGPUDawnEncoderInternalUsageDescriptor; +struct WGPUDawnExperimentalSubgroupLimits; +struct WGPUDawnMultisampleStateRenderToSingleSampled; +struct WGPUDawnRenderPassColorAttachmentRenderToSingleSampled; +struct WGPUDawnShaderModuleSPIRVOptionsDescriptor; +struct WGPUDawnTextureInternalUsageDescriptor; +struct WGPUDawnTogglesDescriptor; +struct WGPUDawnWireWGSLControl; +struct WGPUDepthStencilStateDepthWriteDefinedDawn; +struct WGPUExtent2D; +struct WGPUExtent3D; +struct WGPUExternalTextureBindingEntry; +struct WGPUExternalTextureBindingLayout; +struct WGPUFuture; +struct WGPUInstanceFeatures; +struct WGPULimits; +struct WGPUMemoryHeapInfo; +struct WGPUMultisampleState; +struct WGPUOrigin2D; +struct WGPUOrigin3D; +struct WGPUPipelineLayoutDescriptor; +struct WGPUPipelineLayoutStorageAttachment; +struct WGPUPopErrorScopeCallbackInfo; +struct WGPUPrimitiveDepthClipControl; +struct WGPUPrimitiveState; +struct WGPUQuerySetDescriptor; +struct WGPUQueueDescriptor; +struct WGPUQueueWorkDoneCallbackInfo; +struct WGPURenderBundleDescriptor; +struct WGPURenderBundleEncoderDescriptor; +struct WGPURenderPassDepthStencilAttachment; +struct WGPURenderPassDescriptorMaxDrawCount; +struct WGPURenderPassTimestampWrites; +struct WGPURequestAdapterCallbackInfo; +struct WGPURequestAdapterOptions; +struct WGPURequestDeviceCallbackInfo; +struct WGPUSamplerBindingLayout; +struct WGPUSamplerDescriptor; +struct WGPUShaderModuleSPIRVDescriptor; +struct WGPUShaderModuleWGSLDescriptor; +struct WGPUShaderModuleDescriptor; +struct WGPUSharedBufferMemoryBeginAccessDescriptor; +struct WGPUSharedBufferMemoryDescriptor; +struct WGPUSharedBufferMemoryEndAccessState; +struct WGPUSharedBufferMemoryProperties; +struct WGPUSharedFenceDXGISharedHandleDescriptor; +struct WGPUSharedFenceDXGISharedHandleExportInfo; +struct WGPUSharedFenceMTLSharedEventDescriptor; +struct WGPUSharedFenceMTLSharedEventExportInfo; +struct WGPUSharedFenceDescriptor; +struct WGPUSharedFenceExportInfo; +struct WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor; +struct WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo; +struct WGPUSharedFenceVkSemaphoreSyncFDDescriptor; +struct WGPUSharedFenceVkSemaphoreSyncFDExportInfo; +struct WGPUSharedFenceVkSemaphoreZirconHandleDescriptor; +struct WGPUSharedFenceVkSemaphoreZirconHandleExportInfo; +struct WGPUSharedTextureMemoryDXGISharedHandleDescriptor; +struct WGPUSharedTextureMemoryEGLImageDescriptor; +struct WGPUSharedTextureMemoryIOSurfaceDescriptor; +struct WGPUSharedTextureMemoryAHardwareBufferDescriptor; +struct WGPUSharedTextureMemoryBeginAccessDescriptor; +struct WGPUSharedTextureMemoryDescriptor; +struct WGPUSharedTextureMemoryDmaBufPlane; +struct WGPUSharedTextureMemoryEndAccessState; +struct WGPUSharedTextureMemoryOpaqueFDDescriptor; +struct WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor; +struct WGPUSharedTextureMemoryVkImageLayoutBeginState; +struct WGPUSharedTextureMemoryVkImageLayoutEndState; +struct WGPUSharedTextureMemoryZirconHandleDescriptor; +struct WGPUStencilFaceState; +struct WGPUStorageTextureBindingLayout; +struct WGPUSurfaceDescriptor; +struct WGPUSurfaceDescriptorFromAndroidNativeWindow; +struct WGPUSurfaceDescriptorFromCanvasHTMLSelector; +struct WGPUSurfaceDescriptorFromMetalLayer; +struct WGPUSurfaceDescriptorFromWaylandSurface; +struct WGPUSurfaceDescriptorFromWindowsHWND; +struct WGPUSurfaceDescriptorFromWindowsCoreWindow; +struct WGPUSurfaceDescriptorFromWindowsSwapChainPanel; +struct WGPUSurfaceDescriptorFromXlibWindow; +struct WGPUSwapChainDescriptor; +struct WGPUTextureBindingLayout; +struct WGPUTextureBindingViewDimensionDescriptor; +struct WGPUTextureDataLayout; +struct WGPUTextureViewDescriptor; +struct WGPUVertexAttribute; +struct WGPUAdapterPropertiesMemoryHeaps; +struct WGPUBindGroupDescriptor; +struct WGPUBindGroupLayoutEntry; +struct WGPUBlendState; +struct WGPUCompilationInfo; +struct WGPUComputePassDescriptor; +struct WGPUDepthStencilState; +struct WGPUExternalTextureDescriptor; +struct WGPUFutureWaitInfo; +struct WGPUImageCopyBuffer; +struct WGPUImageCopyExternalTexture; +struct WGPUImageCopyTexture; +struct WGPUInstanceDescriptor; +struct WGPUPipelineLayoutPixelLocalStorage; +struct WGPUProgrammableStageDescriptor; +struct WGPURenderPassColorAttachment; +struct WGPURenderPassStorageAttachment; +struct WGPURequiredLimits; +struct WGPUSharedTextureMemoryDmaBufDescriptor; +struct WGPUSharedTextureMemoryProperties; +struct WGPUSharedTextureMemoryVkImageDescriptor; +struct WGPUSupportedLimits; +struct WGPUTextureDescriptor; +struct WGPUVertexBufferLayout; +struct WGPUBindGroupLayoutDescriptor; +struct WGPUColorTargetState; +struct WGPUComputePipelineDescriptor; +struct WGPUDeviceDescriptor; +struct WGPURenderPassDescriptor; +struct WGPURenderPassPixelLocalStorage; +struct WGPUVertexState; +struct WGPUFragmentState; +struct WGPURenderPipelineDescriptor; + +typedef enum WGPUWGSLFeatureName { + WGPUWGSLFeatureName_Undefined = 0x00000000, + WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, + WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002, + WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003, + WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004, + WGPUWGSLFeatureName_ChromiumTestingUnimplemented = 0x000003E8, + WGPUWGSLFeatureName_ChromiumTestingUnsafeExperimental = 0x000003E9, + WGPUWGSLFeatureName_ChromiumTestingExperimental = 0x000003EA, + WGPUWGSLFeatureName_ChromiumTestingShippedWithKillswitch = 0x000003EB, + WGPUWGSLFeatureName_ChromiumTestingShipped = 0x000003EC, + WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF +} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE; typedef enum WGPUAdapterType { - WGPUAdapterType_DiscreteGPU = 0x00000000, - WGPUAdapterType_IntegratedGPU = 0x00000001, - WGPUAdapterType_CPU = 0x00000002, - WGPUAdapterType_Unknown = 0x00000003, + WGPUAdapterType_DiscreteGPU = 0x00000001, + WGPUAdapterType_IntegratedGPU = 0x00000002, + WGPUAdapterType_CPU = 0x00000003, + WGPUAdapterType_Unknown = 0x00000004, WGPUAdapterType_Force32 = 0x7FFFFFFF -} WGPUAdapterType; +} WGPUAdapterType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUAddressMode { - WGPUAddressMode_Repeat = 0x00000000, - WGPUAddressMode_MirrorRepeat = 0x00000001, - WGPUAddressMode_ClampToEdge = 0x00000002, + WGPUAddressMode_Undefined = 0x00000000, + WGPUAddressMode_ClampToEdge = 0x00000001, + WGPUAddressMode_Repeat = 0x00000002, + WGPUAddressMode_MirrorRepeat = 0x00000003, WGPUAddressMode_Force32 = 0x7FFFFFFF -} WGPUAddressMode; +} WGPUAddressMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUAlphaMode { - WGPUAlphaMode_Premultiplied = 0x00000000, - WGPUAlphaMode_Unpremultiplied = 0x00000001, - WGPUAlphaMode_Opaque = 0x00000002, + WGPUAlphaMode_Opaque = 0x00000001, + WGPUAlphaMode_Premultiplied = 0x00000002, + WGPUAlphaMode_Unpremultiplied = 0x00000003, WGPUAlphaMode_Force32 = 0x7FFFFFFF -} WGPUAlphaMode; +} WGPUAlphaMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUBackendType { - WGPUBackendType_Null = 0x00000000, - WGPUBackendType_WebGPU = 0x00000001, - WGPUBackendType_D3D11 = 0x00000002, - WGPUBackendType_D3D12 = 0x00000003, - WGPUBackendType_Metal = 0x00000004, - WGPUBackendType_Vulkan = 0x00000005, - WGPUBackendType_OpenGL = 0x00000006, - WGPUBackendType_OpenGLES = 0x00000007, + 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; +} 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_Undefined = 0x00000000, + WGPUBlendFactor_Zero = 0x00000001, + WGPUBlendFactor_One = 0x00000002, + WGPUBlendFactor_Src = 0x00000003, + WGPUBlendFactor_OneMinusSrc = 0x00000004, + WGPUBlendFactor_SrcAlpha = 0x00000005, + WGPUBlendFactor_OneMinusSrcAlpha = 0x00000006, + WGPUBlendFactor_Dst = 0x00000007, + WGPUBlendFactor_OneMinusDst = 0x00000008, + WGPUBlendFactor_DstAlpha = 0x00000009, + WGPUBlendFactor_OneMinusDstAlpha = 0x0000000A, + WGPUBlendFactor_SrcAlphaSaturated = 0x0000000B, + WGPUBlendFactor_Constant = 0x0000000C, + WGPUBlendFactor_OneMinusConstant = 0x0000000D, + WGPUBlendFactor_Src1 = 0x0000000E, + WGPUBlendFactor_OneMinusSrc1 = 0x0000000F, + WGPUBlendFactor_Src1Alpha = 0x00000010, + WGPUBlendFactor_OneMinusSrc1Alpha = 0x00000011, WGPUBlendFactor_Force32 = 0x7FFFFFFF -} WGPUBlendFactor; +} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE; typedef enum WGPUBlendOperation { - WGPUBlendOperation_Add = 0x00000000, - WGPUBlendOperation_Subtract = 0x00000001, - WGPUBlendOperation_ReverseSubtract = 0x00000002, - WGPUBlendOperation_Min = 0x00000003, - WGPUBlendOperation_Max = 0x00000004, + WGPUBlendOperation_Undefined = 0x00000000, + WGPUBlendOperation_Add = 0x00000001, + WGPUBlendOperation_Subtract = 0x00000002, + WGPUBlendOperation_ReverseSubtract = 0x00000003, + WGPUBlendOperation_Min = 0x00000004, + WGPUBlendOperation_Max = 0x00000005, WGPUBlendOperation_Force32 = 0x7FFFFFFF -} WGPUBlendOperation; +} WGPUBlendOperation WGPU_ENUM_ATTRIBUTE; typedef enum WGPUBufferBindingType { WGPUBufferBindingType_Undefined = 0x00000000, @@ -157,80 +344,96 @@ typedef enum WGPUBufferBindingType { WGPUBufferBindingType_Storage = 0x00000002, WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, WGPUBufferBindingType_Force32 = 0x7FFFFFFF -} WGPUBufferBindingType; +} WGPUBufferBindingType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUBufferMapAsyncStatus { WGPUBufferMapAsyncStatus_Success = 0x00000000, - WGPUBufferMapAsyncStatus_Error = 0x00000001, - WGPUBufferMapAsyncStatus_Unknown = 0x00000002, - WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, - WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, - WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, + WGPUBufferMapAsyncStatus_InstanceDropped = 0x00000001, + WGPUBufferMapAsyncStatus_ValidationError = 0x00000002, + WGPUBufferMapAsyncStatus_Unknown = 0x00000003, + WGPUBufferMapAsyncStatus_DeviceLost = 0x00000004, + WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000005, + WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000006, + WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000007, + WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000008, + WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000009, WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUBufferMapAsyncStatus; +} WGPUBufferMapAsyncStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBufferMapState { + WGPUBufferMapState_Unmapped = 0x00000001, + WGPUBufferMapState_Pending = 0x00000002, + WGPUBufferMapState_Mapped = 0x00000003, + WGPUBufferMapState_Force32 = 0x7FFFFFFF +} WGPUBufferMapState WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCallbackMode { + WGPUCallbackMode_WaitAnyOnly = 0x00000000, + WGPUCallbackMode_AllowProcessEvents = 0x00000001, + WGPUCallbackMode_AllowSpontaneous = 0x00000002, + WGPUCallbackMode_Force32 = 0x7FFFFFFF +} WGPUCallbackMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCompareFunction { WGPUCompareFunction_Undefined = 0x00000000, WGPUCompareFunction_Never = 0x00000001, WGPUCompareFunction_Less = 0x00000002, - WGPUCompareFunction_LessEqual = 0x00000003, - WGPUCompareFunction_Greater = 0x00000004, - WGPUCompareFunction_GreaterEqual = 0x00000005, - WGPUCompareFunction_Equal = 0x00000006, - WGPUCompareFunction_NotEqual = 0x00000007, + WGPUCompareFunction_Equal = 0x00000003, + WGPUCompareFunction_LessEqual = 0x00000004, + WGPUCompareFunction_Greater = 0x00000005, + WGPUCompareFunction_NotEqual = 0x00000006, + WGPUCompareFunction_GreaterEqual = 0x00000007, WGPUCompareFunction_Always = 0x00000008, WGPUCompareFunction_Force32 = 0x7FFFFFFF -} WGPUCompareFunction; +} WGPUCompareFunction WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCompilationInfoRequestStatus { WGPUCompilationInfoRequestStatus_Success = 0x00000000, - WGPUCompilationInfoRequestStatus_Error = 0x00000001, - WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002, - WGPUCompilationInfoRequestStatus_Unknown = 0x00000003, + WGPUCompilationInfoRequestStatus_InstanceDropped = 0x00000001, + WGPUCompilationInfoRequestStatus_Error = 0x00000002, + WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000003, + WGPUCompilationInfoRequestStatus_Unknown = 0x00000004, WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF -} WGPUCompilationInfoRequestStatus; +} WGPUCompilationInfoRequestStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCompilationMessageType { - WGPUCompilationMessageType_Error = 0x00000000, - WGPUCompilationMessageType_Warning = 0x00000001, - WGPUCompilationMessageType_Info = 0x00000002, + WGPUCompilationMessageType_Error = 0x00000001, + WGPUCompilationMessageType_Warning = 0x00000002, + WGPUCompilationMessageType_Info = 0x00000003, WGPUCompilationMessageType_Force32 = 0x7FFFFFFF -} WGPUCompilationMessageType; - -typedef enum WGPUComputePassTimestampLocation { - WGPUComputePassTimestampLocation_Beginning = 0x00000000, - WGPUComputePassTimestampLocation_End = 0x00000001, - WGPUComputePassTimestampLocation_Force32 = 0x7FFFFFFF -} WGPUComputePassTimestampLocation; +} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCreatePipelineAsyncStatus { WGPUCreatePipelineAsyncStatus_Success = 0x00000000, - WGPUCreatePipelineAsyncStatus_Error = 0x00000001, - WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000002, - WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000003, - WGPUCreatePipelineAsyncStatus_Unknown = 0x00000004, + WGPUCreatePipelineAsyncStatus_InstanceDropped = 0x00000001, + WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000002, + WGPUCreatePipelineAsyncStatus_InternalError = 0x00000003, + WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000004, + WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000005, + WGPUCreatePipelineAsyncStatus_Unknown = 0x00000006, WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUCreatePipelineAsyncStatus; +} WGPUCreatePipelineAsyncStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCullMode { - WGPUCullMode_None = 0x00000000, - WGPUCullMode_Front = 0x00000001, - WGPUCullMode_Back = 0x00000002, + WGPUCullMode_Undefined = 0x00000000, + WGPUCullMode_None = 0x00000001, + WGPUCullMode_Front = 0x00000002, + WGPUCullMode_Back = 0x00000003, WGPUCullMode_Force32 = 0x7FFFFFFF -} WGPUCullMode; +} WGPUCullMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUDeviceLostReason { WGPUDeviceLostReason_Undefined = 0x00000000, WGPUDeviceLostReason_Destroyed = 0x00000001, WGPUDeviceLostReason_Force32 = 0x7FFFFFFF -} WGPUDeviceLostReason; +} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE; typedef enum WGPUErrorFilter { - WGPUErrorFilter_Validation = 0x00000000, - WGPUErrorFilter_OutOfMemory = 0x00000001, - WGPUErrorFilter_Internal = 0x00000002, + WGPUErrorFilter_Validation = 0x00000001, + WGPUErrorFilter_OutOfMemory = 0x00000002, + WGPUErrorFilter_Internal = 0x00000003, WGPUErrorFilter_Force32 = 0x7FFFFFFF -} WGPUErrorFilter; +} WGPUErrorFilter WGPU_ENUM_ATTRIBUTE; typedef enum WGPUErrorType { WGPUErrorType_NoError = 0x00000000, @@ -240,130 +443,177 @@ typedef enum WGPUErrorType { WGPUErrorType_Unknown = 0x00000004, WGPUErrorType_DeviceLost = 0x00000005, WGPUErrorType_Force32 = 0x7FFFFFFF -} WGPUErrorType; +} WGPUErrorType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUExternalTextureRotation { + WGPUExternalTextureRotation_Rotate0Degrees = 0x00000000, + WGPUExternalTextureRotation_Rotate90Degrees = 0x00000001, + WGPUExternalTextureRotation_Rotate180Degrees = 0x00000002, + WGPUExternalTextureRotation_Rotate270Degrees = 0x00000003, + WGPUExternalTextureRotation_Force32 = 0x7FFFFFFF +} WGPUExternalTextureRotation WGPU_ENUM_ATTRIBUTE; typedef enum WGPUFeatureName { WGPUFeatureName_Undefined = 0x00000000, WGPUFeatureName_DepthClipControl = 0x00000001, WGPUFeatureName_Depth32FloatStencil8 = 0x00000002, WGPUFeatureName_TimestampQuery = 0x00000003, - WGPUFeatureName_PipelineStatisticsQuery = 0x00000004, - WGPUFeatureName_TextureCompressionBC = 0x00000005, - WGPUFeatureName_TextureCompressionETC2 = 0x00000006, - WGPUFeatureName_TextureCompressionASTC = 0x00000007, - WGPUFeatureName_IndirectFirstInstance = 0x00000008, - WGPUFeatureName_ShaderF16 = 0x00000009, - WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000A, - WGPUFeatureName_DawnShaderFloat16 = 0x000003E9, + 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_DawnInternalUsages = 0x000003EA, WGPUFeatureName_DawnMultiPlanarFormats = 0x000003EB, WGPUFeatureName_DawnNative = 0x000003EC, - WGPUFeatureName_ChromiumExperimentalDp4a = 0x000003ED, - WGPUFeatureName_TimestampQueryInsidePasses = 0x000003EE, + WGPUFeatureName_ChromiumExperimentalTimestampQueryInsidePasses = 0x000003EE, + WGPUFeatureName_ImplicitDeviceSynchronization = 0x000003EF, + WGPUFeatureName_SurfaceCapabilities = 0x000003F0, + WGPUFeatureName_TransientAttachments = 0x000003F1, + WGPUFeatureName_MSAARenderToSingleSampled = 0x000003F2, + WGPUFeatureName_DualSourceBlending = 0x000003F3, + WGPUFeatureName_D3D11MultithreadProtected = 0x000003F4, + WGPUFeatureName_ANGLETextureSharing = 0x000003F5, + WGPUFeatureName_ChromiumExperimentalSubgroups = 0x000003F6, + WGPUFeatureName_ChromiumExperimentalSubgroupUniformControlFlow = 0x000003F7, + WGPUFeatureName_PixelLocalStorageCoherent = 0x000003F9, + WGPUFeatureName_PixelLocalStorageNonCoherent = 0x000003FA, + WGPUFeatureName_Norm16TextureFormats = 0x000003FB, + WGPUFeatureName_MultiPlanarFormatExtendedUsages = 0x000003FC, + WGPUFeatureName_MultiPlanarFormatP010 = 0x000003FD, + WGPUFeatureName_HostMappedPointer = 0x000003FE, + WGPUFeatureName_MultiPlanarRenderTargets = 0x000003FF, + WGPUFeatureName_MultiPlanarFormatNv12a = 0x00000400, + WGPUFeatureName_FramebufferFetch = 0x00000401, + WGPUFeatureName_BufferMapExtendedUsages = 0x00000402, + WGPUFeatureName_AdapterPropertiesMemoryHeaps = 0x00000403, + WGPUFeatureName_AdapterPropertiesD3D = 0x00000404, + WGPUFeatureName_R8UnormStorage = 0x00000405, + WGPUFeatureName_SharedTextureMemoryVkDedicatedAllocation = 0x0000044C, + WGPUFeatureName_SharedTextureMemoryAHardwareBuffer = 0x0000044D, + WGPUFeatureName_SharedTextureMemoryDmaBuf = 0x0000044E, + WGPUFeatureName_SharedTextureMemoryOpaqueFD = 0x0000044F, + WGPUFeatureName_SharedTextureMemoryZirconHandle = 0x00000450, + WGPUFeatureName_SharedTextureMemoryDXGISharedHandle = 0x00000451, + WGPUFeatureName_SharedTextureMemoryD3D11Texture2D = 0x00000452, + WGPUFeatureName_SharedTextureMemoryIOSurface = 0x00000453, + WGPUFeatureName_SharedTextureMemoryEGLImage = 0x00000454, + WGPUFeatureName_SharedFenceVkSemaphoreOpaqueFD = 0x000004B0, + WGPUFeatureName_SharedFenceVkSemaphoreSyncFD = 0x000004B1, + WGPUFeatureName_SharedFenceVkSemaphoreZirconHandle = 0x000004B2, + WGPUFeatureName_SharedFenceDXGISharedHandle = 0x000004B3, + WGPUFeatureName_SharedFenceMTLSharedEvent = 0x000004B4, + WGPUFeatureName_SharedBufferMemoryD3D12Resource = 0x000004B5, WGPUFeatureName_Force32 = 0x7FFFFFFF -} WGPUFeatureName; +} WGPUFeatureName WGPU_ENUM_ATTRIBUTE; typedef enum WGPUFilterMode { - WGPUFilterMode_Nearest = 0x00000000, - WGPUFilterMode_Linear = 0x00000001, + WGPUFilterMode_Undefined = 0x00000000, + WGPUFilterMode_Nearest = 0x00000001, + WGPUFilterMode_Linear = 0x00000002, WGPUFilterMode_Force32 = 0x7FFFFFFF -} WGPUFilterMode; +} WGPUFilterMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUFrontFace { - WGPUFrontFace_CCW = 0x00000000, - WGPUFrontFace_CW = 0x00000001, + WGPUFrontFace_Undefined = 0x00000000, + WGPUFrontFace_CCW = 0x00000001, + WGPUFrontFace_CW = 0x00000002, WGPUFrontFace_Force32 = 0x7FFFFFFF -} WGPUFrontFace; +} WGPUFrontFace WGPU_ENUM_ATTRIBUTE; typedef enum WGPUIndexFormat { WGPUIndexFormat_Undefined = 0x00000000, WGPUIndexFormat_Uint16 = 0x00000001, WGPUIndexFormat_Uint32 = 0x00000002, WGPUIndexFormat_Force32 = 0x7FFFFFFF -} WGPUIndexFormat; +} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE; typedef enum WGPULoadOp { WGPULoadOp_Undefined = 0x00000000, WGPULoadOp_Clear = 0x00000001, WGPULoadOp_Load = 0x00000002, WGPULoadOp_Force32 = 0x7FFFFFFF -} WGPULoadOp; +} WGPULoadOp WGPU_ENUM_ATTRIBUTE; typedef enum WGPULoggingType { - WGPULoggingType_Verbose = 0x00000000, - WGPULoggingType_Info = 0x00000001, - WGPULoggingType_Warning = 0x00000002, - WGPULoggingType_Error = 0x00000003, + WGPULoggingType_Verbose = 0x00000001, + WGPULoggingType_Info = 0x00000002, + WGPULoggingType_Warning = 0x00000003, + WGPULoggingType_Error = 0x00000004, WGPULoggingType_Force32 = 0x7FFFFFFF -} WGPULoggingType; +} WGPULoggingType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUMipmapFilterMode { + WGPUMipmapFilterMode_Undefined = 0x00000000, + WGPUMipmapFilterMode_Nearest = 0x00000001, + WGPUMipmapFilterMode_Linear = 0x00000002, + WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF +} WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE; -typedef enum WGPUPipelineStatisticName { - WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000, - WGPUPipelineStatisticName_ClipperInvocations = 0x00000001, - WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002, - WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003, - WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004, - WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF -} WGPUPipelineStatisticName; +typedef enum WGPUPopErrorScopeStatus { + WGPUPopErrorScopeStatus_Success = 0x00000000, + WGPUPopErrorScopeStatus_InstanceDropped = 0x00000001, + WGPUPopErrorScopeStatus_Force32 = 0x7FFFFFFF +} WGPUPopErrorScopeStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPUPowerPreference { WGPUPowerPreference_Undefined = 0x00000000, WGPUPowerPreference_LowPower = 0x00000001, WGPUPowerPreference_HighPerformance = 0x00000002, WGPUPowerPreference_Force32 = 0x7FFFFFFF -} WGPUPowerPreference; +} WGPUPowerPreference WGPU_ENUM_ATTRIBUTE; typedef enum WGPUPresentMode { - WGPUPresentMode_Immediate = 0x00000000, - WGPUPresentMode_Mailbox = 0x00000001, - WGPUPresentMode_Fifo = 0x00000002, + WGPUPresentMode_Fifo = 0x00000001, + WGPUPresentMode_Immediate = 0x00000003, + WGPUPresentMode_Mailbox = 0x00000004, WGPUPresentMode_Force32 = 0x7FFFFFFF -} WGPUPresentMode; +} WGPUPresentMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUPrimitiveTopology { - WGPUPrimitiveTopology_PointList = 0x00000000, - WGPUPrimitiveTopology_LineList = 0x00000001, - WGPUPrimitiveTopology_LineStrip = 0x00000002, - WGPUPrimitiveTopology_TriangleList = 0x00000003, - WGPUPrimitiveTopology_TriangleStrip = 0x00000004, + WGPUPrimitiveTopology_Undefined = 0x00000000, + WGPUPrimitiveTopology_PointList = 0x00000001, + WGPUPrimitiveTopology_LineList = 0x00000002, + WGPUPrimitiveTopology_LineStrip = 0x00000003, + WGPUPrimitiveTopology_TriangleList = 0x00000004, + WGPUPrimitiveTopology_TriangleStrip = 0x00000005, WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF -} WGPUPrimitiveTopology; +} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE; typedef enum WGPUQueryType { - WGPUQueryType_Occlusion = 0x00000000, - WGPUQueryType_PipelineStatistics = 0x00000001, + WGPUQueryType_Occlusion = 0x00000001, WGPUQueryType_Timestamp = 0x00000002, WGPUQueryType_Force32 = 0x7FFFFFFF -} WGPUQueryType; +} WGPUQueryType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUQueueWorkDoneStatus { WGPUQueueWorkDoneStatus_Success = 0x00000000, - WGPUQueueWorkDoneStatus_Error = 0x00000001, - WGPUQueueWorkDoneStatus_Unknown = 0x00000002, - WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003, + WGPUQueueWorkDoneStatus_InstanceDropped = 0x00000001, + WGPUQueueWorkDoneStatus_Error = 0x00000002, + WGPUQueueWorkDoneStatus_Unknown = 0x00000003, + WGPUQueueWorkDoneStatus_DeviceLost = 0x00000004, WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF -} WGPUQueueWorkDoneStatus; - -typedef enum WGPURenderPassTimestampLocation { - WGPURenderPassTimestampLocation_Beginning = 0x00000000, - WGPURenderPassTimestampLocation_End = 0x00000001, - WGPURenderPassTimestampLocation_Force32 = 0x7FFFFFFF -} WGPURenderPassTimestampLocation; +} WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPURequestAdapterStatus { WGPURequestAdapterStatus_Success = 0x00000000, - WGPURequestAdapterStatus_Unavailable = 0x00000001, - WGPURequestAdapterStatus_Error = 0x00000002, - WGPURequestAdapterStatus_Unknown = 0x00000003, + WGPURequestAdapterStatus_InstanceDropped = 0x00000001, + WGPURequestAdapterStatus_Unavailable = 0x00000002, + WGPURequestAdapterStatus_Error = 0x00000003, + WGPURequestAdapterStatus_Unknown = 0x00000004, WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF -} WGPURequestAdapterStatus; +} WGPURequestAdapterStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPURequestDeviceStatus { WGPURequestDeviceStatus_Success = 0x00000000, - WGPURequestDeviceStatus_Error = 0x00000001, - WGPURequestDeviceStatus_Unknown = 0x00000002, + WGPURequestDeviceStatus_InstanceDropped = 0x00000001, + WGPURequestDeviceStatus_Error = 0x00000002, + WGPURequestDeviceStatus_Unknown = 0x00000003, WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF -} WGPURequestDeviceStatus; +} WGPURequestDeviceStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPUSType { WGPUSType_Invalid = 0x00000000, @@ -381,14 +631,57 @@ typedef enum WGPUSType { WGPUSType_ExternalTextureBindingLayout = 0x0000000D, WGPUSType_SurfaceDescriptorFromWindowsSwapChainPanel = 0x0000000E, WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, + WGPUSType_DepthStencilStateDepthWriteDefinedDawn = 0x00000010, + WGPUSType_TextureBindingViewDimensionDescriptor = 0x00000011, WGPUSType_DawnTextureInternalUsageDescriptor = 0x000003E8, - WGPUSType_DawnTogglesDeviceDescriptor = 0x000003EA, WGPUSType_DawnEncoderInternalUsageDescriptor = 0x000003EB, WGPUSType_DawnInstanceDescriptor = 0x000003EC, WGPUSType_DawnCacheDeviceDescriptor = 0x000003ED, WGPUSType_DawnAdapterPropertiesPowerPreference = 0x000003EE, + WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient = 0x000003EF, + WGPUSType_DawnTogglesDescriptor = 0x000003F0, + WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor = 0x000003F1, + WGPUSType_RequestAdapterOptionsLUID = 0x000003F2, + WGPUSType_RequestAdapterOptionsGetGLProc = 0x000003F3, + WGPUSType_RequestAdapterOptionsD3D11Device = 0x000003F4, + WGPUSType_DawnMultisampleStateRenderToSingleSampled = 0x000003F5, + WGPUSType_DawnRenderPassColorAttachmentRenderToSingleSampled = 0x000003F6, + WGPUSType_RenderPassPixelLocalStorage = 0x000003F7, + WGPUSType_PipelineLayoutPixelLocalStorage = 0x000003F8, + WGPUSType_BufferHostMappedPointer = 0x000003F9, + WGPUSType_DawnExperimentalSubgroupLimits = 0x000003FA, + WGPUSType_AdapterPropertiesMemoryHeaps = 0x000003FB, + WGPUSType_AdapterPropertiesD3D = 0x000003FC, + WGPUSType_DawnComputePipelineFullSubgroups = 0x000003FD, + WGPUSType_DawnWireWGSLControl = 0x000003FE, + WGPUSType_DawnWGSLBlocklist = 0x000003FF, + WGPUSType_SharedTextureMemoryVkImageDescriptor = 0x0000044C, + WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor = 0x0000044D, + WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor = 0x0000044E, + WGPUSType_SharedTextureMemoryDmaBufDescriptor = 0x0000044F, + WGPUSType_SharedTextureMemoryOpaqueFDDescriptor = 0x00000450, + WGPUSType_SharedTextureMemoryZirconHandleDescriptor = 0x00000451, + WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor = 0x00000452, + WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor = 0x00000453, + WGPUSType_SharedTextureMemoryIOSurfaceDescriptor = 0x00000454, + WGPUSType_SharedTextureMemoryEGLImageDescriptor = 0x00000455, + WGPUSType_SharedTextureMemoryInitializedBeginState = 0x000004B0, + WGPUSType_SharedTextureMemoryInitializedEndState = 0x000004B1, + WGPUSType_SharedTextureMemoryVkImageLayoutBeginState = 0x000004B2, + WGPUSType_SharedTextureMemoryVkImageLayoutEndState = 0x000004B3, + WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor = 0x000004B4, + WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo = 0x000004B5, + WGPUSType_SharedFenceVkSemaphoreSyncFDDescriptor = 0x000004B6, + WGPUSType_SharedFenceVkSemaphoreSyncFDExportInfo = 0x000004B7, + WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor = 0x000004B8, + WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo = 0x000004B9, + WGPUSType_SharedFenceDXGISharedHandleDescriptor = 0x000004BA, + WGPUSType_SharedFenceDXGISharedHandleExportInfo = 0x000004BB, + WGPUSType_SharedFenceMTLSharedEventDescriptor = 0x000004BC, + WGPUSType_SharedFenceMTLSharedEventExportInfo = 0x000004BD, + WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor = 0x000004BE, WGPUSType_Force32 = 0x7FFFFFFF -} WGPUSType; +} WGPUSType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUSamplerBindingType { WGPUSamplerBindingType_Undefined = 0x00000000, @@ -396,56 +689,64 @@ typedef enum WGPUSamplerBindingType { WGPUSamplerBindingType_NonFiltering = 0x00000002, WGPUSamplerBindingType_Comparison = 0x00000003, WGPUSamplerBindingType_Force32 = 0x7FFFFFFF -} WGPUSamplerBindingType; +} WGPUSamplerBindingType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUSharedFenceType { + WGPUSharedFenceType_Undefined = 0x00000000, + WGPUSharedFenceType_VkSemaphoreOpaqueFD = 0x00000001, + WGPUSharedFenceType_VkSemaphoreSyncFD = 0x00000002, + WGPUSharedFenceType_VkSemaphoreZirconHandle = 0x00000003, + WGPUSharedFenceType_DXGISharedHandle = 0x00000004, + WGPUSharedFenceType_MTLSharedEvent = 0x00000005, + WGPUSharedFenceType_Force32 = 0x7FFFFFFF +} WGPUSharedFenceType 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_Undefined = 0x00000000, + WGPUStencilOperation_Keep = 0x00000001, + WGPUStencilOperation_Zero = 0x00000002, + WGPUStencilOperation_Replace = 0x00000003, + WGPUStencilOperation_Invert = 0x00000004, + WGPUStencilOperation_IncrementClamp = 0x00000005, + WGPUStencilOperation_DecrementClamp = 0x00000006, + WGPUStencilOperation_IncrementWrap = 0x00000007, + WGPUStencilOperation_DecrementWrap = 0x00000008, WGPUStencilOperation_Force32 = 0x7FFFFFFF -} WGPUStencilOperation; +} WGPUStencilOperation WGPU_ENUM_ATTRIBUTE; typedef enum WGPUStorageTextureAccess { WGPUStorageTextureAccess_Undefined = 0x00000000, WGPUStorageTextureAccess_WriteOnly = 0x00000001, + WGPUStorageTextureAccess_ReadOnly = 0x00000002, + WGPUStorageTextureAccess_ReadWrite = 0x00000003, WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF -} WGPUStorageTextureAccess; +} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE; typedef enum WGPUStoreOp { WGPUStoreOp_Undefined = 0x00000000, WGPUStoreOp_Store = 0x00000001, WGPUStoreOp_Discard = 0x00000002, WGPUStoreOp_Force32 = 0x7FFFFFFF -} WGPUStoreOp; +} WGPUStoreOp WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureAspect { - WGPUTextureAspect_All = 0x00000000, - WGPUTextureAspect_StencilOnly = 0x00000001, - WGPUTextureAspect_DepthOnly = 0x00000002, - WGPUTextureAspect_Plane0Only = 0x00000003, - WGPUTextureAspect_Plane1Only = 0x00000004, + WGPUTextureAspect_Undefined = 0x00000000, + WGPUTextureAspect_All = 0x00000001, + WGPUTextureAspect_StencilOnly = 0x00000002, + WGPUTextureAspect_DepthOnly = 0x00000003, + WGPUTextureAspect_Plane0Only = 0x00000004, + WGPUTextureAspect_Plane1Only = 0x00000005, + WGPUTextureAspect_Plane2Only = 0x00000006, WGPUTextureAspect_Force32 = 0x7FFFFFFF -} WGPUTextureAspect; - -typedef enum WGPUTextureComponentType { - WGPUTextureComponentType_Float = 0x00000000, - WGPUTextureComponentType_Sint = 0x00000001, - WGPUTextureComponentType_Uint = 0x00000002, - WGPUTextureComponentType_DepthComparison = 0x00000003, - WGPUTextureComponentType_Force32 = 0x7FFFFFFF -} WGPUTextureComponentType; +} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureDimension { - WGPUTextureDimension_1D = 0x00000000, - WGPUTextureDimension_2D = 0x00000001, - WGPUTextureDimension_3D = 0x00000002, + WGPUTextureDimension_Undefined = 0x00000000, + WGPUTextureDimension_1D = 0x00000001, + WGPUTextureDimension_2D = 0x00000002, + WGPUTextureDimension_3D = 0x00000003, WGPUTextureDimension_Force32 = 0x7FFFFFFF -} WGPUTextureDimension; +} WGPUTextureDimension WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureFormat { WGPUTextureFormat_Undefined = 0x00000000, @@ -473,79 +774,88 @@ typedef enum WGPUTextureFormat { WGPUTextureFormat_RGBA8Sint = 0x00000016, WGPUTextureFormat_BGRA8Unorm = 0x00000017, WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018, - WGPUTextureFormat_RGB10A2Unorm = 0x00000019, - WGPUTextureFormat_RG11B10Ufloat = 0x0000001A, - WGPUTextureFormat_RGB9E5Ufloat = 0x0000001B, - WGPUTextureFormat_RG32Float = 0x0000001C, - WGPUTextureFormat_RG32Uint = 0x0000001D, - WGPUTextureFormat_RG32Sint = 0x0000001E, - WGPUTextureFormat_RGBA16Uint = 0x0000001F, - WGPUTextureFormat_RGBA16Sint = 0x00000020, - WGPUTextureFormat_RGBA16Float = 0x00000021, - WGPUTextureFormat_RGBA32Float = 0x00000022, - WGPUTextureFormat_RGBA32Uint = 0x00000023, - WGPUTextureFormat_RGBA32Sint = 0x00000024, - WGPUTextureFormat_Stencil8 = 0x00000025, - WGPUTextureFormat_Depth16Unorm = 0x00000026, - WGPUTextureFormat_Depth24Plus = 0x00000027, - WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028, - WGPUTextureFormat_Depth32Float = 0x00000029, - WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002A, - WGPUTextureFormat_BC1RGBAUnorm = 0x0000002B, - WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002C, - WGPUTextureFormat_BC2RGBAUnorm = 0x0000002D, - WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002E, - WGPUTextureFormat_BC3RGBAUnorm = 0x0000002F, - WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000030, - WGPUTextureFormat_BC4RUnorm = 0x00000031, - WGPUTextureFormat_BC4RSnorm = 0x00000032, - WGPUTextureFormat_BC5RGUnorm = 0x00000033, - WGPUTextureFormat_BC5RGSnorm = 0x00000034, - WGPUTextureFormat_BC6HRGBUfloat = 0x00000035, - WGPUTextureFormat_BC6HRGBFloat = 0x00000036, - WGPUTextureFormat_BC7RGBAUnorm = 0x00000037, - WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000038, - WGPUTextureFormat_ETC2RGB8Unorm = 0x00000039, - WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003A, - WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003B, - WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003C, - WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003D, - WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003E, - WGPUTextureFormat_EACR11Unorm = 0x0000003F, - WGPUTextureFormat_EACR11Snorm = 0x00000040, - WGPUTextureFormat_EACRG11Unorm = 0x00000041, - WGPUTextureFormat_EACRG11Snorm = 0x00000042, - WGPUTextureFormat_ASTC4x4Unorm = 0x00000043, - WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000044, - WGPUTextureFormat_ASTC5x4Unorm = 0x00000045, - WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000046, - WGPUTextureFormat_ASTC5x5Unorm = 0x00000047, - WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000048, - WGPUTextureFormat_ASTC6x5Unorm = 0x00000049, - WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004A, - WGPUTextureFormat_ASTC6x6Unorm = 0x0000004B, - WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004C, - WGPUTextureFormat_ASTC8x5Unorm = 0x0000004D, - WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004E, - WGPUTextureFormat_ASTC8x6Unorm = 0x0000004F, - WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000050, - WGPUTextureFormat_ASTC8x8Unorm = 0x00000051, - WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000052, - WGPUTextureFormat_ASTC10x5Unorm = 0x00000053, - WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000054, - WGPUTextureFormat_ASTC10x6Unorm = 0x00000055, - WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000056, - WGPUTextureFormat_ASTC10x8Unorm = 0x00000057, - WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000058, - WGPUTextureFormat_ASTC10x10Unorm = 0x00000059, - WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005A, - WGPUTextureFormat_ASTC12x10Unorm = 0x0000005B, - WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005C, - WGPUTextureFormat_ASTC12x12Unorm = 0x0000005D, - WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005E, - WGPUTextureFormat_R8BG8Biplanar420Unorm = 0x0000005F, + WGPUTextureFormat_RGB10A2Uint = 0x00000019, + WGPUTextureFormat_RGB10A2Unorm = 0x0000001A, + WGPUTextureFormat_RG11B10Ufloat = 0x0000001B, + WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C, + WGPUTextureFormat_RG32Float = 0x0000001D, + WGPUTextureFormat_RG32Uint = 0x0000001E, + WGPUTextureFormat_RG32Sint = 0x0000001F, + WGPUTextureFormat_RGBA16Uint = 0x00000020, + WGPUTextureFormat_RGBA16Sint = 0x00000021, + WGPUTextureFormat_RGBA16Float = 0x00000022, + WGPUTextureFormat_RGBA32Float = 0x00000023, + WGPUTextureFormat_RGBA32Uint = 0x00000024, + WGPUTextureFormat_RGBA32Sint = 0x00000025, + WGPUTextureFormat_Stencil8 = 0x00000026, + WGPUTextureFormat_Depth16Unorm = 0x00000027, + WGPUTextureFormat_Depth24Plus = 0x00000028, + WGPUTextureFormat_Depth24PlusStencil8 = 0x00000029, + WGPUTextureFormat_Depth32Float = 0x0000002A, + WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B, + WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C, + WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D, + WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E, + WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F, + WGPUTextureFormat_BC3RGBAUnorm = 0x00000030, + WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031, + WGPUTextureFormat_BC4RUnorm = 0x00000032, + WGPUTextureFormat_BC4RSnorm = 0x00000033, + WGPUTextureFormat_BC5RGUnorm = 0x00000034, + WGPUTextureFormat_BC5RGSnorm = 0x00000035, + WGPUTextureFormat_BC6HRGBUfloat = 0x00000036, + WGPUTextureFormat_BC6HRGBFloat = 0x00000037, + WGPUTextureFormat_BC7RGBAUnorm = 0x00000038, + WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039, + WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A, + WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B, + WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C, + WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D, + WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E, + WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F, + WGPUTextureFormat_EACR11Unorm = 0x00000040, + WGPUTextureFormat_EACR11Snorm = 0x00000041, + WGPUTextureFormat_EACRG11Unorm = 0x00000042, + WGPUTextureFormat_EACRG11Snorm = 0x00000043, + WGPUTextureFormat_ASTC4x4Unorm = 0x00000044, + WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045, + WGPUTextureFormat_ASTC5x4Unorm = 0x00000046, + WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047, + WGPUTextureFormat_ASTC5x5Unorm = 0x00000048, + WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049, + WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A, + WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B, + WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C, + WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D, + WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E, + WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F, + WGPUTextureFormat_ASTC8x6Unorm = 0x00000050, + WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051, + WGPUTextureFormat_ASTC8x8Unorm = 0x00000052, + WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053, + WGPUTextureFormat_ASTC10x5Unorm = 0x00000054, + WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055, + WGPUTextureFormat_ASTC10x6Unorm = 0x00000056, + WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057, + WGPUTextureFormat_ASTC10x8Unorm = 0x00000058, + WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059, + WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A, + WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B, + WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C, + WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D, + WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E, + WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F, + WGPUTextureFormat_R16Unorm = 0x00000060, + WGPUTextureFormat_RG16Unorm = 0x00000061, + WGPUTextureFormat_RGBA16Unorm = 0x00000062, + WGPUTextureFormat_R16Snorm = 0x00000063, + WGPUTextureFormat_RG16Snorm = 0x00000064, + WGPUTextureFormat_RGBA16Snorm = 0x00000065, + WGPUTextureFormat_R8BG8Biplanar420Unorm = 0x00000066, + WGPUTextureFormat_R10X6BG10X6Biplanar420Unorm = 0x00000067, + WGPUTextureFormat_R8BG8A8Triplanar420Unorm = 0x00000068, WGPUTextureFormat_Force32 = 0x7FFFFFFF -} WGPUTextureFormat; +} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureSampleType { WGPUTextureSampleType_Undefined = 0x00000000, @@ -555,7 +865,7 @@ typedef enum WGPUTextureSampleType { WGPUTextureSampleType_Sint = 0x00000004, WGPUTextureSampleType_Uint = 0x00000005, WGPUTextureSampleType_Force32 = 0x7FFFFFFF -} WGPUTextureSampleType; +} WGPUTextureSampleType WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureViewDimension { WGPUTextureViewDimension_Undefined = 0x00000000, @@ -566,7 +876,7 @@ typedef enum WGPUTextureViewDimension { WGPUTextureViewDimension_CubeArray = 0x00000005, WGPUTextureViewDimension_3D = 0x00000006, WGPUTextureViewDimension_Force32 = 0x7FFFFFFF -} WGPUTextureViewDimension; +} WGPUTextureViewDimension WGPU_ENUM_ATTRIBUTE; typedef enum WGPUVertexFormat { WGPUVertexFormat_Undefined = 0x00000000, @@ -600,15 +910,27 @@ typedef enum WGPUVertexFormat { WGPUVertexFormat_Sint32x2 = 0x0000001C, WGPUVertexFormat_Sint32x3 = 0x0000001D, WGPUVertexFormat_Sint32x4 = 0x0000001E, + WGPUVertexFormat_Unorm10_10_10_2 = 0x0000001F, WGPUVertexFormat_Force32 = 0x7FFFFFFF -} WGPUVertexFormat; +} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE; typedef enum WGPUVertexStepMode { - WGPUVertexStepMode_Vertex = 0x00000000, - WGPUVertexStepMode_Instance = 0x00000001, - WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002, + WGPUVertexStepMode_Undefined = 0x00000000, + WGPUVertexStepMode_VertexBufferNotUsed = 0x00000001, + WGPUVertexStepMode_Vertex = 0x00000002, + WGPUVertexStepMode_Instance = 0x00000003, WGPUVertexStepMode_Force32 = 0x7FFFFFFF -} WGPUVertexStepMode; +} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUWaitStatus { + WGPUWaitStatus_Success = 0x00000000, + WGPUWaitStatus_TimedOut = 0x00000001, + WGPUWaitStatus_UnsupportedTimeout = 0x00000002, + WGPUWaitStatus_UnsupportedCount = 0x00000003, + WGPUWaitStatus_UnsupportedMixedSources = 0x00000004, + WGPUWaitStatus_Unknown = 0x00000005, + WGPUWaitStatus_Force32 = 0x7FFFFFFF +} WGPUWaitStatus WGPU_ENUM_ATTRIBUTE; typedef enum WGPUBufferUsage { WGPUBufferUsage_None = 0x00000000, @@ -623,8 +945,8 @@ typedef enum WGPUBufferUsage { WGPUBufferUsage_Indirect = 0x00000100, WGPUBufferUsage_QueryResolve = 0x00000200, WGPUBufferUsage_Force32 = 0x7FFFFFFF -} WGPUBufferUsage; -typedef WGPUFlags WGPUBufferUsageFlags; +} WGPUBufferUsage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUBufferUsageFlags WGPU_ENUM_ATTRIBUTE; typedef enum WGPUColorWriteMask { WGPUColorWriteMask_None = 0x00000000, @@ -634,16 +956,27 @@ typedef enum WGPUColorWriteMask { WGPUColorWriteMask_Alpha = 0x00000008, WGPUColorWriteMask_All = 0x0000000F, WGPUColorWriteMask_Force32 = 0x7FFFFFFF -} WGPUColorWriteMask; -typedef WGPUFlags WGPUColorWriteMaskFlags; +} WGPUColorWriteMask WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUColorWriteMaskFlags WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUHeapProperty { + WGPUHeapProperty_Undefined = 0x00000000, + WGPUHeapProperty_DeviceLocal = 0x00000001, + WGPUHeapProperty_HostVisible = 0x00000002, + WGPUHeapProperty_HostCoherent = 0x00000004, + WGPUHeapProperty_HostUncached = 0x00000008, + WGPUHeapProperty_HostCached = 0x00000010, + WGPUHeapProperty_Force32 = 0x7FFFFFFF +} WGPUHeapProperty WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUHeapPropertyFlags WGPU_ENUM_ATTRIBUTE; typedef enum WGPUMapMode { WGPUMapMode_None = 0x00000000, WGPUMapMode_Read = 0x00000001, WGPUMapMode_Write = 0x00000002, WGPUMapMode_Force32 = 0x7FFFFFFF -} WGPUMapMode; -typedef WGPUFlags WGPUMapModeFlags; +} WGPUMapMode WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUMapModeFlags WGPU_ENUM_ATTRIBUTE; typedef enum WGPUShaderStage { WGPUShaderStage_None = 0x00000000, @@ -651,8 +984,8 @@ typedef enum WGPUShaderStage { WGPUShaderStage_Fragment = 0x00000002, WGPUShaderStage_Compute = 0x00000004, WGPUShaderStage_Force32 = 0x7FFFFFFF -} WGPUShaderStage; -typedef WGPUFlags WGPUShaderStageFlags; +} WGPUShaderStage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUShaderStageFlags WGPU_ENUM_ATTRIBUTE; typedef enum WGPUTextureUsage { WGPUTextureUsage_None = 0x00000000, @@ -661,20 +994,37 @@ typedef enum WGPUTextureUsage { WGPUTextureUsage_TextureBinding = 0x00000004, WGPUTextureUsage_StorageBinding = 0x00000008, WGPUTextureUsage_RenderAttachment = 0x00000010, - WGPUTextureUsage_Present = 0x00000020, + WGPUTextureUsage_TransientAttachment = 0x00000020, + WGPUTextureUsage_StorageAttachment = 0x00000040, WGPUTextureUsage_Force32 = 0x7FFFFFFF -} WGPUTextureUsage; -typedef WGPUFlags WGPUTextureUsageFlags; +} WGPUTextureUsage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUTextureUsageFlags WGPU_ENUM_ATTRIBUTE; + +typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCallback)(void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUDawnLoadCacheDataFunction)(void const * key, size_t keySize, void * value, size_t valueSize, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDawnStoreCacheDataFunction)(void const * key, size_t keySize, void const * value, size_t valueSize, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPULoggingCallback)(WGPULoggingType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUPopErrorScopeCallback)(WGPUPopErrorScopeStatus status, WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef struct WGPUChainedStruct { struct WGPUChainedStruct const * next; WGPUSType sType; -} WGPUChainedStruct; +} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUChainedStructOut { struct WGPUChainedStructOut * next; WGPUSType sType; -} WGPUChainedStructOut; +} WGPUChainedStructOut WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUAdapterProperties { WGPUChainedStructOut * nextInChain; @@ -686,155 +1036,263 @@ typedef struct WGPUAdapterProperties { char const * driverDescription; WGPUAdapterType adapterType; WGPUBackendType backendType; -} WGPUAdapterProperties; + WGPUBool compatibilityMode; +} WGPUAdapterProperties WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUAdapterProperties +typedef struct WGPUAdapterPropertiesD3D { + WGPUChainedStructOut chain; + uint32_t shaderModel; +} WGPUAdapterPropertiesD3D WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBindGroupEntry { WGPUChainedStruct const * nextInChain; uint32_t binding; - WGPUBuffer buffer; // nullable + WGPU_NULLABLE WGPUBuffer buffer; uint64_t offset; uint64_t size; - WGPUSampler sampler; // nullable - WGPUTextureView textureView; // nullable -} WGPUBindGroupEntry; + WGPU_NULLABLE WGPUSampler sampler; + WGPU_NULLABLE WGPUTextureView textureView; +} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBlendComponent { WGPUBlendOperation operation; WGPUBlendFactor srcFactor; WGPUBlendFactor dstFactor; -} WGPUBlendComponent; +} WGPUBlendComponent WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBufferBindingLayout { WGPUChainedStruct const * nextInChain; WGPUBufferBindingType type; - bool hasDynamicOffset; + WGPUBool hasDynamicOffset; uint64_t minBindingSize; -} WGPUBufferBindingLayout; +} WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBufferDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUBufferUsageFlags usage; uint64_t size; - bool mappedAtCreation; -} WGPUBufferDescriptor; + WGPUBool mappedAtCreation; +} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUBufferDescriptor +typedef struct WGPUBufferHostMappedPointer { + WGPUChainedStruct chain; + void * pointer; + WGPUCallback disposeCallback; + void * userdata; +} WGPUBufferHostMappedPointer WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBufferMapCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUBufferMapCallback callback; + void * userdata; +} WGPUBufferMapCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUColor { double r; double g; double b; double a; -} WGPUColor; +} WGPUColor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCommandBufferDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPUCommandBufferDescriptor; + WGPU_NULLABLE char const * label; +} WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCommandEncoderDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPUCommandEncoderDescriptor; + WGPU_NULLABLE char const * label; +} WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCompilationInfoCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCompilationInfoCallback callback; + void * userdata; +} WGPUCompilationInfoCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCompilationMessage { WGPUChainedStruct const * nextInChain; - char const * message; // nullable + WGPU_NULLABLE char const * message; WGPUCompilationMessageType type; uint64_t lineNum; uint64_t linePos; uint64_t offset; uint64_t length; -} WGPUCompilationMessage; + uint64_t utf16LinePos; + uint64_t utf16Offset; + uint64_t utf16Length; +} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUComputePassTimestampWrite { +typedef struct WGPUComputePassTimestampWrites { WGPUQuerySet querySet; - uint32_t queryIndex; - WGPUComputePassTimestampLocation location; -} WGPUComputePassTimestampWrite; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPUComputePassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUConstantEntry { WGPUChainedStruct const * nextInChain; char const * key; double value; -} WGPUConstantEntry; +} WGPUConstantEntry WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCopyTextureForBrowserOptions { WGPUChainedStruct const * nextInChain; - bool flipY; - bool needsColorSpaceConversion; + WGPUBool flipY; + WGPUBool needsColorSpaceConversion; WGPUAlphaMode srcAlphaMode; - float const * srcTransferFunctionParameters; // nullable - float const * conversionMatrix; // nullable - float const * dstTransferFunctionParameters; // nullable + WGPU_NULLABLE float const * srcTransferFunctionParameters; + WGPU_NULLABLE float const * conversionMatrix; + WGPU_NULLABLE float const * dstTransferFunctionParameters; WGPUAlphaMode dstAlphaMode; - bool internalUsage; -} WGPUCopyTextureForBrowserOptions; + WGPUBool internalUsage; +} WGPUCopyTextureForBrowserOptions WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCreateComputePipelineAsyncCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCreateComputePipelineAsyncCallback callback; + void * userdata; +} WGPUCreateComputePipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCreateRenderPipelineAsyncCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCreateRenderPipelineAsyncCallback callback; + void * userdata; +} WGPUCreateRenderPipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUInstanceDescriptor +typedef struct WGPUDawnWGSLBlocklist { + WGPUChainedStruct chain; + size_t blocklistedFeatureCount; + const char* const * blocklistedFeatures; +} WGPUDawnWGSLBlocklist WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUAdapterProperties typedef struct WGPUDawnAdapterPropertiesPowerPreference { WGPUChainedStructOut chain; WGPUPowerPreference powerPreference; -} WGPUDawnAdapterPropertiesPowerPreference; +} WGPUDawnAdapterPropertiesPowerPreference WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUBufferDescriptor +typedef struct WGPUDawnBufferDescriptorErrorInfoFromWireClient { + WGPUChainedStruct chain; + WGPUBool outOfMemory; +} WGPUDawnBufferDescriptorErrorInfoFromWireClient WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUDeviceDescriptor typedef struct WGPUDawnCacheDeviceDescriptor { WGPUChainedStruct chain; char const * isolationKey; -} WGPUDawnCacheDeviceDescriptor; + WGPUDawnLoadCacheDataFunction loadDataFunction; + WGPUDawnStoreCacheDataFunction storeDataFunction; + void * functionUserdata; +} WGPUDawnCacheDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUComputePipelineDescriptor +typedef struct WGPUDawnComputePipelineFullSubgroups { + WGPUChainedStruct chain; + WGPUBool requiresFullSubgroups; +} WGPUDawnComputePipelineFullSubgroups WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUCommandEncoderDescriptor typedef struct WGPUDawnEncoderInternalUsageDescriptor { WGPUChainedStruct chain; - bool useInternalUsages; -} WGPUDawnEncoderInternalUsageDescriptor; + WGPUBool useInternalUsages; +} WGPUDawnEncoderInternalUsageDescriptor WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUInstanceDescriptor -typedef struct WGPUDawnInstanceDescriptor { +// Can be chained in WGPUSupportedLimits +typedef struct WGPUDawnExperimentalSubgroupLimits { + WGPUChainedStructOut chain; + uint32_t minSubgroupSize; + uint32_t maxSubgroupSize; +} WGPUDawnExperimentalSubgroupLimits WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUMultisampleState +typedef struct WGPUDawnMultisampleStateRenderToSingleSampled { + WGPUChainedStruct chain; + WGPUBool enabled; +} WGPUDawnMultisampleStateRenderToSingleSampled WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPURenderPassColorAttachment +typedef struct WGPUDawnRenderPassColorAttachmentRenderToSingleSampled { WGPUChainedStruct chain; - uint32_t additionalRuntimeSearchPathsCount; - const char* const * additionalRuntimeSearchPaths; -} WGPUDawnInstanceDescriptor; + uint32_t implicitSampleCount; +} WGPUDawnRenderPassColorAttachmentRenderToSingleSampled WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUShaderModuleDescriptor +typedef struct WGPUDawnShaderModuleSPIRVOptionsDescriptor { + WGPUChainedStruct chain; + WGPUBool allowNonUniformDerivatives; +} WGPUDawnShaderModuleSPIRVOptionsDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUTextureDescriptor typedef struct WGPUDawnTextureInternalUsageDescriptor { WGPUChainedStruct chain; WGPUTextureUsageFlags internalUsage; -} WGPUDawnTextureInternalUsageDescriptor; +} WGPUDawnTextureInternalUsageDescriptor WGPU_STRUCTURE_ATTRIBUTE; +// Can be chained in WGPUInstanceDescriptor +// Can be chained in WGPURequestAdapterOptions // Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnTogglesDeviceDescriptor { +typedef struct WGPUDawnTogglesDescriptor { + WGPUChainedStruct chain; + size_t enabledToggleCount; + const char* const * enabledToggles; + size_t disabledToggleCount; + const char* const * disabledToggles; +} WGPUDawnTogglesDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUInstanceDescriptor +typedef struct WGPUDawnWireWGSLControl { + WGPUChainedStruct chain; + WGPUBool enableExperimental; + WGPUBool enableUnsafe; + WGPUBool enableTesting; +} WGPUDawnWireWGSLControl WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUDepthStencilState +typedef struct WGPUDepthStencilStateDepthWriteDefinedDawn { WGPUChainedStruct chain; - uint32_t forceEnabledTogglesCount; - const char* const * forceEnabledToggles; - uint32_t forceDisabledTogglesCount; - const char* const * forceDisabledToggles; -} WGPUDawnTogglesDeviceDescriptor; + WGPUBool depthWriteDefined; +} WGPUDepthStencilStateDepthWriteDefinedDawn WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUExtent2D { uint32_t width; uint32_t height; -} WGPUExtent2D; +} WGPUExtent2D WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUExtent3D { uint32_t width; uint32_t height; uint32_t depthOrArrayLayers; -} WGPUExtent3D; +} WGPUExtent3D WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUBindGroupEntry typedef struct WGPUExternalTextureBindingEntry { WGPUChainedStruct chain; WGPUExternalTexture externalTexture; -} WGPUExternalTextureBindingEntry; +} WGPUExternalTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUBindGroupLayoutEntry typedef struct WGPUExternalTextureBindingLayout { WGPUChainedStruct chain; -} WGPUExternalTextureBindingLayout; +} WGPUExternalTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUInstanceDescriptor { +typedef struct WGPUFuture { + uint64_t id; +} WGPUFuture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUInstanceFeatures { WGPUChainedStruct const * nextInChain; -} WGPUInstanceDescriptor; + WGPUBool timedWaitAnyEnable; + size_t timedWaitAnyMaxCount; +} WGPUInstanceFeatures WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPULimits { uint32_t maxTextureDimension1D; @@ -842,6 +1300,7 @@ typedef struct WGPULimits { uint32_t maxTextureDimension3D; uint32_t maxTextureArrayLayers; uint32_t maxBindGroups; + uint32_t maxBindGroupsPlusVertexBuffers; uint32_t maxBindingsPerBindGroup; uint32_t maxDynamicUniformBuffersPerPipelineLayout; uint32_t maxDynamicStorageBuffersPerPipelineLayout; @@ -861,44 +1320,64 @@ typedef struct WGPULimits { 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; +} WGPULimits WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUMemoryHeapInfo { + WGPUHeapPropertyFlags properties; + uint64_t size; +} WGPUMemoryHeapInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUMultisampleState { WGPUChainedStruct const * nextInChain; uint32_t count; uint32_t mask; - bool alphaToCoverageEnabled; -} WGPUMultisampleState; + WGPUBool alphaToCoverageEnabled; +} WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUOrigin2D { uint32_t x; uint32_t y; -} WGPUOrigin2D; +} WGPUOrigin2D WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUOrigin3D { uint32_t x; uint32_t y; uint32_t z; -} WGPUOrigin3D; +} WGPUOrigin3D WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUPipelineLayoutDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t bindGroupLayoutCount; + WGPU_NULLABLE char const * label; + size_t bindGroupLayoutCount; WGPUBindGroupLayout const * bindGroupLayouts; -} WGPUPipelineLayoutDescriptor; +} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPipelineLayoutStorageAttachment { + WGPUChainedStruct const * nextInChain; + uint64_t offset; + WGPUTextureFormat format; +} WGPUPipelineLayoutStorageAttachment WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPopErrorScopeCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUPopErrorScopeCallback callback; + WGPUErrorCallback oldCallback; + void * userdata; +} WGPUPopErrorScopeCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUPrimitiveState typedef struct WGPUPrimitiveDepthClipControl { WGPUChainedStruct chain; - bool unclippedDepth; -} WGPUPrimitiveDepthClipControl; + WGPUBool unclippedDepth; +} WGPUPrimitiveDepthClipControl WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUPrimitiveState { WGPUChainedStruct const * nextInChain; @@ -906,207 +1385,418 @@ typedef struct WGPUPrimitiveState { WGPUIndexFormat stripIndexFormat; WGPUFrontFace frontFace; WGPUCullMode cullMode; -} WGPUPrimitiveState; +} WGPUPrimitiveState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUQuerySetDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUQueryType type; uint32_t count; - WGPUPipelineStatisticName const * pipelineStatistics; - uint32_t pipelineStatisticsCount; -} WGPUQuerySetDescriptor; +} WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUQueueDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPUQueueDescriptor; + WGPU_NULLABLE char const * label; +} WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUQueueWorkDoneCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUQueueWorkDoneCallback callback; + void * userdata; +} WGPUQueueWorkDoneCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderBundleDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPURenderBundleDescriptor; + WGPU_NULLABLE char const * label; +} WGPURenderBundleDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderBundleEncoderDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t colorFormatsCount; + WGPU_NULLABLE char const * label; + size_t colorFormatCount; WGPUTextureFormat const * colorFormats; WGPUTextureFormat depthStencilFormat; uint32_t sampleCount; - bool depthReadOnly; - bool stencilReadOnly; -} WGPURenderBundleEncoderDescriptor; + WGPUBool depthReadOnly; + WGPUBool stencilReadOnly; +} WGPURenderBundleEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPassDepthStencilAttachment { WGPUTextureView view; WGPULoadOp depthLoadOp; WGPUStoreOp depthStoreOp; - float clearDepth; float depthClearValue; - bool depthReadOnly; + WGPUBool depthReadOnly; WGPULoadOp stencilLoadOp; WGPUStoreOp stencilStoreOp; - uint32_t clearStencil; uint32_t stencilClearValue; - bool stencilReadOnly; -} WGPURenderPassDepthStencilAttachment; + WGPUBool stencilReadOnly; +} WGPURenderPassDepthStencilAttachment WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPURenderPassDescriptor typedef struct WGPURenderPassDescriptorMaxDrawCount { WGPUChainedStruct chain; uint64_t maxDrawCount; -} WGPURenderPassDescriptorMaxDrawCount; +} WGPURenderPassDescriptorMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPURenderPassTimestampWrite { +typedef struct WGPURenderPassTimestampWrites { WGPUQuerySet querySet; - uint32_t queryIndex; - WGPURenderPassTimestampLocation location; -} WGPURenderPassTimestampWrite; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPURenderPassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequestAdapterCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPURequestAdapterCallback callback; + void * userdata; +} WGPURequestAdapterCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURequestAdapterOptions { WGPUChainedStruct const * nextInChain; - WGPUSurface compatibleSurface; // nullable + WGPU_NULLABLE WGPUSurface compatibleSurface; WGPUPowerPreference powerPreference; - bool forceFallbackAdapter; -} WGPURequestAdapterOptions; + WGPUBackendType backendType; + WGPUBool forceFallbackAdapter; + WGPUBool compatibilityMode; +} WGPURequestAdapterOptions WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequestDeviceCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPURequestDeviceCallback callback; + void * userdata; +} WGPURequestDeviceCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSamplerBindingLayout { WGPUChainedStruct const * nextInChain; WGPUSamplerBindingType type; -} WGPUSamplerBindingLayout; +} WGPUSamplerBindingLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSamplerDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUAddressMode addressModeU; WGPUAddressMode addressModeV; WGPUAddressMode addressModeW; WGPUFilterMode magFilter; WGPUFilterMode minFilter; - WGPUFilterMode mipmapFilter; + WGPUMipmapFilterMode mipmapFilter; float lodMinClamp; float lodMaxClamp; WGPUCompareFunction compare; uint16_t maxAnisotropy; -} WGPUSamplerDescriptor; - -typedef struct WGPUShaderModuleDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPUShaderModuleDescriptor; +} WGPUSamplerDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUShaderModuleDescriptor typedef struct WGPUShaderModuleSPIRVDescriptor { WGPUChainedStruct chain; uint32_t codeSize; uint32_t const * code; -} WGPUShaderModuleSPIRVDescriptor; +} WGPUShaderModuleSPIRVDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUShaderModuleDescriptor typedef struct WGPUShaderModuleWGSLDescriptor { WGPUChainedStruct chain; - char const * source; -} WGPUShaderModuleWGSLDescriptor; + char const * code; +} WGPUShaderModuleWGSLDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderModuleDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedBufferMemoryBeginAccessDescriptor { + WGPUChainedStruct const * nextInChain; + WGPUBool initialized; + size_t fenceCount; + WGPUSharedFence const * fences; + uint64_t const * signaledValues; +} WGPUSharedBufferMemoryBeginAccessDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedBufferMemoryDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUSharedBufferMemoryDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedBufferMemoryEndAccessState { + WGPUChainedStructOut * nextInChain; + WGPUBool initialized; + size_t fenceCount; + WGPUSharedFence const * fences; + uint64_t const * signaledValues; +} WGPUSharedBufferMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedBufferMemoryProperties { + WGPUChainedStructOut * nextInChain; + WGPUBufferUsageFlags usage; + uint64_t size; +} WGPUSharedBufferMemoryProperties WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceDescriptor +typedef struct WGPUSharedFenceDXGISharedHandleDescriptor { + WGPUChainedStruct chain; + void * handle; +} WGPUSharedFenceDXGISharedHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceExportInfo +typedef struct WGPUSharedFenceDXGISharedHandleExportInfo { + WGPUChainedStructOut chain; + void * handle; +} WGPUSharedFenceDXGISharedHandleExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceDescriptor +typedef struct WGPUSharedFenceMTLSharedEventDescriptor { + WGPUChainedStruct chain; + void * sharedEvent; +} WGPUSharedFenceMTLSharedEventDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceExportInfo +typedef struct WGPUSharedFenceMTLSharedEventExportInfo { + WGPUChainedStructOut chain; + void * sharedEvent; +} WGPUSharedFenceMTLSharedEventExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedFenceDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUSharedFenceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedFenceExportInfo { + WGPUChainedStructOut * nextInChain; + WGPUSharedFenceType type; +} WGPUSharedFenceExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceDescriptor +typedef struct WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor { + WGPUChainedStruct chain; + int handle; +} WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceExportInfo +typedef struct WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo { + WGPUChainedStructOut chain; + int handle; +} WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceDescriptor +typedef struct WGPUSharedFenceVkSemaphoreSyncFDDescriptor { + WGPUChainedStruct chain; + int handle; +} WGPUSharedFenceVkSemaphoreSyncFDDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceExportInfo +typedef struct WGPUSharedFenceVkSemaphoreSyncFDExportInfo { + WGPUChainedStructOut chain; + int handle; +} WGPUSharedFenceVkSemaphoreSyncFDExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceDescriptor +typedef struct WGPUSharedFenceVkSemaphoreZirconHandleDescriptor { + WGPUChainedStruct chain; + uint32_t handle; +} WGPUSharedFenceVkSemaphoreZirconHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedFenceExportInfo +typedef struct WGPUSharedFenceVkSemaphoreZirconHandleExportInfo { + WGPUChainedStructOut chain; + uint32_t handle; +} WGPUSharedFenceVkSemaphoreZirconHandleExportInfo WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryDXGISharedHandleDescriptor { + WGPUChainedStruct chain; + void * handle; + WGPUBool useKeyedMutex; +} WGPUSharedTextureMemoryDXGISharedHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryEGLImageDescriptor { + WGPUChainedStruct chain; + void * image; +} WGPUSharedTextureMemoryEGLImageDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryIOSurfaceDescriptor { + WGPUChainedStruct chain; + void * ioSurface; +} WGPUSharedTextureMemoryIOSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryAHardwareBufferDescriptor { + WGPUChainedStruct chain; + void * handle; +} WGPUSharedTextureMemoryAHardwareBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedTextureMemoryBeginAccessDescriptor { + WGPUChainedStruct const * nextInChain; + WGPUBool concurrentRead; + WGPUBool initialized; + size_t fenceCount; + WGPUSharedFence const * fences; + uint64_t const * signaledValues; +} WGPUSharedTextureMemoryBeginAccessDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedTextureMemoryDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUSharedTextureMemoryDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedTextureMemoryDmaBufPlane { + int fd; + uint64_t offset; + uint32_t stride; +} WGPUSharedTextureMemoryDmaBufPlane WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedTextureMemoryEndAccessState { + WGPUChainedStructOut * nextInChain; + WGPUBool initialized; + size_t fenceCount; + WGPUSharedFence const * fences; + uint64_t const * signaledValues; +} WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryOpaqueFDDescriptor { + WGPUChainedStruct chain; + void const * vkImageCreateInfo; + int memoryFD; + uint32_t memoryTypeIndex; + uint64_t allocationSize; + WGPUBool dedicatedAllocation; +} WGPUSharedTextureMemoryOpaqueFDDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor { + WGPUChainedStruct chain; + WGPUBool dedicatedAllocation; +} WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryBeginAccessDescriptor +typedef struct WGPUSharedTextureMemoryVkImageLayoutBeginState { + WGPUChainedStruct chain; + int32_t oldLayout; + int32_t newLayout; +} WGPUSharedTextureMemoryVkImageLayoutBeginState WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryEndAccessState +typedef struct WGPUSharedTextureMemoryVkImageLayoutEndState { + WGPUChainedStructOut chain; + int32_t oldLayout; + int32_t newLayout; +} WGPUSharedTextureMemoryVkImageLayoutEndState WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryZirconHandleDescriptor { + WGPUChainedStruct chain; + uint32_t memoryFD; + uint64_t allocationSize; +} WGPUSharedTextureMemoryZirconHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUStencilFaceState { WGPUCompareFunction compare; WGPUStencilOperation failOp; WGPUStencilOperation depthFailOp; WGPUStencilOperation passOp; -} WGPUStencilFaceState; +} WGPUStencilFaceState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUStorageTextureBindingLayout { WGPUChainedStruct const * nextInChain; WGPUStorageTextureAccess access; WGPUTextureFormat format; WGPUTextureViewDimension viewDimension; -} WGPUStorageTextureBindingLayout; +} WGPUStorageTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSurfaceDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable -} WGPUSurfaceDescriptor; + WGPU_NULLABLE char const * label; +} WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { WGPUChainedStruct chain; void * window; -} WGPUSurfaceDescriptorFromAndroidNativeWindow; +} WGPUSurfaceDescriptorFromAndroidNativeWindow WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { WGPUChainedStruct chain; char const * selector; -} WGPUSurfaceDescriptorFromCanvasHTMLSelector; +} WGPUSurfaceDescriptorFromCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromMetalLayer { WGPUChainedStruct chain; void * layer; -} WGPUSurfaceDescriptorFromMetalLayer; +} WGPUSurfaceDescriptorFromMetalLayer WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromWaylandSurface { WGPUChainedStruct chain; void * display; void * surface; -} WGPUSurfaceDescriptorFromWaylandSurface; - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceDescriptorFromWindowsCoreWindow { - WGPUChainedStruct chain; - void * coreWindow; -} WGPUSurfaceDescriptorFromWindowsCoreWindow; +} WGPUSurfaceDescriptorFromWaylandSurface WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromWindowsHWND { WGPUChainedStruct chain; void * hinstance; void * hwnd; -} WGPUSurfaceDescriptorFromWindowsHWND; +} WGPUSurfaceDescriptorFromWindowsHWND WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromWindowsCoreWindow { + WGPUChainedStruct chain; + void * coreWindow; +} WGPUSurfaceDescriptorFromWindowsCoreWindow WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromWindowsSwapChainPanel { WGPUChainedStruct chain; void * swapChainPanel; -} WGPUSurfaceDescriptorFromWindowsSwapChainPanel; +} WGPUSurfaceDescriptorFromWindowsSwapChainPanel WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromXlibWindow { WGPUChainedStruct chain; void * display; - uint32_t window; -} WGPUSurfaceDescriptorFromXlibWindow; + uint64_t window; +} WGPUSurfaceDescriptorFromXlibWindow WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSwapChainDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUTextureUsageFlags usage; WGPUTextureFormat format; uint32_t width; uint32_t height; WGPUPresentMode presentMode; - uint64_t implementation; -} WGPUSwapChainDescriptor; +} WGPUSwapChainDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureBindingLayout { WGPUChainedStruct const * nextInChain; WGPUTextureSampleType sampleType; WGPUTextureViewDimension viewDimension; - bool multisampled; -} WGPUTextureBindingLayout; + WGPUBool multisampled; +} WGPUTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUTextureDescriptor +typedef struct WGPUTextureBindingViewDimensionDescriptor { + WGPUChainedStruct chain; + WGPUTextureViewDimension textureBindingViewDimension; +} WGPUTextureBindingViewDimensionDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureDataLayout { WGPUChainedStruct const * nextInChain; uint64_t offset; uint32_t bytesPerRow; uint32_t rowsPerImage; -} WGPUTextureDataLayout; +} WGPUTextureDataLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureViewDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUTextureFormat format; WGPUTextureViewDimension dimension; uint32_t baseMipLevel; @@ -1114,21 +1804,28 @@ typedef struct WGPUTextureViewDescriptor { uint32_t baseArrayLayer; uint32_t arrayLayerCount; WGPUTextureAspect aspect; -} WGPUTextureViewDescriptor; +} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUVertexAttribute { WGPUVertexFormat format; uint64_t offset; uint32_t shaderLocation; -} WGPUVertexAttribute; +} WGPUVertexAttribute WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUAdapterProperties +typedef struct WGPUAdapterPropertiesMemoryHeaps { + WGPUChainedStructOut chain; + size_t heapCount; + WGPUMemoryHeapInfo const * heapInfo; +} WGPUAdapterPropertiesMemoryHeaps WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBindGroupDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUBindGroupLayout layout; - uint32_t entryCount; + size_t entryCount; WGPUBindGroupEntry const * entries; -} WGPUBindGroupDescriptor; +} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBindGroupLayoutEntry { WGPUChainedStruct const * nextInChain; @@ -1138,30 +1835,29 @@ typedef struct WGPUBindGroupLayoutEntry { WGPUSamplerBindingLayout sampler; WGPUTextureBindingLayout texture; WGPUStorageTextureBindingLayout storageTexture; -} WGPUBindGroupLayoutEntry; +} WGPUBindGroupLayoutEntry WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBlendState { WGPUBlendComponent color; WGPUBlendComponent alpha; -} WGPUBlendState; +} WGPUBlendState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCompilationInfo { WGPUChainedStruct const * nextInChain; - uint32_t messageCount; + size_t messageCount; WGPUCompilationMessage const * messages; -} WGPUCompilationInfo; +} WGPUCompilationInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUComputePassDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t timestampWriteCount; - WGPUComputePassTimestampWrite const * timestampWrites; -} WGPUComputePassDescriptor; + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUComputePassTimestampWrites const * timestampWrites; +} WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUDepthStencilState { WGPUChainedStruct const * nextInChain; WGPUTextureFormat format; - bool depthWriteEnabled; + WGPUBool depthWriteEnabled; WGPUCompareFunction depthCompare; WGPUStencilFaceState stencilFront; WGPUStencilFaceState stencilBack; @@ -1170,33 +1866,42 @@ typedef struct WGPUDepthStencilState { int32_t depthBias; float depthBiasSlopeScale; float depthBiasClamp; -} WGPUDepthStencilState; +} WGPUDepthStencilState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUExternalTextureDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUTextureView plane0; - WGPUTextureView plane1; // nullable + WGPU_NULLABLE WGPUTextureView plane1; WGPUOrigin2D visibleOrigin; WGPUExtent2D visibleSize; - bool doYuvToRgbConversionOnly; - float const * yuvToRgbConversionMatrix; // nullable + WGPUBool doYuvToRgbConversionOnly; + WGPU_NULLABLE float const * yuvToRgbConversionMatrix; float const * srcTransferFunctionParameters; float const * dstTransferFunctionParameters; float const * gamutConversionMatrix; -} WGPUExternalTextureDescriptor; + WGPUBool flipY; + WGPUBool mirrored; + WGPUExternalTextureRotation rotation; +} WGPUExternalTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUFutureWaitInfo { + WGPUFuture future; + WGPUBool completed; +} WGPUFutureWaitInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUImageCopyBuffer { WGPUChainedStruct const * nextInChain; WGPUTextureDataLayout layout; WGPUBuffer buffer; -} WGPUImageCopyBuffer; +} WGPUImageCopyBuffer WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUImageCopyExternalTexture { WGPUChainedStruct const * nextInChain; WGPUExternalTexture externalTexture; WGPUOrigin3D origin; -} WGPUImageCopyExternalTexture; + WGPUExtent2D naturalSize; +} WGPUImageCopyExternalTexture WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUImageCopyTexture { WGPUChainedStruct const * nextInChain; @@ -1204,654 +1909,803 @@ typedef struct WGPUImageCopyTexture { uint32_t mipLevel; WGPUOrigin3D origin; WGPUTextureAspect aspect; -} WGPUImageCopyTexture; +} WGPUImageCopyTexture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUInstanceDescriptor { + WGPUChainedStruct const * nextInChain; + WGPUInstanceFeatures features; +} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUPipelineLayoutDescriptor +typedef struct WGPUPipelineLayoutPixelLocalStorage { + WGPUChainedStruct chain; + uint64_t totalPixelLocalStorageSize; + size_t storageAttachmentCount; + WGPUPipelineLayoutStorageAttachment const * storageAttachments; +} WGPUPipelineLayoutPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUProgrammableStageDescriptor { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; - uint32_t constantCount; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; WGPUConstantEntry const * constants; -} WGPUProgrammableStageDescriptor; +} WGPUProgrammableStageDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPassColorAttachment { - WGPUTextureView view; // nullable - WGPUTextureView resolveTarget; // nullable + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE WGPUTextureView view; + uint32_t depthSlice; + WGPU_NULLABLE WGPUTextureView resolveTarget; WGPULoadOp loadOp; WGPUStoreOp storeOp; - WGPUColor clearColor; WGPUColor clearValue; -} WGPURenderPassColorAttachment; +} WGPURenderPassColorAttachment WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPassStorageAttachment { + WGPUChainedStruct const * nextInChain; + uint64_t offset; + WGPUTextureView storage; + WGPULoadOp loadOp; + WGPUStoreOp storeOp; + WGPUColor clearValue; +} WGPURenderPassStorageAttachment WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURequiredLimits { WGPUChainedStruct const * nextInChain; WGPULimits limits; -} WGPURequiredLimits; +} WGPURequiredLimits WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryDmaBufDescriptor { + WGPUChainedStruct chain; + WGPUExtent3D size; + uint32_t drmFormat; + uint64_t drmModifier; + size_t planeCount; + WGPUSharedTextureMemoryDmaBufPlane const * planes; +} WGPUSharedTextureMemoryDmaBufDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSharedTextureMemoryProperties { + WGPUChainedStructOut * nextInChain; + WGPUTextureUsageFlags usage; + WGPUExtent3D size; + WGPUTextureFormat format; +} WGPUSharedTextureMemoryProperties WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSharedTextureMemoryDescriptor +typedef struct WGPUSharedTextureMemoryVkImageDescriptor { + WGPUChainedStruct chain; + int32_t vkFormat; + int32_t vkUsageFlags; + WGPUExtent3D vkExtent3D; +} WGPUSharedTextureMemoryVkImageDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSupportedLimits { WGPUChainedStructOut * nextInChain; WGPULimits limits; -} WGPUSupportedLimits; +} WGPUSupportedLimits WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable + WGPU_NULLABLE char const * label; WGPUTextureUsageFlags usage; WGPUTextureDimension dimension; WGPUExtent3D size; WGPUTextureFormat format; uint32_t mipLevelCount; uint32_t sampleCount; - uint32_t viewFormatCount; + size_t viewFormatCount; WGPUTextureFormat const * viewFormats; -} WGPUTextureDescriptor; +} WGPUTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUVertexBufferLayout { uint64_t arrayStride; WGPUVertexStepMode stepMode; - uint32_t attributeCount; + size_t attributeCount; WGPUVertexAttribute const * attributes; -} WGPUVertexBufferLayout; +} WGPUVertexBufferLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUBindGroupLayoutDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t entryCount; + WGPU_NULLABLE char const * label; + size_t entryCount; WGPUBindGroupLayoutEntry const * entries; -} WGPUBindGroupLayoutDescriptor; +} WGPUBindGroupLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUColorTargetState { WGPUChainedStruct const * nextInChain; WGPUTextureFormat format; - WGPUBlendState const * blend; // nullable + WGPU_NULLABLE WGPUBlendState const * blend; WGPUColorWriteMaskFlags writeMask; -} WGPUColorTargetState; +} WGPUColorTargetState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUComputePipelineDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - WGPUPipelineLayout layout; // nullable + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUPipelineLayout layout; WGPUProgrammableStageDescriptor compute; -} WGPUComputePipelineDescriptor; +} WGPUComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUDeviceDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t requiredFeaturesCount; + WGPU_NULLABLE char const * label; + size_t requiredFeatureCount; WGPUFeatureName const * requiredFeatures; - WGPURequiredLimits const * requiredLimits; // nullable + WGPU_NULLABLE WGPURequiredLimits const * requiredLimits; WGPUQueueDescriptor defaultQueue; -} WGPUDeviceDescriptor; + WGPUDeviceLostCallback deviceLostCallback; + void * deviceLostUserdata; +} WGPUDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPassDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - uint32_t colorAttachmentCount; + WGPU_NULLABLE char const * label; + size_t colorAttachmentCount; WGPURenderPassColorAttachment const * colorAttachments; - WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; // nullable - WGPUQuerySet occlusionQuerySet; // nullable - uint32_t timestampWriteCount; - WGPURenderPassTimestampWrite const * timestampWrites; -} WGPURenderPassDescriptor; + WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; + WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; + WGPU_NULLABLE WGPURenderPassTimestampWrites const * timestampWrites; +} WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPURenderPassDescriptor +typedef struct WGPURenderPassPixelLocalStorage { + WGPUChainedStruct chain; + uint64_t totalPixelLocalStorageSize; + size_t storageAttachmentCount; + WGPURenderPassStorageAttachment const * storageAttachments; +} WGPURenderPassPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUVertexState { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; - uint32_t constantCount; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; WGPUConstantEntry const * constants; - uint32_t bufferCount; + size_t bufferCount; WGPUVertexBufferLayout const * buffers; -} WGPUVertexState; +} WGPUVertexState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUFragmentState { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; - uint32_t constantCount; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; WGPUConstantEntry const * constants; - uint32_t targetCount; + size_t targetCount; WGPUColorTargetState const * targets; -} WGPUFragmentState; +} WGPUFragmentState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPipelineDescriptor { WGPUChainedStruct const * nextInChain; - char const * label; // nullable - WGPUPipelineLayout layout; // nullable + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUPipelineLayout layout; WGPUVertexState vertex; WGPUPrimitiveState primitive; - WGPUDepthStencilState const * depthStencil; // nullable + WGPU_NULLABLE WGPUDepthStencilState const * depthStencil; WGPUMultisampleState multisample; - WGPUFragmentState const * fragment; // nullable -} WGPURenderPipelineDescriptor; + WGPU_NULLABLE WGPUFragmentState const * fragment; +} WGPURenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; #ifdef __cplusplus extern "C" { #endif -typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata); -typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo, void * userdata); -typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata); -typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata); -typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata); -typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata); -typedef void (*WGPULoggingCallback)(WGPULoggingType type, char const * message, void * userdata); -typedef void (*WGPUProc)(void); -typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata); -typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata); -typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata); - #if !defined(WGPU_SKIP_PROCS) -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor); -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName); +typedef void (*WGPUProcAdapterPropertiesFreeMembers)(WGPUAdapterProperties value) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterPropertiesMemoryHeapsFreeMembers)(WGPUAdapterPropertiesMemoryHeaps value) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcGetInstanceFeatures)(WGPUInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedBufferMemoryEndAccessStateFreeMembers)(WGPUSharedBufferMemoryEndAccessState value) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedTextureMemoryEndAccessStateFreeMembers)(WGPUSharedTextureMemoryEndAccessState value) WGPU_FUNCTION_ATTRIBUTE; // Procs of Adapter -typedef WGPUDevice (*WGPUProcAdapterCreateDevice)(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor /* nullable */); -typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features); -typedef bool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits); -typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties); -typedef bool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature); -typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor /* nullable */, WGPURequestDeviceCallback callback, void * userdata); -typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter); -typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter); +typedef WGPUDevice (*WGPUProcAdapterCreateDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUInstance (*WGPUProcAdapterGetInstance)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcAdapterRequestDeviceF)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * options, WGPURequestDeviceCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; // Procs of BindGroup -typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, char const * label); -typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup); -typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup 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); -typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout); -typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout 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); -typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size); -typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size); -typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer); -typedef WGPUBufferUsage (*WGPUProcBufferGetUsage)(WGPUBuffer buffer); -typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata); -typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, char const * label); -typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer); -typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer); -typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer); +typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcBufferMapAsyncF)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo) 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); -typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer); -typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer 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, WGPUComputePassDescriptor const * descriptor /* nullable */); -typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor); -typedef void (*WGPUProcCommandEncoderClearBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size); -typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size); -typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize); -typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -typedef void (*WGPUProcCommandEncoderCopyTextureToTextureInternal)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor /* nullable */); -typedef void (*WGPUProcCommandEncoderInjectValidationError)(WGPUCommandEncoder commandEncoder, char const * message); -typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel); -typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder); -typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel); -typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); -typedef void (*WGPUProcCommandEncoderSetLabel)(WGPUCommandEncoder commandEncoder, char const * label); -typedef void (*WGPUProcCommandEncoderWriteBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size); -typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder); -typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder 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 (*WGPUProcCommandEncoderInjectValidationError)(WGPUCommandEncoder commandEncoder, char const * message) 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 (*WGPUProcCommandEncoderWriteBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) 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 (*WGPUProcComputePassEncoderDispatch)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); -typedef void (*WGPUProcComputePassEncoderDispatchIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderEndPass)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel); -typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel); -typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, char const * label); -typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); -typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder); +typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Procs of ComputePipeline -typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex); -typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, char const * label); -typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline); -typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline 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); -typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor); -typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor); -typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor /* nullable */); -typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor); -typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata); -typedef WGPUBuffer (*WGPUProcDeviceCreateErrorBuffer)(WGPUDevice device); -typedef WGPUExternalTexture (*WGPUProcDeviceCreateErrorExternalTexture)(WGPUDevice device); -typedef WGPUTexture (*WGPUProcDeviceCreateErrorTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -typedef WGPUExternalTexture (*WGPUProcDeviceCreateExternalTexture)(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor); -typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor); -typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor); -typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor); -typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor); -typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata); -typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPUSamplerDescriptor const * descriptor /* nullable */); -typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor); -typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface /* nullable */, WGPUSwapChainDescriptor const * descriptor); -typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device); -typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features); -typedef void (*WGPUProcDeviceForceLoss)(WGPUDevice device, WGPUDeviceLostReason type, char const * message); -typedef WGPUAdapter (*WGPUProcDeviceGetAdapter)(WGPUDevice device); -typedef bool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits); -typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device); -typedef bool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature); -typedef void (*WGPUProcDeviceInjectError)(WGPUDevice device, WGPUErrorType type, char const * message); -typedef bool (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter); -typedef void (*WGPUProcDeviceSetDeviceLostCallback)(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata); -typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const * label); -typedef void (*WGPUProcDeviceSetLoggingCallback)(WGPUDevice device, WGPULoggingCallback callback, void * userdata); -typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -typedef void (*WGPUProcDeviceTick)(WGPUDevice device); -typedef void (*WGPUProcDeviceReference)(WGPUDevice device); -typedef void (*WGPUProcDeviceRelease)(WGPUDevice device); +typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcDeviceCreateComputePipelineAsyncF)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBuffer (*WGPUProcDeviceCreateErrorBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUExternalTexture (*WGPUProcDeviceCreateErrorExternalTexture)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUShaderModule (*WGPUProcDeviceCreateErrorShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor, char const * errorMessage) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTexture (*WGPUProcDeviceCreateErrorTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUExternalTexture (*WGPUProcDeviceCreateExternalTexture)(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcDeviceCreateRenderPipelineAsyncF)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceForceLoss)(WGPUDevice device, WGPUDeviceLostReason type, char const * message) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUAdapter (*WGPUProcDeviceGetAdapter)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureUsageFlags (*WGPUProcDeviceGetSupportedSurfaceUsage)(WGPUDevice device, WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSharedBufferMemory (*WGPUProcDeviceImportSharedBufferMemory)(WGPUDevice device, WGPUSharedBufferMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSharedFence (*WGPUProcDeviceImportSharedFence)(WGPUDevice device, WGPUSharedFenceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSharedTextureMemory (*WGPUProcDeviceImportSharedTextureMemory)(WGPUDevice device, WGPUSharedTextureMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceInjectError)(WGPUDevice device, WGPUErrorType type, char const * message) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback oldCallback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcDevicePopErrorScopeF)(WGPUDevice device, WGPUPopErrorScopeCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetDeviceLostCallback)(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetLoggingCallback)(WGPUDevice device, WGPULoggingCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceTick)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceValidateTextureDescriptor)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceReference)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; // Procs of ExternalTexture -typedef void (*WGPUProcExternalTextureDestroy)(WGPUExternalTexture externalTexture); -typedef void (*WGPUProcExternalTextureSetLabel)(WGPUExternalTexture externalTexture, char const * label); -typedef void (*WGPUProcExternalTextureReference)(WGPUExternalTexture externalTexture); -typedef void (*WGPUProcExternalTextureRelease)(WGPUExternalTexture externalTexture); +typedef void (*WGPUProcExternalTextureDestroy)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcExternalTextureExpire)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcExternalTextureRefresh)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcExternalTextureSetLabel)(WGPUExternalTexture externalTexture, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcExternalTextureReference)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcExternalTextureRelease)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; // Procs of Instance -typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor); -typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPURequestAdapterOptions const * options /* nullable */, WGPURequestAdapterCallback callback, void * userdata); -typedef void (*WGPUProcInstanceReference)(WGPUInstance instance); -typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance); +typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcInstanceEnumerateWGSLLanguageFeatures)(WGPUInstance instance, WGPUWGSLFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcInstanceHasWGSLLanguageFeature)(WGPUInstance instance, WGPUWGSLFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcInstanceRequestAdapterF)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUWaitStatus (*WGPUProcInstanceWaitAny)(WGPUInstance instance, size_t futureCount, WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; +typedef 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); -typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout); -typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout 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); -typedef uint32_t (*WGPUProcQuerySetGetCount)(WGPUQuerySet querySet); -typedef WGPUQueryType (*WGPUProcQuerySetGetType)(WGPUQuerySet querySet); -typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, char const * label); -typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet); -typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet 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 (*WGPUProcQueueCopyExternalTextureForBrowser)(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -typedef void (*WGPUProcQueueCopyTextureForBrowser)(WGPUQueue queue, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneCallback callback, void * userdata); -typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label); -typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); -typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size); -typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize); -typedef void (*WGPUProcQueueReference)(WGPUQueue queue); -typedef void (*WGPUProcQueueRelease)(WGPUQueue queue); +typedef void (*WGPUProcQueueCopyExternalTextureForBrowser)(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueCopyTextureForBrowser)(WGPUQueue queue, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcQueueOnSubmittedWorkDoneF)(WGPUQueue queue, WGPUQueueWorkDoneCallbackInfo callbackInfo) 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 (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle); -typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle 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); -typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor /* nullable */); -typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel); -typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder); -typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel); -typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderSetLabel)(WGPURenderBundleEncoder renderBundleEncoder, char const * label); -typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); -typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder); -typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder 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); -typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderEndPass)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const * bundles); -typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel); -typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel); -typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcRenderPassEncoderSetBlendConstant)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color); -typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, char const * label); -typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); -typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); -typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); -typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); -typedef void (*WGPUProcRenderPassEncoderWriteTimestamp)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder 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 (*WGPUProcRenderPassEncoderPixelLocalStorageBarrier)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetBlendConstant)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderWriteTimestamp)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Procs of RenderPipeline -typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex); -typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, char const * label); -typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline); -typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline 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); -typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler); -typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler); +typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; // Procs of ShaderModule -typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata); -typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, char const * label); -typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule); -typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule); +typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUFuture (*WGPUProcShaderModuleGetCompilationInfoF)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallbackInfo callbackInfo) 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 SharedBufferMemory +typedef WGPUBool (*WGPUProcSharedBufferMemoryBeginAccess)(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBuffer (*WGPUProcSharedBufferMemoryCreateBuffer)(WGPUSharedBufferMemory sharedBufferMemory, WGPU_NULLABLE WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcSharedBufferMemoryEndAccess)(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedBufferMemoryGetProperties)(WGPUSharedBufferMemory sharedBufferMemory, WGPUSharedBufferMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcSharedBufferMemoryIsDeviceLost)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedBufferMemorySetLabel)(WGPUSharedBufferMemory sharedBufferMemory, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedBufferMemoryReference)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedBufferMemoryRelease)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of SharedFence +typedef void (*WGPUProcSharedFenceExportInfo)(WGPUSharedFence sharedFence, WGPUSharedFenceExportInfo * info) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedFenceReference)(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedFenceRelease)(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of SharedTextureMemory +typedef WGPUBool (*WGPUProcSharedTextureMemoryBeginAccess)(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTexture (*WGPUProcSharedTextureMemoryCreateTexture)(WGPUSharedTextureMemory sharedTextureMemory, WGPU_NULLABLE WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcSharedTextureMemoryEndAccess)(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedTextureMemoryGetProperties)(WGPUSharedTextureMemory sharedTextureMemory, WGPUSharedTextureMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcSharedTextureMemoryIsDeviceLost)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedTextureMemorySetLabel)(WGPUSharedTextureMemory sharedTextureMemory, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedTextureMemoryReference)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSharedTextureMemoryRelease)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; // Procs of Surface -typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface); -typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface); +typedef WGPUTextureFormat (*WGPUProcSurfaceGetPreferredFormat)(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; // Procs of SwapChain -typedef void (*WGPUProcSwapChainConfigure)(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height); -typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain); +typedef WGPUTexture (*WGPUProcSwapChainGetCurrentTexture)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; // Procs of Texture -typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor /* nullable */); -typedef void (*WGPUProcTextureDestroy)(WGPUTexture texture); -typedef uint32_t (*WGPUProcTextureGetDepthOrArrayLayers)(WGPUTexture texture); -typedef WGPUTextureDimension (*WGPUProcTextureGetDimension)(WGPUTexture texture); -typedef WGPUTextureFormat (*WGPUProcTextureGetFormat)(WGPUTexture texture); -typedef uint32_t (*WGPUProcTextureGetHeight)(WGPUTexture texture); -typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture); -typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture); -typedef WGPUTextureUsage (*WGPUProcTextureGetUsage)(WGPUTexture texture); -typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture); -typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, char const * label); -typedef void (*WGPUProcTextureReference)(WGPUTexture texture); -typedef void (*WGPUProcTextureRelease)(WGPUTexture texture); +typedef WGPUTextureView (*WGPUProcTextureCreateErrorView)(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +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); -typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView); -typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView); +typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; + #endif // !defined(WGPU_SKIP_PROCS) #if !defined(WGPU_SKIP_DECLARATIONS) -WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor); -WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName); +WGPU_EXPORT void wgpuAdapterPropertiesFreeMembers(WGPUAdapterProperties value) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterPropertiesMemoryHeapsFreeMembers(WGPUAdapterPropertiesMemoryHeaps value) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuGetInstanceFeatures(WGPUInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPU_NULLABLE WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedBufferMemoryEndAccessStateFreeMembers(WGPUSharedBufferMemoryEndAccessState value) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedTextureMemoryEndAccessStateFreeMembers(WGPUSharedTextureMemoryEndAccessState value) WGPU_FUNCTION_ATTRIBUTE; // Methods of Adapter -WGPU_EXPORT WGPUDevice wgpuAdapterCreateDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor /* nullable */); -WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features); -WGPU_EXPORT bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits); -WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties); -WGPU_EXPORT bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature); -WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor /* nullable */, WGPURequestDeviceCallback callback, void * userdata); -WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter); -WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter); +WGPU_EXPORT WGPUDevice wgpuAdapterCreateDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUInstance wgpuAdapterGetInstance(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuAdapterRequestDeviceF(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * options, WGPURequestDeviceCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; // Methods of BindGroup -WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label); -WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup); -WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup); +WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; // Methods of BindGroupLayout -WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label); -WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout); -WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout); +WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; // Methods of Buffer -WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer); -WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size); -WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size); -WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer); -WGPU_EXPORT WGPUBufferUsage wgpuBufferGetUsage(WGPUBuffer buffer); -WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata); -WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label); -WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer); -WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer); -WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer); +WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBufferUsageFlags wgpuBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuBufferMapAsyncF(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; // Methods of CommandBuffer -WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label); -WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer); -WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer); +WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; // Methods of CommandEncoder -WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor /* nullable */); -WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor); -WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size); -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTextureInternal(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor /* nullable */); -WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message); -WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder); -WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); -WGPU_EXPORT void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label); -WGPU_EXPORT void wgpuCommandEncoderWriteBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size); -WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder); -WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder); +WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message) 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 wgpuCommandEncoderWriteBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; // Methods of ComputePassEncoder -WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); -WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label); -WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); -WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder); +WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Methods of ComputePipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex); -WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label); -WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline); -WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline); +WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; // Methods of Device -WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor); -WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor); -WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor); -WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor /* nullable */); -WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor); -WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata); -WGPU_EXPORT WGPUBuffer wgpuDeviceCreateErrorBuffer(WGPUDevice device); -WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateErrorExternalTexture(WGPUDevice device); -WGPU_EXPORT WGPUTexture wgpuDeviceCreateErrorTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateExternalTexture(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor); -WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor); -WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor); -WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor); -WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor); -WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata); -WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * descriptor /* nullable */); -WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor); -WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface /* nullable */, WGPUSwapChainDescriptor const * descriptor); -WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device); -WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features); -WGPU_EXPORT void wgpuDeviceForceLoss(WGPUDevice device, WGPUDeviceLostReason type, char const * message); -WGPU_EXPORT WGPUAdapter wgpuDeviceGetAdapter(WGPUDevice device); -WGPU_EXPORT bool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits); -WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device); -WGPU_EXPORT bool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature); -WGPU_EXPORT void wgpuDeviceInjectError(WGPUDevice device, WGPUErrorType type, char const * message); -WGPU_EXPORT bool wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter); -WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, char const * label); -WGPU_EXPORT void wgpuDeviceSetLoggingCallback(WGPUDevice device, WGPULoggingCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceTick(WGPUDevice device); -WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device); -WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device); +WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuDeviceCreateComputePipelineAsyncF(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBuffer wgpuDeviceCreateErrorBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateErrorExternalTexture(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateErrorShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor, char const * errorMessage) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTexture wgpuDeviceCreateErrorTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateExternalTexture(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuDeviceCreateRenderPipelineAsyncF(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceForceLoss(WGPUDevice device, WGPUDeviceLostReason type, char const * message) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUAdapter wgpuDeviceGetAdapter(WGPUDevice device) 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 WGPUTextureUsageFlags wgpuDeviceGetSupportedSurfaceUsage(WGPUDevice device, WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSharedBufferMemory wgpuDeviceImportSharedBufferMemory(WGPUDevice device, WGPUSharedBufferMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSharedFence wgpuDeviceImportSharedFence(WGPUDevice device, WGPUSharedFenceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSharedTextureMemory wgpuDeviceImportSharedTextureMemory(WGPUDevice device, WGPUSharedTextureMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceInjectError(WGPUDevice device, WGPUErrorType type, char const * message) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback oldCallback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuDevicePopErrorScopeF(WGPUDevice device, WGPUPopErrorScopeCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetLoggingCallback(WGPUDevice device, WGPULoggingCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceTick(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceValidateTextureDescriptor(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; // Methods of ExternalTexture -WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture); -WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, char const * label); -WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture); -WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture); +WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuExternalTextureExpire(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuExternalTextureRefresh(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; // Methods of Instance -WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor); -WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions const * options /* nullable */, WGPURequestAdapterCallback callback, void * userdata); -WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance); -WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance); +WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuInstanceEnumerateWGSLLanguageFeatures(WGPUInstance instance, WGPUWGSLFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuInstanceRequestAdapterF(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUWaitStatus wgpuInstanceWaitAny(WGPUInstance instance, size_t futureCount, WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; // Methods of PipelineLayout -WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label); -WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout); -WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout); +WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; // Methods of QuerySet -WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet); -WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet); -WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet); -WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label); -WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet); -WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet); +WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; // Methods of Queue -WGPU_EXPORT void wgpuQueueCopyExternalTextureForBrowser(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -WGPU_EXPORT void wgpuQueueCopyTextureForBrowser(WGPUQueue queue, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneCallback callback, void * userdata); -WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label); -WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); -WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size); -WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize); -WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue); -WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue); +WGPU_EXPORT void wgpuQueueCopyExternalTextureForBrowser(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueCopyTextureForBrowser(WGPUQueue queue, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuQueueOnSubmittedWorkDoneF(WGPUQueue queue, WGPUQueueWorkDoneCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; // Methods of RenderBundle -WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle); -WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle); +WGPU_EXPORT void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; // Methods of RenderBundleEncoder -WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor /* nullable */); -WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder); -WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label); -WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); -WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder); -WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder); +WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; // Methods of RenderPassEncoder -WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex); -WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderEndPass(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const * bundles); -WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color); -WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label); -WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); -WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); -WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); -WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); -WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder); +WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderPixelLocalStorageBarrier(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Methods of RenderPipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex); -WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label); -WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline); -WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline); +WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; // Methods of Sampler -WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label); -WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler); -WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler); +WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; // Methods of ShaderModule -WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata); -WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label); -WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule); -WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule); +WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUFuture wgpuShaderModuleGetCompilationInfoF(WGPUShaderModule shaderModule, WGPUCompilationInfoCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of SharedBufferMemory +WGPU_EXPORT WGPUBool wgpuSharedBufferMemoryBeginAccess(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBuffer wgpuSharedBufferMemoryCreateBuffer(WGPUSharedBufferMemory sharedBufferMemory, WGPU_NULLABLE WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuSharedBufferMemoryEndAccess(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedBufferMemoryGetProperties(WGPUSharedBufferMemory sharedBufferMemory, WGPUSharedBufferMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuSharedBufferMemoryIsDeviceLost(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedBufferMemorySetLabel(WGPUSharedBufferMemory sharedBufferMemory, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedBufferMemoryReference(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedBufferMemoryRelease(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of SharedFence +WGPU_EXPORT void wgpuSharedFenceExportInfo(WGPUSharedFence sharedFence, WGPUSharedFenceExportInfo * info) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedFenceReference(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedFenceRelease(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of SharedTextureMemory +WGPU_EXPORT WGPUBool wgpuSharedTextureMemoryBeginAccess(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTexture wgpuSharedTextureMemoryCreateTexture(WGPUSharedTextureMemory sharedTextureMemory, WGPU_NULLABLE WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuSharedTextureMemoryEndAccess(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedTextureMemoryGetProperties(WGPUSharedTextureMemory sharedTextureMemory, WGPUSharedTextureMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuSharedTextureMemoryIsDeviceLost(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedTextureMemorySetLabel(WGPUSharedTextureMemory sharedTextureMemory, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedTextureMemoryReference(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSharedTextureMemoryRelease(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; // Methods of Surface -WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface); -WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface); +WGPU_EXPORT WGPUTextureFormat wgpuSurfaceGetPreferredFormat(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; // Methods of SwapChain -WGPU_EXPORT void wgpuSwapChainConfigure(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height); -WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain); +WGPU_EXPORT WGPUTexture wgpuSwapChainGetCurrentTexture(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; // Methods of Texture -WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor /* nullable */); -WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture); -WGPU_EXPORT uint32_t wgpuTextureGetDepthOrArrayLayers(WGPUTexture texture); -WGPU_EXPORT WGPUTextureDimension wgpuTextureGetDimension(WGPUTexture texture); -WGPU_EXPORT WGPUTextureFormat wgpuTextureGetFormat(WGPUTexture texture); -WGPU_EXPORT uint32_t wgpuTextureGetHeight(WGPUTexture texture); -WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture); -WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture); -WGPU_EXPORT WGPUTextureUsage wgpuTextureGetUsage(WGPUTexture texture); -WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture); -WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, char const * label); -WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture); -WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture); +WGPU_EXPORT WGPUTextureView wgpuTextureCreateErrorView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetDepthOrArrayLayers(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureDimension wgpuTextureGetDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureFormat wgpuTextureGetFormat(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetHeight(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureUsageFlags wgpuTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; // Methods of TextureView -WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label); -WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView); -WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView); +WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; + #endif // !defined(WGPU_SKIP_DECLARATIONS) diff --git a/lib/dawn/inc/dawn/webgpu_cpp.h b/lib/dawn/inc/dawn/webgpu_cpp.h index 025588e..e4ac825 100644 --- a/lib/dawn/inc/dawn/webgpu_cpp.h +++ b/lib/dawn/inc/dawn/webgpu_cpp.h @@ -1,9 +1,16 @@ +#ifdef __EMSCRIPTEN__ +#error "Do not include this header. Emscripten already provides headers needed for WebGPU." +#endif #ifndef WEBGPU_CPP_H_ #define WEBGPU_CPP_H_ -#include "dawn/webgpu.h" -#include "dawn/EnumClassBitmasks.h" +#include "webgpu/webgpu.h" +#include "webgpu/webgpu_cpp_chained_struct.h" +#include "webgpu/webgpu_enum_class_bitmasks.h" #include +#include +#include +#include namespace wgpu { @@ -15,65 +22,87 @@ namespace wgpu { static constexpr uint32_t kArrayLayerCountUndefined = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; static constexpr uint32_t kCopyStrideUndefined = WGPU_COPY_STRIDE_UNDEFINED; + static constexpr uint32_t kDepthSliceUndefined = WGPU_DEPTH_SLICE_UNDEFINED; static constexpr uint32_t kLimitU32Undefined = WGPU_LIMIT_U32_UNDEFINED; static constexpr uint64_t kLimitU64Undefined = WGPU_LIMIT_U64_UNDEFINED; static constexpr uint32_t kMipLevelCountUndefined = WGPU_MIP_LEVEL_COUNT_UNDEFINED; - static constexpr uint32_t kStrideUndefined = WGPU_STRIDE_UNDEFINED; + static constexpr uint32_t kQuerySetIndexUndefined = WGPU_QUERY_SET_INDEX_UNDEFINED; static constexpr size_t kWholeMapSize = WGPU_WHOLE_MAP_SIZE; static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE; + enum class WGSLFeatureName : uint32_t { + Undefined = 0x00000000, + ReadonlyAndReadwriteStorageTextures = 0x00000001, + Packed4x8IntegerDotProduct = 0x00000002, + UnrestrictedPointerParameters = 0x00000003, + PointerCompositeAccess = 0x00000004, + ChromiumTestingUnimplemented = 0x000003E8, + ChromiumTestingUnsafeExperimental = 0x000003E9, + ChromiumTestingExperimental = 0x000003EA, + ChromiumTestingShippedWithKillswitch = 0x000003EB, + ChromiumTestingShipped = 0x000003EC, + }; + enum class AdapterType : uint32_t { - DiscreteGPU = 0x00000000, - IntegratedGPU = 0x00000001, - CPU = 0x00000002, - Unknown = 0x00000003, + DiscreteGPU = 0x00000001, + IntegratedGPU = 0x00000002, + CPU = 0x00000003, + Unknown = 0x00000004, }; enum class AddressMode : uint32_t { - Repeat = 0x00000000, - MirrorRepeat = 0x00000001, - ClampToEdge = 0x00000002, + Undefined = 0x00000000, + ClampToEdge = 0x00000001, + Repeat = 0x00000002, + MirrorRepeat = 0x00000003, }; enum class AlphaMode : uint32_t { - Premultiplied = 0x00000000, - Unpremultiplied = 0x00000001, - Opaque = 0x00000002, + Opaque = 0x00000001, + Premultiplied = 0x00000002, + Unpremultiplied = 0x00000003, }; enum class BackendType : uint32_t { - Null = 0x00000000, - WebGPU = 0x00000001, - D3D11 = 0x00000002, - D3D12 = 0x00000003, - Metal = 0x00000004, - Vulkan = 0x00000005, - OpenGL = 0x00000006, - OpenGLES = 0x00000007, + Undefined = 0x00000000, + Null = 0x00000001, + WebGPU = 0x00000002, + D3D11 = 0x00000003, + D3D12 = 0x00000004, + Metal = 0x00000005, + Vulkan = 0x00000006, + OpenGL = 0x00000007, + OpenGLES = 0x00000008, }; enum class BlendFactor : uint32_t { - Zero = 0x00000000, - One = 0x00000001, - Src = 0x00000002, - OneMinusSrc = 0x00000003, - SrcAlpha = 0x00000004, - OneMinusSrcAlpha = 0x00000005, - Dst = 0x00000006, - OneMinusDst = 0x00000007, - DstAlpha = 0x00000008, - OneMinusDstAlpha = 0x00000009, - SrcAlphaSaturated = 0x0000000A, - Constant = 0x0000000B, - OneMinusConstant = 0x0000000C, + Undefined = 0x00000000, + Zero = 0x00000001, + One = 0x00000002, + Src = 0x00000003, + OneMinusSrc = 0x00000004, + SrcAlpha = 0x00000005, + OneMinusSrcAlpha = 0x00000006, + Dst = 0x00000007, + OneMinusDst = 0x00000008, + DstAlpha = 0x00000009, + OneMinusDstAlpha = 0x0000000A, + SrcAlphaSaturated = 0x0000000B, + Constant = 0x0000000C, + OneMinusConstant = 0x0000000D, + Src1 = 0x0000000E, + OneMinusSrc1 = 0x0000000F, + Src1Alpha = 0x00000010, + OneMinusSrc1Alpha = 0x00000011, }; enum class BlendOperation : uint32_t { - Add = 0x00000000, - Subtract = 0x00000001, - ReverseSubtract = 0x00000002, - Min = 0x00000003, - Max = 0x00000004, + Undefined = 0x00000000, + Add = 0x00000001, + Subtract = 0x00000002, + ReverseSubtract = 0x00000003, + Min = 0x00000004, + Max = 0x00000005, }; enum class BufferBindingType : uint32_t { @@ -85,55 +114,70 @@ namespace wgpu { enum class BufferMapAsyncStatus : uint32_t { Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - DestroyedBeforeCallback = 0x00000004, - UnmappedBeforeCallback = 0x00000005, + InstanceDropped = 0x00000001, + ValidationError = 0x00000002, + Unknown = 0x00000003, + DeviceLost = 0x00000004, + DestroyedBeforeCallback = 0x00000005, + UnmappedBeforeCallback = 0x00000006, + MappingAlreadyPending = 0x00000007, + OffsetOutOfRange = 0x00000008, + SizeOutOfRange = 0x00000009, + }; + + enum class BufferMapState : uint32_t { + Unmapped = 0x00000001, + Pending = 0x00000002, + Mapped = 0x00000003, + }; + + enum class CallbackMode : uint32_t { + WaitAnyOnly = 0x00000000, + AllowProcessEvents = 0x00000001, + AllowSpontaneous = 0x00000002, }; enum class CompareFunction : uint32_t { Undefined = 0x00000000, Never = 0x00000001, Less = 0x00000002, - LessEqual = 0x00000003, - Greater = 0x00000004, - GreaterEqual = 0x00000005, - Equal = 0x00000006, - NotEqual = 0x00000007, + Equal = 0x00000003, + LessEqual = 0x00000004, + Greater = 0x00000005, + NotEqual = 0x00000006, + GreaterEqual = 0x00000007, Always = 0x00000008, }; enum class CompilationInfoRequestStatus : uint32_t { Success = 0x00000000, - Error = 0x00000001, - DeviceLost = 0x00000002, - Unknown = 0x00000003, + InstanceDropped = 0x00000001, + Error = 0x00000002, + DeviceLost = 0x00000003, + Unknown = 0x00000004, }; enum class CompilationMessageType : uint32_t { - Error = 0x00000000, - Warning = 0x00000001, - Info = 0x00000002, - }; - - enum class ComputePassTimestampLocation : uint32_t { - Beginning = 0x00000000, - End = 0x00000001, + Error = 0x00000001, + Warning = 0x00000002, + Info = 0x00000003, }; enum class CreatePipelineAsyncStatus : uint32_t { Success = 0x00000000, - Error = 0x00000001, - DeviceLost = 0x00000002, - DeviceDestroyed = 0x00000003, - Unknown = 0x00000004, + InstanceDropped = 0x00000001, + ValidationError = 0x00000002, + InternalError = 0x00000003, + DeviceLost = 0x00000004, + DeviceDestroyed = 0x00000005, + Unknown = 0x00000006, }; enum class CullMode : uint32_t { - None = 0x00000000, - Front = 0x00000001, - Back = 0x00000002, + Undefined = 0x00000000, + None = 0x00000001, + Front = 0x00000002, + Back = 0x00000003, }; enum class DeviceLostReason : uint32_t { @@ -142,9 +186,9 @@ namespace wgpu { }; enum class ErrorFilter : uint32_t { - Validation = 0x00000000, - OutOfMemory = 0x00000001, - Internal = 0x00000002, + Validation = 0x00000001, + OutOfMemory = 0x00000002, + Internal = 0x00000003, }; enum class ErrorType : uint32_t { @@ -156,34 +200,79 @@ namespace wgpu { DeviceLost = 0x00000005, }; + enum class ExternalTextureRotation : uint32_t { + Rotate0Degrees = 0x00000000, + Rotate90Degrees = 0x00000001, + Rotate180Degrees = 0x00000002, + Rotate270Degrees = 0x00000003, + }; + enum class FeatureName : uint32_t { Undefined = 0x00000000, DepthClipControl = 0x00000001, Depth32FloatStencil8 = 0x00000002, TimestampQuery = 0x00000003, - PipelineStatisticsQuery = 0x00000004, - TextureCompressionBC = 0x00000005, - TextureCompressionETC2 = 0x00000006, - TextureCompressionASTC = 0x00000007, - IndirectFirstInstance = 0x00000008, - ShaderF16 = 0x00000009, - RG11B10UfloatRenderable = 0x0000000A, - DawnShaderFloat16 = 0x000003E9, + TextureCompressionBC = 0x00000004, + TextureCompressionETC2 = 0x00000005, + TextureCompressionASTC = 0x00000006, + IndirectFirstInstance = 0x00000007, + ShaderF16 = 0x00000008, + RG11B10UfloatRenderable = 0x00000009, + BGRA8UnormStorage = 0x0000000A, + Float32Filterable = 0x0000000B, DawnInternalUsages = 0x000003EA, DawnMultiPlanarFormats = 0x000003EB, DawnNative = 0x000003EC, - ChromiumExperimentalDp4a = 0x000003ED, - TimestampQueryInsidePasses = 0x000003EE, + ChromiumExperimentalTimestampQueryInsidePasses = 0x000003EE, + ImplicitDeviceSynchronization = 0x000003EF, + SurfaceCapabilities = 0x000003F0, + TransientAttachments = 0x000003F1, + MSAARenderToSingleSampled = 0x000003F2, + DualSourceBlending = 0x000003F3, + D3D11MultithreadProtected = 0x000003F4, + ANGLETextureSharing = 0x000003F5, + ChromiumExperimentalSubgroups = 0x000003F6, + ChromiumExperimentalSubgroupUniformControlFlow = 0x000003F7, + PixelLocalStorageCoherent = 0x000003F9, + PixelLocalStorageNonCoherent = 0x000003FA, + Norm16TextureFormats = 0x000003FB, + MultiPlanarFormatExtendedUsages = 0x000003FC, + MultiPlanarFormatP010 = 0x000003FD, + HostMappedPointer = 0x000003FE, + MultiPlanarRenderTargets = 0x000003FF, + MultiPlanarFormatNv12a = 0x00000400, + FramebufferFetch = 0x00000401, + BufferMapExtendedUsages = 0x00000402, + AdapterPropertiesMemoryHeaps = 0x00000403, + AdapterPropertiesD3D = 0x00000404, + R8UnormStorage = 0x00000405, + SharedTextureMemoryVkDedicatedAllocation = 0x0000044C, + SharedTextureMemoryAHardwareBuffer = 0x0000044D, + SharedTextureMemoryDmaBuf = 0x0000044E, + SharedTextureMemoryOpaqueFD = 0x0000044F, + SharedTextureMemoryZirconHandle = 0x00000450, + SharedTextureMemoryDXGISharedHandle = 0x00000451, + SharedTextureMemoryD3D11Texture2D = 0x00000452, + SharedTextureMemoryIOSurface = 0x00000453, + SharedTextureMemoryEGLImage = 0x00000454, + SharedFenceVkSemaphoreOpaqueFD = 0x000004B0, + SharedFenceVkSemaphoreSyncFD = 0x000004B1, + SharedFenceVkSemaphoreZirconHandle = 0x000004B2, + SharedFenceDXGISharedHandle = 0x000004B3, + SharedFenceMTLSharedEvent = 0x000004B4, + SharedBufferMemoryD3D12Resource = 0x000004B5, }; enum class FilterMode : uint32_t { - Nearest = 0x00000000, - Linear = 0x00000001, + Undefined = 0x00000000, + Nearest = 0x00000001, + Linear = 0x00000002, }; enum class FrontFace : uint32_t { - CCW = 0x00000000, - CW = 0x00000001, + Undefined = 0x00000000, + CCW = 0x00000001, + CW = 0x00000002, }; enum class IndexFormat : uint32_t { @@ -199,18 +288,21 @@ namespace wgpu { }; enum class LoggingType : uint32_t { - Verbose = 0x00000000, - Info = 0x00000001, - Warning = 0x00000002, - Error = 0x00000003, + Verbose = 0x00000001, + Info = 0x00000002, + Warning = 0x00000003, + Error = 0x00000004, + }; + + enum class MipmapFilterMode : uint32_t { + Undefined = 0x00000000, + Nearest = 0x00000001, + Linear = 0x00000002, }; - enum class PipelineStatisticName : uint32_t { - VertexShaderInvocations = 0x00000000, - ClipperInvocations = 0x00000001, - ClipperPrimitivesOut = 0x00000002, - FragmentShaderInvocations = 0x00000003, - ComputeShaderInvocations = 0x00000004, + enum class PopErrorScopeStatus : uint32_t { + Success = 0x00000000, + InstanceDropped = 0x00000001, }; enum class PowerPreference : uint32_t { @@ -220,48 +312,46 @@ namespace wgpu { }; enum class PresentMode : uint32_t { - Immediate = 0x00000000, - Mailbox = 0x00000001, - Fifo = 0x00000002, + Fifo = 0x00000001, + Immediate = 0x00000003, + Mailbox = 0x00000004, }; enum class PrimitiveTopology : uint32_t { - PointList = 0x00000000, - LineList = 0x00000001, - LineStrip = 0x00000002, - TriangleList = 0x00000003, - TriangleStrip = 0x00000004, + Undefined = 0x00000000, + PointList = 0x00000001, + LineList = 0x00000002, + LineStrip = 0x00000003, + TriangleList = 0x00000004, + TriangleStrip = 0x00000005, }; enum class QueryType : uint32_t { - Occlusion = 0x00000000, - PipelineStatistics = 0x00000001, + Occlusion = 0x00000001, Timestamp = 0x00000002, }; enum class QueueWorkDoneStatus : uint32_t { Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - }; - - enum class RenderPassTimestampLocation : uint32_t { - Beginning = 0x00000000, - End = 0x00000001, + InstanceDropped = 0x00000001, + Error = 0x00000002, + Unknown = 0x00000003, + DeviceLost = 0x00000004, }; enum class RequestAdapterStatus : uint32_t { Success = 0x00000000, - Unavailable = 0x00000001, - Error = 0x00000002, - Unknown = 0x00000003, + InstanceDropped = 0x00000001, + Unavailable = 0x00000002, + Error = 0x00000003, + Unknown = 0x00000004, }; enum class RequestDeviceStatus : uint32_t { Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, + InstanceDropped = 0x00000001, + Error = 0x00000002, + Unknown = 0x00000003, }; enum class SType : uint32_t { @@ -280,12 +370,55 @@ namespace wgpu { ExternalTextureBindingLayout = 0x0000000D, SurfaceDescriptorFromWindowsSwapChainPanel = 0x0000000E, RenderPassDescriptorMaxDrawCount = 0x0000000F, + DepthStencilStateDepthWriteDefinedDawn = 0x00000010, + TextureBindingViewDimensionDescriptor = 0x00000011, DawnTextureInternalUsageDescriptor = 0x000003E8, - DawnTogglesDeviceDescriptor = 0x000003EA, DawnEncoderInternalUsageDescriptor = 0x000003EB, DawnInstanceDescriptor = 0x000003EC, DawnCacheDeviceDescriptor = 0x000003ED, DawnAdapterPropertiesPowerPreference = 0x000003EE, + DawnBufferDescriptorErrorInfoFromWireClient = 0x000003EF, + DawnTogglesDescriptor = 0x000003F0, + DawnShaderModuleSPIRVOptionsDescriptor = 0x000003F1, + RequestAdapterOptionsLUID = 0x000003F2, + RequestAdapterOptionsGetGLProc = 0x000003F3, + RequestAdapterOptionsD3D11Device = 0x000003F4, + DawnMultisampleStateRenderToSingleSampled = 0x000003F5, + DawnRenderPassColorAttachmentRenderToSingleSampled = 0x000003F6, + RenderPassPixelLocalStorage = 0x000003F7, + PipelineLayoutPixelLocalStorage = 0x000003F8, + BufferHostMappedPointer = 0x000003F9, + DawnExperimentalSubgroupLimits = 0x000003FA, + AdapterPropertiesMemoryHeaps = 0x000003FB, + AdapterPropertiesD3D = 0x000003FC, + DawnComputePipelineFullSubgroups = 0x000003FD, + DawnWireWGSLControl = 0x000003FE, + DawnWGSLBlocklist = 0x000003FF, + SharedTextureMemoryVkImageDescriptor = 0x0000044C, + SharedTextureMemoryVkDedicatedAllocationDescriptor = 0x0000044D, + SharedTextureMemoryAHardwareBufferDescriptor = 0x0000044E, + SharedTextureMemoryDmaBufDescriptor = 0x0000044F, + SharedTextureMemoryOpaqueFDDescriptor = 0x00000450, + SharedTextureMemoryZirconHandleDescriptor = 0x00000451, + SharedTextureMemoryDXGISharedHandleDescriptor = 0x00000452, + SharedTextureMemoryD3D11Texture2DDescriptor = 0x00000453, + SharedTextureMemoryIOSurfaceDescriptor = 0x00000454, + SharedTextureMemoryEGLImageDescriptor = 0x00000455, + SharedTextureMemoryInitializedBeginState = 0x000004B0, + SharedTextureMemoryInitializedEndState = 0x000004B1, + SharedTextureMemoryVkImageLayoutBeginState = 0x000004B2, + SharedTextureMemoryVkImageLayoutEndState = 0x000004B3, + SharedFenceVkSemaphoreOpaqueFDDescriptor = 0x000004B4, + SharedFenceVkSemaphoreOpaqueFDExportInfo = 0x000004B5, + SharedFenceVkSemaphoreSyncFDDescriptor = 0x000004B6, + SharedFenceVkSemaphoreSyncFDExportInfo = 0x000004B7, + SharedFenceVkSemaphoreZirconHandleDescriptor = 0x000004B8, + SharedFenceVkSemaphoreZirconHandleExportInfo = 0x000004B9, + SharedFenceDXGISharedHandleDescriptor = 0x000004BA, + SharedFenceDXGISharedHandleExportInfo = 0x000004BB, + SharedFenceMTLSharedEventDescriptor = 0x000004BC, + SharedFenceMTLSharedEventExportInfo = 0x000004BD, + SharedBufferMemoryD3D12ResourceDescriptor = 0x000004BE, }; enum class SamplerBindingType : uint32_t { @@ -295,20 +428,32 @@ namespace wgpu { Comparison = 0x00000003, }; + enum class SharedFenceType : uint32_t { + Undefined = 0x00000000, + VkSemaphoreOpaqueFD = 0x00000001, + VkSemaphoreSyncFD = 0x00000002, + VkSemaphoreZirconHandle = 0x00000003, + DXGISharedHandle = 0x00000004, + MTLSharedEvent = 0x00000005, + }; + enum class StencilOperation : uint32_t { - Keep = 0x00000000, - Zero = 0x00000001, - Replace = 0x00000002, - Invert = 0x00000003, - IncrementClamp = 0x00000004, - DecrementClamp = 0x00000005, - IncrementWrap = 0x00000006, - DecrementWrap = 0x00000007, + Undefined = 0x00000000, + Keep = 0x00000001, + Zero = 0x00000002, + Replace = 0x00000003, + Invert = 0x00000004, + IncrementClamp = 0x00000005, + DecrementClamp = 0x00000006, + IncrementWrap = 0x00000007, + DecrementWrap = 0x00000008, }; enum class StorageTextureAccess : uint32_t { Undefined = 0x00000000, WriteOnly = 0x00000001, + ReadOnly = 0x00000002, + ReadWrite = 0x00000003, }; enum class StoreOp : uint32_t { @@ -318,24 +463,20 @@ namespace wgpu { }; enum class TextureAspect : uint32_t { - All = 0x00000000, - StencilOnly = 0x00000001, - DepthOnly = 0x00000002, - Plane0Only = 0x00000003, - Plane1Only = 0x00000004, - }; - - enum class TextureComponentType : uint32_t { - Float = 0x00000000, - Sint = 0x00000001, - Uint = 0x00000002, - DepthComparison = 0x00000003, + Undefined = 0x00000000, + All = 0x00000001, + StencilOnly = 0x00000002, + DepthOnly = 0x00000003, + Plane0Only = 0x00000004, + Plane1Only = 0x00000005, + Plane2Only = 0x00000006, }; enum class TextureDimension : uint32_t { - e1D = 0x00000000, - e2D = 0x00000001, - e3D = 0x00000002, + Undefined = 0x00000000, + e1D = 0x00000001, + e2D = 0x00000002, + e3D = 0x00000003, }; enum class TextureFormat : uint32_t { @@ -364,77 +505,86 @@ namespace wgpu { RGBA8Sint = 0x00000016, BGRA8Unorm = 0x00000017, BGRA8UnormSrgb = 0x00000018, - RGB10A2Unorm = 0x00000019, - RG11B10Ufloat = 0x0000001A, - RGB9E5Ufloat = 0x0000001B, - RG32Float = 0x0000001C, - RG32Uint = 0x0000001D, - RG32Sint = 0x0000001E, - RGBA16Uint = 0x0000001F, - RGBA16Sint = 0x00000020, - RGBA16Float = 0x00000021, - RGBA32Float = 0x00000022, - RGBA32Uint = 0x00000023, - RGBA32Sint = 0x00000024, - Stencil8 = 0x00000025, - Depth16Unorm = 0x00000026, - Depth24Plus = 0x00000027, - Depth24PlusStencil8 = 0x00000028, - Depth32Float = 0x00000029, - Depth32FloatStencil8 = 0x0000002A, - BC1RGBAUnorm = 0x0000002B, - BC1RGBAUnormSrgb = 0x0000002C, - BC2RGBAUnorm = 0x0000002D, - BC2RGBAUnormSrgb = 0x0000002E, - BC3RGBAUnorm = 0x0000002F, - BC3RGBAUnormSrgb = 0x00000030, - BC4RUnorm = 0x00000031, - BC4RSnorm = 0x00000032, - BC5RGUnorm = 0x00000033, - BC5RGSnorm = 0x00000034, - BC6HRGBUfloat = 0x00000035, - BC6HRGBFloat = 0x00000036, - BC7RGBAUnorm = 0x00000037, - BC7RGBAUnormSrgb = 0x00000038, - ETC2RGB8Unorm = 0x00000039, - ETC2RGB8UnormSrgb = 0x0000003A, - ETC2RGB8A1Unorm = 0x0000003B, - ETC2RGB8A1UnormSrgb = 0x0000003C, - ETC2RGBA8Unorm = 0x0000003D, - ETC2RGBA8UnormSrgb = 0x0000003E, - EACR11Unorm = 0x0000003F, - EACR11Snorm = 0x00000040, - EACRG11Unorm = 0x00000041, - EACRG11Snorm = 0x00000042, - ASTC4x4Unorm = 0x00000043, - ASTC4x4UnormSrgb = 0x00000044, - ASTC5x4Unorm = 0x00000045, - ASTC5x4UnormSrgb = 0x00000046, - ASTC5x5Unorm = 0x00000047, - ASTC5x5UnormSrgb = 0x00000048, - ASTC6x5Unorm = 0x00000049, - ASTC6x5UnormSrgb = 0x0000004A, - ASTC6x6Unorm = 0x0000004B, - ASTC6x6UnormSrgb = 0x0000004C, - ASTC8x5Unorm = 0x0000004D, - ASTC8x5UnormSrgb = 0x0000004E, - ASTC8x6Unorm = 0x0000004F, - ASTC8x6UnormSrgb = 0x00000050, - ASTC8x8Unorm = 0x00000051, - ASTC8x8UnormSrgb = 0x00000052, - ASTC10x5Unorm = 0x00000053, - ASTC10x5UnormSrgb = 0x00000054, - ASTC10x6Unorm = 0x00000055, - ASTC10x6UnormSrgb = 0x00000056, - ASTC10x8Unorm = 0x00000057, - ASTC10x8UnormSrgb = 0x00000058, - ASTC10x10Unorm = 0x00000059, - ASTC10x10UnormSrgb = 0x0000005A, - ASTC12x10Unorm = 0x0000005B, - ASTC12x10UnormSrgb = 0x0000005C, - ASTC12x12Unorm = 0x0000005D, - ASTC12x12UnormSrgb = 0x0000005E, - R8BG8Biplanar420Unorm = 0x0000005F, + RGB10A2Uint = 0x00000019, + RGB10A2Unorm = 0x0000001A, + RG11B10Ufloat = 0x0000001B, + RGB9E5Ufloat = 0x0000001C, + RG32Float = 0x0000001D, + RG32Uint = 0x0000001E, + RG32Sint = 0x0000001F, + RGBA16Uint = 0x00000020, + RGBA16Sint = 0x00000021, + RGBA16Float = 0x00000022, + RGBA32Float = 0x00000023, + RGBA32Uint = 0x00000024, + RGBA32Sint = 0x00000025, + Stencil8 = 0x00000026, + Depth16Unorm = 0x00000027, + Depth24Plus = 0x00000028, + Depth24PlusStencil8 = 0x00000029, + Depth32Float = 0x0000002A, + Depth32FloatStencil8 = 0x0000002B, + BC1RGBAUnorm = 0x0000002C, + BC1RGBAUnormSrgb = 0x0000002D, + BC2RGBAUnorm = 0x0000002E, + BC2RGBAUnormSrgb = 0x0000002F, + BC3RGBAUnorm = 0x00000030, + BC3RGBAUnormSrgb = 0x00000031, + BC4RUnorm = 0x00000032, + BC4RSnorm = 0x00000033, + BC5RGUnorm = 0x00000034, + BC5RGSnorm = 0x00000035, + BC6HRGBUfloat = 0x00000036, + BC6HRGBFloat = 0x00000037, + BC7RGBAUnorm = 0x00000038, + BC7RGBAUnormSrgb = 0x00000039, + ETC2RGB8Unorm = 0x0000003A, + ETC2RGB8UnormSrgb = 0x0000003B, + ETC2RGB8A1Unorm = 0x0000003C, + ETC2RGB8A1UnormSrgb = 0x0000003D, + ETC2RGBA8Unorm = 0x0000003E, + ETC2RGBA8UnormSrgb = 0x0000003F, + EACR11Unorm = 0x00000040, + EACR11Snorm = 0x00000041, + EACRG11Unorm = 0x00000042, + EACRG11Snorm = 0x00000043, + ASTC4x4Unorm = 0x00000044, + ASTC4x4UnormSrgb = 0x00000045, + ASTC5x4Unorm = 0x00000046, + ASTC5x4UnormSrgb = 0x00000047, + ASTC5x5Unorm = 0x00000048, + ASTC5x5UnormSrgb = 0x00000049, + ASTC6x5Unorm = 0x0000004A, + ASTC6x5UnormSrgb = 0x0000004B, + ASTC6x6Unorm = 0x0000004C, + ASTC6x6UnormSrgb = 0x0000004D, + ASTC8x5Unorm = 0x0000004E, + ASTC8x5UnormSrgb = 0x0000004F, + ASTC8x6Unorm = 0x00000050, + ASTC8x6UnormSrgb = 0x00000051, + ASTC8x8Unorm = 0x00000052, + ASTC8x8UnormSrgb = 0x00000053, + ASTC10x5Unorm = 0x00000054, + ASTC10x5UnormSrgb = 0x00000055, + ASTC10x6Unorm = 0x00000056, + ASTC10x6UnormSrgb = 0x00000057, + ASTC10x8Unorm = 0x00000058, + ASTC10x8UnormSrgb = 0x00000059, + ASTC10x10Unorm = 0x0000005A, + ASTC10x10UnormSrgb = 0x0000005B, + ASTC12x10Unorm = 0x0000005C, + ASTC12x10UnormSrgb = 0x0000005D, + ASTC12x12Unorm = 0x0000005E, + ASTC12x12UnormSrgb = 0x0000005F, + R16Unorm = 0x00000060, + RG16Unorm = 0x00000061, + RGBA16Unorm = 0x00000062, + R16Snorm = 0x00000063, + RG16Snorm = 0x00000064, + RGBA16Snorm = 0x00000065, + R8BG8Biplanar420Unorm = 0x00000066, + R10X6BG10X6Biplanar420Unorm = 0x00000067, + R8BG8A8Triplanar420Unorm = 0x00000068, }; enum class TextureSampleType : uint32_t { @@ -488,12 +638,23 @@ namespace wgpu { Sint32x2 = 0x0000001C, Sint32x3 = 0x0000001D, Sint32x4 = 0x0000001E, + Unorm10_10_10_2 = 0x0000001F, }; enum class VertexStepMode : uint32_t { - Vertex = 0x00000000, - Instance = 0x00000001, - VertexBufferNotUsed = 0x00000002, + Undefined = 0x00000000, + VertexBufferNotUsed = 0x00000001, + Vertex = 0x00000002, + Instance = 0x00000003, + }; + + enum class WaitStatus : uint32_t { + Success = 0x00000000, + TimedOut = 0x00000001, + UnsupportedTimeout = 0x00000002, + UnsupportedCount = 0x00000003, + UnsupportedMixedSources = 0x00000004, + Unknown = 0x00000005, }; @@ -520,6 +681,15 @@ namespace wgpu { All = 0x0000000F, }; + enum class HeapProperty : uint32_t { + Undefined = 0x00000000, + DeviceLocal = 0x00000001, + HostVisible = 0x00000002, + HostCoherent = 0x00000004, + HostUncached = 0x00000008, + HostCached = 0x00000010, + }; + enum class MapMode : uint32_t { None = 0x00000000, Read = 0x00000001, @@ -540,17 +710,22 @@ namespace wgpu { TextureBinding = 0x00000004, StorageBinding = 0x00000008, RenderAttachment = 0x00000010, - Present = 0x00000020, + TransientAttachment = 0x00000020, + StorageAttachment = 0x00000040, }; using BufferMapCallback = WGPUBufferMapCallback; + using Callback = WGPUCallback; using CompilationInfoCallback = WGPUCompilationInfoCallback; using CreateComputePipelineAsyncCallback = WGPUCreateComputePipelineAsyncCallback; using CreateRenderPipelineAsyncCallback = WGPUCreateRenderPipelineAsyncCallback; + using DawnLoadCacheDataFunction = WGPUDawnLoadCacheDataFunction; + using DawnStoreCacheDataFunction = WGPUDawnStoreCacheDataFunction; using DeviceLostCallback = WGPUDeviceLostCallback; using ErrorCallback = WGPUErrorCallback; using LoggingCallback = WGPULoggingCallback; + using PopErrorScopeCallback = WGPUPopErrorScopeCallback; using Proc = WGPUProc; using QueueWorkDoneCallback = WGPUQueueWorkDoneCallback; using RequestAdapterCallback = WGPURequestAdapterCallback; @@ -576,54 +751,107 @@ namespace wgpu { class RenderPipeline; class Sampler; class ShaderModule; + class SharedBufferMemory; + class SharedFence; + class SharedTextureMemory; class Surface; class SwapChain; class Texture; class TextureView; struct AdapterProperties; + struct AdapterPropertiesD3D; struct BindGroupEntry; struct BlendComponent; struct BufferBindingLayout; struct BufferDescriptor; + struct BufferHostMappedPointer; + struct BufferMapCallbackInfo; struct Color; struct CommandBufferDescriptor; struct CommandEncoderDescriptor; + struct CompilationInfoCallbackInfo; struct CompilationMessage; - struct ComputePassTimestampWrite; + struct ComputePassTimestampWrites; struct ConstantEntry; struct CopyTextureForBrowserOptions; + struct CreateComputePipelineAsyncCallbackInfo; + struct CreateRenderPipelineAsyncCallbackInfo; + struct DawnWGSLBlocklist; struct DawnAdapterPropertiesPowerPreference; + struct DawnBufferDescriptorErrorInfoFromWireClient; struct DawnCacheDeviceDescriptor; + struct DawnComputePipelineFullSubgroups; struct DawnEncoderInternalUsageDescriptor; - struct DawnInstanceDescriptor; + struct DawnExperimentalSubgroupLimits; + struct DawnMultisampleStateRenderToSingleSampled; + struct DawnRenderPassColorAttachmentRenderToSingleSampled; + struct DawnShaderModuleSPIRVOptionsDescriptor; struct DawnTextureInternalUsageDescriptor; - struct DawnTogglesDeviceDescriptor; + struct DawnTogglesDescriptor; + struct DawnWireWGSLControl; + struct DepthStencilStateDepthWriteDefinedDawn; struct Extent2D; struct Extent3D; struct ExternalTextureBindingEntry; struct ExternalTextureBindingLayout; - struct InstanceDescriptor; + struct Future; + struct InstanceFeatures; struct Limits; + struct MemoryHeapInfo; struct MultisampleState; struct Origin2D; struct Origin3D; struct PipelineLayoutDescriptor; + struct PipelineLayoutStorageAttachment; + struct PopErrorScopeCallbackInfo; struct PrimitiveDepthClipControl; struct PrimitiveState; struct QuerySetDescriptor; struct QueueDescriptor; + struct QueueWorkDoneCallbackInfo; struct RenderBundleDescriptor; struct RenderBundleEncoderDescriptor; struct RenderPassDepthStencilAttachment; struct RenderPassDescriptorMaxDrawCount; - struct RenderPassTimestampWrite; + struct RenderPassTimestampWrites; + struct RequestAdapterCallbackInfo; struct RequestAdapterOptions; + struct RequestDeviceCallbackInfo; struct SamplerBindingLayout; struct SamplerDescriptor; - struct ShaderModuleDescriptor; struct ShaderModuleSPIRVDescriptor; struct ShaderModuleWGSLDescriptor; + struct ShaderModuleDescriptor; + struct SharedBufferMemoryBeginAccessDescriptor; + struct SharedBufferMemoryDescriptor; + struct SharedBufferMemoryEndAccessState; + struct SharedBufferMemoryProperties; + struct SharedFenceDXGISharedHandleDescriptor; + struct SharedFenceDXGISharedHandleExportInfo; + struct SharedFenceMTLSharedEventDescriptor; + struct SharedFenceMTLSharedEventExportInfo; + struct SharedFenceDescriptor; + struct SharedFenceExportInfo; + struct SharedFenceVkSemaphoreOpaqueFDDescriptor; + struct SharedFenceVkSemaphoreOpaqueFDExportInfo; + struct SharedFenceVkSemaphoreSyncFDDescriptor; + struct SharedFenceVkSemaphoreSyncFDExportInfo; + struct SharedFenceVkSemaphoreZirconHandleDescriptor; + struct SharedFenceVkSemaphoreZirconHandleExportInfo; + struct SharedTextureMemoryDXGISharedHandleDescriptor; + struct SharedTextureMemoryEGLImageDescriptor; + struct SharedTextureMemoryIOSurfaceDescriptor; + struct SharedTextureMemoryAHardwareBufferDescriptor; + struct SharedTextureMemoryBeginAccessDescriptor; + struct SharedTextureMemoryDescriptor; + struct SharedTextureMemoryDmaBufPlane; + struct SharedTextureMemoryEndAccessState; + struct SharedTextureMemoryOpaqueFDDescriptor; + struct SharedTextureMemoryVkDedicatedAllocationDescriptor; + struct SharedTextureMemoryVkImageLayoutBeginState; + struct SharedTextureMemoryVkImageLayoutEndState; + struct SharedTextureMemoryZirconHandleDescriptor; struct StencilFaceState; struct StorageTextureBindingLayout; struct SurfaceDescriptor; @@ -631,15 +859,17 @@ namespace wgpu { struct SurfaceDescriptorFromCanvasHTMLSelector; struct SurfaceDescriptorFromMetalLayer; struct SurfaceDescriptorFromWaylandSurface; - struct SurfaceDescriptorFromWindowsCoreWindow; struct SurfaceDescriptorFromWindowsHWND; + struct SurfaceDescriptorFromWindowsCoreWindow; struct SurfaceDescriptorFromWindowsSwapChainPanel; struct SurfaceDescriptorFromXlibWindow; struct SwapChainDescriptor; struct TextureBindingLayout; + struct TextureBindingViewDimensionDescriptor; struct TextureDataLayout; struct TextureViewDescriptor; struct VertexAttribute; + struct AdapterPropertiesMemoryHeaps; struct BindGroupDescriptor; struct BindGroupLayoutEntry; struct BlendState; @@ -647,12 +877,19 @@ namespace wgpu { struct ComputePassDescriptor; struct DepthStencilState; struct ExternalTextureDescriptor; + struct FutureWaitInfo; struct ImageCopyBuffer; struct ImageCopyExternalTexture; struct ImageCopyTexture; + struct InstanceDescriptor; + struct PipelineLayoutPixelLocalStorage; struct ProgrammableStageDescriptor; struct RenderPassColorAttachment; + struct RenderPassStorageAttachment; struct RequiredLimits; + struct SharedTextureMemoryDmaBufDescriptor; + struct SharedTextureMemoryProperties; + struct SharedTextureMemoryVkImageDescriptor; struct SupportedLimits; struct TextureDescriptor; struct VertexBufferLayout; @@ -661,10 +898,29 @@ namespace wgpu { struct ComputePipelineDescriptor; struct DeviceDescriptor; struct RenderPassDescriptor; + struct RenderPassPixelLocalStorage; struct VertexState; struct FragmentState; struct RenderPipelineDescriptor; + + // Special class for booleans in order to allow implicit conversions. + class Bool { + public: + constexpr Bool() = default; + // NOLINTNEXTLINE(runtime/explicit) allow implicit construction + constexpr Bool(bool value) : mValue(static_cast(value)) {} + // NOLINTNEXTLINE(runtime/explicit) allow implicit construction + Bool(WGPUBool value): mValue(value) {} + + constexpr operator bool() const { return static_cast(mValue); } + + private: + friend struct std::hash; + // Default to false. + WGPUBool mValue = static_cast(false); + }; + template class ObjectBase { public: @@ -725,7 +981,7 @@ namespace wgpu { CType Get() const { return mHandle; } - CType Release() { + CType MoveToCHandle() { CType result = mHandle; mHandle = 0; return result; @@ -749,10 +1005,12 @@ namespace wgpu { Device CreateDevice(DeviceDescriptor const * descriptor = nullptr) const; size_t EnumerateFeatures(FeatureName * features) const; - bool GetLimits(SupportedLimits * limits) const; + Instance GetInstance() const; + Bool GetLimits(SupportedLimits * limits) const; void GetProperties(AdapterProperties * properties) const; - bool HasFeature(FeatureName feature) const; + Bool HasFeature(FeatureName feature) const; void RequestDevice(DeviceDescriptor const * descriptor, RequestDeviceCallback callback, void * userdata) const; + Future RequestDevice(DeviceDescriptor const * options, RequestDeviceCallbackInfo callbackInfo) const; private: friend ObjectBase; @@ -793,10 +1051,12 @@ namespace wgpu { void Destroy() const; void const * GetConstMappedRange(size_t offset = 0, size_t size = WGPU_WHOLE_MAP_SIZE) const; + BufferMapState GetMapState() const; void * GetMappedRange(size_t offset = 0, size_t size = WGPU_WHOLE_MAP_SIZE) const; uint64_t GetSize() const; BufferUsage GetUsage() const; void MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallback callback, void * userdata) const; + Future MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallbackInfo callbackInfo) const; void SetLabel(char const * label) const; void Unmap() const; @@ -831,7 +1091,6 @@ namespace wgpu { void CopyBufferToTexture(ImageCopyBuffer const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const; void CopyTextureToBuffer(ImageCopyTexture const * source, ImageCopyBuffer const * destination, Extent3D const * copySize) const; void CopyTextureToTexture(ImageCopyTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const; - void CopyTextureToTextureInternal(ImageCopyTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize) const; CommandBuffer Finish(CommandBufferDescriptor const * descriptor = nullptr) const; void InjectValidationError(char const * message) const; void InsertDebugMarker(char const * markerLabel) const; @@ -853,16 +1112,13 @@ namespace wgpu { using ObjectBase::ObjectBase; using ObjectBase::operator=; - void Dispatch(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const; - void DispatchIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; void DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const; void DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; void End() const; - void EndPass() const; void InsertDebugMarker(char const * markerLabel) const; void PopDebugGroup() const; void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; + void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; void SetLabel(char const * label) const; void SetPipeline(ComputePipeline const& pipeline) const; void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; @@ -898,8 +1154,10 @@ namespace wgpu { CommandEncoder CreateCommandEncoder(CommandEncoderDescriptor const * descriptor = nullptr) const; ComputePipeline CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const; void CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CreateComputePipelineAsyncCallback callback, void * userdata) const; - Buffer CreateErrorBuffer() const; + Future CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CreateComputePipelineAsyncCallbackInfo callbackInfo) const; + Buffer CreateErrorBuffer(BufferDescriptor const * descriptor) const; ExternalTexture CreateErrorExternalTexture() const; + ShaderModule CreateErrorShaderModule(ShaderModuleDescriptor const * descriptor, char const * errorMessage) const; Texture CreateErrorTexture(TextureDescriptor const * descriptor) const; ExternalTexture CreateExternalTexture(ExternalTextureDescriptor const * externalTextureDescriptor) const; PipelineLayout CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const; @@ -907,6 +1165,7 @@ namespace wgpu { RenderBundleEncoder CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const; RenderPipeline CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const; void CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CreateRenderPipelineAsyncCallback callback, void * userdata) const; + Future CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CreateRenderPipelineAsyncCallbackInfo callbackInfo) const; Sampler CreateSampler(SamplerDescriptor const * descriptor = nullptr) const; ShaderModule CreateShaderModule(ShaderModuleDescriptor const * descriptor) const; SwapChain CreateSwapChain(Surface const& surface, SwapChainDescriptor const * descriptor) const; @@ -915,17 +1174,23 @@ namespace wgpu { size_t EnumerateFeatures(FeatureName * features) const; void ForceLoss(DeviceLostReason type, char const * message) const; Adapter GetAdapter() const; - bool GetLimits(SupportedLimits * limits) const; + Bool GetLimits(SupportedLimits * limits) const; Queue GetQueue() const; - bool HasFeature(FeatureName feature) const; + TextureUsage GetSupportedSurfaceUsage(Surface const& surface) const; + Bool HasFeature(FeatureName feature) const; + SharedBufferMemory ImportSharedBufferMemory(SharedBufferMemoryDescriptor const * descriptor) const; + SharedFence ImportSharedFence(SharedFenceDescriptor const * descriptor) const; + SharedTextureMemory ImportSharedTextureMemory(SharedTextureMemoryDescriptor const * descriptor) const; void InjectError(ErrorType type, char const * message) const; - bool PopErrorScope(ErrorCallback callback, void * userdata) const; + void PopErrorScope(ErrorCallback oldCallback, void * userdata) const; + Future PopErrorScope(PopErrorScopeCallbackInfo callbackInfo) const; void PushErrorScope(ErrorFilter filter) const; void SetDeviceLostCallback(DeviceLostCallback callback, void * userdata) const; void SetLabel(char const * label) const; void SetLoggingCallback(LoggingCallback callback, void * userdata) const; void SetUncapturedErrorCallback(ErrorCallback callback, void * userdata) const; void Tick() const; + void ValidateTextureDescriptor(TextureDescriptor const * descriptor) const; private: friend ObjectBase; @@ -939,6 +1204,8 @@ namespace wgpu { using ObjectBase::operator=; void Destroy() const; + void Expire() const; + void Refresh() const; void SetLabel(char const * label) const; private: @@ -953,7 +1220,12 @@ namespace wgpu { using ObjectBase::operator=; Surface CreateSurface(SurfaceDescriptor const * descriptor) const; + size_t EnumerateWGSLLanguageFeatures(WGSLFeatureName * features) const; + Bool HasWGSLLanguageFeature(WGSLFeatureName feature) const; + void ProcessEvents() const; void RequestAdapter(RequestAdapterOptions const * options, RequestAdapterCallback callback, void * userdata) const; + Future RequestAdapter(RequestAdapterOptions const * options, RequestAdapterCallbackInfo callbackInfo) const; + WaitStatus WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const; private: friend ObjectBase; @@ -997,9 +1269,10 @@ namespace wgpu { void CopyExternalTextureForBrowser(ImageCopyExternalTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; void CopyTextureForBrowser(ImageCopyTexture const * source, ImageCopyTexture const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - void OnSubmittedWorkDone(uint64_t signalValue, QueueWorkDoneCallback callback, void * userdata) const; + void OnSubmittedWorkDone(QueueWorkDoneCallback callback, void * userdata) const; + Future OnSubmittedWorkDone(QueueWorkDoneCallbackInfo callbackInfo) const; void SetLabel(char const * label) const; - void Submit(uint32_t commandCount, CommandBuffer const * commands) const; + void Submit(size_t commandCount, CommandBuffer const * commands) const; void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const; void WriteTexture(ImageCopyTexture const * destination, void const * data, size_t dataSize, TextureDataLayout const * dataLayout, Extent3D const * writeSize) const; @@ -1014,6 +1287,7 @@ namespace wgpu { using ObjectBase::ObjectBase; using ObjectBase::operator=; + void SetLabel(char const * label) const; private: friend ObjectBase; @@ -1034,7 +1308,7 @@ namespace wgpu { void InsertDebugMarker(char const * markerLabel) const; void PopDebugGroup() const; void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; + void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; void SetLabel(char const * label) const; void SetPipeline(RenderPipeline const& pipeline) const; @@ -1058,12 +1332,12 @@ namespace wgpu { void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; void End() const; void EndOcclusionQuery() const; - void EndPass() const; - void ExecuteBundles(uint32_t bundleCount, RenderBundle const * bundles) const; + void ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const; void InsertDebugMarker(char const * markerLabel) const; + void PixelLocalStorageBarrier() const; void PopDebugGroup() const; void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; + void SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; void SetBlendConstant(Color const * color) const; void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = WGPU_WHOLE_SIZE) const; void SetLabel(char const * label) const; @@ -1113,6 +1387,7 @@ namespace wgpu { using ObjectBase::operator=; void GetCompilationInfo(CompilationInfoCallback callback, void * userdata) const; + Future GetCompilationInfo(CompilationInfoCallbackInfo callbackInfo) const; void SetLabel(char const * label) const; private: @@ -1121,11 +1396,61 @@ namespace wgpu { static void WGPURelease(WGPUShaderModule handle); }; + class SharedBufferMemory : public ObjectBase { + public: + using ObjectBase::ObjectBase; + using ObjectBase::operator=; + + Bool BeginAccess(Buffer const& buffer, SharedBufferMemoryBeginAccessDescriptor const * descriptor) const; + Buffer CreateBuffer(BufferDescriptor const * descriptor = nullptr) const; + Bool EndAccess(Buffer const& buffer, SharedBufferMemoryEndAccessState * descriptor) const; + void GetProperties(SharedBufferMemoryProperties * properties) const; + Bool IsDeviceLost() const; + void SetLabel(char const * label) const; + + private: + friend ObjectBase; + static void WGPUReference(WGPUSharedBufferMemory handle); + static void WGPURelease(WGPUSharedBufferMemory handle); + }; + + class SharedFence : public ObjectBase { + public: + using ObjectBase::ObjectBase; + using ObjectBase::operator=; + + void ExportInfo(SharedFenceExportInfo * info) const; + + private: + friend ObjectBase; + static void WGPUReference(WGPUSharedFence handle); + static void WGPURelease(WGPUSharedFence handle); + }; + + class SharedTextureMemory : public ObjectBase { + public: + using ObjectBase::ObjectBase; + using ObjectBase::operator=; + + Bool BeginAccess(Texture const& texture, SharedTextureMemoryBeginAccessDescriptor const * descriptor) const; + Texture CreateTexture(TextureDescriptor const * descriptor = nullptr) const; + Bool EndAccess(Texture const& texture, SharedTextureMemoryEndAccessState * descriptor) const; + void GetProperties(SharedTextureMemoryProperties * properties) const; + Bool IsDeviceLost() const; + void SetLabel(char const * label) const; + + private: + friend ObjectBase; + static void WGPUReference(WGPUSharedTextureMemory handle); + static void WGPURelease(WGPUSharedTextureMemory handle); + }; + class Surface : public ObjectBase { public: using ObjectBase::ObjectBase; using ObjectBase::operator=; + TextureFormat GetPreferredFormat(Adapter const& adapter) const; private: friend ObjectBase; @@ -1138,7 +1463,7 @@ namespace wgpu { using ObjectBase::ObjectBase; using ObjectBase::operator=; - void Configure(TextureFormat format, TextureUsage allowedUsage, uint32_t width, uint32_t height) const; + Texture GetCurrentTexture() const; TextureView GetCurrentTextureView() const; void Present() const; @@ -1153,6 +1478,7 @@ namespace wgpu { using ObjectBase::ObjectBase; using ObjectBase::operator=; + TextureView CreateErrorView(TextureViewDescriptor const * descriptor = nullptr) const; TextureView CreateView(TextureViewDescriptor const * descriptor = nullptr) const; void Destroy() const; uint32_t GetDepthOrArrayLayers() const; @@ -1186,28 +1512,35 @@ namespace wgpu { Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr); + Bool GetInstanceFeatures(InstanceFeatures * features); Proc GetProcAddress(Device device, char const * procName); - struct ChainedStruct { - ChainedStruct const * nextInChain = nullptr; - SType sType = SType::Invalid; - }; - - struct ChainedStructOut { - ChainedStruct * nextInChain = nullptr; - SType sType = SType::Invalid; - }; - struct AdapterProperties { + AdapterProperties() = default; + ~AdapterProperties(); + AdapterProperties(const AdapterProperties&) = delete; + AdapterProperties& operator=(const AdapterProperties&) = delete; + AdapterProperties(AdapterProperties&&); + AdapterProperties& operator=(AdapterProperties&&); ChainedStructOut * nextInChain = nullptr; - uint32_t vendorID; - char const * vendorName; - char const * architecture; - uint32_t deviceID; - char const * name; - char const * driverDescription; - AdapterType adapterType; - BackendType backendType; + uint32_t const vendorID = {}; + char const * const vendorName = nullptr; + char const * const architecture = nullptr; + uint32_t const deviceID = {}; + char const * const name = nullptr; + char const * const driverDescription = nullptr; + AdapterType const adapterType = {}; + BackendType const backendType = {}; + Bool const compatibilityMode = false; + }; + + // Can be chained in AdapterProperties + struct AdapterPropertiesD3D : ChainedStructOut { + AdapterPropertiesD3D() { + sType = SType::AdapterPropertiesD3D; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); + alignas(kFirstMemberAlignment) uint32_t shaderModel; }; struct BindGroupEntry { @@ -1229,7 +1562,7 @@ namespace wgpu { struct BufferBindingLayout { ChainedStruct const * nextInChain = nullptr; BufferBindingType type = BufferBindingType::Undefined; - bool hasDynamicOffset = false; + Bool hasDynamicOffset = false; uint64_t minBindingSize = 0; }; @@ -1238,7 +1571,25 @@ namespace wgpu { char const * label = nullptr; BufferUsage usage; uint64_t size; - bool mappedAtCreation = false; + Bool mappedAtCreation = false; + }; + + // Can be chained in BufferDescriptor + struct BufferHostMappedPointer : ChainedStruct { + BufferHostMappedPointer() { + sType = SType::BufferHostMappedPointer; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * pointer; + Callback disposeCallback; + void * userdata; + }; + + struct BufferMapCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + BufferMapCallback callback; + void * userdata; }; struct Color { @@ -1258,6 +1609,13 @@ namespace wgpu { char const * label = nullptr; }; + struct CompilationInfoCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + CompilationInfoCallback callback; + void * userdata = nullptr; + }; + struct CompilationMessage { ChainedStruct const * nextInChain = nullptr; char const * message = nullptr; @@ -1266,12 +1624,15 @@ namespace wgpu { uint64_t linePos; uint64_t offset; uint64_t length; + uint64_t utf16LinePos; + uint64_t utf16Offset; + uint64_t utf16Length; }; - struct ComputePassTimestampWrite { + struct ComputePassTimestampWrites { QuerySet querySet; - uint32_t queryIndex; - ComputePassTimestampLocation location; + uint32_t beginningOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; + uint32_t endOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; }; struct ConstantEntry { @@ -1282,14 +1643,38 @@ namespace wgpu { struct CopyTextureForBrowserOptions { ChainedStruct const * nextInChain = nullptr; - bool flipY = false; - bool needsColorSpaceConversion = false; + Bool flipY = false; + Bool needsColorSpaceConversion = false; AlphaMode srcAlphaMode = AlphaMode::Unpremultiplied; float const * srcTransferFunctionParameters = nullptr; float const * conversionMatrix = nullptr; float const * dstTransferFunctionParameters = nullptr; AlphaMode dstAlphaMode = AlphaMode::Unpremultiplied; - bool internalUsage = false; + Bool internalUsage = false; + }; + + struct CreateComputePipelineAsyncCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + CreateComputePipelineAsyncCallback callback; + void * userdata; + }; + + struct CreateRenderPipelineAsyncCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + CreateRenderPipelineAsyncCallback callback; + void * userdata; + }; + + // Can be chained in InstanceDescriptor + struct DawnWGSLBlocklist : ChainedStruct { + DawnWGSLBlocklist() { + sType = SType::DawnWGSLBlocklist; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t )); + alignas(kFirstMemberAlignment) size_t blocklistedFeatureCount = 0; + const char* const * blocklistedFeatures; }; // Can be chained in AdapterProperties @@ -1301,6 +1686,15 @@ namespace wgpu { alignas(kFirstMemberAlignment) PowerPreference powerPreference = PowerPreference::Undefined; }; + // Can be chained in BufferDescriptor + struct DawnBufferDescriptorErrorInfoFromWireClient : ChainedStruct { + DawnBufferDescriptorErrorInfoFromWireClient() { + sType = SType::DawnBufferDescriptorErrorInfoFromWireClient; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool outOfMemory = false; + }; + // Can be chained in DeviceDescriptor struct DawnCacheDeviceDescriptor : ChainedStruct { DawnCacheDeviceDescriptor() { @@ -1308,6 +1702,18 @@ namespace wgpu { } static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(char const * )); alignas(kFirstMemberAlignment) char const * isolationKey = ""; + DawnLoadCacheDataFunction loadDataFunction = nullptr; + DawnStoreCacheDataFunction storeDataFunction = nullptr; + void * functionUserdata = nullptr; + }; + + // Can be chained in ComputePipelineDescriptor + struct DawnComputePipelineFullSubgroups : ChainedStruct { + DawnComputePipelineFullSubgroups() { + sType = SType::DawnComputePipelineFullSubgroups; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool requiresFullSubgroups = false; }; // Can be chained in CommandEncoderDescriptor @@ -1315,18 +1721,45 @@ namespace wgpu { DawnEncoderInternalUsageDescriptor() { sType = SType::DawnEncoderInternalUsageDescriptor; } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(bool )); - alignas(kFirstMemberAlignment) bool useInternalUsages = false; + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool useInternalUsages = false; }; - // Can be chained in InstanceDescriptor - struct DawnInstanceDescriptor : ChainedStruct { - DawnInstanceDescriptor() { - sType = SType::DawnInstanceDescriptor; + // Can be chained in SupportedLimits + struct DawnExperimentalSubgroupLimits : ChainedStructOut { + DawnExperimentalSubgroupLimits() { + sType = SType::DawnExperimentalSubgroupLimits; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); + alignas(kFirstMemberAlignment) uint32_t minSubgroupSize = WGPU_LIMIT_U32_UNDEFINED; + uint32_t maxSubgroupSize = WGPU_LIMIT_U32_UNDEFINED; + }; + + // Can be chained in MultisampleState + struct DawnMultisampleStateRenderToSingleSampled : ChainedStruct { + DawnMultisampleStateRenderToSingleSampled() { + sType = SType::DawnMultisampleStateRenderToSingleSampled; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool enabled = false; + }; + + // Can be chained in RenderPassColorAttachment + struct DawnRenderPassColorAttachmentRenderToSingleSampled : ChainedStruct { + DawnRenderPassColorAttachmentRenderToSingleSampled() { + sType = SType::DawnRenderPassColorAttachmentRenderToSingleSampled; } static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); - alignas(kFirstMemberAlignment) uint32_t additionalRuntimeSearchPathsCount = 0; - const char* const * additionalRuntimeSearchPaths; + alignas(kFirstMemberAlignment) uint32_t implicitSampleCount = 1; + }; + + // Can be chained in ShaderModuleDescriptor + struct DawnShaderModuleSPIRVOptionsDescriptor : ChainedStruct { + DawnShaderModuleSPIRVOptionsDescriptor() { + sType = SType::DawnShaderModuleSPIRVOptionsDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool allowNonUniformDerivatives = false; }; // Can be chained in TextureDescriptor @@ -1338,21 +1771,43 @@ namespace wgpu { alignas(kFirstMemberAlignment) TextureUsage internalUsage = TextureUsage::None; }; + // Can be chained in InstanceDescriptor + // Can be chained in RequestAdapterOptions // Can be chained in DeviceDescriptor - struct DawnTogglesDeviceDescriptor : ChainedStruct { - DawnTogglesDeviceDescriptor() { - sType = SType::DawnTogglesDeviceDescriptor; + struct DawnTogglesDescriptor : ChainedStruct { + DawnTogglesDescriptor() { + sType = SType::DawnTogglesDescriptor; } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); - alignas(kFirstMemberAlignment) uint32_t forceEnabledTogglesCount = 0; - const char* const * forceEnabledToggles; - uint32_t forceDisabledTogglesCount = 0; - const char* const * forceDisabledToggles; + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t )); + alignas(kFirstMemberAlignment) size_t enabledToggleCount = 0; + const char* const * enabledToggles; + size_t disabledToggleCount = 0; + const char* const * disabledToggles; + }; + + // Can be chained in InstanceDescriptor + struct DawnWireWGSLControl : ChainedStruct { + DawnWireWGSLControl() { + sType = SType::DawnWireWGSLControl; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool enableExperimental = false; + Bool enableUnsafe = false; + Bool enableTesting = false; + }; + + // Can be chained in DepthStencilState + struct DepthStencilStateDepthWriteDefinedDawn : ChainedStruct { + DepthStencilStateDepthWriteDefinedDawn() { + sType = SType::DepthStencilStateDepthWriteDefinedDawn; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool depthWriteDefined; }; struct Extent2D { - uint32_t width = 0; - uint32_t height = 1; + uint32_t width; + uint32_t height; }; struct Extent3D { @@ -1377,8 +1832,14 @@ namespace wgpu { } }; - struct InstanceDescriptor { + struct Future { + uint64_t id; + }; + + struct InstanceFeatures { ChainedStruct const * nextInChain = nullptr; + Bool timedWaitAnyEnable = false; + size_t timedWaitAnyMaxCount = 0; }; struct Limits { @@ -1387,6 +1848,7 @@ namespace wgpu { uint32_t maxTextureDimension3D = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxTextureArrayLayers = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxBindGroups = WGPU_LIMIT_U32_UNDEFINED; + uint32_t maxBindGroupsPlusVertexBuffers = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxBindingsPerBindGroup = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxDynamicUniformBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxDynamicStorageBuffersPerPipelineLayout = WGPU_LIMIT_U32_UNDEFINED; @@ -1406,6 +1868,7 @@ namespace wgpu { uint32_t maxInterStageShaderComponents = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxInterStageShaderVariables = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxColorAttachments = WGPU_LIMIT_U32_UNDEFINED; + uint32_t maxColorAttachmentBytesPerSample = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxComputeWorkgroupStorageSize = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxComputeInvocationsPerWorkgroup = WGPU_LIMIT_U32_UNDEFINED; uint32_t maxComputeWorkgroupSizeX = WGPU_LIMIT_U32_UNDEFINED; @@ -1414,11 +1877,16 @@ namespace wgpu { uint32_t maxComputeWorkgroupsPerDimension = WGPU_LIMIT_U32_UNDEFINED; }; + struct MemoryHeapInfo { + HeapProperty properties; + uint64_t size; + }; + struct MultisampleState { ChainedStruct const * nextInChain = nullptr; uint32_t count = 1; uint32_t mask = 0xFFFFFFFF; - bool alphaToCoverageEnabled = false; + Bool alphaToCoverageEnabled = false; }; struct Origin2D { @@ -1435,17 +1903,31 @@ namespace wgpu { struct PipelineLayoutDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t bindGroupLayoutCount; + size_t bindGroupLayoutCount; BindGroupLayout const * bindGroupLayouts; }; + struct PipelineLayoutStorageAttachment { + ChainedStruct const * nextInChain = nullptr; + uint64_t offset = 0; + TextureFormat format; + }; + + struct PopErrorScopeCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + PopErrorScopeCallback callback; + ErrorCallback oldCallback; + void * userdata = nullptr; + }; + // Can be chained in PrimitiveState struct PrimitiveDepthClipControl : ChainedStruct { PrimitiveDepthClipControl() { sType = SType::PrimitiveDepthClipControl; } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(bool )); - alignas(kFirstMemberAlignment) bool unclippedDepth = false; + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool unclippedDepth = false; }; struct PrimitiveState { @@ -1461,8 +1943,6 @@ namespace wgpu { char const * label = nullptr; QueryType type; uint32_t count; - PipelineStatisticName const * pipelineStatistics; - uint32_t pipelineStatisticsCount = 0; }; struct QueueDescriptor { @@ -1470,6 +1950,13 @@ namespace wgpu { char const * label = nullptr; }; + struct QueueWorkDoneCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + QueueWorkDoneCallback callback; + void * userdata; + }; + struct RenderBundleDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; @@ -1478,26 +1965,24 @@ namespace wgpu { struct RenderBundleEncoderDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t colorFormatsCount; + size_t colorFormatCount; TextureFormat const * colorFormats; TextureFormat depthStencilFormat = TextureFormat::Undefined; uint32_t sampleCount = 1; - bool depthReadOnly = false; - bool stencilReadOnly = false; + Bool depthReadOnly = false; + Bool stencilReadOnly = false; }; struct RenderPassDepthStencilAttachment { TextureView view; LoadOp depthLoadOp = LoadOp::Undefined; StoreOp depthStoreOp = StoreOp::Undefined; - float clearDepth = NAN; - float depthClearValue = 0; - bool depthReadOnly = false; + float depthClearValue = NAN; + Bool depthReadOnly = false; LoadOp stencilLoadOp = LoadOp::Undefined; StoreOp stencilStoreOp = StoreOp::Undefined; - uint32_t clearStencil = 0; uint32_t stencilClearValue = 0; - bool stencilReadOnly = false; + Bool stencilReadOnly = false; }; // Can be chained in RenderPassDescriptor @@ -1509,17 +1994,33 @@ namespace wgpu { alignas(kFirstMemberAlignment) uint64_t maxDrawCount = 50000000; }; - struct RenderPassTimestampWrite { + struct RenderPassTimestampWrites { QuerySet querySet; - uint32_t queryIndex; - RenderPassTimestampLocation location; + uint32_t beginningOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; + uint32_t endOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED; + }; + + struct RequestAdapterCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + RequestAdapterCallback callback; + void * userdata; }; struct RequestAdapterOptions { ChainedStruct const * nextInChain = nullptr; Surface compatibleSurface = nullptr; PowerPreference powerPreference = PowerPreference::Undefined; - bool forceFallbackAdapter = false; + BackendType backendType = BackendType::Undefined; + Bool forceFallbackAdapter = false; + Bool compatibilityMode = false; + }; + + struct RequestDeviceCallbackInfo { + ChainedStruct const * nextInChain = nullptr; + CallbackMode mode; + RequestDeviceCallback callback; + void * userdata; }; struct SamplerBindingLayout { @@ -1535,18 +2036,13 @@ namespace wgpu { AddressMode addressModeW = AddressMode::ClampToEdge; FilterMode magFilter = FilterMode::Nearest; FilterMode minFilter = FilterMode::Nearest; - FilterMode mipmapFilter = FilterMode::Nearest; + MipmapFilterMode mipmapFilter = MipmapFilterMode::Nearest; float lodMinClamp = 0.0f; - float lodMaxClamp = 1000.0f; + float lodMaxClamp = 32.0f; CompareFunction compare = CompareFunction::Undefined; uint16_t maxAnisotropy = 1; }; - struct ShaderModuleDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - // Can be chained in ShaderModuleDescriptor struct ShaderModuleSPIRVDescriptor : ChainedStruct { ShaderModuleSPIRVDescriptor() { @@ -1563,7 +2059,268 @@ namespace wgpu { sType = SType::ShaderModuleWGSLDescriptor; } static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(char const * )); - alignas(kFirstMemberAlignment) char const * source; + alignas(kFirstMemberAlignment) char const * code; + }; + + struct ShaderModuleDescriptor { + ChainedStruct const * nextInChain = nullptr; + char const * label = nullptr; + }; + + struct SharedBufferMemoryBeginAccessDescriptor { + ChainedStruct const * nextInChain = nullptr; + Bool initialized; + size_t fenceCount; + SharedFence const * fences; + uint64_t const * signaledValues; + }; + + struct SharedBufferMemoryDescriptor { + ChainedStruct const * nextInChain = nullptr; + char const * label = nullptr; + }; + + struct SharedBufferMemoryEndAccessState { + SharedBufferMemoryEndAccessState() = default; + ~SharedBufferMemoryEndAccessState(); + SharedBufferMemoryEndAccessState(const SharedBufferMemoryEndAccessState&) = delete; + SharedBufferMemoryEndAccessState& operator=(const SharedBufferMemoryEndAccessState&) = delete; + SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&&); + SharedBufferMemoryEndAccessState& operator=(SharedBufferMemoryEndAccessState&&); + ChainedStructOut * nextInChain = nullptr; + Bool const initialized = {}; + size_t const fenceCount = {}; + SharedFence const * const fences = {}; + uint64_t const * const signaledValues = {}; + }; + + struct SharedBufferMemoryProperties { + ChainedStructOut * nextInChain = nullptr; + BufferUsage usage; + uint64_t size; + }; + + // Can be chained in SharedFenceDescriptor + struct SharedFenceDXGISharedHandleDescriptor : ChainedStruct { + SharedFenceDXGISharedHandleDescriptor() { + sType = SType::SharedFenceDXGISharedHandleDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * handle; + }; + + // Can be chained in SharedFenceExportInfo + struct SharedFenceDXGISharedHandleExportInfo : ChainedStructOut { + SharedFenceDXGISharedHandleExportInfo() { + sType = SType::SharedFenceDXGISharedHandleExportInfo; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * handle; + }; + + // Can be chained in SharedFenceDescriptor + struct SharedFenceMTLSharedEventDescriptor : ChainedStruct { + SharedFenceMTLSharedEventDescriptor() { + sType = SType::SharedFenceMTLSharedEventDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * sharedEvent; + }; + + // Can be chained in SharedFenceExportInfo + struct SharedFenceMTLSharedEventExportInfo : ChainedStructOut { + SharedFenceMTLSharedEventExportInfo() { + sType = SType::SharedFenceMTLSharedEventExportInfo; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * sharedEvent; + }; + + struct SharedFenceDescriptor { + ChainedStruct const * nextInChain = nullptr; + char const * label = nullptr; + }; + + struct SharedFenceExportInfo { + ChainedStructOut * nextInChain = nullptr; + SharedFenceType type; + }; + + // Can be chained in SharedFenceDescriptor + struct SharedFenceVkSemaphoreOpaqueFDDescriptor : ChainedStruct { + SharedFenceVkSemaphoreOpaqueFDDescriptor() { + sType = SType::SharedFenceVkSemaphoreOpaqueFDDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int )); + alignas(kFirstMemberAlignment) int handle; + }; + + // Can be chained in SharedFenceExportInfo + struct SharedFenceVkSemaphoreOpaqueFDExportInfo : ChainedStructOut { + SharedFenceVkSemaphoreOpaqueFDExportInfo() { + sType = SType::SharedFenceVkSemaphoreOpaqueFDExportInfo; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int )); + alignas(kFirstMemberAlignment) int handle; + }; + + // Can be chained in SharedFenceDescriptor + struct SharedFenceVkSemaphoreSyncFDDescriptor : ChainedStruct { + SharedFenceVkSemaphoreSyncFDDescriptor() { + sType = SType::SharedFenceVkSemaphoreSyncFDDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int )); + alignas(kFirstMemberAlignment) int handle; + }; + + // Can be chained in SharedFenceExportInfo + struct SharedFenceVkSemaphoreSyncFDExportInfo : ChainedStructOut { + SharedFenceVkSemaphoreSyncFDExportInfo() { + sType = SType::SharedFenceVkSemaphoreSyncFDExportInfo; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int )); + alignas(kFirstMemberAlignment) int handle; + }; + + // Can be chained in SharedFenceDescriptor + struct SharedFenceVkSemaphoreZirconHandleDescriptor : ChainedStruct { + SharedFenceVkSemaphoreZirconHandleDescriptor() { + sType = SType::SharedFenceVkSemaphoreZirconHandleDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); + alignas(kFirstMemberAlignment) uint32_t handle; + }; + + // Can be chained in SharedFenceExportInfo + struct SharedFenceVkSemaphoreZirconHandleExportInfo : ChainedStructOut { + SharedFenceVkSemaphoreZirconHandleExportInfo() { + sType = SType::SharedFenceVkSemaphoreZirconHandleExportInfo; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); + alignas(kFirstMemberAlignment) uint32_t handle; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryDXGISharedHandleDescriptor : ChainedStruct { + SharedTextureMemoryDXGISharedHandleDescriptor() { + sType = SType::SharedTextureMemoryDXGISharedHandleDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * handle; + Bool useKeyedMutex; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryEGLImageDescriptor : ChainedStruct { + SharedTextureMemoryEGLImageDescriptor() { + sType = SType::SharedTextureMemoryEGLImageDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * image; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryIOSurfaceDescriptor : ChainedStruct { + SharedTextureMemoryIOSurfaceDescriptor() { + sType = SType::SharedTextureMemoryIOSurfaceDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * ioSurface; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryAHardwareBufferDescriptor : ChainedStruct { + SharedTextureMemoryAHardwareBufferDescriptor() { + sType = SType::SharedTextureMemoryAHardwareBufferDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * handle; + }; + + struct SharedTextureMemoryBeginAccessDescriptor { + ChainedStruct const * nextInChain = nullptr; + Bool concurrentRead; + Bool initialized; + size_t fenceCount; + SharedFence const * fences; + uint64_t const * signaledValues; + }; + + struct SharedTextureMemoryDescriptor { + ChainedStruct const * nextInChain = nullptr; + char const * label = nullptr; + }; + + struct SharedTextureMemoryDmaBufPlane { + int fd; + uint64_t offset; + uint32_t stride; + }; + + struct SharedTextureMemoryEndAccessState { + SharedTextureMemoryEndAccessState() = default; + ~SharedTextureMemoryEndAccessState(); + SharedTextureMemoryEndAccessState(const SharedTextureMemoryEndAccessState&) = delete; + SharedTextureMemoryEndAccessState& operator=(const SharedTextureMemoryEndAccessState&) = delete; + SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&&); + SharedTextureMemoryEndAccessState& operator=(SharedTextureMemoryEndAccessState&&); + ChainedStructOut * nextInChain = nullptr; + Bool const initialized = {}; + size_t const fenceCount = {}; + SharedFence const * const fences = {}; + uint64_t const * const signaledValues = {}; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryOpaqueFDDescriptor : ChainedStruct { + SharedTextureMemoryOpaqueFDDescriptor() { + sType = SType::SharedTextureMemoryOpaqueFDDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void const * )); + alignas(kFirstMemberAlignment) void const * vkImageCreateInfo; + int memoryFD; + uint32_t memoryTypeIndex; + uint64_t allocationSize; + Bool dedicatedAllocation; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryVkDedicatedAllocationDescriptor : ChainedStruct { + SharedTextureMemoryVkDedicatedAllocationDescriptor() { + sType = SType::SharedTextureMemoryVkDedicatedAllocationDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool )); + alignas(kFirstMemberAlignment) Bool dedicatedAllocation; + }; + + // Can be chained in SharedTextureMemoryBeginAccessDescriptor + struct SharedTextureMemoryVkImageLayoutBeginState : ChainedStruct { + SharedTextureMemoryVkImageLayoutBeginState() { + sType = SType::SharedTextureMemoryVkImageLayoutBeginState; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int32_t )); + alignas(kFirstMemberAlignment) int32_t oldLayout; + int32_t newLayout; + }; + + // Can be chained in SharedTextureMemoryEndAccessState + struct SharedTextureMemoryVkImageLayoutEndState : ChainedStructOut { + SharedTextureMemoryVkImageLayoutEndState() { + sType = SType::SharedTextureMemoryVkImageLayoutEndState; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int32_t )); + alignas(kFirstMemberAlignment) int32_t oldLayout; + int32_t newLayout; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryZirconHandleDescriptor : ChainedStruct { + SharedTextureMemoryZirconHandleDescriptor() { + sType = SType::SharedTextureMemoryZirconHandleDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t )); + alignas(kFirstMemberAlignment) uint32_t memoryFD; + uint64_t allocationSize; }; struct StencilFaceState { @@ -1577,7 +2334,7 @@ namespace wgpu { ChainedStruct const * nextInChain = nullptr; StorageTextureAccess access = StorageTextureAccess::Undefined; TextureFormat format = TextureFormat::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; + TextureViewDimension viewDimension = TextureViewDimension::e2D; }; struct SurfaceDescriptor { @@ -1622,15 +2379,6 @@ namespace wgpu { void * surface; }; - // Can be chained in SurfaceDescriptor - struct SurfaceDescriptorFromWindowsCoreWindow : ChainedStruct { - SurfaceDescriptorFromWindowsCoreWindow() { - sType = SType::SurfaceDescriptorFromWindowsCoreWindow; - } - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); - alignas(kFirstMemberAlignment) void * coreWindow; - }; - // Can be chained in SurfaceDescriptor struct SurfaceDescriptorFromWindowsHWND : ChainedStruct { SurfaceDescriptorFromWindowsHWND() { @@ -1641,6 +2389,15 @@ namespace wgpu { void * hwnd; }; + // Can be chained in SurfaceDescriptor + struct SurfaceDescriptorFromWindowsCoreWindow : ChainedStruct { + SurfaceDescriptorFromWindowsCoreWindow() { + sType = SType::SurfaceDescriptorFromWindowsCoreWindow; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); + alignas(kFirstMemberAlignment) void * coreWindow; + }; + // Can be chained in SurfaceDescriptor struct SurfaceDescriptorFromWindowsSwapChainPanel : ChainedStruct { SurfaceDescriptorFromWindowsSwapChainPanel() { @@ -1657,7 +2414,7 @@ namespace wgpu { } static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void * )); alignas(kFirstMemberAlignment) void * display; - uint32_t window; + uint64_t window; }; struct SwapChainDescriptor { @@ -1668,14 +2425,22 @@ namespace wgpu { uint32_t width; uint32_t height; PresentMode presentMode; - uint64_t implementation = 0; }; struct TextureBindingLayout { ChainedStruct const * nextInChain = nullptr; TextureSampleType sampleType = TextureSampleType::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - bool multisampled = false; + TextureViewDimension viewDimension = TextureViewDimension::e2D; + Bool multisampled = false; + }; + + // Can be chained in TextureDescriptor + struct TextureBindingViewDimensionDescriptor : ChainedStruct { + TextureBindingViewDimensionDescriptor() { + sType = SType::TextureBindingViewDimensionDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension )); + alignas(kFirstMemberAlignment) TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; }; struct TextureDataLayout { @@ -1703,11 +2468,26 @@ namespace wgpu { uint32_t shaderLocation; }; + // Can be chained in AdapterProperties + struct AdapterPropertiesMemoryHeaps : ChainedStructOut { + AdapterPropertiesMemoryHeaps() { + sType = SType::AdapterPropertiesMemoryHeaps; + } + ~AdapterPropertiesMemoryHeaps(); + AdapterPropertiesMemoryHeaps(const AdapterPropertiesMemoryHeaps&) = delete; + AdapterPropertiesMemoryHeaps& operator=(const AdapterPropertiesMemoryHeaps&) = delete; + AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&&); + AdapterPropertiesMemoryHeaps& operator=(AdapterPropertiesMemoryHeaps&&); + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t )); + alignas(kFirstMemberAlignment) size_t const heapCount = {}; + MemoryHeapInfo const * const heapInfo = {}; + }; + struct BindGroupDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; BindGroupLayout layout; - uint32_t entryCount; + size_t entryCount; BindGroupEntry const * entries; }; @@ -1728,22 +2508,21 @@ namespace wgpu { struct CompilationInfo { ChainedStruct const * nextInChain = nullptr; - uint32_t messageCount; + size_t messageCount; CompilationMessage const * messages; }; struct ComputePassDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t timestampWriteCount = 0; - ComputePassTimestampWrite const * timestampWrites; + ComputePassTimestampWrites const * timestampWrites = nullptr; }; struct DepthStencilState { ChainedStruct const * nextInChain = nullptr; TextureFormat format; - bool depthWriteEnabled = false; - CompareFunction depthCompare = CompareFunction::Always; + Bool depthWriteEnabled = false; + CompareFunction depthCompare = CompareFunction::Undefined; StencilFaceState stencilFront; StencilFaceState stencilBack; uint32_t stencilReadMask = 0xFFFFFFFF; @@ -1760,11 +2539,19 @@ namespace wgpu { TextureView plane1 = nullptr; Origin2D visibleOrigin; Extent2D visibleSize; - bool doYuvToRgbConversionOnly = false; + Bool doYuvToRgbConversionOnly = false; float const * yuvToRgbConversionMatrix = nullptr; float const * srcTransferFunctionParameters; float const * dstTransferFunctionParameters; float const * gamutConversionMatrix; + Bool flipY = false; + Bool mirrored = false; + ExternalTextureRotation rotation = ExternalTextureRotation::Rotate0Degrees; + }; + + struct FutureWaitInfo { + Future future; + Bool completed = false; }; struct ImageCopyBuffer { @@ -1777,6 +2564,7 @@ namespace wgpu { ChainedStruct const * nextInChain = nullptr; ExternalTexture externalTexture; Origin3D origin; + Extent2D naturalSize; }; struct ImageCopyTexture { @@ -1787,20 +2575,46 @@ namespace wgpu { TextureAspect aspect = TextureAspect::All; }; + struct InstanceDescriptor { + ChainedStruct const * nextInChain = nullptr; + InstanceFeatures features; + }; + + // Can be chained in PipelineLayoutDescriptor + struct PipelineLayoutPixelLocalStorage : ChainedStruct { + PipelineLayoutPixelLocalStorage() { + sType = SType::PipelineLayoutPixelLocalStorage; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t )); + alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; + size_t storageAttachmentCount = 0; + PipelineLayoutStorageAttachment const * storageAttachments; + }; + struct ProgrammableStageDescriptor { ChainedStruct const * nextInChain = nullptr; ShaderModule module; - char const * entryPoint; - uint32_t constantCount = 0; + char const * entryPoint = nullptr; + size_t constantCount = 0; ConstantEntry const * constants; }; struct RenderPassColorAttachment { + ChainedStruct const * nextInChain = nullptr; TextureView view = nullptr; + uint32_t depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; TextureView resolveTarget = nullptr; LoadOp loadOp; StoreOp storeOp; - Color clearColor = { NAN, NAN, NAN, NAN }; + Color clearValue; + }; + + struct RenderPassStorageAttachment { + ChainedStruct const * nextInChain = nullptr; + uint64_t offset = 0; + TextureView storage; + LoadOp loadOp; + StoreOp storeOp; Color clearValue; }; @@ -1809,6 +2623,37 @@ namespace wgpu { Limits limits; }; + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryDmaBufDescriptor : ChainedStruct { + SharedTextureMemoryDmaBufDescriptor() { + sType = SType::SharedTextureMemoryDmaBufDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Extent3D )); + alignas(kFirstMemberAlignment) Extent3D size; + uint32_t drmFormat; + uint64_t drmModifier; + size_t planeCount; + SharedTextureMemoryDmaBufPlane const * planes; + }; + + struct SharedTextureMemoryProperties { + ChainedStructOut * nextInChain = nullptr; + TextureUsage usage; + Extent3D size; + TextureFormat format; + }; + + // Can be chained in SharedTextureMemoryDescriptor + struct SharedTextureMemoryVkImageDescriptor : ChainedStruct { + SharedTextureMemoryVkImageDescriptor() { + sType = SType::SharedTextureMemoryVkImageDescriptor; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int32_t )); + alignas(kFirstMemberAlignment) int32_t vkFormat; + int32_t vkUsageFlags; + Extent3D vkExtent3D; + }; + struct SupportedLimits { ChainedStructOut * nextInChain = nullptr; Limits limits; @@ -1823,21 +2668,21 @@ namespace wgpu { TextureFormat format; uint32_t mipLevelCount = 1; uint32_t sampleCount = 1; - uint32_t viewFormatCount = 0; + size_t viewFormatCount = 0; TextureFormat const * viewFormats; }; struct VertexBufferLayout { uint64_t arrayStride; VertexStepMode stepMode = VertexStepMode::Vertex; - uint32_t attributeCount; + size_t attributeCount; VertexAttribute const * attributes; }; struct BindGroupLayoutDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t entryCount; + size_t entryCount; BindGroupLayoutEntry const * entries; }; @@ -1858,40 +2703,52 @@ namespace wgpu { struct DeviceDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t requiredFeaturesCount = 0; + size_t requiredFeatureCount = 0; FeatureName const * requiredFeatures = nullptr; RequiredLimits const * requiredLimits = nullptr; QueueDescriptor defaultQueue; + DeviceLostCallback deviceLostCallback = nullptr; + void * deviceLostUserdata = nullptr; }; struct RenderPassDescriptor { ChainedStruct const * nextInChain = nullptr; char const * label = nullptr; - uint32_t colorAttachmentCount; + size_t colorAttachmentCount; RenderPassColorAttachment const * colorAttachments; RenderPassDepthStencilAttachment const * depthStencilAttachment = nullptr; QuerySet occlusionQuerySet = nullptr; - uint32_t timestampWriteCount = 0; - RenderPassTimestampWrite const * timestampWrites; + RenderPassTimestampWrites const * timestampWrites = nullptr; + }; + + // Can be chained in RenderPassDescriptor + struct RenderPassPixelLocalStorage : ChainedStruct { + RenderPassPixelLocalStorage() { + sType = SType::RenderPassPixelLocalStorage; + } + static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t )); + alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; + size_t storageAttachmentCount = 0; + RenderPassStorageAttachment const * storageAttachments; }; struct VertexState { ChainedStruct const * nextInChain = nullptr; ShaderModule module; - char const * entryPoint; - uint32_t constantCount = 0; + char const * entryPoint = nullptr; + size_t constantCount = 0; ConstantEntry const * constants; - uint32_t bufferCount = 0; + size_t bufferCount = 0; VertexBufferLayout const * buffers; }; struct FragmentState { ChainedStruct const * nextInChain = nullptr; ShaderModule module; - char const * entryPoint; - uint32_t constantCount = 0; + char const * entryPoint = nullptr; + size_t constantCount = 0; ConstantEntry const * constants; - uint32_t targetCount; + size_t targetCount; ColorTargetState const * targets; }; @@ -1906,38 +2763,50 @@ namespace wgpu { FragmentState const * fragment = nullptr; }; - - // The operators of EnumClassBitmmasks in the dawn:: namespace need to be imported - // in the wgpu namespace for Argument Dependent Lookup. - DAWN_IMPORT_BITMASK_OPERATORS } // namespace wgpu -namespace dawn { +namespace wgpu { template<> - struct IsDawnBitmask { + struct IsWGPUBitmask { static constexpr bool enable = true; }; template<> - struct IsDawnBitmask { + struct IsWGPUBitmask { static constexpr bool enable = true; }; template<> - struct IsDawnBitmask { + struct IsWGPUBitmask { static constexpr bool enable = true; }; template<> - struct IsDawnBitmask { + struct IsWGPUBitmask { static constexpr bool enable = true; }; template<> - struct IsDawnBitmask { + struct IsWGPUBitmask { static constexpr bool enable = true; }; -} // namespace dawn + template<> + struct IsWGPUBitmask { + static constexpr bool enable = true; + }; + +} // namespace wgpu + +namespace std { +// Custom boolean class needs corresponding hash function so that it appears as a transparent bool. +template <> +struct hash { + public: + size_t operator()(const wgpu::Bool &v) const { + return hash()(v); + } +}; +} // namespace std #endif // WEBGPU_CPP_H_ diff --git a/lib/dawn/inc/dawn/webgpu_cpp_print.h b/lib/dawn/inc/dawn/webgpu_cpp_print.h index 55fac56..127b4a4 100644 --- a/lib/dawn/inc/dawn/webgpu_cpp_print.h +++ b/lib/dawn/inc/dawn/webgpu_cpp_print.h @@ -11,6 +11,44 @@ namespace wgpu { + template + std::basic_ostream& operator<<(std::basic_ostream& o, WGSLFeatureName value) { + switch (value) { + case WGSLFeatureName::Undefined: + o << "WGSLFeatureName::Undefined"; + break; + case WGSLFeatureName::ReadonlyAndReadwriteStorageTextures: + o << "WGSLFeatureName::ReadonlyAndReadwriteStorageTextures"; + break; + case WGSLFeatureName::Packed4x8IntegerDotProduct: + o << "WGSLFeatureName::Packed4x8IntegerDotProduct"; + break; + case WGSLFeatureName::UnrestrictedPointerParameters: + o << "WGSLFeatureName::UnrestrictedPointerParameters"; + break; + case WGSLFeatureName::PointerCompositeAccess: + o << "WGSLFeatureName::PointerCompositeAccess"; + break; + case WGSLFeatureName::ChromiumTestingUnimplemented: + o << "WGSLFeatureName::ChromiumTestingUnimplemented"; + break; + case WGSLFeatureName::ChromiumTestingUnsafeExperimental: + o << "WGSLFeatureName::ChromiumTestingUnsafeExperimental"; + break; + case WGSLFeatureName::ChromiumTestingExperimental: + o << "WGSLFeatureName::ChromiumTestingExperimental"; + break; + case WGSLFeatureName::ChromiumTestingShippedWithKillswitch: + o << "WGSLFeatureName::ChromiumTestingShippedWithKillswitch"; + break; + case WGSLFeatureName::ChromiumTestingShipped: + o << "WGSLFeatureName::ChromiumTestingShipped"; + break; + default: + o << "WGSLFeatureName::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } template std::basic_ostream& operator<<(std::basic_ostream& o, AdapterType value) { switch (value) { @@ -34,14 +72,17 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, AddressMode value) { switch (value) { + case AddressMode::Undefined: + o << "AddressMode::Undefined"; + break; + case AddressMode::ClampToEdge: + o << "AddressMode::ClampToEdge"; + break; case AddressMode::Repeat: o << "AddressMode::Repeat"; break; case AddressMode::MirrorRepeat: o << "AddressMode::MirrorRepeat"; - break; - case AddressMode::ClampToEdge: - o << "AddressMode::ClampToEdge"; break; default: o << "AddressMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -51,14 +92,14 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, AlphaMode value) { switch (value) { + case AlphaMode::Opaque: + o << "AlphaMode::Opaque"; + break; case AlphaMode::Premultiplied: o << "AlphaMode::Premultiplied"; break; case AlphaMode::Unpremultiplied: o << "AlphaMode::Unpremultiplied"; - break; - case AlphaMode::Opaque: - o << "AlphaMode::Opaque"; break; default: o << "AlphaMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -68,6 +109,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, BackendType value) { switch (value) { + case BackendType::Undefined: + o << "BackendType::Undefined"; + break; case BackendType::Null: o << "BackendType::Null"; break; @@ -100,6 +144,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, BlendFactor value) { switch (value) { + case BlendFactor::Undefined: + o << "BlendFactor::Undefined"; + break; case BlendFactor::Zero: o << "BlendFactor::Zero"; break; @@ -138,6 +185,18 @@ namespace wgpu { break; case BlendFactor::OneMinusConstant: o << "BlendFactor::OneMinusConstant"; + break; + case BlendFactor::Src1: + o << "BlendFactor::Src1"; + break; + case BlendFactor::OneMinusSrc1: + o << "BlendFactor::OneMinusSrc1"; + break; + case BlendFactor::Src1Alpha: + o << "BlendFactor::Src1Alpha"; + break; + case BlendFactor::OneMinusSrc1Alpha: + o << "BlendFactor::OneMinusSrc1Alpha"; break; default: o << "BlendFactor::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -147,6 +206,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, BlendOperation value) { switch (value) { + case BlendOperation::Undefined: + o << "BlendOperation::Undefined"; + break; case BlendOperation::Add: o << "BlendOperation::Add"; break; @@ -193,8 +255,11 @@ namespace wgpu { case BufferMapAsyncStatus::Success: o << "BufferMapAsyncStatus::Success"; break; - case BufferMapAsyncStatus::Error: - o << "BufferMapAsyncStatus::Error"; + case BufferMapAsyncStatus::InstanceDropped: + o << "BufferMapAsyncStatus::InstanceDropped"; + break; + case BufferMapAsyncStatus::ValidationError: + o << "BufferMapAsyncStatus::ValidationError"; break; case BufferMapAsyncStatus::Unknown: o << "BufferMapAsyncStatus::Unknown"; @@ -207,6 +272,15 @@ namespace wgpu { break; case BufferMapAsyncStatus::UnmappedBeforeCallback: o << "BufferMapAsyncStatus::UnmappedBeforeCallback"; + break; + case BufferMapAsyncStatus::MappingAlreadyPending: + o << "BufferMapAsyncStatus::MappingAlreadyPending"; + break; + case BufferMapAsyncStatus::OffsetOutOfRange: + o << "BufferMapAsyncStatus::OffsetOutOfRange"; + break; + case BufferMapAsyncStatus::SizeOutOfRange: + o << "BufferMapAsyncStatus::SizeOutOfRange"; break; default: o << "BufferMapAsyncStatus::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -214,6 +288,40 @@ namespace wgpu { return o; } template + std::basic_ostream& operator<<(std::basic_ostream& o, BufferMapState value) { + switch (value) { + case BufferMapState::Unmapped: + o << "BufferMapState::Unmapped"; + break; + case BufferMapState::Pending: + o << "BufferMapState::Pending"; + break; + case BufferMapState::Mapped: + o << "BufferMapState::Mapped"; + break; + default: + o << "BufferMapState::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } + template + std::basic_ostream& operator<<(std::basic_ostream& o, CallbackMode value) { + switch (value) { + case CallbackMode::WaitAnyOnly: + o << "CallbackMode::WaitAnyOnly"; + break; + case CallbackMode::AllowProcessEvents: + o << "CallbackMode::AllowProcessEvents"; + break; + case CallbackMode::AllowSpontaneous: + o << "CallbackMode::AllowSpontaneous"; + break; + default: + o << "CallbackMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } + template std::basic_ostream& operator<<(std::basic_ostream& o, CompareFunction value) { switch (value) { case CompareFunction::Undefined: @@ -225,21 +333,21 @@ namespace wgpu { case CompareFunction::Less: o << "CompareFunction::Less"; break; + case CompareFunction::Equal: + o << "CompareFunction::Equal"; + break; case CompareFunction::LessEqual: o << "CompareFunction::LessEqual"; break; case CompareFunction::Greater: o << "CompareFunction::Greater"; break; - case CompareFunction::GreaterEqual: - o << "CompareFunction::GreaterEqual"; - break; - case CompareFunction::Equal: - o << "CompareFunction::Equal"; - break; case CompareFunction::NotEqual: o << "CompareFunction::NotEqual"; break; + case CompareFunction::GreaterEqual: + o << "CompareFunction::GreaterEqual"; + break; case CompareFunction::Always: o << "CompareFunction::Always"; break; @@ -254,6 +362,9 @@ namespace wgpu { case CompilationInfoRequestStatus::Success: o << "CompilationInfoRequestStatus::Success"; break; + case CompilationInfoRequestStatus::InstanceDropped: + o << "CompilationInfoRequestStatus::InstanceDropped"; + break; case CompilationInfoRequestStatus::Error: o << "CompilationInfoRequestStatus::Error"; break; @@ -286,27 +397,19 @@ namespace wgpu { return o; } template - std::basic_ostream& operator<<(std::basic_ostream& o, ComputePassTimestampLocation value) { - switch (value) { - case ComputePassTimestampLocation::Beginning: - o << "ComputePassTimestampLocation::Beginning"; - break; - case ComputePassTimestampLocation::End: - o << "ComputePassTimestampLocation::End"; - break; - default: - o << "ComputePassTimestampLocation::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); - } - return o; - } - template std::basic_ostream& operator<<(std::basic_ostream& o, CreatePipelineAsyncStatus value) { switch (value) { case CreatePipelineAsyncStatus::Success: o << "CreatePipelineAsyncStatus::Success"; break; - case CreatePipelineAsyncStatus::Error: - o << "CreatePipelineAsyncStatus::Error"; + case CreatePipelineAsyncStatus::InstanceDropped: + o << "CreatePipelineAsyncStatus::InstanceDropped"; + break; + case CreatePipelineAsyncStatus::ValidationError: + o << "CreatePipelineAsyncStatus::ValidationError"; + break; + case CreatePipelineAsyncStatus::InternalError: + o << "CreatePipelineAsyncStatus::InternalError"; break; case CreatePipelineAsyncStatus::DeviceLost: o << "CreatePipelineAsyncStatus::DeviceLost"; @@ -325,6 +428,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, CullMode value) { switch (value) { + case CullMode::Undefined: + o << "CullMode::Undefined"; + break; case CullMode::None: o << "CullMode::None"; break; @@ -397,6 +503,26 @@ namespace wgpu { return o; } template + std::basic_ostream& operator<<(std::basic_ostream& o, ExternalTextureRotation value) { + switch (value) { + case ExternalTextureRotation::Rotate0Degrees: + o << "ExternalTextureRotation::Rotate0Degrees"; + break; + case ExternalTextureRotation::Rotate90Degrees: + o << "ExternalTextureRotation::Rotate90Degrees"; + break; + case ExternalTextureRotation::Rotate180Degrees: + o << "ExternalTextureRotation::Rotate180Degrees"; + break; + case ExternalTextureRotation::Rotate270Degrees: + o << "ExternalTextureRotation::Rotate270Degrees"; + break; + default: + o << "ExternalTextureRotation::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } + template std::basic_ostream& operator<<(std::basic_ostream& o, FeatureName value) { switch (value) { case FeatureName::Undefined: @@ -411,9 +537,6 @@ namespace wgpu { case FeatureName::TimestampQuery: o << "FeatureName::TimestampQuery"; break; - case FeatureName::PipelineStatisticsQuery: - o << "FeatureName::PipelineStatisticsQuery"; - break; case FeatureName::TextureCompressionBC: o << "FeatureName::TextureCompressionBC"; break; @@ -432,8 +555,11 @@ namespace wgpu { case FeatureName::RG11B10UfloatRenderable: o << "FeatureName::RG11B10UfloatRenderable"; break; - case FeatureName::DawnShaderFloat16: - o << "FeatureName::DawnShaderFloat16"; + case FeatureName::BGRA8UnormStorage: + o << "FeatureName::BGRA8UnormStorage"; + break; + case FeatureName::Float32Filterable: + o << "FeatureName::Float32Filterable"; break; case FeatureName::DawnInternalUsages: o << "FeatureName::DawnInternalUsages"; @@ -444,11 +570,119 @@ namespace wgpu { case FeatureName::DawnNative: o << "FeatureName::DawnNative"; break; - case FeatureName::ChromiumExperimentalDp4a: - o << "FeatureName::ChromiumExperimentalDp4a"; + case FeatureName::ChromiumExperimentalTimestampQueryInsidePasses: + o << "FeatureName::ChromiumExperimentalTimestampQueryInsidePasses"; + break; + case FeatureName::ImplicitDeviceSynchronization: + o << "FeatureName::ImplicitDeviceSynchronization"; + break; + case FeatureName::SurfaceCapabilities: + o << "FeatureName::SurfaceCapabilities"; + break; + case FeatureName::TransientAttachments: + o << "FeatureName::TransientAttachments"; + break; + case FeatureName::MSAARenderToSingleSampled: + o << "FeatureName::MSAARenderToSingleSampled"; + break; + case FeatureName::DualSourceBlending: + o << "FeatureName::DualSourceBlending"; + break; + case FeatureName::D3D11MultithreadProtected: + o << "FeatureName::D3D11MultithreadProtected"; + break; + case FeatureName::ANGLETextureSharing: + o << "FeatureName::ANGLETextureSharing"; + break; + case FeatureName::ChromiumExperimentalSubgroups: + o << "FeatureName::ChromiumExperimentalSubgroups"; + break; + case FeatureName::ChromiumExperimentalSubgroupUniformControlFlow: + o << "FeatureName::ChromiumExperimentalSubgroupUniformControlFlow"; + break; + case FeatureName::PixelLocalStorageCoherent: + o << "FeatureName::PixelLocalStorageCoherent"; + break; + case FeatureName::PixelLocalStorageNonCoherent: + o << "FeatureName::PixelLocalStorageNonCoherent"; + break; + case FeatureName::Norm16TextureFormats: + o << "FeatureName::Norm16TextureFormats"; + break; + case FeatureName::MultiPlanarFormatExtendedUsages: + o << "FeatureName::MultiPlanarFormatExtendedUsages"; + break; + case FeatureName::MultiPlanarFormatP010: + o << "FeatureName::MultiPlanarFormatP010"; + break; + case FeatureName::HostMappedPointer: + o << "FeatureName::HostMappedPointer"; + break; + case FeatureName::MultiPlanarRenderTargets: + o << "FeatureName::MultiPlanarRenderTargets"; + break; + case FeatureName::MultiPlanarFormatNv12a: + o << "FeatureName::MultiPlanarFormatNv12a"; + break; + case FeatureName::FramebufferFetch: + o << "FeatureName::FramebufferFetch"; + break; + case FeatureName::BufferMapExtendedUsages: + o << "FeatureName::BufferMapExtendedUsages"; + break; + case FeatureName::AdapterPropertiesMemoryHeaps: + o << "FeatureName::AdapterPropertiesMemoryHeaps"; + break; + case FeatureName::AdapterPropertiesD3D: + o << "FeatureName::AdapterPropertiesD3D"; + break; + case FeatureName::R8UnormStorage: + o << "FeatureName::R8UnormStorage"; + break; + case FeatureName::SharedTextureMemoryVkDedicatedAllocation: + o << "FeatureName::SharedTextureMemoryVkDedicatedAllocation"; + break; + case FeatureName::SharedTextureMemoryAHardwareBuffer: + o << "FeatureName::SharedTextureMemoryAHardwareBuffer"; break; - case FeatureName::TimestampQueryInsidePasses: - o << "FeatureName::TimestampQueryInsidePasses"; + case FeatureName::SharedTextureMemoryDmaBuf: + o << "FeatureName::SharedTextureMemoryDmaBuf"; + break; + case FeatureName::SharedTextureMemoryOpaqueFD: + o << "FeatureName::SharedTextureMemoryOpaqueFD"; + break; + case FeatureName::SharedTextureMemoryZirconHandle: + o << "FeatureName::SharedTextureMemoryZirconHandle"; + break; + case FeatureName::SharedTextureMemoryDXGISharedHandle: + o << "FeatureName::SharedTextureMemoryDXGISharedHandle"; + break; + case FeatureName::SharedTextureMemoryD3D11Texture2D: + o << "FeatureName::SharedTextureMemoryD3D11Texture2D"; + break; + case FeatureName::SharedTextureMemoryIOSurface: + o << "FeatureName::SharedTextureMemoryIOSurface"; + break; + case FeatureName::SharedTextureMemoryEGLImage: + o << "FeatureName::SharedTextureMemoryEGLImage"; + break; + case FeatureName::SharedFenceVkSemaphoreOpaqueFD: + o << "FeatureName::SharedFenceVkSemaphoreOpaqueFD"; + break; + case FeatureName::SharedFenceVkSemaphoreSyncFD: + o << "FeatureName::SharedFenceVkSemaphoreSyncFD"; + break; + case FeatureName::SharedFenceVkSemaphoreZirconHandle: + o << "FeatureName::SharedFenceVkSemaphoreZirconHandle"; + break; + case FeatureName::SharedFenceDXGISharedHandle: + o << "FeatureName::SharedFenceDXGISharedHandle"; + break; + case FeatureName::SharedFenceMTLSharedEvent: + o << "FeatureName::SharedFenceMTLSharedEvent"; + break; + case FeatureName::SharedBufferMemoryD3D12Resource: + o << "FeatureName::SharedBufferMemoryD3D12Resource"; break; default: o << "FeatureName::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -458,6 +692,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, FilterMode value) { switch (value) { + case FilterMode::Undefined: + o << "FilterMode::Undefined"; + break; case FilterMode::Nearest: o << "FilterMode::Nearest"; break; @@ -472,6 +709,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, FrontFace value) { switch (value) { + case FrontFace::Undefined: + o << "FrontFace::Undefined"; + break; case FrontFace::CCW: o << "FrontFace::CCW"; break; @@ -538,25 +778,33 @@ namespace wgpu { return o; } template - std::basic_ostream& operator<<(std::basic_ostream& o, PipelineStatisticName value) { + std::basic_ostream& operator<<(std::basic_ostream& o, MipmapFilterMode value) { switch (value) { - case PipelineStatisticName::VertexShaderInvocations: - o << "PipelineStatisticName::VertexShaderInvocations"; + case MipmapFilterMode::Undefined: + o << "MipmapFilterMode::Undefined"; break; - case PipelineStatisticName::ClipperInvocations: - o << "PipelineStatisticName::ClipperInvocations"; + case MipmapFilterMode::Nearest: + o << "MipmapFilterMode::Nearest"; break; - case PipelineStatisticName::ClipperPrimitivesOut: - o << "PipelineStatisticName::ClipperPrimitivesOut"; + case MipmapFilterMode::Linear: + o << "MipmapFilterMode::Linear"; break; - case PipelineStatisticName::FragmentShaderInvocations: - o << "PipelineStatisticName::FragmentShaderInvocations"; + default: + o << "MipmapFilterMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } + template + std::basic_ostream& operator<<(std::basic_ostream& o, PopErrorScopeStatus value) { + switch (value) { + case PopErrorScopeStatus::Success: + o << "PopErrorScopeStatus::Success"; break; - case PipelineStatisticName::ComputeShaderInvocations: - o << "PipelineStatisticName::ComputeShaderInvocations"; + case PopErrorScopeStatus::InstanceDropped: + o << "PopErrorScopeStatus::InstanceDropped"; break; default: - o << "PipelineStatisticName::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + o << "PopErrorScopeStatus::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); } return o; } @@ -580,14 +828,14 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, PresentMode value) { switch (value) { + case PresentMode::Fifo: + o << "PresentMode::Fifo"; + break; case PresentMode::Immediate: o << "PresentMode::Immediate"; break; case PresentMode::Mailbox: o << "PresentMode::Mailbox"; - break; - case PresentMode::Fifo: - o << "PresentMode::Fifo"; break; default: o << "PresentMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -597,6 +845,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, PrimitiveTopology value) { switch (value) { + case PrimitiveTopology::Undefined: + o << "PrimitiveTopology::Undefined"; + break; case PrimitiveTopology::PointList: o << "PrimitiveTopology::PointList"; break; @@ -623,9 +874,6 @@ namespace wgpu { case QueryType::Occlusion: o << "QueryType::Occlusion"; break; - case QueryType::PipelineStatistics: - o << "QueryType::PipelineStatistics"; - break; case QueryType::Timestamp: o << "QueryType::Timestamp"; break; @@ -640,6 +888,9 @@ namespace wgpu { case QueueWorkDoneStatus::Success: o << "QueueWorkDoneStatus::Success"; break; + case QueueWorkDoneStatus::InstanceDropped: + o << "QueueWorkDoneStatus::InstanceDropped"; + break; case QueueWorkDoneStatus::Error: o << "QueueWorkDoneStatus::Error"; break; @@ -655,25 +906,14 @@ namespace wgpu { return o; } template - std::basic_ostream& operator<<(std::basic_ostream& o, RenderPassTimestampLocation value) { - switch (value) { - case RenderPassTimestampLocation::Beginning: - o << "RenderPassTimestampLocation::Beginning"; - break; - case RenderPassTimestampLocation::End: - o << "RenderPassTimestampLocation::End"; - break; - default: - o << "RenderPassTimestampLocation::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); - } - return o; - } - template std::basic_ostream& operator<<(std::basic_ostream& o, RequestAdapterStatus value) { switch (value) { case RequestAdapterStatus::Success: o << "RequestAdapterStatus::Success"; break; + case RequestAdapterStatus::InstanceDropped: + o << "RequestAdapterStatus::InstanceDropped"; + break; case RequestAdapterStatus::Unavailable: o << "RequestAdapterStatus::Unavailable"; break; @@ -694,6 +934,9 @@ namespace wgpu { case RequestDeviceStatus::Success: o << "RequestDeviceStatus::Success"; break; + case RequestDeviceStatus::InstanceDropped: + o << "RequestDeviceStatus::InstanceDropped"; + break; case RequestDeviceStatus::Error: o << "RequestDeviceStatus::Error"; break; @@ -753,12 +996,15 @@ namespace wgpu { case SType::RenderPassDescriptorMaxDrawCount: o << "SType::RenderPassDescriptorMaxDrawCount"; break; + case SType::DepthStencilStateDepthWriteDefinedDawn: + o << "SType::DepthStencilStateDepthWriteDefinedDawn"; + break; + case SType::TextureBindingViewDimensionDescriptor: + o << "SType::TextureBindingViewDimensionDescriptor"; + break; case SType::DawnTextureInternalUsageDescriptor: o << "SType::DawnTextureInternalUsageDescriptor"; break; - case SType::DawnTogglesDeviceDescriptor: - o << "SType::DawnTogglesDeviceDescriptor"; - break; case SType::DawnEncoderInternalUsageDescriptor: o << "SType::DawnEncoderInternalUsageDescriptor"; break; @@ -770,6 +1016,132 @@ namespace wgpu { break; case SType::DawnAdapterPropertiesPowerPreference: o << "SType::DawnAdapterPropertiesPowerPreference"; + break; + case SType::DawnBufferDescriptorErrorInfoFromWireClient: + o << "SType::DawnBufferDescriptorErrorInfoFromWireClient"; + break; + case SType::DawnTogglesDescriptor: + o << "SType::DawnTogglesDescriptor"; + break; + case SType::DawnShaderModuleSPIRVOptionsDescriptor: + o << "SType::DawnShaderModuleSPIRVOptionsDescriptor"; + break; + case SType::RequestAdapterOptionsLUID: + o << "SType::RequestAdapterOptionsLUID"; + break; + case SType::RequestAdapterOptionsGetGLProc: + o << "SType::RequestAdapterOptionsGetGLProc"; + break; + case SType::RequestAdapterOptionsD3D11Device: + o << "SType::RequestAdapterOptionsD3D11Device"; + break; + case SType::DawnMultisampleStateRenderToSingleSampled: + o << "SType::DawnMultisampleStateRenderToSingleSampled"; + break; + case SType::DawnRenderPassColorAttachmentRenderToSingleSampled: + o << "SType::DawnRenderPassColorAttachmentRenderToSingleSampled"; + break; + case SType::RenderPassPixelLocalStorage: + o << "SType::RenderPassPixelLocalStorage"; + break; + case SType::PipelineLayoutPixelLocalStorage: + o << "SType::PipelineLayoutPixelLocalStorage"; + break; + case SType::BufferHostMappedPointer: + o << "SType::BufferHostMappedPointer"; + break; + case SType::DawnExperimentalSubgroupLimits: + o << "SType::DawnExperimentalSubgroupLimits"; + break; + case SType::AdapterPropertiesMemoryHeaps: + o << "SType::AdapterPropertiesMemoryHeaps"; + break; + case SType::AdapterPropertiesD3D: + o << "SType::AdapterPropertiesD3D"; + break; + case SType::DawnComputePipelineFullSubgroups: + o << "SType::DawnComputePipelineFullSubgroups"; + break; + case SType::DawnWireWGSLControl: + o << "SType::DawnWireWGSLControl"; + break; + case SType::DawnWGSLBlocklist: + o << "SType::DawnWGSLBlocklist"; + break; + case SType::SharedTextureMemoryVkImageDescriptor: + o << "SType::SharedTextureMemoryVkImageDescriptor"; + break; + case SType::SharedTextureMemoryVkDedicatedAllocationDescriptor: + o << "SType::SharedTextureMemoryVkDedicatedAllocationDescriptor"; + break; + case SType::SharedTextureMemoryAHardwareBufferDescriptor: + o << "SType::SharedTextureMemoryAHardwareBufferDescriptor"; + break; + case SType::SharedTextureMemoryDmaBufDescriptor: + o << "SType::SharedTextureMemoryDmaBufDescriptor"; + break; + case SType::SharedTextureMemoryOpaqueFDDescriptor: + o << "SType::SharedTextureMemoryOpaqueFDDescriptor"; + break; + case SType::SharedTextureMemoryZirconHandleDescriptor: + o << "SType::SharedTextureMemoryZirconHandleDescriptor"; + break; + case SType::SharedTextureMemoryDXGISharedHandleDescriptor: + o << "SType::SharedTextureMemoryDXGISharedHandleDescriptor"; + break; + case SType::SharedTextureMemoryD3D11Texture2DDescriptor: + o << "SType::SharedTextureMemoryD3D11Texture2DDescriptor"; + break; + case SType::SharedTextureMemoryIOSurfaceDescriptor: + o << "SType::SharedTextureMemoryIOSurfaceDescriptor"; + break; + case SType::SharedTextureMemoryEGLImageDescriptor: + o << "SType::SharedTextureMemoryEGLImageDescriptor"; + break; + case SType::SharedTextureMemoryInitializedBeginState: + o << "SType::SharedTextureMemoryInitializedBeginState"; + break; + case SType::SharedTextureMemoryInitializedEndState: + o << "SType::SharedTextureMemoryInitializedEndState"; + break; + case SType::SharedTextureMemoryVkImageLayoutBeginState: + o << "SType::SharedTextureMemoryVkImageLayoutBeginState"; + break; + case SType::SharedTextureMemoryVkImageLayoutEndState: + o << "SType::SharedTextureMemoryVkImageLayoutEndState"; + break; + case SType::SharedFenceVkSemaphoreOpaqueFDDescriptor: + o << "SType::SharedFenceVkSemaphoreOpaqueFDDescriptor"; + break; + case SType::SharedFenceVkSemaphoreOpaqueFDExportInfo: + o << "SType::SharedFenceVkSemaphoreOpaqueFDExportInfo"; + break; + case SType::SharedFenceVkSemaphoreSyncFDDescriptor: + o << "SType::SharedFenceVkSemaphoreSyncFDDescriptor"; + break; + case SType::SharedFenceVkSemaphoreSyncFDExportInfo: + o << "SType::SharedFenceVkSemaphoreSyncFDExportInfo"; + break; + case SType::SharedFenceVkSemaphoreZirconHandleDescriptor: + o << "SType::SharedFenceVkSemaphoreZirconHandleDescriptor"; + break; + case SType::SharedFenceVkSemaphoreZirconHandleExportInfo: + o << "SType::SharedFenceVkSemaphoreZirconHandleExportInfo"; + break; + case SType::SharedFenceDXGISharedHandleDescriptor: + o << "SType::SharedFenceDXGISharedHandleDescriptor"; + break; + case SType::SharedFenceDXGISharedHandleExportInfo: + o << "SType::SharedFenceDXGISharedHandleExportInfo"; + break; + case SType::SharedFenceMTLSharedEventDescriptor: + o << "SType::SharedFenceMTLSharedEventDescriptor"; + break; + case SType::SharedFenceMTLSharedEventExportInfo: + o << "SType::SharedFenceMTLSharedEventExportInfo"; + break; + case SType::SharedBufferMemoryD3D12ResourceDescriptor: + o << "SType::SharedBufferMemoryD3D12ResourceDescriptor"; break; default: o << "SType::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -797,8 +1169,37 @@ namespace wgpu { return o; } template + std::basic_ostream& operator<<(std::basic_ostream& o, SharedFenceType value) { + switch (value) { + case SharedFenceType::Undefined: + o << "SharedFenceType::Undefined"; + break; + case SharedFenceType::VkSemaphoreOpaqueFD: + o << "SharedFenceType::VkSemaphoreOpaqueFD"; + break; + case SharedFenceType::VkSemaphoreSyncFD: + o << "SharedFenceType::VkSemaphoreSyncFD"; + break; + case SharedFenceType::VkSemaphoreZirconHandle: + o << "SharedFenceType::VkSemaphoreZirconHandle"; + break; + case SharedFenceType::DXGISharedHandle: + o << "SharedFenceType::DXGISharedHandle"; + break; + case SharedFenceType::MTLSharedEvent: + o << "SharedFenceType::MTLSharedEvent"; + break; + default: + o << "SharedFenceType::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } + template std::basic_ostream& operator<<(std::basic_ostream& o, StencilOperation value) { switch (value) { + case StencilOperation::Undefined: + o << "StencilOperation::Undefined"; + break; case StencilOperation::Keep: o << "StencilOperation::Keep"; break; @@ -836,6 +1237,12 @@ namespace wgpu { break; case StorageTextureAccess::WriteOnly: o << "StorageTextureAccess::WriteOnly"; + break; + case StorageTextureAccess::ReadOnly: + o << "StorageTextureAccess::ReadOnly"; + break; + case StorageTextureAccess::ReadWrite: + o << "StorageTextureAccess::ReadWrite"; break; default: o << "StorageTextureAccess::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -862,6 +1269,9 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, TextureAspect value) { switch (value) { + case TextureAspect::Undefined: + o << "TextureAspect::Undefined"; + break; case TextureAspect::All: o << "TextureAspect::All"; break; @@ -877,34 +1287,20 @@ namespace wgpu { case TextureAspect::Plane1Only: o << "TextureAspect::Plane1Only"; break; - default: - o << "TextureAspect::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); - } - return o; - } - template - std::basic_ostream& operator<<(std::basic_ostream& o, TextureComponentType value) { - switch (value) { - case TextureComponentType::Float: - o << "TextureComponentType::Float"; - break; - case TextureComponentType::Sint: - o << "TextureComponentType::Sint"; - break; - case TextureComponentType::Uint: - o << "TextureComponentType::Uint"; - break; - case TextureComponentType::DepthComparison: - o << "TextureComponentType::DepthComparison"; + case TextureAspect::Plane2Only: + o << "TextureAspect::Plane2Only"; break; default: - o << "TextureComponentType::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + o << "TextureAspect::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); } return o; } template std::basic_ostream& operator<<(std::basic_ostream& o, TextureDimension value) { switch (value) { + case TextureDimension::Undefined: + o << "TextureDimension::Undefined"; + break; case TextureDimension::e1D: o << "TextureDimension::e1D"; break; @@ -997,6 +1393,9 @@ namespace wgpu { case TextureFormat::BGRA8UnormSrgb: o << "TextureFormat::BGRA8UnormSrgb"; break; + case TextureFormat::RGB10A2Uint: + o << "TextureFormat::RGB10A2Uint"; + break; case TextureFormat::RGB10A2Unorm: o << "TextureFormat::RGB10A2Unorm"; break; @@ -1207,8 +1606,32 @@ namespace wgpu { case TextureFormat::ASTC12x12UnormSrgb: o << "TextureFormat::ASTC12x12UnormSrgb"; break; + case TextureFormat::R16Unorm: + o << "TextureFormat::R16Unorm"; + break; + case TextureFormat::RG16Unorm: + o << "TextureFormat::RG16Unorm"; + break; + case TextureFormat::RGBA16Unorm: + o << "TextureFormat::RGBA16Unorm"; + break; + case TextureFormat::R16Snorm: + o << "TextureFormat::R16Snorm"; + break; + case TextureFormat::RG16Snorm: + o << "TextureFormat::RG16Snorm"; + break; + case TextureFormat::RGBA16Snorm: + o << "TextureFormat::RGBA16Snorm"; + break; case TextureFormat::R8BG8Biplanar420Unorm: o << "TextureFormat::R8BG8Biplanar420Unorm"; + break; + case TextureFormat::R10X6BG10X6Biplanar420Unorm: + o << "TextureFormat::R10X6BG10X6Biplanar420Unorm"; + break; + case TextureFormat::R8BG8A8Triplanar420Unorm: + o << "TextureFormat::R8BG8A8Triplanar420Unorm"; break; default: o << "TextureFormat::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -1365,6 +1788,9 @@ namespace wgpu { break; case VertexFormat::Sint32x4: o << "VertexFormat::Sint32x4"; + break; + case VertexFormat::Unorm10_10_10_2: + o << "VertexFormat::Unorm10_10_10_2"; break; default: o << "VertexFormat::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); @@ -1374,20 +1800,49 @@ namespace wgpu { template std::basic_ostream& operator<<(std::basic_ostream& o, VertexStepMode value) { switch (value) { + case VertexStepMode::Undefined: + o << "VertexStepMode::Undefined"; + break; + case VertexStepMode::VertexBufferNotUsed: + o << "VertexStepMode::VertexBufferNotUsed"; + break; case VertexStepMode::Vertex: o << "VertexStepMode::Vertex"; break; case VertexStepMode::Instance: o << "VertexStepMode::Instance"; - break; - case VertexStepMode::VertexBufferNotUsed: - o << "VertexStepMode::VertexBufferNotUsed"; break; default: o << "VertexStepMode::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); } return o; } + template + std::basic_ostream& operator<<(std::basic_ostream& o, WaitStatus value) { + switch (value) { + case WaitStatus::Success: + o << "WaitStatus::Success"; + break; + case WaitStatus::TimedOut: + o << "WaitStatus::TimedOut"; + break; + case WaitStatus::UnsupportedTimeout: + o << "WaitStatus::UnsupportedTimeout"; + break; + case WaitStatus::UnsupportedCount: + o << "WaitStatus::UnsupportedCount"; + break; + case WaitStatus::UnsupportedMixedSources: + o << "WaitStatus::UnsupportedMixedSources"; + break; + case WaitStatus::Unknown: + o << "WaitStatus::Unknown"; + break; + default: + o << "WaitStatus::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + return o; + } template std::basic_ostream& operator<<(std::basic_ostream& o, BufferUsage value) { @@ -1566,6 +2021,74 @@ namespace wgpu { return o; } template + std::basic_ostream& operator<<(std::basic_ostream& o, HeapProperty value) { + o << "HeapProperty::"; + if (!static_cast(value)) { + // 0 is often explicitly declared as None. + o << "Undefined"; + return o; + } + + bool moreThanOneBit = !HasZeroOrOneBits(value); + if (moreThanOneBit) { + o << "("; + } + + bool first = true; + if (value & HeapProperty::DeviceLocal) { + if (!first) { + o << "|"; + } + first = false; + o << "DeviceLocal"; + value &= ~HeapProperty::DeviceLocal; + } + if (value & HeapProperty::HostVisible) { + if (!first) { + o << "|"; + } + first = false; + o << "HostVisible"; + value &= ~HeapProperty::HostVisible; + } + if (value & HeapProperty::HostCoherent) { + if (!first) { + o << "|"; + } + first = false; + o << "HostCoherent"; + value &= ~HeapProperty::HostCoherent; + } + if (value & HeapProperty::HostUncached) { + if (!first) { + o << "|"; + } + first = false; + o << "HostUncached"; + value &= ~HeapProperty::HostUncached; + } + if (value & HeapProperty::HostCached) { + if (!first) { + o << "|"; + } + first = false; + o << "HostCached"; + value &= ~HeapProperty::HostCached; + } + + if (static_cast(value)) { + if (!first) { + o << "|"; + } + o << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast::type>(value); + } + + if (moreThanOneBit) { + o << ")"; + } + return o; + } + template std::basic_ostream& operator<<(std::basic_ostream& o, MapMode value) { o << "MapMode::"; if (!static_cast(value)) { @@ -1716,13 +2239,21 @@ namespace wgpu { o << "RenderAttachment"; value &= ~TextureUsage::RenderAttachment; } - if (value & TextureUsage::Present) { + if (value & TextureUsage::TransientAttachment) { + if (!first) { + o << "|"; + } + first = false; + o << "TransientAttachment"; + value &= ~TextureUsage::TransientAttachment; + } + if (value & TextureUsage::StorageAttachment) { if (!first) { o << "|"; } first = false; - o << "Present"; - value &= ~TextureUsage::Present; + o << "StorageAttachment"; + value &= ~TextureUsage::StorageAttachment; } if (static_cast(value)) { diff --git a/lib/dawn/inc/dawn/wire/Wire.h b/lib/dawn/inc/dawn/wire/Wire.h index e866db3..1d5836b 100644 --- a/lib/dawn/inc/dawn/wire/Wire.h +++ b/lib/dawn/inc/dawn/wire/Wire.h @@ -1,16 +1,29 @@ -// Copyright 2017 The Dawn Authors +// Copyright 2017 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_WIRE_WIRE_H_ #define INCLUDE_DAWN_WIRE_WIRE_H_ @@ -50,9 +63,12 @@ class DAWN_WIRE_EXPORT CommandHandler { virtual const volatile char* HandleCommands(const volatile char* commands, size_t size) = 0; }; -} // namespace dawn::wire +// Handle struct that are used to uniquely represent an object of a particular type in the wire. +struct Handle { + uint32_t id = 0; + uint32_t generation = 0; +}; -// TODO(dawn:824): Remove once the deprecation period is passed. -namespace dawn_wire = dawn::wire; +} // namespace dawn::wire #endif // INCLUDE_DAWN_WIRE_WIRE_H_ diff --git a/lib/dawn/inc/dawn/wire/WireClient.h b/lib/dawn/inc/dawn/wire/WireClient.h index 02b4c07..a1e268a 100644 --- a/lib/dawn/inc/dawn/wire/WireClient.h +++ b/lib/dawn/inc/dawn/wire/WireClient.h @@ -1,16 +1,29 @@ -// Copyright 2019 The Dawn Authors +// Copyright 2019 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_WIRE_WIRECLIENT_H_ #define INCLUDE_DAWN_WIRE_WIRECLIENT_H_ @@ -32,30 +45,24 @@ DAWN_WIRE_EXPORT const DawnProcTable& GetProcs(); struct ReservedTexture { WGPUTexture texture; - uint32_t id; - uint32_t generation; - uint32_t deviceId; - uint32_t deviceGeneration; + Handle handle; + Handle deviceHandle; }; struct ReservedSwapChain { WGPUSwapChain swapchain; - uint32_t id; - uint32_t generation; - uint32_t deviceId; - uint32_t deviceGeneration; + Handle deviceHandle; + Handle handle; }; struct ReservedDevice { WGPUDevice device; - uint32_t id; - uint32_t generation; + Handle handle; }; struct ReservedInstance { WGPUInstance instance; - uint32_t id; - uint32_t generation; + Handle handle; }; struct DAWN_WIRE_EXPORT WireClientDescriptor { @@ -71,9 +78,9 @@ class DAWN_WIRE_EXPORT WireClient : public CommandHandler { const volatile char* HandleCommands(const volatile char* commands, size_t size) override; ReservedTexture ReserveTexture(WGPUDevice device, const WGPUTextureDescriptor* descriptor); - ReservedSwapChain ReserveSwapChain(WGPUDevice device); - ReservedDevice ReserveDevice(); - ReservedInstance ReserveInstance(); + ReservedSwapChain ReserveSwapChain(WGPUDevice device, + const WGPUSwapChainDescriptor* descriptor); + ReservedInstance ReserveInstance(const WGPUInstanceDescriptor* descriptor = nullptr); void ReclaimTextureReservation(const ReservedTexture& reservation); void ReclaimSwapChainReservation(const ReservedSwapChain& reservation); diff --git a/lib/dawn/inc/dawn/wire/WireServer.h b/lib/dawn/inc/dawn/wire/WireServer.h index 9fc2ab3..1c67262 100644 --- a/lib/dawn/inc/dawn/wire/WireServer.h +++ b/lib/dawn/inc/dawn/wire/WireServer.h @@ -1,16 +1,29 @@ -// Copyright 2019 The Dawn Authors +// Copyright 2019 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_WIRE_WIRESERVER_H_ #define INCLUDE_DAWN_WIRE_WIRESERVER_H_ @@ -41,20 +54,9 @@ class DAWN_WIRE_EXPORT WireServer : public CommandHandler { const volatile char* HandleCommands(const volatile char* commands, size_t size) override; - bool InjectTexture(WGPUTexture texture, - uint32_t id, - uint32_t generation, - uint32_t deviceId, - uint32_t deviceGeneration); - bool InjectSwapChain(WGPUSwapChain swapchain, - uint32_t id, - uint32_t generation, - uint32_t deviceId, - uint32_t deviceGeneration); - - bool InjectDevice(WGPUDevice device, uint32_t id, uint32_t generation); - - bool InjectInstance(WGPUInstance instance, uint32_t id, uint32_t generation); + bool InjectTexture(WGPUTexture texture, const Handle& handle, const Handle& deviceHandle); + bool InjectSwapChain(WGPUSwapChain swapchain, const Handle& handle, const Handle& deviceHandle); + bool InjectInstance(WGPUInstance instance, const Handle& handle); // Look up a device by (id, generation) pair. Returns nullptr if the generation // has expired or the id is not found. diff --git a/lib/dawn/inc/dawn/wire/dawn_wire_export.h b/lib/dawn/inc/dawn/wire/dawn_wire_export.h index e5b2113..f63e18d 100644 --- a/lib/dawn/inc/dawn/wire/dawn_wire_export.h +++ b/lib/dawn/inc/dawn/wire/dawn_wire_export.h @@ -1,16 +1,29 @@ -// Copyright 2018 The Dawn Authors +// Copyright 2018 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_DAWN_WIRE_DAWN_WIRE_EXPORT_H_ #define INCLUDE_DAWN_WIRE_DAWN_WIRE_EXPORT_H_ diff --git a/lib/dawn/inc/webgpu/webgpu.h b/lib/dawn/inc/webgpu/webgpu.h index 535045e..aa36bc1 100644 --- a/lib/dawn/inc/webgpu/webgpu.h +++ b/lib/dawn/inc/webgpu/webgpu.h @@ -1,16 +1,29 @@ -// Copyright 2022 The Dawn Authors +// Copyright 2022 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_WEBGPU_WEBGPU_H_ #define INCLUDE_WEBGPU_WEBGPU_H_ diff --git a/lib/dawn/inc/webgpu/webgpu_cpp.h b/lib/dawn/inc/webgpu/webgpu_cpp.h index f1a6333..d717a62 100644 --- a/lib/dawn/inc/webgpu/webgpu_cpp.h +++ b/lib/dawn/inc/webgpu/webgpu_cpp.h @@ -1,16 +1,29 @@ -// Copyright 2022 The Dawn Authors +// Copyright 2022 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_WEBGPU_WEBGPU_CPP_H_ #define INCLUDE_WEBGPU_WEBGPU_CPP_H_ diff --git a/lib/dawn/inc/webgpu/webgpu_cpp_chained_struct.h b/lib/dawn/inc/webgpu/webgpu_cpp_chained_struct.h new file mode 100644 index 0000000..96bbec4 --- /dev/null +++ b/lib/dawn/inc/webgpu/webgpu_cpp_chained_struct.h @@ -0,0 +1,29 @@ +#ifdef __EMSCRIPTEN__ +#error "Do not include this header. Emscripten already provides headers needed for WebGPU." +#endif +#ifndef WEBGPU_CPP_CHAINED_STRUCT_H_ +#define WEBGPU_CPP_CHAINED_STRUCT_H_ + +#include +#include + +// This header file declares the ChainedStruct structures separately from the WebGPU +// headers so that dependencies can directly extend structures without including the larger header +// which exposes capabilities that may require correctly set proc tables. +namespace wgpu { + + enum class SType : uint32_t; + + struct ChainedStruct { + ChainedStruct const * nextInChain = nullptr; + SType sType = SType(0u); + }; + + struct ChainedStructOut { + ChainedStructOut * nextInChain = nullptr; + SType sType = SType(0u); + }; + +} // namespace wgpu} + +#endif // WEBGPU_CPP_CHAINED_STRUCT_H_ diff --git a/lib/dawn/inc/webgpu/webgpu_enum_class_bitmasks.h b/lib/dawn/inc/webgpu/webgpu_enum_class_bitmasks.h new file mode 100644 index 0000000..e98c8c5 --- /dev/null +++ b/lib/dawn/inc/webgpu/webgpu_enum_class_bitmasks.h @@ -0,0 +1,161 @@ +// Copyright 2017 The Dawn & Tint Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef WEBGPU_ENUM_CLASS_BITMASKS_H_ +#define WEBGPU_ENUM_CLASS_BITMASKS_H_ + +#include + +// The operators in wgpu:: namespace need be introduced into other namespaces with +// using-declarations for C++ Argument Dependent Lookup to work. +#define WGPU_IMPORT_BITMASK_OPERATORS \ + using wgpu::operator|; \ + using wgpu::operator&; \ + using wgpu::operator^; \ + using wgpu::operator~; \ + using wgpu::operator&=; \ + using wgpu::operator|=; \ + using wgpu::operator^=; \ + using wgpu::HasZeroOrOneBits; + +namespace wgpu { + +template +struct IsWGPUBitmask { + static constexpr bool enable = false; +}; + +template +struct LowerBitmask { + static constexpr bool enable = false; +}; + +template +struct LowerBitmask::enable>::type> { + static constexpr bool enable = true; + using type = T; + constexpr static T Lower(T t) { return t; } +}; + +template +struct BoolConvertible { + using Integral = typename std::underlying_type::type; + + // NOLINTNEXTLINE(runtime/explicit) + explicit constexpr BoolConvertible(Integral value) : value(value) {} + constexpr operator bool() const { return value != 0; } + constexpr operator T() const { return static_cast(value); } + + Integral value; +}; + +template +struct LowerBitmask> { + static constexpr bool enable = true; + using type = T; + static constexpr type Lower(BoolConvertible t) { return t; } +}; + +template < + typename T1, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr BoolConvertible::type> operator|(T1 left, T2 right) { + using T = typename LowerBitmask::type; + using Integral = typename std::underlying_type::type; + return BoolConvertible(static_cast(LowerBitmask::Lower(left)) | + static_cast(LowerBitmask::Lower(right))); +} + +template < + typename T1, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr BoolConvertible::type> operator&(T1 left, T2 right) { + using T = typename LowerBitmask::type; + using Integral = typename std::underlying_type::type; + return BoolConvertible(static_cast(LowerBitmask::Lower(left)) & + static_cast(LowerBitmask::Lower(right))); +} + +template < + typename T1, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr BoolConvertible::type> operator^(T1 left, T2 right) { + using T = typename LowerBitmask::type; + using Integral = typename std::underlying_type::type; + return BoolConvertible(static_cast(LowerBitmask::Lower(left)) ^ + static_cast(LowerBitmask::Lower(right))); +} + +template +constexpr BoolConvertible::type> operator~(T1 t) { + using T = typename LowerBitmask::type; + using Integral = typename std::underlying_type::type; + return BoolConvertible(~static_cast(LowerBitmask::Lower(t))); +} + +template < + typename T, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr T& operator&=(T& l, T2 right) { + T r = LowerBitmask::Lower(right); + l = l & r; + return l; +} + +template < + typename T, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr T& operator|=(T& l, T2 right) { + T r = LowerBitmask::Lower(right); + l = l | r; + return l; +} + +template < + typename T, + typename T2, + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> +constexpr T& operator^=(T& l, T2 right) { + T r = LowerBitmask::Lower(right); + l = l ^ r; + return l; +} + +template +constexpr bool HasZeroOrOneBits(T value) { + using Integral = typename std::underlying_type::type; + return (static_cast(value) & (static_cast(value) - 1)) == 0; +} + +} // namespace wgpu + +#endif // WEBGPU_ENUM_CLASS_BITMASKS_H_ diff --git a/lib/dawn/inc/webgpu/webgpu_glfw.h b/lib/dawn/inc/webgpu/webgpu_glfw.h index 5d3f4e3..c35252c 100644 --- a/lib/dawn/inc/webgpu/webgpu_glfw.h +++ b/lib/dawn/inc/webgpu/webgpu_glfw.h @@ -1,16 +1,29 @@ -// Copyright 2022 The Dawn Authors +// Copyright 2022 The Dawn & Tint Authors // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// http://www.apache.org/licenses/LICENSE-2.0 +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDE_WEBGPU_WEBGPU_GLFW_H_ #define INCLUDE_WEBGPU_WEBGPU_GLFW_H_