diff --git a/.scratch/dawn-package/dawn.tar.gz b/.scratch/dawn-package/dawn.tar.gz deleted file mode 100644 index 549f371..0000000 Binary files a/.scratch/dawn-package/dawn.tar.gz and /dev/null differ diff --git a/.scratch/dawn-package/extracted/include/dawn/dawn_proc_table.h b/.scratch/dawn-package/extracted/include/dawn/dawn_proc_table.h deleted file mode 100644 index aa51fb5..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/dawn_proc_table.h +++ /dev/null @@ -1,330 +0,0 @@ - -#ifndef DAWN_DAWN_PROC_TABLE_H_ -#define DAWN_DAWN_PROC_TABLE_H_ - -#include "dawn/webgpu.h" - -// Note: Often allocated as a static global. Do not add a complex constructor. -typedef struct DawnProcTable { - uint8_t version[20]; - - WGPUProcCreateInstance createInstance; - WGPUProcGetInstanceFeatures getInstanceFeatures; - WGPUProcGetInstanceLimits getInstanceLimits; - WGPUProcHasInstanceFeature hasInstanceFeature; - WGPUProcGetProcAddress getProcAddress; - - WGPUProcAdapterCreateDevice adapterCreateDevice; - WGPUProcAdapterGetFeatures adapterGetFeatures; - WGPUProcAdapterGetFormatCapabilities adapterGetFormatCapabilities; - WGPUProcAdapterGetInfo adapterGetInfo; - WGPUProcAdapterGetInstance adapterGetInstance; - WGPUProcAdapterGetLimits adapterGetLimits; - WGPUProcAdapterHasFeature adapterHasFeature; - WGPUProcAdapterRequestDevice adapterRequestDevice; - WGPUProcAdapterAddRef adapterAddRef; - WGPUProcAdapterRelease adapterRelease; - - WGPUProcAdapterInfoFreeMembers adapterInfoFreeMembers; - - WGPUProcAdapterPropertiesMemoryHeapsFreeMembers adapterPropertiesMemoryHeapsFreeMembers; - - WGPUProcAdapterPropertiesSubgroupMatrixConfigsFreeMembers adapterPropertiesSubgroupMatrixConfigsFreeMembers; - - WGPUProcBindGroupSetLabel bindGroupSetLabel; - WGPUProcBindGroupAddRef bindGroupAddRef; - WGPUProcBindGroupRelease bindGroupRelease; - - WGPUProcBindGroupLayoutSetLabel bindGroupLayoutSetLabel; - WGPUProcBindGroupLayoutAddRef bindGroupLayoutAddRef; - WGPUProcBindGroupLayoutRelease bindGroupLayoutRelease; - - WGPUProcBufferCreateTexelView bufferCreateTexelView; - WGPUProcBufferDestroy bufferDestroy; - WGPUProcBufferGetConstMappedRange bufferGetConstMappedRange; - WGPUProcBufferGetMappedRange bufferGetMappedRange; - WGPUProcBufferGetMapState bufferGetMapState; - WGPUProcBufferGetSize bufferGetSize; - WGPUProcBufferGetUsage bufferGetUsage; - WGPUProcBufferMapAsync bufferMapAsync; - WGPUProcBufferReadMappedRange bufferReadMappedRange; - WGPUProcBufferSetLabel bufferSetLabel; - WGPUProcBufferUnmap bufferUnmap; - WGPUProcBufferWriteMappedRange bufferWriteMappedRange; - WGPUProcBufferAddRef bufferAddRef; - WGPUProcBufferRelease bufferRelease; - - WGPUProcCommandBufferSetLabel commandBufferSetLabel; - WGPUProcCommandBufferAddRef commandBufferAddRef; - WGPUProcCommandBufferRelease commandBufferRelease; - - WGPUProcCommandEncoderBeginComputePass commandEncoderBeginComputePass; - WGPUProcCommandEncoderBeginRenderPass commandEncoderBeginRenderPass; - WGPUProcCommandEncoderClearBuffer commandEncoderClearBuffer; - WGPUProcCommandEncoderCopyBufferToBuffer commandEncoderCopyBufferToBuffer; - WGPUProcCommandEncoderCopyBufferToTexture commandEncoderCopyBufferToTexture; - WGPUProcCommandEncoderCopyTextureToBuffer commandEncoderCopyTextureToBuffer; - WGPUProcCommandEncoderCopyTextureToTexture commandEncoderCopyTextureToTexture; - WGPUProcCommandEncoderFinish commandEncoderFinish; - WGPUProcCommandEncoderInjectValidationError commandEncoderInjectValidationError; - WGPUProcCommandEncoderInsertDebugMarker commandEncoderInsertDebugMarker; - WGPUProcCommandEncoderPopDebugGroup commandEncoderPopDebugGroup; - WGPUProcCommandEncoderPushDebugGroup commandEncoderPushDebugGroup; - WGPUProcCommandEncoderResolveQuerySet commandEncoderResolveQuerySet; - WGPUProcCommandEncoderSetLabel commandEncoderSetLabel; - WGPUProcCommandEncoderWriteBuffer commandEncoderWriteBuffer; - WGPUProcCommandEncoderWriteTimestamp commandEncoderWriteTimestamp; - WGPUProcCommandEncoderAddRef commandEncoderAddRef; - WGPUProcCommandEncoderRelease commandEncoderRelease; - - WGPUProcComputePassEncoderDispatchWorkgroups computePassEncoderDispatchWorkgroups; - WGPUProcComputePassEncoderDispatchWorkgroupsIndirect computePassEncoderDispatchWorkgroupsIndirect; - WGPUProcComputePassEncoderEnd computePassEncoderEnd; - WGPUProcComputePassEncoderInsertDebugMarker computePassEncoderInsertDebugMarker; - WGPUProcComputePassEncoderPopDebugGroup computePassEncoderPopDebugGroup; - WGPUProcComputePassEncoderPushDebugGroup computePassEncoderPushDebugGroup; - WGPUProcComputePassEncoderSetBindGroup computePassEncoderSetBindGroup; - WGPUProcComputePassEncoderSetImmediates computePassEncoderSetImmediates; - WGPUProcComputePassEncoderSetLabel computePassEncoderSetLabel; - WGPUProcComputePassEncoderSetPipeline computePassEncoderSetPipeline; - WGPUProcComputePassEncoderSetResourceTable computePassEncoderSetResourceTable; - WGPUProcComputePassEncoderWriteTimestamp computePassEncoderWriteTimestamp; - WGPUProcComputePassEncoderAddRef computePassEncoderAddRef; - WGPUProcComputePassEncoderRelease computePassEncoderRelease; - - WGPUProcComputePipelineGetBindGroupLayout computePipelineGetBindGroupLayout; - WGPUProcComputePipelineSetLabel computePipelineSetLabel; - WGPUProcComputePipelineAddRef computePipelineAddRef; - WGPUProcComputePipelineRelease computePipelineRelease; - - WGPUProcDawnDrmFormatCapabilitiesFreeMembers dawnDrmFormatCapabilitiesFreeMembers; - - WGPUProcDeviceCreateBindGroup deviceCreateBindGroup; - WGPUProcDeviceCreateBindGroupLayout deviceCreateBindGroupLayout; - WGPUProcDeviceCreateBuffer deviceCreateBuffer; - WGPUProcDeviceCreateCommandEncoder deviceCreateCommandEncoder; - WGPUProcDeviceCreateComputePipeline deviceCreateComputePipeline; - WGPUProcDeviceCreateComputePipelineAsync deviceCreateComputePipelineAsync; - WGPUProcDeviceCreateErrorBuffer deviceCreateErrorBuffer; - WGPUProcDeviceCreateErrorExternalTexture deviceCreateErrorExternalTexture; - WGPUProcDeviceCreateErrorShaderModule deviceCreateErrorShaderModule; - WGPUProcDeviceCreateErrorTexture deviceCreateErrorTexture; - WGPUProcDeviceCreateExternalTexture deviceCreateExternalTexture; - WGPUProcDeviceCreatePipelineLayout deviceCreatePipelineLayout; - WGPUProcDeviceCreateQuerySet deviceCreateQuerySet; - WGPUProcDeviceCreateRenderBundleEncoder deviceCreateRenderBundleEncoder; - WGPUProcDeviceCreateRenderPipeline deviceCreateRenderPipeline; - WGPUProcDeviceCreateRenderPipelineAsync deviceCreateRenderPipelineAsync; - WGPUProcDeviceCreateResourceTable deviceCreateResourceTable; - WGPUProcDeviceCreateSampler deviceCreateSampler; - WGPUProcDeviceCreateShaderModule deviceCreateShaderModule; - WGPUProcDeviceCreateTexture deviceCreateTexture; - WGPUProcDeviceDestroy deviceDestroy; - WGPUProcDeviceForceLoss deviceForceLoss; - WGPUProcDeviceGetAdapter deviceGetAdapter; - WGPUProcDeviceGetAdapterInfo deviceGetAdapterInfo; - WGPUProcDeviceGetAHardwareBufferProperties deviceGetAHardwareBufferProperties; - WGPUProcDeviceGetFeatures deviceGetFeatures; - WGPUProcDeviceGetLimits deviceGetLimits; - WGPUProcDeviceGetLostFuture deviceGetLostFuture; - WGPUProcDeviceGetQueue deviceGetQueue; - WGPUProcDeviceHasFeature deviceHasFeature; - WGPUProcDeviceImportSharedBufferMemory deviceImportSharedBufferMemory; - WGPUProcDeviceImportSharedFence deviceImportSharedFence; - WGPUProcDeviceImportSharedTextureMemory deviceImportSharedTextureMemory; - WGPUProcDeviceInjectError deviceInjectError; - WGPUProcDevicePopErrorScope devicePopErrorScope; - WGPUProcDevicePushErrorScope devicePushErrorScope; - WGPUProcDeviceSetLabel deviceSetLabel; - WGPUProcDeviceSetLoggingCallback deviceSetLoggingCallback; - WGPUProcDeviceTick deviceTick; - WGPUProcDeviceValidateTextureDescriptor deviceValidateTextureDescriptor; - WGPUProcDeviceAddRef deviceAddRef; - WGPUProcDeviceRelease deviceRelease; - - WGPUProcExternalTextureDestroy externalTextureDestroy; - WGPUProcExternalTextureExpire externalTextureExpire; - WGPUProcExternalTextureRefresh externalTextureRefresh; - WGPUProcExternalTextureSetLabel externalTextureSetLabel; - WGPUProcExternalTextureAddRef externalTextureAddRef; - WGPUProcExternalTextureRelease externalTextureRelease; - - WGPUProcInstanceCreateSurface instanceCreateSurface; - WGPUProcInstanceGetWGSLLanguageFeatures instanceGetWGSLLanguageFeatures; - WGPUProcInstanceHasWGSLLanguageFeature instanceHasWGSLLanguageFeature; - WGPUProcInstanceProcessEvents instanceProcessEvents; - WGPUProcInstanceRequestAdapter instanceRequestAdapter; - WGPUProcInstanceWaitAny instanceWaitAny; - WGPUProcInstanceAddRef instanceAddRef; - WGPUProcInstanceRelease instanceRelease; - - WGPUProcPipelineLayoutSetLabel pipelineLayoutSetLabel; - WGPUProcPipelineLayoutAddRef pipelineLayoutAddRef; - WGPUProcPipelineLayoutRelease pipelineLayoutRelease; - - WGPUProcQuerySetDestroy querySetDestroy; - WGPUProcQuerySetGetCount querySetGetCount; - WGPUProcQuerySetGetType querySetGetType; - WGPUProcQuerySetSetLabel querySetSetLabel; - WGPUProcQuerySetAddRef querySetAddRef; - WGPUProcQuerySetRelease querySetRelease; - - WGPUProcQueueCopyExternalTextureForBrowser queueCopyExternalTextureForBrowser; - WGPUProcQueueCopyTextureForBrowser queueCopyTextureForBrowser; - WGPUProcQueueOnSubmittedWorkDone queueOnSubmittedWorkDone; - WGPUProcQueueSetLabel queueSetLabel; - WGPUProcQueueSubmit queueSubmit; - WGPUProcQueueWriteBuffer queueWriteBuffer; - WGPUProcQueueWriteTexture queueWriteTexture; - WGPUProcQueueAddRef queueAddRef; - WGPUProcQueueRelease queueRelease; - - WGPUProcRenderBundleSetLabel renderBundleSetLabel; - WGPUProcRenderBundleAddRef renderBundleAddRef; - WGPUProcRenderBundleRelease renderBundleRelease; - - WGPUProcRenderBundleEncoderDraw renderBundleEncoderDraw; - WGPUProcRenderBundleEncoderDrawIndexed renderBundleEncoderDrawIndexed; - WGPUProcRenderBundleEncoderDrawIndexedIndirect renderBundleEncoderDrawIndexedIndirect; - WGPUProcRenderBundleEncoderDrawIndirect renderBundleEncoderDrawIndirect; - WGPUProcRenderBundleEncoderFinish renderBundleEncoderFinish; - WGPUProcRenderBundleEncoderInsertDebugMarker renderBundleEncoderInsertDebugMarker; - WGPUProcRenderBundleEncoderPopDebugGroup renderBundleEncoderPopDebugGroup; - WGPUProcRenderBundleEncoderPushDebugGroup renderBundleEncoderPushDebugGroup; - WGPUProcRenderBundleEncoderSetBindGroup renderBundleEncoderSetBindGroup; - WGPUProcRenderBundleEncoderSetImmediates renderBundleEncoderSetImmediates; - WGPUProcRenderBundleEncoderSetIndexBuffer renderBundleEncoderSetIndexBuffer; - WGPUProcRenderBundleEncoderSetLabel renderBundleEncoderSetLabel; - WGPUProcRenderBundleEncoderSetPipeline renderBundleEncoderSetPipeline; - WGPUProcRenderBundleEncoderSetResourceTable renderBundleEncoderSetResourceTable; - WGPUProcRenderBundleEncoderSetVertexBuffer renderBundleEncoderSetVertexBuffer; - WGPUProcRenderBundleEncoderAddRef renderBundleEncoderAddRef; - WGPUProcRenderBundleEncoderRelease renderBundleEncoderRelease; - - WGPUProcRenderPassEncoderBeginOcclusionQuery renderPassEncoderBeginOcclusionQuery; - WGPUProcRenderPassEncoderDraw renderPassEncoderDraw; - WGPUProcRenderPassEncoderDrawIndexed renderPassEncoderDrawIndexed; - WGPUProcRenderPassEncoderDrawIndexedIndirect renderPassEncoderDrawIndexedIndirect; - WGPUProcRenderPassEncoderDrawIndirect renderPassEncoderDrawIndirect; - WGPUProcRenderPassEncoderEnd renderPassEncoderEnd; - WGPUProcRenderPassEncoderEndOcclusionQuery renderPassEncoderEndOcclusionQuery; - WGPUProcRenderPassEncoderExecuteBundles renderPassEncoderExecuteBundles; - WGPUProcRenderPassEncoderInsertDebugMarker renderPassEncoderInsertDebugMarker; - WGPUProcRenderPassEncoderMultiDrawIndexedIndirect renderPassEncoderMultiDrawIndexedIndirect; - WGPUProcRenderPassEncoderMultiDrawIndirect renderPassEncoderMultiDrawIndirect; - WGPUProcRenderPassEncoderPixelLocalStorageBarrier renderPassEncoderPixelLocalStorageBarrier; - WGPUProcRenderPassEncoderPopDebugGroup renderPassEncoderPopDebugGroup; - WGPUProcRenderPassEncoderPushDebugGroup renderPassEncoderPushDebugGroup; - WGPUProcRenderPassEncoderSetBindGroup renderPassEncoderSetBindGroup; - WGPUProcRenderPassEncoderSetBlendConstant renderPassEncoderSetBlendConstant; - WGPUProcRenderPassEncoderSetImmediates renderPassEncoderSetImmediates; - WGPUProcRenderPassEncoderSetIndexBuffer renderPassEncoderSetIndexBuffer; - WGPUProcRenderPassEncoderSetLabel renderPassEncoderSetLabel; - WGPUProcRenderPassEncoderSetPipeline renderPassEncoderSetPipeline; - WGPUProcRenderPassEncoderSetResourceTable renderPassEncoderSetResourceTable; - WGPUProcRenderPassEncoderSetScissorRect renderPassEncoderSetScissorRect; - WGPUProcRenderPassEncoderSetStencilReference renderPassEncoderSetStencilReference; - WGPUProcRenderPassEncoderSetVertexBuffer renderPassEncoderSetVertexBuffer; - WGPUProcRenderPassEncoderSetViewport renderPassEncoderSetViewport; - WGPUProcRenderPassEncoderWriteTimestamp renderPassEncoderWriteTimestamp; - WGPUProcRenderPassEncoderAddRef renderPassEncoderAddRef; - WGPUProcRenderPassEncoderRelease renderPassEncoderRelease; - - WGPUProcRenderPipelineGetBindGroupLayout renderPipelineGetBindGroupLayout; - WGPUProcRenderPipelineSetLabel renderPipelineSetLabel; - WGPUProcRenderPipelineAddRef renderPipelineAddRef; - WGPUProcRenderPipelineRelease renderPipelineRelease; - - WGPUProcResourceTableDestroy resourceTableDestroy; - WGPUProcResourceTableGetSize resourceTableGetSize; - WGPUProcResourceTableInsertBinding resourceTableInsertBinding; - WGPUProcResourceTableRemoveBinding resourceTableRemoveBinding; - WGPUProcResourceTableSetLabel resourceTableSetLabel; - WGPUProcResourceTableUpdate resourceTableUpdate; - WGPUProcResourceTableAddRef resourceTableAddRef; - WGPUProcResourceTableRelease resourceTableRelease; - - WGPUProcSamplerSetLabel samplerSetLabel; - WGPUProcSamplerAddRef samplerAddRef; - WGPUProcSamplerRelease samplerRelease; - - WGPUProcShaderModuleGetCompilationInfo shaderModuleGetCompilationInfo; - WGPUProcShaderModuleSetLabel shaderModuleSetLabel; - WGPUProcShaderModuleAddRef shaderModuleAddRef; - WGPUProcShaderModuleRelease shaderModuleRelease; - - WGPUProcSharedBufferMemoryBeginAccess sharedBufferMemoryBeginAccess; - WGPUProcSharedBufferMemoryCreateBuffer sharedBufferMemoryCreateBuffer; - WGPUProcSharedBufferMemoryEndAccess sharedBufferMemoryEndAccess; - WGPUProcSharedBufferMemoryGetProperties sharedBufferMemoryGetProperties; - WGPUProcSharedBufferMemoryIsDeviceLost sharedBufferMemoryIsDeviceLost; - WGPUProcSharedBufferMemorySetLabel sharedBufferMemorySetLabel; - WGPUProcSharedBufferMemoryAddRef sharedBufferMemoryAddRef; - WGPUProcSharedBufferMemoryRelease sharedBufferMemoryRelease; - - WGPUProcSharedBufferMemoryEndAccessStateFreeMembers sharedBufferMemoryEndAccessStateFreeMembers; - - WGPUProcSharedFenceExportInfo sharedFenceExportInfo; - WGPUProcSharedFenceSetLabel sharedFenceSetLabel; - WGPUProcSharedFenceAddRef sharedFenceAddRef; - WGPUProcSharedFenceRelease sharedFenceRelease; - - WGPUProcSharedTextureMemoryBeginAccess sharedTextureMemoryBeginAccess; - WGPUProcSharedTextureMemoryCreateTexture sharedTextureMemoryCreateTexture; - WGPUProcSharedTextureMemoryEndAccess sharedTextureMemoryEndAccess; - WGPUProcSharedTextureMemoryGetProperties sharedTextureMemoryGetProperties; - WGPUProcSharedTextureMemoryIsDeviceLost sharedTextureMemoryIsDeviceLost; - WGPUProcSharedTextureMemorySetLabel sharedTextureMemorySetLabel; - WGPUProcSharedTextureMemoryAddRef sharedTextureMemoryAddRef; - WGPUProcSharedTextureMemoryRelease sharedTextureMemoryRelease; - - WGPUProcSharedTextureMemoryEndAccessStateFreeMembers sharedTextureMemoryEndAccessStateFreeMembers; - - WGPUProcSupportedFeaturesFreeMembers supportedFeaturesFreeMembers; - - WGPUProcSupportedInstanceFeaturesFreeMembers supportedInstanceFeaturesFreeMembers; - - WGPUProcSupportedWGSLLanguageFeaturesFreeMembers supportedWGSLLanguageFeaturesFreeMembers; - - WGPUProcSurfaceConfigure surfaceConfigure; - WGPUProcSurfaceGetCapabilities surfaceGetCapabilities; - WGPUProcSurfaceGetCurrentTexture surfaceGetCurrentTexture; - WGPUProcSurfacePresent surfacePresent; - WGPUProcSurfaceSetLabel surfaceSetLabel; - WGPUProcSurfaceUnconfigure surfaceUnconfigure; - WGPUProcSurfaceAddRef surfaceAddRef; - WGPUProcSurfaceRelease surfaceRelease; - - WGPUProcSurfaceCapabilitiesFreeMembers surfaceCapabilitiesFreeMembers; - - WGPUProcTexelBufferViewSetLabel texelBufferViewSetLabel; - WGPUProcTexelBufferViewAddRef texelBufferViewAddRef; - WGPUProcTexelBufferViewRelease texelBufferViewRelease; - - WGPUProcTextureCreateErrorView textureCreateErrorView; - WGPUProcTextureCreateView textureCreateView; - WGPUProcTextureDestroy textureDestroy; - WGPUProcTextureGetDepthOrArrayLayers textureGetDepthOrArrayLayers; - WGPUProcTextureGetDimension textureGetDimension; - WGPUProcTextureGetFormat textureGetFormat; - WGPUProcTextureGetHeight textureGetHeight; - WGPUProcTextureGetMipLevelCount textureGetMipLevelCount; - WGPUProcTextureGetSampleCount textureGetSampleCount; - WGPUProcTextureGetTextureBindingViewDimension textureGetTextureBindingViewDimension; - WGPUProcTextureGetUsage textureGetUsage; - WGPUProcTextureGetWidth textureGetWidth; - WGPUProcTexturePin texturePin; - WGPUProcTextureSetLabel textureSetLabel; - WGPUProcTextureSetOwnershipForMemoryDump textureSetOwnershipForMemoryDump; - WGPUProcTextureUnpin textureUnpin; - WGPUProcTextureAddRef textureAddRef; - WGPUProcTextureRelease textureRelease; - - WGPUProcTextureViewSetLabel textureViewSetLabel; - WGPUProcTextureViewAddRef textureViewAddRef; - WGPUProcTextureViewRelease textureViewRelease; - - -} DawnProcTable; - -#endif // DAWN_DAWN_PROC_TABLE_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/D3D11Backend.h b/.scratch/dawn-package/extracted/include/dawn/native/D3D11Backend.h deleted file mode 100644 index 29d9156..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/D3D11Backend.h +++ /dev/null @@ -1,65 +0,0 @@ -// 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/.scratch/dawn-package/extracted/include/dawn/native/D3D12Backend.h b/.scratch/dawn-package/extracted/include/dawn/native/D3D12Backend.h deleted file mode 100644 index e27c671..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/D3D12Backend.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 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_D3D12BACKEND_H_ -#define INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_ - -#include -#include -#include -#include - -#include "dawn/native/D3DBackend.h" - -struct ID3D12Device; -struct ID3D12Resource; - -namespace dawn::native::d3d12 { - -class Device; - -enum MemorySegment { - Local, - NonLocal, -}; - -DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D12Device(WGPUDevice device); - -DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetOrCreateD3D11On12Device( - WGPUDevice device); - -DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D12CommandQueue( - WGPUDevice device); - -DAWN_NATIVE_EXPORT uint64_t SetExternalMemoryReservation(WGPUDevice device, - uint64_t requestedReservationSize, - MemorySegment memorySegment); - -// May be chained on SharedBufferMemoryDescriptor -struct DAWN_NATIVE_EXPORT SharedBufferMemoryD3D12ResourceDescriptor : wgpu::ChainedStruct { - SharedBufferMemoryD3D12ResourceDescriptor() { - sType = static_cast(WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor); - } - - // This ID3D12Resource object must be created from the same ID3D12Device used in the - // WGPUDevice. - Microsoft::WRL::ComPtr resource; -}; - -// May be chained on SharedTextureMemoryDescriptor. -struct DAWN_NATIVE_EXPORT SharedTextureMemoryD3D12ResourceDescriptor : wgpu::ChainedStruct { - SharedTextureMemoryD3D12ResourceDescriptor() { - sType = static_cast(WGPUSType_SharedTextureMemoryD3D12ResourceDescriptor); - } - - // This ID3D12Resource object must be created from the same ID3D12Device used in the - // WGPUDevice. - Microsoft::WRL::ComPtr resource; -}; - -} // namespace dawn::native::d3d12 - -#endif // INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/D3DBackend.h b/.scratch/dawn-package/extracted/include/dawn/native/D3DBackend.h deleted file mode 100644 index f00e3bc..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/D3DBackend.h +++ /dev/null @@ -1,56 +0,0 @@ -// 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" - -namespace dawn::native::d3d { - -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_t kDXGIKeyedMutexAcquireKey = 0; - -} // namespace dawn::native::d3d - -#endif // INCLUDE_DAWN_NATIVE_D3DBACKEND_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/DawnNative.h b/.scratch/dawn-package/extracted/include/dawn/native/DawnNative.h deleted file mode 100644 index c0f2bf1..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/DawnNative.h +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright 2018 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_DAWNNATIVE_H_ -#define INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_ - -#include - -#include -#include -#include - -#include "dawn/dawn_proc_table.h" -#include "dawn/native/dawn_native_export.h" - -namespace dawn::platform { -class Platform; -} // namespace dawn::platform - -namespace dawn::native { - -class InstanceBase; -class AdapterBase; - -// 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 -// features and optimizations. -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 -// required to be supported by all Dawn backends and can only be used when it is enabled on the -// creation of device. -struct FeatureInfo { - const char* name; - const char* description; - const char* url; - // The enum of feature state, could be stable or experimental. Using an experimental feature - // requires the AllowUnsafeAPIs toggle to be enabled. - enum class FeatureState { Stable = 0, Experimental }; - FeatureState featureState; -}; - -// An adapter is an object that represent on possibility of creating devices in the system. -// Most of the time it will represent a combination of a physical GPU and an API. Not that the -// same GPU can be represented by multiple adapters but on different APIs. -// -// The underlying Dawn adapter is owned by the Dawn instance so this class is not RAII but just -// a reference to an underlying adapter. -class DAWN_NATIVE_EXPORT Adapter { - public: - Adapter(); - // NOLINTNEXTLINE(runtime/explicit) - Adapter(AdapterBase* impl); - ~Adapter(); - - Adapter(const Adapter& other); - Adapter& operator=(const Adapter& other); - - void SetUseTieredLimits(bool useTieredLimits); - - // Check that the Adapter is able to support importing external images. This is necessary - // to implement the swapchain and interop APIs in Chromium. - bool SupportsExternalImages() const; - - explicit operator bool() const; - - // Create a device on this adapter. On an error, nullptr is returned. - WGPUDevice CreateDevice(const wgpu::DeviceDescriptor* deviceDescriptor); - WGPUDevice CreateDevice(const WGPUDeviceDescriptor* deviceDescriptor = nullptr); - - // Returns the underlying WGPUAdapter object. - WGPUAdapter Get() const; - - // Reset the backend device object for testing purposes. - void ResetInternalDeviceForTesting(); - - private: - AdapterBase* mImpl = nullptr; -}; - -enum BackendValidationLevel { Full, Partial, Disabled }; - -// Can be chained in InstanceDescriptor -struct DAWN_NATIVE_EXPORT DawnInstanceDescriptor : wgpu::ChainedStruct { - DawnInstanceDescriptor(); - uint32_t additionalRuntimeSearchPathsCount = 0; - const char* const* additionalRuntimeSearchPaths = nullptr; - dawn::platform::Platform* platform = nullptr; - - BackendValidationLevel backendValidationLevel = BackendValidationLevel::Disabled; - bool beginCaptureOnStartup = false; - - WGPULoggingCallbackInfo loggingCallbackInfo = WGPU_LOGGING_CALLBACK_INFO_INIT; - - template , - typename = std::enable_if_t>> - void SetLoggingCallback(F callback, T userdata) { - assert(loggingCallbackInfo.callback == nullptr); - - loggingCallbackInfo.callback = [](WGPULoggingType type, struct WGPUStringView message, - void* callback_param, void* userdata_param) { - auto cb = reinterpret_cast(callback_param); - (*cb)(static_cast(type), message, static_cast(userdata_param)); - }; - loggingCallbackInfo.userdata1 = reinterpret_cast(+callback); - loggingCallbackInfo.userdata2 = reinterpret_cast(userdata); - } - - template , - typename = std::enable_if_t>> - void SetLoggingCallback(L callback) { - assert(loggingCallbackInfo.callback == nullptr); - using F = wgpu::LoggingCallback; - static_assert(std::is_convertible_v, "Logging callback cannot be a binding lambda"); - - loggingCallbackInfo.callback = [](WGPULoggingType type, struct WGPUStringView message, - void* callback_param, void*) { - auto cb = reinterpret_cast(callback_param); - (*cb)(static_cast(type), message); - }; - loggingCallbackInfo.userdata1 = reinterpret_cast(+callback); - loggingCallbackInfo.userdata2 = 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). -// -// This is an RAII class for Dawn instances and also controls the lifetime of all adapters -// for this instance. -class DAWN_NATIVE_EXPORT Instance { - public: - explicit Instance(const WGPUInstanceDescriptor* desc = nullptr); - explicit Instance(const wgpu::InstanceDescriptor* desc); - explicit Instance(InstanceBase* impl); - ~Instance(); - - Instance(const Instance& other) = delete; - Instance& operator=(const Instance& other) = delete; - - // 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); - - // Enables backend validation layers - void SetBackendValidationLevel(BackendValidationLevel validationLevel); - - uint64_t GetDeviceCountForTesting() const; - // Backdoor to get the number of deprecation warnings for testing - uint64_t GetDeprecationWarningCountForTesting() const; - - // Returns the underlying WGPUInstance object. - WGPUInstance Get() const; - - // Make mImpl->mPlatform point to an object inside Dawn in case it becomes a dangling pointer - void DisconnectDawnPlatform(); - - // Used by DawnTest, NOT thread-safe. - void SetPlatformForTesting(dawn::platform::Platform* platform); - - private: - InstanceBase* mImpl = nullptr; -}; - -// Backend-agnostic API for dawn_native -DAWN_NATIVE_EXPORT const DawnProcTable& GetProcs(); - -// Query the names of all the toggles that are enabled in adapter -DAWN_NATIVE_EXPORT std::vector GetTogglesUsed(const wgpu::Adapter& adapter); - -// Query the names of all the toggles that are enabled in device -DAWN_NATIVE_EXPORT std::vector GetTogglesUsed(WGPUDevice device); - -// Backdoor to get the number of lazy clears for testing -DAWN_NATIVE_EXPORT size_t GetLazyClearCountForTesting(WGPUDevice device); - -// Query if texture has been initialized -DAWN_NATIVE_EXPORT bool IsTextureSubresourceInitialized( - WGPUTexture texture, - uint32_t baseMipLevel, - uint32_t levelCount, - uint32_t baseArrayLayer, - uint32_t layerCount, - WGPUTextureAspect aspect = WGPUTextureAspect_All); - -// Backdoor to get the order of the ProcMap for testing -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(); -DAWN_NATIVE_EXPORT void ClearErrorInjector(); -DAWN_NATIVE_EXPORT uint64_t AcquireErrorInjectorCallCount(); -DAWN_NATIVE_EXPORT void InjectErrorAt(uint64_t index); - -// The different types of external images -enum ExternalImageType : uint16_t { - OpaqueFD, - DmaBuf, - IOSurface, - EGLImage, - GLTexture, - AHardwareBuffer, - Last = AHardwareBuffer, -}; - -// Common properties of external images -struct DAWN_NATIVE_EXPORT ExternalImageDescriptor { - public: - const WGPUTextureDescriptor* cTextureDescriptor = nullptr; // Must match image creation params - bool isInitialized = false; // Whether the texture is initialized on import - ExternalImageType GetType() const; - - protected: - explicit ExternalImageDescriptor(ExternalImageType type); - - private: - ExternalImageType mType; -}; - -struct DAWN_NATIVE_EXPORT ExternalImageExportInfo { - public: - bool isInitialized = false; // Whether the texture is initialized after export - ExternalImageType GetType() const; - - protected: - explicit ExternalImageExportInfo(ExternalImageType type); - - private: - ExternalImageType mType; -}; - -DAWN_NATIVE_EXPORT bool CheckIsErrorForTesting(void* objectHandle); - -DAWN_NATIVE_EXPORT std::string GetObjectLabelForTesting(void* objectHandle); - -DAWN_NATIVE_EXPORT uint64_t GetAllocatedSizeForTesting(WGPUBuffer buffer); - -DAWN_NATIVE_EXPORT std::vector AllToggleInfos(); - -// 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); - -class DAWN_NATIVE_EXPORT MemoryDump { - public: - // Standard attribute |name|s for the AddScalar() and AddString() methods. - // These match the expected names in Chromium memory-infra instrumentation. - static const char kNameSize[]; // To represent allocated space. - static const char kNameObjectCount[]; // To represent number of objects. - - // Standard attribute |unit|s for the AddScalar() and AddString() methods. - // These match the expected names in Chromium memory-infra instrumentation. - static const char kUnitsBytes[]; // Unit name to represent bytes. - static const char kUnitsObjects[]; // Unit name to represent #objects. - - MemoryDump() = default; - - virtual void AddScalar(const char* name, - const char* key, - const char* units, - uint64_t value) = 0; - - virtual void AddString(const char* name, const char* key, const std::string& value) = 0; - - virtual void AddOwnerGUID(const char* name, uint64_t ownerGUID); - - MemoryDump(const MemoryDump&) = delete; - MemoryDump& operator=(const MemoryDump&) = delete; - - protected: - virtual ~MemoryDump() = default; -}; -DAWN_NATIVE_EXPORT void DumpMemoryStatistics(WGPUDevice device, MemoryDump* dump); - -// Intended for background tracing for UMA that returns the estimated memory usage. -struct DAWN_NATIVE_EXPORT MemoryUsageInfo { - // Total memory usage. - uint64_t totalUsage; - // Total depth stencil textures' memory. - uint64_t depthStencilTexturesUsage; - // Total MSAA textures' memory. - uint64_t msaaTexturesUsage; - // Number of MSAA textures. - uint64_t msaaTexturesCount; - // Largest MSAA texture's memory. - uint64_t largestMsaaTextureUsage; - // Total textures' memory. - uint64_t texturesUsage; - // Total buffers' memory. - uint64_t buffersUsage; -}; -DAWN_NATIVE_EXPORT MemoryUsageInfo ComputeEstimatedMemoryUsageInfo(WGPUDevice device); - -// Memory information gathered from backend specific allocators. -// - memory allocated by clients for objects such as buffers, textures. -// - heap memory used by the allocator for allocations. -struct DAWN_NATIVE_EXPORT AllocatorMemoryInfo { - uint64_t totalUsedMemory = 0; - uint64_t totalAllocatedMemory = 0; - uint64_t totalLazyAllocatedMemory = 0; - uint64_t totalLazyUsedMemory = 0; -}; -DAWN_NATIVE_EXPORT AllocatorMemoryInfo GetAllocatorMemoryInfo(WGPUDevice device); - -// Free any unused GPU memory like staging buffers, cached resources, etc. Returns true if there are -// still objects to delete and ReduceMemoryUsage() should be run again after a short delay to allow -// submitted work to complete. -DAWN_NATIVE_EXPORT bool ReduceMemoryUsage(WGPUDevice device); - -// Perform tasks that are appropriate to do when idle like serializing pipeline -// caches, etc. -DAWN_NATIVE_EXPORT void PerformIdleTasks(const wgpu::Device& device); - -DAWN_NATIVE_EXPORT bool IsDeviceLost(WGPUDevice device); - -} // namespace dawn::native - -#endif // INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/NullBackend.h b/.scratch/dawn-package/extracted/include/dawn/native/NullBackend.h deleted file mode 100644 index 5de9920..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/NullBackend.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 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_NULLBACKEND_H_ -#define INCLUDE_DAWN_NATIVE_NULLBACKEND_H_ - -#include "dawn/native/DawnNative.h" - -namespace dawn::native::null { - -// Nothing for now \o/ - -} // namespace dawn::native::null - -#endif // INCLUDE_DAWN_NATIVE_NULLBACKEND_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/VulkanBackend.h b/.scratch/dawn-package/extracted/include/dawn/native/VulkanBackend.h deleted file mode 100644 index 355c4b8..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/VulkanBackend.h +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2018 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_VULKANBACKEND_H_ -#define INCLUDE_DAWN_NATIVE_VULKANBACKEND_H_ - -#include - -#include -#include - -#include "dawn/native/DawnNative.h" - -namespace dawn::native::vulkan { - -DAWN_NATIVE_EXPORT VkInstance GetInstance(WGPUDevice device); - -DAWN_NATIVE_EXPORT PFN_vkVoidFunction GetInstanceProcAddr(WGPUDevice device, const char* pName); - -enum class NeedsDedicatedAllocation { - Yes, - No, - // Use Vulkan reflection to detect whether a dedicated allocation is needed. - Detect, -}; - -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorVk : ExternalImageDescriptor { - public: - // The following members may be ignored if |ExternalImageDescriptor::isInitialized| is false - // since the import does not need to preserve texture contents. - - // See https://www.khronos.org/registry/vulkan/specs/1.1/html/chap7.html. The acquire - // operation old/new layouts must match exactly the layouts in the release operation. So - // we may need to issue two barriers releasedOldLayout -> releasedNewLayout -> - // cTextureDescriptor.usage if the new layout is not compatible with the desired usage. - // The first barrier is the queue transfer, the second is the layout transition to our - // desired usage. - VkImageLayout releasedOldLayout = VK_IMAGE_LAYOUT_GENERAL; - VkImageLayout releasedNewLayout = VK_IMAGE_LAYOUT_GENERAL; - - // Try to detect the need to use a dedicated allocation for imported images by default but let - // the application override this as drivers have bugs and forget to require a dedicated - // allocation. - NeedsDedicatedAllocation dedicatedAllocation = NeedsDedicatedAllocation::Detect; - - protected: - using ExternalImageDescriptor::ExternalImageDescriptor; -}; - -struct ExternalImageExportInfoVk : ExternalImageExportInfo { - public: - // See comments in |ExternalImageDescriptorVk| - // Contains the old/new layouts used in the queue release operation. - VkImageLayout releasedOldLayout = VK_IMAGE_LAYOUT_UNDEFINED; - VkImageLayout releasedNewLayout = VK_IMAGE_LAYOUT_UNDEFINED; - - protected: - using ExternalImageExportInfo::ExternalImageExportInfo; -}; - -// Can't use DAWN_PLATFORM_IS(LINUX) since header included in both Dawn and Chrome -#if defined(__linux__) || defined(__Fuchsia__) - -// Common properties of external images represented by FDs. On successful import the file -// descriptor's ownership is transferred to the Dawn implementation and they shouldn't be -// used outside of Dawn again. TODO(enga): Also transfer ownership in the error case so the -// caller can assume the FD is always consumed. -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorFD : ExternalImageDescriptorVk { - public: - int memoryFD = -1; // A file descriptor from an export of the memory of the image - std::vector waitFDs; // File descriptors of semaphores which will be waited on - - protected: - using ExternalImageDescriptorVk::ExternalImageDescriptorVk; -}; - -// Descriptor for opaque file descriptor image import -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorOpaqueFD : ExternalImageDescriptorFD { - ExternalImageDescriptorOpaqueFD(); - - VkDeviceSize allocationSize = 0; // Must match VkMemoryAllocateInfo from image creation - uint32_t memoryTypeIndex = 0; // Must match VkMemoryAllocateInfo from image creation -}; - -// The plane-wise offset and stride. -struct DAWN_NATIVE_EXPORT PlaneLayout { - uint64_t offset = 0; - uint32_t stride = 0; -}; - -// Descriptor for dma-buf file descriptor image import -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorDmaBuf : ExternalImageDescriptorFD { - ExternalImageDescriptorDmaBuf(); - - static constexpr uint32_t kMaxPlanes = 3; - std::array planeLayouts = {}; - uint64_t drmModifier = 0; // DRM modifier of the buffer -}; - -// Info struct that is written to in |ExportVulkanImage|. -struct DAWN_NATIVE_EXPORT ExternalImageExportInfoFD : ExternalImageExportInfoVk { - public: - // Contains the exported semaphore handles. - std::vector semaphoreHandles; - - protected: - using ExternalImageExportInfoVk::ExternalImageExportInfoVk; -}; - -struct DAWN_NATIVE_EXPORT ExternalImageExportInfoOpaqueFD : ExternalImageExportInfoFD { - ExternalImageExportInfoOpaqueFD(); -}; - -struct DAWN_NATIVE_EXPORT ExternalImageExportInfoDmaBuf : ExternalImageExportInfoFD { - ExternalImageExportInfoDmaBuf(); -}; - -#ifdef __ANDROID__ - -// Descriptor for AHardwareBuffer image import -struct DAWN_NATIVE_EXPORT ExternalImageDescriptorAHardwareBuffer : ExternalImageDescriptorVk { - public: - ExternalImageDescriptorAHardwareBuffer(); - - struct AHardwareBuffer* handle; // The AHardwareBuffer which contains the memory of the image - std::vector waitFDs; // File descriptors of semaphores which will be waited on - - protected: - using ExternalImageDescriptorVk::ExternalImageDescriptorVk; -}; - -struct DAWN_NATIVE_EXPORT ExternalImageExportInfoAHardwareBuffer : ExternalImageExportInfoFD { - ExternalImageExportInfoAHardwareBuffer(); -}; - -#endif // __ANDROID__ - -#endif // defined(__linux__) || defined(__Fuchsia__) - -// Imports external memory into a Vulkan image. Internally, this uses external memory / -// semaphore extensions to import the image and wait on the provided synchronizaton -// primitives before the texture can be used. -// On failure, returns a nullptr. -DAWN_NATIVE_EXPORT WGPUTexture WrapVulkanImage(WGPUDevice device, - const ExternalImageDescriptorVk* descriptor); - -// Exports external memory from a Vulkan image. This must be called on wrapped textures -// before they are destroyed. It writes the semaphore to wait on and the old/new image -// layouts to |info|. Pass VK_IMAGE_LAYOUT_UNDEFINED as |desiredLayout| if you don't want to -// perform a layout transition. -DAWN_NATIVE_EXPORT bool ExportVulkanImage(WGPUTexture texture, - VkImageLayout desiredLayout, - ExternalImageExportInfoVk* info); -// |ExportVulkanImage| with default desiredLayout of VK_IMAGE_LAYOUT_UNDEFINED. -DAWN_NATIVE_EXPORT bool ExportVulkanImage(WGPUTexture texture, ExternalImageExportInfoVk* info); - -} // namespace dawn::native::vulkan - -#endif // INCLUDE_DAWN_NATIVE_VULKANBACKEND_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/native/dawn_native_export.h b/.scratch/dawn-package/extracted/include/dawn/native/dawn_native_export.h deleted file mode 100644 index 0dc6f63..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/native/dawn_native_export.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 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_DAWN_NATIVE_EXPORT_H_ -#define INCLUDE_DAWN_NATIVE_DAWN_NATIVE_EXPORT_H_ - -#if defined(DAWN_NATIVE_SHARED_LIBRARY) -#if defined(_WIN32) -#if defined(DAWN_NATIVE_IMPLEMENTATION) -#define DAWN_NATIVE_EXPORT __declspec(dllexport) -#else -#define DAWN_NATIVE_EXPORT __declspec(dllimport) -#endif -#else // defined(_WIN32) -#if defined(DAWN_NATIVE_IMPLEMENTATION) -#define DAWN_NATIVE_EXPORT __attribute__((visibility("default"))) -#else -#define DAWN_NATIVE_EXPORT -#endif -#endif // defined(_WIN32) -#else // defined(DAWN_NATIVE_SHARED_LIBRARY) -#define DAWN_NATIVE_EXPORT -#endif // defined(DAWN_NATIVE_SHARED_LIBRARY) - -#endif // INCLUDE_DAWN_NATIVE_DAWN_NATIVE_EXPORT_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/webgpu.h b/.scratch/dawn-package/extracted/include/dawn/webgpu.h deleted file mode 100644 index 24122f4..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/webgpu.h +++ /dev/null @@ -1,5025 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2019, "WebGPU native" developers -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifdef __EMSCRIPTEN__ -#error "Do not include this header. Emscripten already provides headers needed for WebGPU." -#endif - -#ifndef WEBGPU_H_ -#define WEBGPU_H_ - -#if defined(WGPU_SHARED_LIBRARY) -# if defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __declspec(dllexport) -# else -# define WGPU_EXPORT __declspec(dllimport) -# endif -# else // defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __attribute__((visibility("default"))) -# else -# define WGPU_EXPORT -# endif -# endif // defined(_WIN32) -#else // defined(WGPU_SHARED_LIBRARY) -# define WGPU_EXPORT -#endif // defined(WGPU_SHARED_LIBRARY) - -#if !defined(WGPU_OBJECT_ATTRIBUTE) -#define WGPU_OBJECT_ATTRIBUTE -#endif -#if !defined(WGPU_ENUM_ATTRIBUTE) -#define WGPU_ENUM_ATTRIBUTE -#endif -#if !defined(WGPU_STRUCTURE_ATTRIBUTE) -#define WGPU_STRUCTURE_ATTRIBUTE -#endif -#if !defined(WGPU_FUNCTION_ATTRIBUTE) -#define WGPU_FUNCTION_ATTRIBUTE -#endif -#if !defined(WGPU_NULLABLE) -#define WGPU_NULLABLE -#endif - -#include -#include -#include - -#define _wgpu_COMMA , -#if defined(__cplusplus) -# define _wgpu_ENUM_ZERO_INIT(type) type(0) -# define _wgpu_STRUCT_ZERO_INIT {} -# if __cplusplus >= 201103L -# define _wgpu_MAKE_INIT_STRUCT(type, value) (type value) -# else -# define _wgpu_MAKE_INIT_STRUCT(type, value) value -# endif -#else -# define _wgpu_ENUM_ZERO_INIT(type) (type)0 -# define _wgpu_STRUCT_ZERO_INIT {0} -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -# define _wgpu_MAKE_INIT_STRUCT(type, value) ((type) value) -# else -# define _wgpu_MAKE_INIT_STRUCT(type, value) value -# endif -#endif - -#define WGPU_TRUE (UINT32_C(1)) -#define WGPU_FALSE (UINT32_C(0)) -#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (UINT32_MAX) -#define WGPU_COPY_STRIDE_UNDEFINED (UINT32_MAX) -#define WGPU_DEPTH_CLEAR_VALUE_UNDEFINED (NAN) -#define WGPU_DEPTH_SLICE_UNDEFINED (UINT32_MAX) -#define WGPU_INVALID_BINDING (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_STRLEN (SIZE_MAX) -#define WGPU_WHOLE_MAP_SIZE (SIZE_MAX) -#define WGPU_WHOLE_SIZE (UINT64_MAX) - -typedef struct WGPUStringView { - WGPU_NULLABLE char const * data; - size_t length; -} WGPUStringView WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_STRING_VIEW_INIT _wgpu_MAKE_INIT_STRUCT(WGPUStringView, { \ - /*.data=*/NULL _wgpu_COMMA \ - /*.length=*/WGPU_STRLEN _wgpu_COMMA \ -}) - -typedef uint64_t WGPUFlags; -typedef uint32_t WGPUBool; - -typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUBufferImpl* WGPUBuffer WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUComputePipelineImpl* WGPUComputePipeline WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUDeviceImpl* WGPUDevice WGPU_OBJECT_ATTRIBUTE; -typedef struct 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 WGPUResourceTableImpl* WGPUResourceTable 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 WGPUTexelBufferViewImpl* WGPUTexelBufferView WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; - -// Structure forward declarations -struct WGPUAdapterPropertiesD3D; -struct WGPUAdapterPropertiesDrm; -struct WGPUAdapterPropertiesVk; -struct WGPUAdapterPropertiesWGPU; -struct WGPUBindingResource; -struct WGPUBlendComponent; -struct WGPUBufferBindingLayout; -struct WGPUBufferHostMappedPointer; -struct WGPUColor; -struct WGPUColorSpaceDawn; -struct WGPUColorTargetStateExpandResolveTextureDawn; -struct WGPUCommandBufferDescriptor; -struct WGPUCompatibilityModeLimits; -struct WGPUConstantEntry; -struct WGPUCopyTextureForBrowserOptions; -struct WGPUDawnAdapterPropertiesPowerPreference; -struct WGPUDawnBufferDescriptorErrorInfoFromWireClient; -struct WGPUDawnCacheDeviceDescriptor; -struct WGPUDawnCompilationMessageUtf16; -struct WGPUDawnConsumeAdapterDescriptor; -struct WGPUDawnDeviceAllocatorControl; -struct WGPUDawnDrmFormatProperties; -struct WGPUDawnEncoderInternalUsageDescriptor; -struct WGPUDawnFakeBufferOOMForTesting; -struct WGPUDawnFakeDeviceInitializeErrorForTesting; -struct WGPUDawnHostMappedPointerLimits; -struct WGPUDawnInjectedInvalidSType; -struct WGPUDawnRenderPassSampleCount; -struct WGPUDawnShaderModuleSPIRVOptionsDescriptor; -struct WGPUDawnTexelCopyBufferRowAlignmentLimits; -struct WGPUDawnTextureInternalUsageDescriptor; -struct WGPUDawnTogglesDescriptor; -struct WGPUDawnWGSLBlocklist; -struct WGPUDawnWireWGSLControl; -struct WGPUEmscriptenSurfaceSourceCanvasHTMLSelector; -struct WGPUExtent2D; -struct WGPUExtent3D; -struct WGPUExternalTextureBindingEntry; -struct WGPUExternalTextureBindingLayout; -struct WGPUFuture; -struct WGPUInstanceLimits; -struct WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER; -struct WGPUMemoryHeapInfo; -struct WGPUMultisampleState; -struct WGPUOrigin2D; -struct WGPUOrigin3D; -struct WGPUPassTimestampWrites; -struct WGPUPipelineLayoutResourceTable; -struct WGPUPipelineLayoutStorageAttachment; -struct WGPUPrimitiveState; -struct WGPUQuerySetDescriptor; -struct WGPUQueueDescriptor; -struct WGPURenderBundleDescriptor; -struct WGPURenderBundleEncoderDescriptor; -struct WGPURenderPassDepthStencilAttachment; -struct WGPURenderPassDescriptorResolveRect; -struct WGPURenderPassMaxDrawCount; -struct WGPURequestAdapterWebGPUBackendOptions; -struct WGPURequestAdapterWebXROptions; -struct WGPUResourceTableDescriptor; -struct WGPUSamplerBindingLayout; -struct WGPUShaderModuleCompilationOptions; -struct WGPUShaderSourceSPIRV; -struct WGPUShaderSourceWGSL; -struct WGPUSharedBufferMemoryBeginAccessDescriptor; -struct WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor; -struct WGPUSharedBufferMemoryEndAccessState; -struct WGPUSharedBufferMemoryProperties; -struct WGPUSharedFenceDXGISharedHandleDescriptor; -struct WGPUSharedFenceDXGISharedHandleExportInfo; -struct WGPUSharedFenceEGLSyncDescriptor; -struct WGPUSharedFenceEGLSyncExportInfo; -struct WGPUSharedFenceMTLSharedEventDescriptor; -struct WGPUSharedFenceMTLSharedEventExportInfo; -struct WGPUSharedFenceSyncFDDescriptor; -struct WGPUSharedFenceSyncFDExportInfo; -struct WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor; -struct WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo; -struct WGPUSharedFenceVkSemaphoreZirconHandleDescriptor; -struct WGPUSharedFenceVkSemaphoreZirconHandleExportInfo; -struct WGPUSharedTextureMemoryAHardwareBufferDescriptor; -struct WGPUSharedTextureMemoryD3D11BeginState; -struct WGPUSharedTextureMemoryD3DSwapchainBeginState; -struct WGPUSharedTextureMemoryDmaBufPlane; -struct WGPUSharedTextureMemoryDXGISharedHandleDescriptor; -struct WGPUSharedTextureMemoryEGLImageDescriptor; -struct WGPUSharedTextureMemoryIOSurfaceDescriptor; -struct WGPUSharedTextureMemoryOpaqueFDDescriptor; -struct WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor; -struct WGPUSharedTextureMemoryVkImageLayoutBeginState; -struct WGPUSharedTextureMemoryVkImageLayoutEndState; -struct WGPUSharedTextureMemoryZirconHandleDescriptor; -struct WGPUStaticSamplerBindingLayout; -struct WGPUStencilFaceState; -struct WGPUStorageTextureBindingLayout; -struct WGPUSubgroupMatrixConfig; -struct WGPUSupportedFeatures; -struct WGPUSupportedInstanceFeatures; -struct WGPUSupportedWGSLLanguageFeatures; -struct WGPUSurfaceCapabilities; -struct WGPUSurfaceColorManagement; -struct WGPUSurfaceConfiguration; -struct WGPUSurfaceDescriptorFromWindowsCoreWindow; -struct WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel; -struct WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel; -struct WGPUSurfaceSourceAndroidNativeWindow; -struct WGPUSurfaceSourceMetalLayer; -struct WGPUSurfaceSourceWaylandSurface; -struct WGPUSurfaceSourceWindowsHWND; -struct WGPUSurfaceSourceXCBWindow; -struct WGPUSurfaceSourceXlibWindow; -struct WGPUSurfaceTexture; -struct WGPUTexelBufferBindingEntry; -struct WGPUTexelBufferBindingLayout; -struct WGPUTexelBufferViewDescriptor; -struct WGPUTexelCopyBufferLayout; -struct WGPUTextureBindingLayout; -struct WGPUTextureBindingViewDimension; -struct WGPUTextureComponentSwizzle; -struct WGPUVertexAttribute; -struct WGPUYCbCrVkDescriptor; -struct WGPUAdapterPropertiesMemoryHeaps; -struct WGPUAdapterPropertiesSubgroupMatrixConfigs; -struct WGPUAHardwareBufferProperties; -struct WGPUBindGroupEntry; -struct WGPUBindGroupLayoutEntry; -struct WGPUBlendState; -struct WGPUBufferDescriptor; -struct WGPUCommandEncoderDescriptor; -struct WGPUCompilationMessage; -struct WGPUComputePassDescriptor; -struct WGPUComputeState; -struct WGPUDawnDrmFormatCapabilities; -struct WGPUDepthStencilState; -struct WGPUExternalTextureDescriptor; -struct WGPUFutureWaitInfo; -struct WGPUImageCopyExternalTexture; -struct WGPUInstanceDescriptor; -struct WGPULimits; -struct WGPUPipelineLayoutPixelLocalStorage; -struct WGPURenderPassColorAttachment; -struct WGPURenderPassRenderAreaRect; -struct WGPURenderPassStorageAttachment; -struct WGPURequestAdapterOptions; -struct WGPUSamplerDescriptor; -struct WGPUShaderModuleDescriptor; -struct WGPUSharedBufferMemoryDescriptor; -struct WGPUSharedFenceDescriptor; -struct WGPUSharedFenceExportInfo; -struct WGPUSharedTextureMemoryAHardwareBufferProperties; -struct WGPUSharedTextureMemoryBeginAccessDescriptor; -struct WGPUSharedTextureMemoryDmaBufDescriptor; -struct WGPUSharedTextureMemoryMetalEndAccessState; -struct WGPUSurfaceDescriptor; -struct WGPUTexelCopyBufferInfo; -struct WGPUTexelCopyTextureInfo; -struct WGPUTextureComponentSwizzleDescriptor; -struct WGPUTextureDescriptor; -struct WGPUVertexBufferLayout; -struct WGPUAdapterInfo; -struct WGPUBindGroupDescriptor; -struct WGPUBindGroupLayoutDescriptor; -struct WGPUColorTargetState; -struct WGPUCompilationInfo; -struct WGPUComputePipelineDescriptor; -struct WGPUDawnFormatCapabilities; -struct WGPUDeviceDescriptor; -struct WGPUPipelineLayoutDescriptor; -struct WGPURenderPassPixelLocalStorage; -struct WGPUSharedTextureMemoryDescriptor; -struct WGPUSharedTextureMemoryEndAccessState; -struct WGPUSharedTextureMemoryProperties; -struct WGPUTextureViewDescriptor; -struct WGPUVertexState; -struct WGPUFragmentState; -struct WGPURenderPassDescriptor; -struct WGPURenderPipelineDescriptor; - -// Callback info structure forward declarations. -struct WGPUBufferMapCallbackInfo; -struct WGPUCompilationInfoCallbackInfo; -struct WGPUCreateComputePipelineAsyncCallbackInfo; -struct WGPUCreateRenderPipelineAsyncCallbackInfo; -struct WGPUDawnLoadCacheDataCallbackInfo; -struct WGPUDawnStoreCacheDataCallbackInfo; -struct WGPUDeviceLostCallbackInfo; -struct WGPULoggingCallbackInfo; -struct WGPUPopErrorScopeCallbackInfo; -struct WGPUQueueWorkDoneCallbackInfo; -struct WGPURequestAdapterCallbackInfo; -struct WGPURequestDeviceCallbackInfo; -struct WGPUUncapturedErrorCallbackInfo; - -typedef enum WGPUAdapterType { - WGPUAdapterType_DiscreteGPU = 0x00000001, - WGPUAdapterType_IntegratedGPU = 0x00000002, - WGPUAdapterType_CPU = 0x00000003, - WGPUAdapterType_Unknown = 0x00000004, - WGPUAdapterType_Force32 = 0x7FFFFFFF -} WGPUAdapterType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUAddressMode { - WGPUAddressMode_Undefined = 0x00000000, - WGPUAddressMode_ClampToEdge = 0x00000001, - WGPUAddressMode_Repeat = 0x00000002, - WGPUAddressMode_MirrorRepeat = 0x00000003, - WGPUAddressMode_Force32 = 0x7FFFFFFF -} WGPUAddressMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUAlphaMode { - WGPUAlphaMode_Opaque = 0x00000001, - WGPUAlphaMode_Premultiplied = 0x00000002, - WGPUAlphaMode_Unpremultiplied = 0x00000003, - WGPUAlphaMode_Force32 = 0x7FFFFFFF -} WGPUAlphaMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBackendType { - WGPUBackendType_Undefined = 0x00000000, - WGPUBackendType_Null = 0x00000001, - WGPUBackendType_WebGPU = 0x00000002, - WGPUBackendType_D3D11 = 0x00000003, - WGPUBackendType_D3D12 = 0x00000004, - WGPUBackendType_Metal = 0x00000005, - WGPUBackendType_Vulkan = 0x00000006, - WGPUBackendType_OpenGL = 0x00000007, - WGPUBackendType_OpenGLES = 0x00000008, - WGPUBackendType_Force32 = 0x7FFFFFFF -} WGPUBackendType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBlendFactor { - WGPUBlendFactor_Undefined = 0x00000000, - WGPUBlendFactor_Zero = 0x00000001, - WGPUBlendFactor_One = 0x00000002, - WGPUBlendFactor_Src = 0x00000003, - WGPUBlendFactor_OneMinusSrc = 0x00000004, - WGPUBlendFactor_SrcAlpha = 0x00000005, - WGPUBlendFactor_OneMinusSrcAlpha = 0x00000006, - WGPUBlendFactor_Dst = 0x00000007, - WGPUBlendFactor_OneMinusDst = 0x00000008, - WGPUBlendFactor_DstAlpha = 0x00000009, - WGPUBlendFactor_OneMinusDstAlpha = 0x0000000A, - WGPUBlendFactor_SrcAlphaSaturated = 0x0000000B, - WGPUBlendFactor_Constant = 0x0000000C, - WGPUBlendFactor_OneMinusConstant = 0x0000000D, - WGPUBlendFactor_Src1 = 0x0000000E, - WGPUBlendFactor_OneMinusSrc1 = 0x0000000F, - WGPUBlendFactor_Src1Alpha = 0x00000010, - WGPUBlendFactor_OneMinusSrc1Alpha = 0x00000011, - WGPUBlendFactor_Force32 = 0x7FFFFFFF -} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBlendOperation { - WGPUBlendOperation_Undefined = 0x00000000, - WGPUBlendOperation_Add = 0x00000001, - WGPUBlendOperation_Subtract = 0x00000002, - WGPUBlendOperation_ReverseSubtract = 0x00000003, - WGPUBlendOperation_Min = 0x00000004, - WGPUBlendOperation_Max = 0x00000005, - WGPUBlendOperation_Force32 = 0x7FFFFFFF -} WGPUBlendOperation WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUBufferBindingType { - WGPUBufferBindingType_BindingNotUsed = 0x00000000, - WGPUBufferBindingType_Undefined = 0x00000001, - WGPUBufferBindingType_Uniform = 0x00000002, - WGPUBufferBindingType_Storage = 0x00000003, - WGPUBufferBindingType_ReadOnlyStorage = 0x00000004, - WGPUBufferBindingType_Force32 = 0x7FFFFFFF -} WGPUBufferBindingType 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 = 0x00000001, - WGPUCallbackMode_AllowProcessEvents = 0x00000002, - WGPUCallbackMode_AllowSpontaneous = 0x00000003, - WGPUCallbackMode_Force32 = 0x7FFFFFFF -} WGPUCallbackMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUColorSpacePrimariesDawn { - WGPUColorSpacePrimariesDawn_SRGB = 0x00000001, - WGPUColorSpacePrimariesDawn_Rec709 = 0x00000001, - WGPUColorSpacePrimariesDawn_Rec601 = 0x00000002, - WGPUColorSpacePrimariesDawn_Rec2020 = 0x00000003, - WGPUColorSpacePrimariesDawn_DisplayP3 = 0x00000004, - WGPUColorSpacePrimariesDawn_Force32 = 0x7FFFFFFF -} WGPUColorSpacePrimariesDawn WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUColorSpaceTransferDawn { - WGPUColorSpaceTransferDawn_Identity = 0x00000001, - WGPUColorSpaceTransferDawn_SRGB = 0x00000002, - WGPUColorSpaceTransferDawn_DisplayP3 = 0x00000003, - WGPUColorSpaceTransferDawn_SMPTE_170M = 0x00000004, - WGPUColorSpaceTransferDawn_HLG = 0x00000005, - WGPUColorSpaceTransferDawn_PQ = 0x00000006, - WGPUColorSpaceTransferDawn_Force32 = 0x7FFFFFFF -} WGPUColorSpaceTransferDawn WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUColorSpaceYCbCrMatrixDawn { - WGPUColorSpaceYCbCrMatrixDawn_Identity = 0x00000001, - WGPUColorSpaceYCbCrMatrixDawn_Rec601 = 0x00000002, - WGPUColorSpaceYCbCrMatrixDawn_Rec709 = 0x00000003, - WGPUColorSpaceYCbCrMatrixDawn_Rec2020 = 0x00000004, - WGPUColorSpaceYCbCrMatrixDawn_Force32 = 0x7FFFFFFF -} WGPUColorSpaceYCbCrMatrixDawn WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUColorSpaceYCbCrRangeDawn { - WGPUColorSpaceYCbCrRangeDawn_Identity = 0x00000001, - WGPUColorSpaceYCbCrRangeDawn_Narrow = 0x00000002, - WGPUColorSpaceYCbCrRangeDawn_Full = 0x00000003, - WGPUColorSpaceYCbCrRangeDawn_Force32 = 0x7FFFFFFF -} WGPUColorSpaceYCbCrRangeDawn WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompareFunction { - WGPUCompareFunction_Undefined = 0x00000000, - WGPUCompareFunction_Never = 0x00000001, - WGPUCompareFunction_Less = 0x00000002, - WGPUCompareFunction_Equal = 0x00000003, - WGPUCompareFunction_LessEqual = 0x00000004, - WGPUCompareFunction_Greater = 0x00000005, - WGPUCompareFunction_NotEqual = 0x00000006, - WGPUCompareFunction_GreaterEqual = 0x00000007, - WGPUCompareFunction_Always = 0x00000008, - WGPUCompareFunction_Force32 = 0x7FFFFFFF -} WGPUCompareFunction WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompilationInfoRequestStatus { - WGPUCompilationInfoRequestStatus_Success = 0x00000001, - WGPUCompilationInfoRequestStatus_CallbackCancelled = 0x00000002, - WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF -} WGPUCompilationInfoRequestStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompilationMessageType { - WGPUCompilationMessageType_Error = 0x00000001, - WGPUCompilationMessageType_Warning = 0x00000002, - WGPUCompilationMessageType_Info = 0x00000003, - WGPUCompilationMessageType_Force32 = 0x7FFFFFFF -} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUComponentSwizzle { - WGPUComponentSwizzle_Undefined = 0x00000000, - WGPUComponentSwizzle_Zero = 0x00000001, - WGPUComponentSwizzle_One = 0x00000002, - WGPUComponentSwizzle_R = 0x00000003, - WGPUComponentSwizzle_G = 0x00000004, - WGPUComponentSwizzle_B = 0x00000005, - WGPUComponentSwizzle_A = 0x00000006, - WGPUComponentSwizzle_Force32 = 0x7FFFFFFF -} WGPUComponentSwizzle WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCompositeAlphaMode { - WGPUCompositeAlphaMode_Auto = 0x00000000, - WGPUCompositeAlphaMode_Opaque = 0x00000001, - WGPUCompositeAlphaMode_Premultiplied = 0x00000002, - WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003, - WGPUCompositeAlphaMode_Inherit = 0x00000004, - WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF -} WGPUCompositeAlphaMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCreatePipelineAsyncStatus { - WGPUCreatePipelineAsyncStatus_Success = 0x00000001, - WGPUCreatePipelineAsyncStatus_CallbackCancelled = 0x00000002, - WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000003, - WGPUCreatePipelineAsyncStatus_InternalError = 0x00000004, - WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUCreatePipelineAsyncStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUCullMode { - WGPUCullMode_Undefined = 0x00000000, - WGPUCullMode_None = 0x00000001, - WGPUCullMode_Front = 0x00000002, - WGPUCullMode_Back = 0x00000003, - WGPUCullMode_Force32 = 0x7FFFFFFF -} WGPUCullMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUDeviceLostReason { - WGPUDeviceLostReason_Unknown = 0x00000001, - WGPUDeviceLostReason_Destroyed = 0x00000002, - WGPUDeviceLostReason_CallbackCancelled = 0x00000003, - WGPUDeviceLostReason_FailedCreation = 0x00000004, - WGPUDeviceLostReason_Force32 = 0x7FFFFFFF -} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUErrorFilter { - WGPUErrorFilter_Validation = 0x00000001, - WGPUErrorFilter_OutOfMemory = 0x00000002, - WGPUErrorFilter_Internal = 0x00000003, - WGPUErrorFilter_Force32 = 0x7FFFFFFF -} WGPUErrorFilter WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUErrorType { - WGPUErrorType_NoError = 0x00000001, - WGPUErrorType_Validation = 0x00000002, - WGPUErrorType_OutOfMemory = 0x00000003, - WGPUErrorType_Internal = 0x00000004, - WGPUErrorType_Unknown = 0x00000005, - WGPUErrorType_Force32 = 0x7FFFFFFF -} WGPUErrorType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUExternalTextureRotation { - WGPUExternalTextureRotation_Rotate0Degrees = 0x00000001, - WGPUExternalTextureRotation_Rotate90Degrees = 0x00000002, - WGPUExternalTextureRotation_Rotate180Degrees = 0x00000003, - WGPUExternalTextureRotation_Rotate270Degrees = 0x00000004, - WGPUExternalTextureRotation_Force32 = 0x7FFFFFFF -} WGPUExternalTextureRotation WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFeatureLevel { - WGPUFeatureLevel_Undefined = 0x00000000, - WGPUFeatureLevel_Compatibility = 0x00000001, - WGPUFeatureLevel_Core = 0x00000002, - WGPUFeatureLevel_Force32 = 0x7FFFFFFF -} WGPUFeatureLevel WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFeatureName { - WGPUFeatureName_CoreFeaturesAndLimits = 0x00000001, - WGPUFeatureName_DepthClipControl = 0x00000002, - WGPUFeatureName_Depth32FloatStencil8 = 0x00000003, - WGPUFeatureName_TextureCompressionBC = 0x00000004, - WGPUFeatureName_TextureCompressionBCSliced3D = 0x00000005, - WGPUFeatureName_TextureCompressionETC2 = 0x00000006, - WGPUFeatureName_TextureCompressionASTC = 0x00000007, - WGPUFeatureName_TextureCompressionASTCSliced3D = 0x00000008, - WGPUFeatureName_TimestampQuery = 0x00000009, - WGPUFeatureName_IndirectFirstInstance = 0x0000000A, - WGPUFeatureName_ShaderF16 = 0x0000000B, - WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000C, - WGPUFeatureName_BGRA8UnormStorage = 0x0000000D, - WGPUFeatureName_Float32Filterable = 0x0000000E, - WGPUFeatureName_Float32Blendable = 0x0000000F, - WGPUFeatureName_ClipDistances = 0x00000010, - WGPUFeatureName_DualSourceBlending = 0x00000011, - WGPUFeatureName_Subgroups = 0x00000012, - WGPUFeatureName_TextureFormatsTier1 = 0x00000013, - WGPUFeatureName_TextureFormatsTier2 = 0x00000014, - WGPUFeatureName_PrimitiveIndex = 0x00000015, - WGPUFeatureName_TextureComponentSwizzle = 0x00000016, - WGPUFeatureName_DawnInternalUsages = 0x00050000, - WGPUFeatureName_DawnMultiPlanarFormats = 0x00050001, - WGPUFeatureName_DawnNative = 0x00050002, - WGPUFeatureName_ChromiumExperimentalTimestampQueryInsidePasses = 0x00050003, - WGPUFeatureName_ImplicitDeviceSynchronization = 0x00050004, - WGPUFeatureName_TransientAttachments = 0x00050006, - WGPUFeatureName_MSAARenderToSingleSampled = 0x00050007, - WGPUFeatureName_D3D11MultithreadProtected = 0x00050008, - WGPUFeatureName_ANGLETextureSharing = 0x00050009, - WGPUFeatureName_PixelLocalStorageCoherent = 0x0005000A, - WGPUFeatureName_PixelLocalStorageNonCoherent = 0x0005000B, - WGPUFeatureName_Unorm16TextureFormats = 0x0005000C, - WGPUFeatureName_MultiPlanarFormatExtendedUsages = 0x0005000D, - WGPUFeatureName_MultiPlanarFormatP010 = 0x0005000E, - WGPUFeatureName_HostMappedPointer = 0x0005000F, - WGPUFeatureName_MultiPlanarRenderTargets = 0x00050010, - WGPUFeatureName_MultiPlanarFormatNv12a = 0x00050011, - WGPUFeatureName_FramebufferFetch = 0x00050012, - WGPUFeatureName_BufferMapExtendedUsages = 0x00050013, - WGPUFeatureName_AdapterPropertiesMemoryHeaps = 0x00050014, - WGPUFeatureName_AdapterPropertiesD3D = 0x00050015, - WGPUFeatureName_AdapterPropertiesVk = 0x00050016, - WGPUFeatureName_DawnFormatCapabilities = 0x00050017, - WGPUFeatureName_DawnDrmFormatCapabilities = 0x00050018, - WGPUFeatureName_MultiPlanarFormatNv16 = 0x00050019, - WGPUFeatureName_MultiPlanarFormatNv24 = 0x0005001A, - WGPUFeatureName_MultiPlanarFormatP210 = 0x0005001B, - WGPUFeatureName_MultiPlanarFormatP410 = 0x0005001C, - WGPUFeatureName_SharedTextureMemoryVkDedicatedAllocation = 0x0005001D, - WGPUFeatureName_SharedTextureMemoryAHardwareBuffer = 0x0005001E, - WGPUFeatureName_SharedTextureMemoryDmaBuf = 0x0005001F, - WGPUFeatureName_SharedTextureMemoryOpaqueFD = 0x00050020, - WGPUFeatureName_SharedTextureMemoryZirconHandle = 0x00050021, - WGPUFeatureName_SharedTextureMemoryDXGISharedHandle = 0x00050022, - WGPUFeatureName_SharedTextureMemoryD3D11Texture2D = 0x00050023, - WGPUFeatureName_SharedTextureMemoryIOSurface = 0x00050024, - WGPUFeatureName_SharedTextureMemoryEGLImage = 0x00050025, - WGPUFeatureName_SharedFenceVkSemaphoreOpaqueFD = 0x00050026, - WGPUFeatureName_SharedFenceSyncFD = 0x00050027, - WGPUFeatureName_SharedFenceVkSemaphoreZirconHandle = 0x00050028, - WGPUFeatureName_SharedFenceDXGISharedHandle = 0x00050029, - WGPUFeatureName_SharedFenceMTLSharedEvent = 0x0005002A, - WGPUFeatureName_SharedBufferMemoryD3D12Resource = 0x0005002B, - WGPUFeatureName_StaticSamplers = 0x0005002C, - WGPUFeatureName_YCbCrVulkanSamplers = 0x0005002D, - WGPUFeatureName_ShaderModuleCompilationOptions = 0x0005002E, - WGPUFeatureName_DawnLoadResolveTexture = 0x0005002F, - WGPUFeatureName_DawnPartialLoadResolveTexture = 0x00050030, - WGPUFeatureName_MultiDrawIndirect = 0x00050031, - WGPUFeatureName_DawnTexelCopyBufferRowAlignment = 0x00050032, - WGPUFeatureName_FlexibleTextureViews = 0x00050033, - WGPUFeatureName_ChromiumExperimentalSubgroupMatrix = 0x00050034, - WGPUFeatureName_SharedFenceEGLSync = 0x00050035, - WGPUFeatureName_DawnDeviceAllocatorControl = 0x00050036, - WGPUFeatureName_AdapterPropertiesWGPU = 0x00050037, - WGPUFeatureName_SharedBufferMemoryD3D12SharedMemoryFileMappingHandle = 0x00050038, - WGPUFeatureName_SharedTextureMemoryD3D12Resource = 0x00050039, - WGPUFeatureName_ChromiumExperimentalSamplingResourceTable = 0x0005003A, - WGPUFeatureName_SubgroupSizeControl = 0x0005003B, - WGPUFeatureName_AtomicVec2uMinMax = 0x0005003C, - WGPUFeatureName_Unorm16FormatsForExternalTexture = 0x0005003D, - WGPUFeatureName_OpaqueYCbCrAndroidForExternalTexture = 0x0005003E, - WGPUFeatureName_Unorm16Filterable = 0x0005003F, - WGPUFeatureName_RenderPassRenderArea = 0x00050040, - WGPUFeatureName_AdapterPropertiesDrm = 0x00050041, - WGPUFeatureName_Force32 = 0x7FFFFFFF -} WGPUFeatureName WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFilterMode { - WGPUFilterMode_Undefined = 0x00000000, - WGPUFilterMode_Nearest = 0x00000001, - WGPUFilterMode_Linear = 0x00000002, - WGPUFilterMode_Force32 = 0x7FFFFFFF -} WGPUFilterMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUFrontFace { - WGPUFrontFace_Undefined = 0x00000000, - WGPUFrontFace_CCW = 0x00000001, - WGPUFrontFace_CW = 0x00000002, - WGPUFrontFace_Force32 = 0x7FFFFFFF -} WGPUFrontFace WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUIndexFormat { - WGPUIndexFormat_Undefined = 0x00000000, - WGPUIndexFormat_Uint16 = 0x00000001, - WGPUIndexFormat_Uint32 = 0x00000002, - WGPUIndexFormat_Force32 = 0x7FFFFFFF -} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUInstanceFeatureName { - WGPUInstanceFeatureName_TimedWaitAny = 0x00000001, - WGPUInstanceFeatureName_ShaderSourceSPIRV = 0x00000002, - WGPUInstanceFeatureName_MultipleDevicesPerAdapter = 0x00000003, - WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF -} WGPUInstanceFeatureName WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPULoadOp { - WGPULoadOp_Undefined = 0x00000000, - WGPULoadOp_Load = 0x00000001, - WGPULoadOp_Clear = 0x00000002, - WGPULoadOp_ExpandResolveTexture = 0x00050003, - WGPULoadOp_Force32 = 0x7FFFFFFF -} WGPULoadOp WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPULoggingType { - WGPULoggingType_Verbose = 0x00000001, - WGPULoggingType_Info = 0x00000002, - WGPULoggingType_Warning = 0x00000003, - WGPULoggingType_Error = 0x00000004, - WGPULoggingType_Force32 = 0x7FFFFFFF -} WGPULoggingType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUMapAsyncStatus { - WGPUMapAsyncStatus_Success = 0x00000001, - WGPUMapAsyncStatus_CallbackCancelled = 0x00000002, - WGPUMapAsyncStatus_Error = 0x00000003, - WGPUMapAsyncStatus_Aborted = 0x00000004, - WGPUMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUMapAsyncStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUMipmapFilterMode { - WGPUMipmapFilterMode_Undefined = 0x00000000, - WGPUMipmapFilterMode_Nearest = 0x00000001, - WGPUMipmapFilterMode_Linear = 0x00000002, - WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF -} WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUOptionalBool { - WGPUOptionalBool_False = 0x00000000, - WGPUOptionalBool_True = 0x00000001, - WGPUOptionalBool_Undefined = 0x00000002, - WGPUOptionalBool_Force32 = 0x7FFFFFFF -} WGPUOptionalBool WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPopErrorScopeStatus { - WGPUPopErrorScopeStatus_Success = 0x00000001, - WGPUPopErrorScopeStatus_CallbackCancelled = 0x00000002, - WGPUPopErrorScopeStatus_Error = 0x00000003, - WGPUPopErrorScopeStatus_Force32 = 0x7FFFFFFF -} WGPUPopErrorScopeStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPowerPreference { - WGPUPowerPreference_Undefined = 0x00000000, - WGPUPowerPreference_LowPower = 0x00000001, - WGPUPowerPreference_HighPerformance = 0x00000002, - WGPUPowerPreference_Force32 = 0x7FFFFFFF -} WGPUPowerPreference WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPredefinedColorSpace { - WGPUPredefinedColorSpace_SRGB = 0x00000001, - WGPUPredefinedColorSpace_DisplayP3 = 0x00000002, - WGPUPredefinedColorSpace_SRGBLinear = 0x00050003, - WGPUPredefinedColorSpace_DisplayP3Linear = 0x00050004, - WGPUPredefinedColorSpace_Force32 = 0x7FFFFFFF -} WGPUPredefinedColorSpace WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPresentMode { - WGPUPresentMode_Undefined = 0x00000000, - WGPUPresentMode_Fifo = 0x00000001, - WGPUPresentMode_FifoRelaxed = 0x00000002, - WGPUPresentMode_Immediate = 0x00000003, - WGPUPresentMode_Mailbox = 0x00000004, - WGPUPresentMode_Force32 = 0x7FFFFFFF -} WGPUPresentMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUPrimitiveTopology { - WGPUPrimitiveTopology_Undefined = 0x00000000, - WGPUPrimitiveTopology_PointList = 0x00000001, - WGPUPrimitiveTopology_LineList = 0x00000002, - WGPUPrimitiveTopology_LineStrip = 0x00000003, - WGPUPrimitiveTopology_TriangleList = 0x00000004, - WGPUPrimitiveTopology_TriangleStrip = 0x00000005, - WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF -} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUQueryType { - WGPUQueryType_Occlusion = 0x00000001, - WGPUQueryType_Timestamp = 0x00000002, - WGPUQueryType_Force32 = 0x7FFFFFFF -} WGPUQueryType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUQueueWorkDoneStatus { - WGPUQueueWorkDoneStatus_Success = 0x00000001, - WGPUQueueWorkDoneStatus_CallbackCancelled = 0x00000002, - WGPUQueueWorkDoneStatus_Error = 0x00000003, - WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF -} WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPURequestAdapterStatus { - WGPURequestAdapterStatus_Success = 0x00000001, - WGPURequestAdapterStatus_CallbackCancelled = 0x00000002, - WGPURequestAdapterStatus_Unavailable = 0x00000003, - WGPURequestAdapterStatus_Error = 0x00000004, - WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF -} WGPURequestAdapterStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPURequestDeviceStatus { - WGPURequestDeviceStatus_Success = 0x00000001, - WGPURequestDeviceStatus_CallbackCancelled = 0x00000002, - WGPURequestDeviceStatus_Error = 0x00000003, - WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF -} WGPURequestDeviceStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSamplerBindingType { - WGPUSamplerBindingType_BindingNotUsed = 0x00000000, - WGPUSamplerBindingType_Undefined = 0x00000001, - WGPUSamplerBindingType_Filtering = 0x00000002, - WGPUSamplerBindingType_NonFiltering = 0x00000003, - WGPUSamplerBindingType_Comparison = 0x00000004, - WGPUSamplerBindingType_Force32 = 0x7FFFFFFF -} WGPUSamplerBindingType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSharedFenceType { - WGPUSharedFenceType_VkSemaphoreOpaqueFD = 0x00000001, - WGPUSharedFenceType_SyncFD = 0x00000002, - WGPUSharedFenceType_VkSemaphoreZirconHandle = 0x00000003, - WGPUSharedFenceType_DXGISharedHandle = 0x00000004, - WGPUSharedFenceType_MTLSharedEvent = 0x00000005, - WGPUSharedFenceType_EGLSync = 0x00000006, - WGPUSharedFenceType_Force32 = 0x7FFFFFFF -} WGPUSharedFenceType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStatus { - WGPUStatus_Success = 0x00000001, - WGPUStatus_Error = 0x00000002, - WGPUStatus_Force32 = 0x7FFFFFFF -} WGPUStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStencilOperation { - WGPUStencilOperation_Undefined = 0x00000000, - WGPUStencilOperation_Keep = 0x00000001, - WGPUStencilOperation_Zero = 0x00000002, - WGPUStencilOperation_Replace = 0x00000003, - WGPUStencilOperation_Invert = 0x00000004, - WGPUStencilOperation_IncrementClamp = 0x00000005, - WGPUStencilOperation_DecrementClamp = 0x00000006, - WGPUStencilOperation_IncrementWrap = 0x00000007, - WGPUStencilOperation_DecrementWrap = 0x00000008, - WGPUStencilOperation_Force32 = 0x7FFFFFFF -} WGPUStencilOperation WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStorageTextureAccess { - WGPUStorageTextureAccess_BindingNotUsed = 0x00000000, - WGPUStorageTextureAccess_Undefined = 0x00000001, - WGPUStorageTextureAccess_WriteOnly = 0x00000002, - WGPUStorageTextureAccess_ReadOnly = 0x00000003, - WGPUStorageTextureAccess_ReadWrite = 0x00000004, - WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF -} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUStoreOp { - WGPUStoreOp_Undefined = 0x00000000, - WGPUStoreOp_Store = 0x00000001, - WGPUStoreOp_Discard = 0x00000002, - WGPUStoreOp_Force32 = 0x7FFFFFFF -} WGPUStoreOp WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSType { - WGPUSType_ShaderSourceSPIRV = 0x00000001, - WGPUSType_ShaderSourceWGSL = 0x00000002, - WGPUSType_RenderPassMaxDrawCount = 0x00000003, - WGPUSType_SurfaceSourceMetalLayer = 0x00000004, - WGPUSType_SurfaceSourceWindowsHWND = 0x00000005, - WGPUSType_SurfaceSourceXlibWindow = 0x00000006, - WGPUSType_SurfaceSourceWaylandSurface = 0x00000007, - WGPUSType_SurfaceSourceAndroidNativeWindow = 0x00000008, - WGPUSType_SurfaceSourceXCBWindow = 0x00000009, - WGPUSType_SurfaceColorManagement = 0x0000000A, - WGPUSType_RequestAdapterWebXROptions = 0x0000000B, - WGPUSType_TextureComponentSwizzleDescriptor = 0x0000000C, - WGPUSType_ExternalTextureBindingLayout = 0x0000000D, - WGPUSType_ExternalTextureBindingEntry = 0x0000000E, - WGPUSType_CompatibilityModeLimits = 0x0000000F, - WGPUSType_TextureBindingViewDimension = 0x00000010, - WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector = 0x00040000, - WGPUSType_SurfaceDescriptorFromWindowsCoreWindow = 0x00050000, - WGPUSType_SurfaceDescriptorFromWindowsUWPSwapChainPanel = 0x00050003, - WGPUSType_DawnTextureInternalUsageDescriptor = 0x00050004, - WGPUSType_DawnEncoderInternalUsageDescriptor = 0x00050005, - WGPUSType_DawnInstanceDescriptor = 0x00050006, - WGPUSType_DawnCacheDeviceDescriptor = 0x00050007, - WGPUSType_DawnAdapterPropertiesPowerPreference = 0x00050008, - WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient = 0x00050009, - WGPUSType_DawnTogglesDescriptor = 0x0005000A, - WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor = 0x0005000B, - WGPUSType_RequestAdapterOptionsLUID = 0x0005000C, - WGPUSType_RequestAdapterOptionsGetGLProc = 0x0005000D, - WGPUSType_RequestAdapterOptionsD3D11Device = 0x0005000E, - WGPUSType_DawnRenderPassSampleCount = 0x0005000F, - WGPUSType_RenderPassPixelLocalStorage = 0x00050010, - WGPUSType_PipelineLayoutPixelLocalStorage = 0x00050011, - WGPUSType_BufferHostMappedPointer = 0x00050012, - WGPUSType_AdapterPropertiesMemoryHeaps = 0x00050013, - WGPUSType_AdapterPropertiesD3D = 0x00050014, - WGPUSType_AdapterPropertiesVk = 0x00050015, - WGPUSType_DawnWireWGSLControl = 0x00050016, - WGPUSType_DawnWGSLBlocklist = 0x00050017, - WGPUSType_DawnDrmFormatCapabilities = 0x00050018, - WGPUSType_ShaderModuleCompilationOptions = 0x00050019, - WGPUSType_ColorTargetStateExpandResolveTextureDawn = 0x0005001A, - WGPUSType_RenderPassRenderAreaRect = 0x0005001B, - WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor = 0x0005001C, - WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor = 0x0005001D, - WGPUSType_SharedTextureMemoryDmaBufDescriptor = 0x0005001E, - WGPUSType_SharedTextureMemoryOpaqueFDDescriptor = 0x0005001F, - WGPUSType_SharedTextureMemoryZirconHandleDescriptor = 0x00050020, - WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor = 0x00050021, - WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor = 0x00050022, - WGPUSType_SharedTextureMemoryIOSurfaceDescriptor = 0x00050023, - WGPUSType_SharedTextureMemoryEGLImageDescriptor = 0x00050024, - WGPUSType_SharedTextureMemoryInitializedBeginState = 0x00050025, - WGPUSType_SharedTextureMemoryInitializedEndState = 0x00050026, - WGPUSType_SharedTextureMemoryVkImageLayoutBeginState = 0x00050027, - WGPUSType_SharedTextureMemoryVkImageLayoutEndState = 0x00050028, - WGPUSType_SharedTextureMemoryD3DSwapchainBeginState = 0x00050029, - WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor = 0x0005002A, - WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo = 0x0005002B, - WGPUSType_SharedFenceSyncFDDescriptor = 0x0005002C, - WGPUSType_SharedFenceSyncFDExportInfo = 0x0005002D, - WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor = 0x0005002E, - WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo = 0x0005002F, - WGPUSType_SharedFenceDXGISharedHandleDescriptor = 0x00050030, - WGPUSType_SharedFenceDXGISharedHandleExportInfo = 0x00050031, - WGPUSType_SharedFenceMTLSharedEventDescriptor = 0x00050032, - WGPUSType_SharedFenceMTLSharedEventExportInfo = 0x00050033, - WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor = 0x00050034, - WGPUSType_StaticSamplerBindingLayout = 0x00050035, - WGPUSType_YCbCrVkDescriptor = 0x00050036, - WGPUSType_SharedTextureMemoryAHardwareBufferProperties = 0x00050037, - WGPUSType_AHardwareBufferProperties = 0x00050038, - WGPUSType_DawnTexelCopyBufferRowAlignmentLimits = 0x0005003A, - WGPUSType_AdapterPropertiesSubgroupMatrixConfigs = 0x0005003B, - WGPUSType_SharedFenceEGLSyncDescriptor = 0x0005003C, - WGPUSType_SharedFenceEGLSyncExportInfo = 0x0005003D, - WGPUSType_DawnInjectedInvalidSType = 0x0005003E, - WGPUSType_DawnCompilationMessageUtf16 = 0x0005003F, - WGPUSType_DawnFakeBufferOOMForTesting = 0x00050040, - WGPUSType_SurfaceDescriptorFromWindowsWinUISwapChainPanel = 0x00050041, - WGPUSType_DawnDeviceAllocatorControl = 0x00050042, - WGPUSType_DawnHostMappedPointerLimits = 0x00050043, - WGPUSType_RenderPassDescriptorResolveRect = 0x00050044, - WGPUSType_RequestAdapterWebGPUBackendOptions = 0x00050045, - WGPUSType_DawnFakeDeviceInitializeErrorForTesting = 0x00050046, - WGPUSType_SharedTextureMemoryD3D11BeginState = 0x00050047, - WGPUSType_DawnConsumeAdapterDescriptor = 0x00050048, - WGPUSType_TexelBufferBindingEntry = 0x00050049, - WGPUSType_TexelBufferBindingLayout = 0x0005004A, - WGPUSType_SharedTextureMemoryMetalEndAccessState = 0x0005004B, - WGPUSType_AdapterPropertiesWGPU = 0x0005004C, - WGPUSType_SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor = 0x0005004D, - WGPUSType_SharedTextureMemoryD3D12ResourceDescriptor = 0x0005004E, - WGPUSType_RequestAdapterOptionsAngleVirtualizationGroup = 0x0005004F, - WGPUSType_PipelineLayoutResourceTable = 0x00050050, - WGPUSType_AdapterPropertiesDrm = 0x00050051, - WGPUSType_Force32 = 0x7FFFFFFF -} WGPUSType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSubgroupMatrixComponentType { - WGPUSubgroupMatrixComponentType_F32 = 0x00000001, - WGPUSubgroupMatrixComponentType_F16 = 0x00000002, - WGPUSubgroupMatrixComponentType_U32 = 0x00000003, - WGPUSubgroupMatrixComponentType_I32 = 0x00000004, - WGPUSubgroupMatrixComponentType_U8 = 0x00000005, - WGPUSubgroupMatrixComponentType_I8 = 0x00000006, - WGPUSubgroupMatrixComponentType_Force32 = 0x7FFFFFFF -} WGPUSubgroupMatrixComponentType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUSurfaceGetCurrentTextureStatus { - WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal = 0x00000001, - WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal = 0x00000002, - WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000003, - WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000004, - WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000005, - WGPUSurfaceGetCurrentTextureStatus_Error = 0x00000006, - WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF -} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTexelBufferAccess { - WGPUTexelBufferAccess_Undefined = 0x00000000, - WGPUTexelBufferAccess_ReadOnly = 0x00000001, - WGPUTexelBufferAccess_ReadWrite = 0x00000002, - WGPUTexelBufferAccess_Force32 = 0x7FFFFFFF -} WGPUTexelBufferAccess WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureAspect { - WGPUTextureAspect_Undefined = 0x00000000, - WGPUTextureAspect_All = 0x00000001, - WGPUTextureAspect_StencilOnly = 0x00000002, - WGPUTextureAspect_DepthOnly = 0x00000003, - WGPUTextureAspect_Plane0Only = 0x00050000, - WGPUTextureAspect_Plane1Only = 0x00050001, - WGPUTextureAspect_Plane2Only = 0x00050002, - WGPUTextureAspect_Force32 = 0x7FFFFFFF -} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureDimension { - WGPUTextureDimension_Undefined = 0x00000000, - WGPUTextureDimension_1D = 0x00000001, - WGPUTextureDimension_2D = 0x00000002, - WGPUTextureDimension_3D = 0x00000003, - WGPUTextureDimension_Force32 = 0x7FFFFFFF -} WGPUTextureDimension WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureFormat { - WGPUTextureFormat_Undefined = 0x00000000, - WGPUTextureFormat_R8Unorm = 0x00000001, - WGPUTextureFormat_R8Snorm = 0x00000002, - WGPUTextureFormat_R8Uint = 0x00000003, - WGPUTextureFormat_R8Sint = 0x00000004, - WGPUTextureFormat_R16Unorm = 0x00000005, - WGPUTextureFormat_R16Snorm = 0x00000006, - WGPUTextureFormat_R16Uint = 0x00000007, - WGPUTextureFormat_R16Sint = 0x00000008, - WGPUTextureFormat_R16Float = 0x00000009, - WGPUTextureFormat_RG8Unorm = 0x0000000A, - WGPUTextureFormat_RG8Snorm = 0x0000000B, - WGPUTextureFormat_RG8Uint = 0x0000000C, - WGPUTextureFormat_RG8Sint = 0x0000000D, - WGPUTextureFormat_R32Float = 0x0000000E, - WGPUTextureFormat_R32Uint = 0x0000000F, - WGPUTextureFormat_R32Sint = 0x00000010, - WGPUTextureFormat_RG16Unorm = 0x00000011, - WGPUTextureFormat_RG16Snorm = 0x00000012, - WGPUTextureFormat_RG16Uint = 0x00000013, - WGPUTextureFormat_RG16Sint = 0x00000014, - WGPUTextureFormat_RG16Float = 0x00000015, - WGPUTextureFormat_RGBA8Unorm = 0x00000016, - WGPUTextureFormat_RGBA8UnormSrgb = 0x00000017, - WGPUTextureFormat_RGBA8Snorm = 0x00000018, - WGPUTextureFormat_RGBA8Uint = 0x00000019, - WGPUTextureFormat_RGBA8Sint = 0x0000001A, - WGPUTextureFormat_BGRA8Unorm = 0x0000001B, - WGPUTextureFormat_BGRA8UnormSrgb = 0x0000001C, - WGPUTextureFormat_RGB10A2Uint = 0x0000001D, - WGPUTextureFormat_RGB10A2Unorm = 0x0000001E, - WGPUTextureFormat_RG11B10Ufloat = 0x0000001F, - WGPUTextureFormat_RGB9E5Ufloat = 0x00000020, - WGPUTextureFormat_RG32Float = 0x00000021, - WGPUTextureFormat_RG32Uint = 0x00000022, - WGPUTextureFormat_RG32Sint = 0x00000023, - WGPUTextureFormat_RGBA16Unorm = 0x00000024, - WGPUTextureFormat_RGBA16Snorm = 0x00000025, - WGPUTextureFormat_RGBA16Uint = 0x00000026, - WGPUTextureFormat_RGBA16Sint = 0x00000027, - WGPUTextureFormat_RGBA16Float = 0x00000028, - WGPUTextureFormat_RGBA32Float = 0x00000029, - WGPUTextureFormat_RGBA32Uint = 0x0000002A, - WGPUTextureFormat_RGBA32Sint = 0x0000002B, - WGPUTextureFormat_Stencil8 = 0x0000002C, - WGPUTextureFormat_Depth16Unorm = 0x0000002D, - WGPUTextureFormat_Depth24Plus = 0x0000002E, - WGPUTextureFormat_Depth24PlusStencil8 = 0x0000002F, - WGPUTextureFormat_Depth32Float = 0x00000030, - WGPUTextureFormat_Depth32FloatStencil8 = 0x00000031, - WGPUTextureFormat_BC1RGBAUnorm = 0x00000032, - WGPUTextureFormat_BC1RGBAUnormSrgb = 0x00000033, - WGPUTextureFormat_BC2RGBAUnorm = 0x00000034, - WGPUTextureFormat_BC2RGBAUnormSrgb = 0x00000035, - WGPUTextureFormat_BC3RGBAUnorm = 0x00000036, - WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000037, - WGPUTextureFormat_BC4RUnorm = 0x00000038, - WGPUTextureFormat_BC4RSnorm = 0x00000039, - WGPUTextureFormat_BC5RGUnorm = 0x0000003A, - WGPUTextureFormat_BC5RGSnorm = 0x0000003B, - WGPUTextureFormat_BC6HRGBUfloat = 0x0000003C, - WGPUTextureFormat_BC6HRGBFloat = 0x0000003D, - WGPUTextureFormat_BC7RGBAUnorm = 0x0000003E, - WGPUTextureFormat_BC7RGBAUnormSrgb = 0x0000003F, - WGPUTextureFormat_ETC2RGB8Unorm = 0x00000040, - WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x00000041, - WGPUTextureFormat_ETC2RGB8A1Unorm = 0x00000042, - WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x00000043, - WGPUTextureFormat_ETC2RGBA8Unorm = 0x00000044, - WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x00000045, - WGPUTextureFormat_EACR11Unorm = 0x00000046, - WGPUTextureFormat_EACR11Snorm = 0x00000047, - WGPUTextureFormat_EACRG11Unorm = 0x00000048, - WGPUTextureFormat_EACRG11Snorm = 0x00000049, - WGPUTextureFormat_ASTC4x4Unorm = 0x0000004A, - WGPUTextureFormat_ASTC4x4UnormSrgb = 0x0000004B, - WGPUTextureFormat_ASTC5x4Unorm = 0x0000004C, - WGPUTextureFormat_ASTC5x4UnormSrgb = 0x0000004D, - WGPUTextureFormat_ASTC5x5Unorm = 0x0000004E, - WGPUTextureFormat_ASTC5x5UnormSrgb = 0x0000004F, - WGPUTextureFormat_ASTC6x5Unorm = 0x00000050, - WGPUTextureFormat_ASTC6x5UnormSrgb = 0x00000051, - WGPUTextureFormat_ASTC6x6Unorm = 0x00000052, - WGPUTextureFormat_ASTC6x6UnormSrgb = 0x00000053, - WGPUTextureFormat_ASTC8x5Unorm = 0x00000054, - WGPUTextureFormat_ASTC8x5UnormSrgb = 0x00000055, - WGPUTextureFormat_ASTC8x6Unorm = 0x00000056, - WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000057, - WGPUTextureFormat_ASTC8x8Unorm = 0x00000058, - WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000059, - WGPUTextureFormat_ASTC10x5Unorm = 0x0000005A, - WGPUTextureFormat_ASTC10x5UnormSrgb = 0x0000005B, - WGPUTextureFormat_ASTC10x6Unorm = 0x0000005C, - WGPUTextureFormat_ASTC10x6UnormSrgb = 0x0000005D, - WGPUTextureFormat_ASTC10x8Unorm = 0x0000005E, - WGPUTextureFormat_ASTC10x8UnormSrgb = 0x0000005F, - WGPUTextureFormat_ASTC10x10Unorm = 0x00000060, - WGPUTextureFormat_ASTC10x10UnormSrgb = 0x00000061, - WGPUTextureFormat_ASTC12x10Unorm = 0x00000062, - WGPUTextureFormat_ASTC12x10UnormSrgb = 0x00000063, - WGPUTextureFormat_ASTC12x12Unorm = 0x00000064, - WGPUTextureFormat_ASTC12x12UnormSrgb = 0x00000065, - WGPUTextureFormat_R8BG8Biplanar420Unorm = 0x00050000, - WGPUTextureFormat_R10X6BG10X6Biplanar420Unorm = 0x00050001, - WGPUTextureFormat_R8BG8A8Triplanar420Unorm = 0x00050002, - WGPUTextureFormat_R8BG8Biplanar422Unorm = 0x00050003, - WGPUTextureFormat_R8BG8Biplanar444Unorm = 0x00050004, - WGPUTextureFormat_R10X6BG10X6Biplanar422Unorm = 0x00050005, - WGPUTextureFormat_R10X6BG10X6Biplanar444Unorm = 0x00050006, - WGPUTextureFormat_OpaqueYCbCrAndroid = 0x00050007, - WGPUTextureFormat_Force32 = 0x7FFFFFFF -} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureSampleType { - WGPUTextureSampleType_BindingNotUsed = 0x00000000, - WGPUTextureSampleType_Undefined = 0x00000001, - WGPUTextureSampleType_Float = 0x00000002, - WGPUTextureSampleType_UnfilterableFloat = 0x00000003, - WGPUTextureSampleType_Depth = 0x00000004, - WGPUTextureSampleType_Sint = 0x00000005, - WGPUTextureSampleType_Uint = 0x00000006, - WGPUTextureSampleType_Force32 = 0x7FFFFFFF -} WGPUTextureSampleType WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUTextureViewDimension { - WGPUTextureViewDimension_Undefined = 0x00000000, - WGPUTextureViewDimension_1D = 0x00000001, - WGPUTextureViewDimension_2D = 0x00000002, - WGPUTextureViewDimension_2DArray = 0x00000003, - WGPUTextureViewDimension_Cube = 0x00000004, - WGPUTextureViewDimension_CubeArray = 0x00000005, - WGPUTextureViewDimension_3D = 0x00000006, - WGPUTextureViewDimension_Force32 = 0x7FFFFFFF -} WGPUTextureViewDimension WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUToneMappingMode { - WGPUToneMappingMode_Standard = 0x00000001, - WGPUToneMappingMode_Extended = 0x00000002, - WGPUToneMappingMode_Force32 = 0x7FFFFFFF -} WGPUToneMappingMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUVertexFormat { - WGPUVertexFormat_Uint8 = 0x00000001, - WGPUVertexFormat_Uint8x2 = 0x00000002, - WGPUVertexFormat_Uint8x4 = 0x00000003, - WGPUVertexFormat_Sint8 = 0x00000004, - WGPUVertexFormat_Sint8x2 = 0x00000005, - WGPUVertexFormat_Sint8x4 = 0x00000006, - WGPUVertexFormat_Unorm8 = 0x00000007, - WGPUVertexFormat_Unorm8x2 = 0x00000008, - WGPUVertexFormat_Unorm8x4 = 0x00000009, - WGPUVertexFormat_Snorm8 = 0x0000000A, - WGPUVertexFormat_Snorm8x2 = 0x0000000B, - WGPUVertexFormat_Snorm8x4 = 0x0000000C, - WGPUVertexFormat_Uint16 = 0x0000000D, - WGPUVertexFormat_Uint16x2 = 0x0000000E, - WGPUVertexFormat_Uint16x4 = 0x0000000F, - WGPUVertexFormat_Sint16 = 0x00000010, - WGPUVertexFormat_Sint16x2 = 0x00000011, - WGPUVertexFormat_Sint16x4 = 0x00000012, - WGPUVertexFormat_Unorm16 = 0x00000013, - WGPUVertexFormat_Unorm16x2 = 0x00000014, - WGPUVertexFormat_Unorm16x4 = 0x00000015, - WGPUVertexFormat_Snorm16 = 0x00000016, - WGPUVertexFormat_Snorm16x2 = 0x00000017, - WGPUVertexFormat_Snorm16x4 = 0x00000018, - WGPUVertexFormat_Float16 = 0x00000019, - WGPUVertexFormat_Float16x2 = 0x0000001A, - WGPUVertexFormat_Float16x4 = 0x0000001B, - WGPUVertexFormat_Float32 = 0x0000001C, - WGPUVertexFormat_Float32x2 = 0x0000001D, - WGPUVertexFormat_Float32x3 = 0x0000001E, - WGPUVertexFormat_Float32x4 = 0x0000001F, - WGPUVertexFormat_Uint32 = 0x00000020, - WGPUVertexFormat_Uint32x2 = 0x00000021, - WGPUVertexFormat_Uint32x3 = 0x00000022, - WGPUVertexFormat_Uint32x4 = 0x00000023, - WGPUVertexFormat_Sint32 = 0x00000024, - WGPUVertexFormat_Sint32x2 = 0x00000025, - WGPUVertexFormat_Sint32x3 = 0x00000026, - WGPUVertexFormat_Sint32x4 = 0x00000027, - WGPUVertexFormat_Unorm10_10_10_2 = 0x00000028, - WGPUVertexFormat_Unorm8x4BGRA = 0x00000029, - WGPUVertexFormat_Force32 = 0x7FFFFFFF -} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUVertexStepMode { - WGPUVertexStepMode_Undefined = 0x00000000, - WGPUVertexStepMode_Vertex = 0x00000001, - WGPUVertexStepMode_Instance = 0x00000002, - WGPUVertexStepMode_Force32 = 0x7FFFFFFF -} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUWaitStatus { - WGPUWaitStatus_Success = 0x00000001, - WGPUWaitStatus_TimedOut = 0x00000002, - WGPUWaitStatus_Error = 0x00000003, - WGPUWaitStatus_Force32 = 0x7FFFFFFF -} WGPUWaitStatus WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUWGSLLanguageFeatureName { - WGPUWGSLLanguageFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, - WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct = 0x00000002, - WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters = 0x00000003, - WGPUWGSLLanguageFeatureName_PointerCompositeAccess = 0x00000004, - WGPUWGSLLanguageFeatureName_UniformBufferStandardLayout = 0x00000005, - WGPUWGSLLanguageFeatureName_SubgroupId = 0x00000006, - WGPUWGSLLanguageFeatureName_TextureAndSamplerLet = 0x00000007, - WGPUWGSLLanguageFeatureName_SubgroupUniformity = 0x00000008, - WGPUWGSLLanguageFeatureName_TextureFormatsTier1 = 0x00000009, - WGPUWGSLLanguageFeatureName_LinearIndexing = 0x0000000A, - WGPUWGSLLanguageFeatureName_ImmediateAddressSpace = 0x0000000B, - WGPUWGSLLanguageFeatureName_ChromiumTestingUnimplemented = 0x00050000, - WGPUWGSLLanguageFeatureName_ChromiumTestingUnsafeExperimental = 0x00050001, - WGPUWGSLLanguageFeatureName_ChromiumTestingExperimental = 0x00050002, - WGPUWGSLLanguageFeatureName_ChromiumTestingShippedWithKillswitch = 0x00050003, - WGPUWGSLLanguageFeatureName_ChromiumTestingShipped = 0x00050004, - WGPUWGSLLanguageFeatureName_SizedBindingArray = 0x00050005, - WGPUWGSLLanguageFeatureName_TexelBuffers = 0x00050006, - WGPUWGSLLanguageFeatureName_ChromiumPrint = 0x00050007, - WGPUWGSLLanguageFeatureName_FragmentDepth = 0x00050008, - WGPUWGSLLanguageFeatureName_BufferView = 0x00050009, - WGPUWGSLLanguageFeatureName_SwizzleAssignment = 0x0005000A, - WGPUWGSLLanguageFeatureName_Force32 = 0x7FFFFFFF -} WGPUWGSLLanguageFeatureName WGPU_ENUM_ATTRIBUTE; - -typedef WGPUFlags WGPUBufferUsage; -static const WGPUBufferUsage WGPUBufferUsage_None = 0x0000000000000000; -static const WGPUBufferUsage WGPUBufferUsage_MapRead = 0x0000000000000001; -static const WGPUBufferUsage WGPUBufferUsage_MapWrite = 0x0000000000000002; -static const WGPUBufferUsage WGPUBufferUsage_CopySrc = 0x0000000000000004; -static const WGPUBufferUsage WGPUBufferUsage_CopyDst = 0x0000000000000008; -static const WGPUBufferUsage WGPUBufferUsage_Index = 0x0000000000000010; -static const WGPUBufferUsage WGPUBufferUsage_Vertex = 0x0000000000000020; -static const WGPUBufferUsage WGPUBufferUsage_Uniform = 0x0000000000000040; -static const WGPUBufferUsage WGPUBufferUsage_Storage = 0x0000000000000080; -static const WGPUBufferUsage WGPUBufferUsage_Indirect = 0x0000000000000100; -static const WGPUBufferUsage WGPUBufferUsage_QueryResolve = 0x0000000000000200; -static const WGPUBufferUsage WGPUBufferUsage_TexelBuffer = 0x0000000000000400; - -typedef WGPUFlags WGPUColorWriteMask; -static const WGPUColorWriteMask WGPUColorWriteMask_None = 0x0000000000000000; -static const WGPUColorWriteMask WGPUColorWriteMask_Red = 0x0000000000000001; -static const WGPUColorWriteMask WGPUColorWriteMask_Green = 0x0000000000000002; -static const WGPUColorWriteMask WGPUColorWriteMask_Blue = 0x0000000000000004; -static const WGPUColorWriteMask WGPUColorWriteMask_Alpha = 0x0000000000000008; -static const WGPUColorWriteMask WGPUColorWriteMask_All = 0x000000000000000F; - -typedef WGPUFlags WGPUHeapProperty; -static const WGPUHeapProperty WGPUHeapProperty_None = 0x0000000000000000; -static const WGPUHeapProperty WGPUHeapProperty_DeviceLocal = 0x0000000000000001; -static const WGPUHeapProperty WGPUHeapProperty_HostVisible = 0x0000000000000002; -static const WGPUHeapProperty WGPUHeapProperty_HostCoherent = 0x0000000000000004; -static const WGPUHeapProperty WGPUHeapProperty_HostUncached = 0x0000000000000008; -static const WGPUHeapProperty WGPUHeapProperty_HostCached = 0x0000000000000010; - -typedef WGPUFlags WGPUMapMode; -static const WGPUMapMode WGPUMapMode_None = 0x0000000000000000; -static const WGPUMapMode WGPUMapMode_Read = 0x0000000000000001; -static const WGPUMapMode WGPUMapMode_Write = 0x0000000000000002; - -typedef WGPUFlags WGPUShaderStage; -static const WGPUShaderStage WGPUShaderStage_None = 0x0000000000000000; -static const WGPUShaderStage WGPUShaderStage_Vertex = 0x0000000000000001; -static const WGPUShaderStage WGPUShaderStage_Fragment = 0x0000000000000002; -static const WGPUShaderStage WGPUShaderStage_Compute = 0x0000000000000004; - -typedef WGPUFlags WGPUTextureUsage; -static const WGPUTextureUsage WGPUTextureUsage_None = 0x0000000000000000; -static const WGPUTextureUsage WGPUTextureUsage_CopySrc = 0x0000000000000001; -static const WGPUTextureUsage WGPUTextureUsage_CopyDst = 0x0000000000000002; -static const WGPUTextureUsage WGPUTextureUsage_TextureBinding = 0x0000000000000004; -static const WGPUTextureUsage WGPUTextureUsage_StorageBinding = 0x0000000000000008; -static const WGPUTextureUsage WGPUTextureUsage_RenderAttachment = 0x0000000000000010; -static const WGPUTextureUsage WGPUTextureUsage_TransientAttachment = 0x0000000000000020; -static const WGPUTextureUsage WGPUTextureUsage_StorageAttachment = 0x0000000000000040; - -typedef void (*WGPUCallback)(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 (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; - -// Callback function pointers -typedef void (*WGPUBufferMapCallback)(WGPUMapAsyncStatus status, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef size_t (*WGPUDawnLoadCacheDataCallback)(size_t keySize, uint8_t const * key, size_t valueSize, uint8_t * value, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUDawnStoreCacheDataCallback)(size_t keySize, uint8_t const * key, size_t valueSize, uint8_t const * value, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUDeviceLostCallback)(WGPUDevice const * device, WGPUDeviceLostReason reason, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPULoggingCallback)(WGPULoggingType type, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUPopErrorScopeCallback)(WGPUPopErrorScopeStatus status, WGPUErrorType type, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef void (*WGPUUncapturedErrorCallback)(WGPUDevice const * device, WGPUErrorType type, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; - -typedef struct WGPUChainedStruct { - struct WGPUChainedStruct * next; - WGPUSType sType; -} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE; - -typedef struct WGPUBufferMapCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUBufferMapCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUBufferMapCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BUFFER_MAP_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBufferMapCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUCompilationInfoCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUCompilationInfoCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUCompilationInfoCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPILATION_INFO_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCompilationInfoCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUCreateComputePipelineAsyncCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUCreateComputePipelineAsyncCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUCreateComputePipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_CREATE_COMPUTE_PIPELINE_ASYNC_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCreateComputePipelineAsyncCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUCreateRenderPipelineAsyncCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUCreateRenderPipelineAsyncCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUCreateRenderPipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_CREATE_RENDER_PIPELINE_ASYNC_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCreateRenderPipelineAsyncCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUDawnLoadCacheDataCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUDawnLoadCacheDataCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUDawnLoadCacheDataCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_LOAD_CACHE_DATA_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnLoadCacheDataCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUDawnStoreCacheDataCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUDawnStoreCacheDataCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUDawnStoreCacheDataCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_STORE_CACHE_DATA_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnStoreCacheDataCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUDeviceLostCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUDeviceLostCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUDeviceLostCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DEVICE_LOST_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDeviceLostCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPULoggingCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPULoggingCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPULoggingCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_LOGGING_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPULoggingCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUPopErrorScopeCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUPopErrorScopeCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUPopErrorScopeCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_POP_ERROR_SCOPE_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPopErrorScopeCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUQueueWorkDoneCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPUQueueWorkDoneCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUQueueWorkDoneCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_QUEUE_WORK_DONE_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUQueueWorkDoneCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPURequestAdapterCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPURequestAdapterCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPURequestAdapterCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_REQUEST_ADAPTER_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPURequestAdapterCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPURequestDeviceCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUCallbackMode mode; - WGPURequestDeviceCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPURequestDeviceCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_REQUEST_DEVICE_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPURequestDeviceCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.mode=*/_wgpu_ENUM_ZERO_INIT(WGPUCallbackMode) _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUUncapturedErrorCallbackInfo { - WGPUChainedStruct * nextInChain; - WGPUUncapturedErrorCallback callback; - WGPU_NULLABLE void* userdata1; - WGPU_NULLABLE void* userdata2; -} WGPUUncapturedErrorCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_UNCAPTURED_ERROR_CALLBACK_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUUncapturedErrorCallbackInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.callback=*/NULL _wgpu_COMMA \ - /*.userdata1=*/NULL _wgpu_COMMA \ - /*.userdata2=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesD3D { - WGPUChainedStruct chain; - uint32_t shaderModel; -} WGPUAdapterPropertiesD3D WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_D3D_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesD3D, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesD3D _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.shaderModel=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesDrm { - WGPUChainedStruct chain; - WGPUBool hasPrimary; - WGPUBool hasRender; - uint64_t primaryMajor; - uint64_t primaryMinor; - uint64_t renderMajor; - uint64_t renderMinor; -} WGPUAdapterPropertiesDrm WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_DRM_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesDrm, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesDrm _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.hasPrimary=*/WGPU_FALSE _wgpu_COMMA \ - /*.hasRender=*/WGPU_FALSE _wgpu_COMMA \ - /*.primaryMajor=*/0 _wgpu_COMMA \ - /*.primaryMinor=*/0 _wgpu_COMMA \ - /*.renderMajor=*/0 _wgpu_COMMA \ - /*.renderMinor=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesVk { - WGPUChainedStruct chain; - uint32_t driverVersion; -} WGPUAdapterPropertiesVk WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_VK_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesVk, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesVk _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.driverVersion=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesWGPU { - WGPUChainedStruct chain; - WGPUBackendType backendType; -} WGPUAdapterPropertiesWGPU WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_WGPU_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesWGPU, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesWGPU _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.backendType=*/WGPUBackendType_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUBindingResource { - WGPUChainedStruct * nextInChain; - WGPU_NULLABLE WGPUBuffer buffer; - uint64_t offset; - uint64_t size; - WGPU_NULLABLE WGPUSampler sampler; - WGPU_NULLABLE WGPUTextureView textureView; -} WGPUBindingResource WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BINDING_RESOURCE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindingResource, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.buffer=*/NULL _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.size=*/WGPU_WHOLE_SIZE _wgpu_COMMA \ - /*.sampler=*/NULL _wgpu_COMMA \ - /*.textureView=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUBlendComponent { - WGPUBlendOperation operation; - WGPUBlendFactor srcFactor; - WGPUBlendFactor dstFactor; -} WGPUBlendComponent WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BLEND_COMPONENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBlendComponent, { \ - /*.operation=*/WGPUBlendOperation_Undefined _wgpu_COMMA \ - /*.srcFactor=*/WGPUBlendFactor_Undefined _wgpu_COMMA \ - /*.dstFactor=*/WGPUBlendFactor_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUBufferBindingLayout { - WGPUChainedStruct * nextInChain; - WGPUBufferBindingType type; - WGPUBool hasDynamicOffset; - uint64_t minBindingSize; -} WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BUFFER_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBufferBindingLayout, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.type=*/WGPUBufferBindingType_Undefined _wgpu_COMMA \ - /*.hasDynamicOffset=*/WGPU_FALSE _wgpu_COMMA \ - /*.minBindingSize=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUBufferDescriptor -typedef struct WGPUBufferHostMappedPointer { - WGPUChainedStruct chain; - void * pointer; - WGPUCallback disposeCallback; - void * userdata; -} WGPUBufferHostMappedPointer WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BUFFER_HOST_MAPPED_POINTER_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBufferHostMappedPointer, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_BufferHostMappedPointer _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.pointer=*/NULL _wgpu_COMMA \ - /*.disposeCallback=*/NULL _wgpu_COMMA \ - /*.userdata=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUColor { - double r; - double g; - double b; - double a; -} WGPUColor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COLOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUColor, { \ - /*.r=*/0. _wgpu_COMMA \ - /*.g=*/0. _wgpu_COMMA \ - /*.b=*/0. _wgpu_COMMA \ - /*.a=*/0. _wgpu_COMMA \ -}) - -typedef struct WGPUColorSpaceDawn { - WGPUChainedStruct * nextInChain; - WGPUColorSpacePrimariesDawn primaries; - WGPUColorSpaceTransferDawn transfer; - WGPUColorSpaceYCbCrRangeDawn yCbCrRange; - WGPUColorSpaceYCbCrMatrixDawn yCbCrMatrix; -} WGPUColorSpaceDawn WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COLOR_SPACE_DAWN_INIT _wgpu_MAKE_INIT_STRUCT(WGPUColorSpaceDawn, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.primaries=*/_wgpu_ENUM_ZERO_INIT(WGPUColorSpacePrimariesDawn) _wgpu_COMMA \ - /*.transfer=*/WGPUColorSpaceTransferDawn_Identity _wgpu_COMMA \ - /*.yCbCrRange=*/WGPUColorSpaceYCbCrRangeDawn_Identity _wgpu_COMMA \ - /*.yCbCrMatrix=*/WGPUColorSpaceYCbCrMatrixDawn_Identity _wgpu_COMMA \ -}) - -// Can be chained in WGPUColorTargetState -typedef struct WGPUColorTargetStateExpandResolveTextureDawn { - WGPUChainedStruct chain; - WGPUBool enabled; -} WGPUColorTargetStateExpandResolveTextureDawn WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COLOR_TARGET_STATE_EXPAND_RESOLVE_TEXTURE_DAWN_INIT _wgpu_MAKE_INIT_STRUCT(WGPUColorTargetStateExpandResolveTextureDawn, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ColorTargetStateExpandResolveTextureDawn _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.enabled=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUCommandBufferDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMMAND_BUFFER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCommandBufferDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -// Can be chained in WGPULimits -typedef struct WGPUCompatibilityModeLimits { - WGPUChainedStruct chain; - uint32_t maxStorageBuffersInVertexStage; - uint32_t maxStorageTexturesInVertexStage; - uint32_t maxStorageBuffersInFragmentStage; - uint32_t maxStorageTexturesInFragmentStage; -} WGPUCompatibilityModeLimits WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPATIBILITY_MODE_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCompatibilityModeLimits, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_CompatibilityModeLimits _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.maxStorageBuffersInVertexStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxStorageTexturesInVertexStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxStorageBuffersInFragmentStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxStorageTexturesInFragmentStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ -}) - -typedef struct WGPUConstantEntry { - WGPUChainedStruct * nextInChain; - WGPUStringView key; - double value; -} WGPUConstantEntry WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_CONSTANT_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUConstantEntry, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.key=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.value=*/0. _wgpu_COMMA \ -}) - -typedef struct WGPUCopyTextureForBrowserOptions { - WGPUChainedStruct * nextInChain; - WGPUBool flipY; - WGPUBool needsColorSpaceConversion; - WGPUAlphaMode srcAlphaMode; - WGPU_NULLABLE float const * srcTransferFunctionParameters; - WGPU_NULLABLE float const * conversionMatrix; - WGPU_NULLABLE float const * dstTransferFunctionParameters; - WGPUAlphaMode dstAlphaMode; - WGPUBool internalUsage; -} WGPUCopyTextureForBrowserOptions WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COPY_TEXTURE_FOR_BROWSER_OPTIONS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCopyTextureForBrowserOptions, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.flipY=*/WGPU_FALSE _wgpu_COMMA \ - /*.needsColorSpaceConversion=*/WGPU_FALSE _wgpu_COMMA \ - /*.srcAlphaMode=*/WGPUAlphaMode_Unpremultiplied _wgpu_COMMA \ - /*.srcTransferFunctionParameters=*/NULL _wgpu_COMMA \ - /*.conversionMatrix=*/NULL _wgpu_COMMA \ - /*.dstTransferFunctionParameters=*/NULL _wgpu_COMMA \ - /*.dstAlphaMode=*/WGPUAlphaMode_Unpremultiplied _wgpu_COMMA \ - /*.internalUsage=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUDawnAdapterPropertiesPowerPreference { - WGPUChainedStruct chain; - WGPUPowerPreference powerPreference; -} WGPUDawnAdapterPropertiesPowerPreference WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_ADAPTER_PROPERTIES_POWER_PREFERENCE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnAdapterPropertiesPowerPreference, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnAdapterPropertiesPowerPreference _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.powerPreference=*/WGPUPowerPreference_Undefined _wgpu_COMMA \ -}) - -// Can be chained in WGPUBufferDescriptor -typedef struct WGPUDawnBufferDescriptorErrorInfoFromWireClient { - WGPUChainedStruct chain; - WGPUBool outOfMemory; -} WGPUDawnBufferDescriptorErrorInfoFromWireClient WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_BUFFER_DESCRIPTOR_ERROR_INFO_FROM_WIRE_CLIENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnBufferDescriptorErrorInfoFromWireClient, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.outOfMemory=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnCacheDeviceDescriptor { - WGPUChainedStruct chain; - WGPUStringView isolationKey; - WGPUDawnLoadCacheDataFunction loadDataFunction; - WGPUDawnStoreCacheDataFunction storeDataFunction; - void * functionUserdata; - WGPUDawnLoadCacheDataCallbackInfo dawnLoadCacheDataCallbackInfo; - WGPUDawnStoreCacheDataCallbackInfo dawnStoreCacheDataCallbackInfo; -} WGPUDawnCacheDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_CACHE_DEVICE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnCacheDeviceDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnCacheDeviceDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.isolationKey=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.loadDataFunction=*/NULL _wgpu_COMMA \ - /*.storeDataFunction=*/NULL _wgpu_COMMA \ - /*.functionUserdata=*/nullptr _wgpu_COMMA \ - /*.dawnLoadCacheDataCallbackInfo=*/WGPU_DAWN_LOAD_CACHE_DATA_CALLBACK_INFO_INIT _wgpu_COMMA \ - /*.dawnStoreCacheDataCallbackInfo=*/WGPU_DAWN_STORE_CACHE_DATA_CALLBACK_INFO_INIT _wgpu_COMMA \ -}) - -// Can be chained in WGPUCompilationMessage -typedef struct WGPUDawnCompilationMessageUtf16 { - WGPUChainedStruct chain; - uint64_t linePos; - uint64_t offset; - uint64_t length; -} WGPUDawnCompilationMessageUtf16 WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_COMPILATION_MESSAGE_UTF16_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnCompilationMessageUtf16, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnCompilationMessageUtf16 _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.linePos=*/0 _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.length=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnConsumeAdapterDescriptor { - WGPUChainedStruct chain; - WGPUBool consumeAdapter; -} WGPUDawnConsumeAdapterDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_CONSUME_ADAPTER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnConsumeAdapterDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnConsumeAdapterDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.consumeAdapter=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnDeviceAllocatorControl { - WGPUChainedStruct chain; - size_t allocatorHeapBlockSize; -} WGPUDawnDeviceAllocatorControl WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_DEVICE_ALLOCATOR_CONTROL_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnDeviceAllocatorControl, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnDeviceAllocatorControl _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.allocatorHeapBlockSize=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUDawnDrmFormatProperties { - uint64_t modifier; - uint32_t modifierPlaneCount; -} WGPUDawnDrmFormatProperties WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_DRM_FORMAT_PROPERTIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnDrmFormatProperties, { \ - /*.modifier=*/0 _wgpu_COMMA \ - /*.modifierPlaneCount=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUCommandEncoderDescriptor -typedef struct WGPUDawnEncoderInternalUsageDescriptor { - WGPUChainedStruct chain; - WGPUBool useInternalUsages; -} WGPUDawnEncoderInternalUsageDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_ENCODER_INTERNAL_USAGE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnEncoderInternalUsageDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnEncoderInternalUsageDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.useInternalUsages=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUBufferDescriptor -typedef struct WGPUDawnFakeBufferOOMForTesting { - WGPUChainedStruct chain; - WGPUBool fakeOOMAtWireClientMap; - WGPUBool fakeOOMAtNativeMap; - WGPUBool fakeOOMAtDevice; -} WGPUDawnFakeBufferOOMForTesting WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_FAKE_BUFFER_OOM_FOR_TESTING_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnFakeBufferOOMForTesting, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnFakeBufferOOMForTesting _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.fakeOOMAtWireClientMap=*/WGPU_FALSE _wgpu_COMMA \ - /*.fakeOOMAtNativeMap=*/WGPU_FALSE _wgpu_COMMA \ - /*.fakeOOMAtDevice=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnFakeDeviceInitializeErrorForTesting { - WGPUChainedStruct chain; -} WGPUDawnFakeDeviceInitializeErrorForTesting WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_FAKE_DEVICE_INITIALIZE_ERROR_FOR_TESTING_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnFakeDeviceInitializeErrorForTesting, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnFakeDeviceInitializeErrorForTesting _wgpu_COMMA \ - }) _wgpu_COMMA \ -}) - -// Can be chained in WGPULimits -typedef struct WGPUDawnHostMappedPointerLimits { - WGPUChainedStruct chain; - uint32_t hostMappedPointerAlignment; -} WGPUDawnHostMappedPointerLimits WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_HOST_MAPPED_POINTER_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnHostMappedPointerLimits, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnHostMappedPointerLimits _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.hostMappedPointerAlignment=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ -}) - -typedef struct WGPUDawnInjectedInvalidSType { - WGPUChainedStruct chain; - WGPUSType invalidSType; -} WGPUDawnInjectedInvalidSType WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_INJECTED_INVALID_S_TYPE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnInjectedInvalidSType, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnInjectedInvalidSType _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.invalidSType=*/_wgpu_ENUM_ZERO_INIT(WGPUSType) _wgpu_COMMA \ -}) - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPUDawnRenderPassSampleCount { - WGPUChainedStruct chain; - uint32_t sampleCount; -} WGPUDawnRenderPassSampleCount WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_RENDER_PASS_SAMPLE_COUNT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnRenderPassSampleCount, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnRenderPassSampleCount _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sampleCount=*/1 _wgpu_COMMA \ -}) - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUDawnShaderModuleSPIRVOptionsDescriptor { - WGPUChainedStruct chain; - WGPUBool allowNonUniformDerivatives; -} WGPUDawnShaderModuleSPIRVOptionsDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_SHADER_MODULE_SPIRV_OPTIONS_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnShaderModuleSPIRVOptionsDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.allowNonUniformDerivatives=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPULimits -typedef struct WGPUDawnTexelCopyBufferRowAlignmentLimits { - WGPUChainedStruct chain; - uint32_t minTexelCopyBufferRowAlignment; -} WGPUDawnTexelCopyBufferRowAlignmentLimits WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_TEXEL_COPY_BUFFER_ROW_ALIGNMENT_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnTexelCopyBufferRowAlignmentLimits, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnTexelCopyBufferRowAlignmentLimits _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.minTexelCopyBufferRowAlignment=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ -}) - -// Can be chained in WGPUTextureDescriptor -typedef struct WGPUDawnTextureInternalUsageDescriptor { - WGPUChainedStruct chain; - WGPUTextureUsage internalUsage; -} WGPUDawnTextureInternalUsageDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_TEXTURE_INTERNAL_USAGE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnTextureInternalUsageDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnTextureInternalUsageDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.internalUsage=*/WGPUTextureUsage_None _wgpu_COMMA \ -}) - -// Can be chained in WGPUInstanceDescriptor -// Can be chained in WGPURequestAdapterOptions -// Can be chained in WGPUDeviceDescriptor -typedef struct WGPUDawnTogglesDescriptor { - WGPUChainedStruct chain; - size_t enabledToggleCount; - const char* const * enabledToggles; - size_t disabledToggleCount; - const char* const * disabledToggles; -} WGPUDawnTogglesDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_TOGGLES_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnTogglesDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnTogglesDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.enabledToggleCount=*/0 _wgpu_COMMA \ - /*.enabledToggles=*/NULL _wgpu_COMMA \ - /*.disabledToggleCount=*/0 _wgpu_COMMA \ - /*.disabledToggles=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUInstanceDescriptor -typedef struct WGPUDawnWGSLBlocklist { - WGPUChainedStruct chain; - size_t blocklistedFeatureCount; - const char* const * blocklistedFeatures; -} WGPUDawnWGSLBlocklist WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_WGSL_BLOCKLIST_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnWGSLBlocklist, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnWGSLBlocklist _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.blocklistedFeatureCount=*/0 _wgpu_COMMA \ - /*.blocklistedFeatures=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUInstanceDescriptor -typedef struct WGPUDawnWireWGSLControl { - WGPUChainedStruct chain; - WGPUBool enableExperimental; - WGPUBool enableUnsafe; - WGPUBool enableTesting; -} WGPUDawnWireWGSLControl WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_WIRE_WGSL_CONTROL_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnWireWGSLControl, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnWireWGSLControl _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.enableExperimental=*/WGPU_FALSE _wgpu_COMMA \ - /*.enableUnsafe=*/WGPU_FALSE _wgpu_COMMA \ - /*.enableTesting=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUEmscriptenSurfaceSourceCanvasHTMLSelector { - WGPUChainedStruct chain; - WGPUStringView selector; -} WGPUEmscriptenSurfaceSourceCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EMSCRIPTEN_SURFACE_SOURCE_CANVAS_HTML_SELECTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUEmscriptenSurfaceSourceCanvasHTMLSelector, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.selector=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUExtent2D { - uint32_t width; - uint32_t height; -} WGPUExtent2D WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EXTENT_2D_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExtent2D, { \ - /*.width=*/0 _wgpu_COMMA \ - /*.height=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUExtent3D { - uint32_t width; - uint32_t height; - uint32_t depthOrArrayLayers; -} WGPUExtent3D WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EXTENT_3D_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExtent3D, { \ - /*.width=*/0 _wgpu_COMMA \ - /*.height=*/1 _wgpu_COMMA \ - /*.depthOrArrayLayers=*/1 _wgpu_COMMA \ -}) - -// Can be chained in WGPUBindGroupEntry -typedef struct WGPUExternalTextureBindingEntry { - WGPUChainedStruct chain; - WGPUExternalTexture externalTexture; -} WGPUExternalTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EXTERNAL_TEXTURE_BINDING_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExternalTextureBindingEntry, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ExternalTextureBindingEntry _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.externalTexture=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUBindGroupLayoutEntry -typedef struct WGPUExternalTextureBindingLayout { - WGPUChainedStruct chain; -} WGPUExternalTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EXTERNAL_TEXTURE_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExternalTextureBindingLayout, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ExternalTextureBindingLayout _wgpu_COMMA \ - }) _wgpu_COMMA \ -}) - -typedef struct WGPUFuture { - uint64_t id; -} WGPUFuture WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_FUTURE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUFuture, { \ - /*.id=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUInstanceLimits { - WGPUChainedStruct * nextInChain; - size_t timedWaitAnyMaxCount; -} WGPUInstanceLimits WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_INSTANCE_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUInstanceLimits, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.timedWaitAnyMaxCount=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER { - WGPUBool unused; -} WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_INTERNAL_HAVE_EMDAWNWEBGPU_HEADER_INIT _wgpu_MAKE_INIT_STRUCT(WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER, { \ - /*.unused=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUMemoryHeapInfo { - WGPUHeapProperty properties; - uint64_t size; -} WGPUMemoryHeapInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_MEMORY_HEAP_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUMemoryHeapInfo, { \ - /*.properties=*/WGPUHeapProperty_None _wgpu_COMMA \ - /*.size=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUMultisampleState { - WGPUChainedStruct * nextInChain; - uint32_t count; - uint32_t mask; - WGPUBool alphaToCoverageEnabled; -} WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_MULTISAMPLE_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUMultisampleState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.count=*/1 _wgpu_COMMA \ - /*.mask=*/0xFFFFFFFF _wgpu_COMMA \ - /*.alphaToCoverageEnabled=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUOrigin2D { - uint32_t x; - uint32_t y; -} WGPUOrigin2D WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ORIGIN_2D_INIT _wgpu_MAKE_INIT_STRUCT(WGPUOrigin2D, { \ - /*.x=*/0 _wgpu_COMMA \ - /*.y=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUOrigin3D { - uint32_t x; - uint32_t y; - uint32_t z; -} WGPUOrigin3D WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ORIGIN_3D_INIT _wgpu_MAKE_INIT_STRUCT(WGPUOrigin3D, { \ - /*.x=*/0 _wgpu_COMMA \ - /*.y=*/0 _wgpu_COMMA \ - /*.z=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUPassTimestampWrites { - WGPUChainedStruct * nextInChain; - WGPUQuerySet querySet; - uint32_t beginningOfPassWriteIndex; - uint32_t endOfPassWriteIndex; -} WGPUPassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PASS_TIMESTAMP_WRITES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPassTimestampWrites, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.querySet=*/NULL _wgpu_COMMA \ - /*.beginningOfPassWriteIndex=*/WGPU_QUERY_SET_INDEX_UNDEFINED _wgpu_COMMA \ - /*.endOfPassWriteIndex=*/WGPU_QUERY_SET_INDEX_UNDEFINED _wgpu_COMMA \ -}) - -// Can be chained in WGPUPipelineLayoutDescriptor -typedef struct WGPUPipelineLayoutResourceTable { - WGPUChainedStruct chain; - WGPUBool usesResourceTable; -} WGPUPipelineLayoutResourceTable WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PIPELINE_LAYOUT_RESOURCE_TABLE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPipelineLayoutResourceTable, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_PipelineLayoutResourceTable _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.usesResourceTable=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUPipelineLayoutStorageAttachment { - WGPUChainedStruct * nextInChain; - uint64_t offset; - WGPUTextureFormat format; -} WGPUPipelineLayoutStorageAttachment WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PIPELINE_LAYOUT_STORAGE_ATTACHMENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPipelineLayoutStorageAttachment, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUPrimitiveState { - WGPUChainedStruct * nextInChain; - WGPUPrimitiveTopology topology; - WGPUIndexFormat stripIndexFormat; - WGPUFrontFace frontFace; - WGPUCullMode cullMode; - WGPUBool unclippedDepth; -} WGPUPrimitiveState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PRIMITIVE_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPrimitiveState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.topology=*/WGPUPrimitiveTopology_Undefined _wgpu_COMMA \ - /*.stripIndexFormat=*/WGPUIndexFormat_Undefined _wgpu_COMMA \ - /*.frontFace=*/WGPUFrontFace_Undefined _wgpu_COMMA \ - /*.cullMode=*/WGPUCullMode_Undefined _wgpu_COMMA \ - /*.unclippedDepth=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUQuerySetDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUQueryType type; - uint32_t count; -} WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_QUERY_SET_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUQuerySetDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.type=*/_wgpu_ENUM_ZERO_INIT(WGPUQueryType) _wgpu_COMMA \ - /*.count=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUQueueDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_QUEUE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUQueueDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPURenderBundleDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPURenderBundleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_BUNDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderBundleDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPURenderBundleEncoderDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - size_t colorFormatCount; - WGPUTextureFormat const * colorFormats; - WGPUTextureFormat depthStencilFormat; - uint32_t sampleCount; - WGPUBool depthReadOnly; - WGPUBool stencilReadOnly; -} WGPURenderBundleEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_BUNDLE_ENCODER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderBundleEncoderDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.colorFormatCount=*/0 _wgpu_COMMA \ - /*.colorFormats=*/NULL _wgpu_COMMA \ - /*.depthStencilFormat=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.sampleCount=*/1 _wgpu_COMMA \ - /*.depthReadOnly=*/WGPU_FALSE _wgpu_COMMA \ - /*.stencilReadOnly=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPURenderPassDepthStencilAttachment { - WGPUChainedStruct * nextInChain; - WGPUTextureView view; - WGPULoadOp depthLoadOp; - WGPUStoreOp depthStoreOp; - float depthClearValue; - WGPUBool depthReadOnly; - WGPULoadOp stencilLoadOp; - WGPUStoreOp stencilStoreOp; - uint32_t stencilClearValue; - WGPUBool stencilReadOnly; -} WGPURenderPassDepthStencilAttachment WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_DEPTH_STENCIL_ATTACHMENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassDepthStencilAttachment, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.view=*/NULL _wgpu_COMMA \ - /*.depthLoadOp=*/WGPULoadOp_Undefined _wgpu_COMMA \ - /*.depthStoreOp=*/WGPUStoreOp_Undefined _wgpu_COMMA \ - /*.depthClearValue=*/WGPU_DEPTH_CLEAR_VALUE_UNDEFINED _wgpu_COMMA \ - /*.depthReadOnly=*/WGPU_FALSE _wgpu_COMMA \ - /*.stencilLoadOp=*/WGPULoadOp_Undefined _wgpu_COMMA \ - /*.stencilStoreOp=*/WGPUStoreOp_Undefined _wgpu_COMMA \ - /*.stencilClearValue=*/0 _wgpu_COMMA \ - /*.stencilReadOnly=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPURenderPassDescriptorResolveRect { - WGPUChainedStruct chain; - uint32_t colorOffsetX; - uint32_t colorOffsetY; - uint32_t resolveOffsetX; - uint32_t resolveOffsetY; - uint32_t width; - uint32_t height; -} WGPURenderPassDescriptorResolveRect WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_DESCRIPTOR_RESOLVE_RECT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassDescriptorResolveRect, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RenderPassDescriptorResolveRect _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.colorOffsetX=*/0 _wgpu_COMMA \ - /*.colorOffsetY=*/0 _wgpu_COMMA \ - /*.resolveOffsetX=*/0 _wgpu_COMMA \ - /*.resolveOffsetY=*/0 _wgpu_COMMA \ - /*.width=*/0 _wgpu_COMMA \ - /*.height=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPURenderPassMaxDrawCount { - WGPUChainedStruct chain; - uint64_t maxDrawCount; -} WGPURenderPassMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_MAX_DRAW_COUNT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassMaxDrawCount, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RenderPassMaxDrawCount _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.maxDrawCount=*/50000000 _wgpu_COMMA \ -}) - -// Can be chained in WGPURequestAdapterOptions -typedef struct WGPURequestAdapterWebGPUBackendOptions { - WGPUChainedStruct chain; -} WGPURequestAdapterWebGPUBackendOptions WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_REQUEST_ADAPTER_WEBGPU_BACKEND_OPTIONS_INIT _wgpu_MAKE_INIT_STRUCT(WGPURequestAdapterWebGPUBackendOptions, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RequestAdapterWebGPUBackendOptions _wgpu_COMMA \ - }) _wgpu_COMMA \ -}) - -// Can be chained in WGPURequestAdapterOptions -typedef struct WGPURequestAdapterWebXROptions { - WGPUChainedStruct chain; - WGPUBool xrCompatible; -} WGPURequestAdapterWebXROptions WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_REQUEST_ADAPTER_WEBXR_OPTIONS_INIT _wgpu_MAKE_INIT_STRUCT(WGPURequestAdapterWebXROptions, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RequestAdapterWebXROptions _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.xrCompatible=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUResourceTableDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - uint32_t size; -} WGPUResourceTableDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RESOURCE_TABLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUResourceTableDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.size=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUSamplerBindingLayout { - WGPUChainedStruct * nextInChain; - WGPUSamplerBindingType type; -} WGPUSamplerBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SAMPLER_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSamplerBindingLayout, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.type=*/WGPUSamplerBindingType_Undefined _wgpu_COMMA \ -}) - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUShaderModuleCompilationOptions { - WGPUChainedStruct chain; - WGPUBool strictMath; -} WGPUShaderModuleCompilationOptions WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHADER_MODULE_COMPILATION_OPTIONS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUShaderModuleCompilationOptions, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ShaderModuleCompilationOptions _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.strictMath=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUShaderSourceSPIRV { - WGPUChainedStruct chain; - uint32_t codeSize; - uint32_t const * code; -} WGPUShaderSourceSPIRV WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHADER_SOURCE_SPIRV_INIT _wgpu_MAKE_INIT_STRUCT(WGPUShaderSourceSPIRV, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ShaderSourceSPIRV _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.codeSize=*/0 _wgpu_COMMA \ - /*.code=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUShaderModuleDescriptor -typedef struct WGPUShaderSourceWGSL { - WGPUChainedStruct chain; - WGPUStringView code; -} WGPUShaderSourceWGSL WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHADER_SOURCE_WGSL_INIT _wgpu_MAKE_INIT_STRUCT(WGPUShaderSourceWGSL, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_ShaderSourceWGSL _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.code=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedBufferMemoryBeginAccessDescriptor { - WGPUChainedStruct * nextInChain; - WGPUBool initialized; - size_t fenceCount; - WGPUSharedFence const * fences; - size_t signaledValueCount; - uint64_t const * signaledValues; -} WGPUSharedBufferMemoryBeginAccessDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_BUFFER_MEMORY_BEGIN_ACCESS_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedBufferMemoryBeginAccessDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.initialized=*/WGPU_FALSE _wgpu_COMMA \ - /*.fenceCount=*/0 _wgpu_COMMA \ - /*.fences=*/NULL _wgpu_COMMA \ - /*.signaledValueCount=*/0 _wgpu_COMMA \ - /*.signaledValues=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedBufferMemoryDescriptor -typedef struct WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor { - WGPUChainedStruct chain; - void * handle; - uint64_t size; -} WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_BUFFER_MEMORY_D3D12_SHARED_MEMORY_FILE_MAPPING_HANDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/NULL _wgpu_COMMA \ - /*.size=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUSharedBufferMemoryEndAccessState { - WGPUChainedStruct * nextInChain; - WGPUBool initialized; - size_t fenceCount; - WGPUSharedFence const * fences; - size_t signaledValueCount; - uint64_t const * signaledValues; -} WGPUSharedBufferMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_BUFFER_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedBufferMemoryEndAccessState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.initialized=*/WGPU_FALSE _wgpu_COMMA \ - /*.fenceCount=*/0 _wgpu_COMMA \ - /*.fences=*/NULL _wgpu_COMMA \ - /*.signaledValueCount=*/0 _wgpu_COMMA \ - /*.signaledValues=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSharedBufferMemoryProperties { - WGPUChainedStruct * nextInChain; - WGPUBufferUsage usage; - uint64_t size; -} WGPUSharedBufferMemoryProperties WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_BUFFER_MEMORY_PROPERTIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedBufferMemoryProperties, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.usage=*/WGPUBufferUsage_None _wgpu_COMMA \ - /*.size=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceDXGISharedHandleDescriptor { - WGPUChainedStruct chain; - void * handle; -} WGPUSharedFenceDXGISharedHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_DXGI_SHARED_HANDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceDXGISharedHandleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceDXGISharedHandleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceDXGISharedHandleExportInfo { - WGPUChainedStruct chain; - void * handle; -} WGPUSharedFenceDXGISharedHandleExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_DXGI_SHARED_HANDLE_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceDXGISharedHandleExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceDXGISharedHandleExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceEGLSyncDescriptor { - WGPUChainedStruct chain; - void * sync; -} WGPUSharedFenceEGLSyncDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_EGL_SYNC_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceEGLSyncDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceEGLSyncDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sync=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceEGLSyncExportInfo { - WGPUChainedStruct chain; - void * sync; -} WGPUSharedFenceEGLSyncExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_EGL_SYNC_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceEGLSyncExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceEGLSyncExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sync=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceMTLSharedEventDescriptor { - WGPUChainedStruct chain; - void * sharedEvent; -} WGPUSharedFenceMTLSharedEventDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_MTL_SHARED_EVENT_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceMTLSharedEventDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceMTLSharedEventDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sharedEvent=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceMTLSharedEventExportInfo { - WGPUChainedStruct chain; - void * sharedEvent; -} WGPUSharedFenceMTLSharedEventExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_MTL_SHARED_EVENT_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceMTLSharedEventExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceMTLSharedEventExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sharedEvent=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceSyncFDDescriptor { - WGPUChainedStruct chain; - int handle; -} WGPUSharedFenceSyncFDDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_SYNC_FD_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceSyncFDDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceSyncFDDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceSyncFDExportInfo { - WGPUChainedStruct chain; - int handle; -} WGPUSharedFenceSyncFDExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_SYNC_FD_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceSyncFDExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceSyncFDExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor { - WGPUChainedStruct chain; - int handle; -} WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_VK_SEMAPHORE_OPAQUE_FD_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo { - WGPUChainedStruct chain; - int handle; -} WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_VK_SEMAPHORE_OPAQUE_FD_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceDescriptor -typedef struct WGPUSharedFenceVkSemaphoreZirconHandleDescriptor { - WGPUChainedStruct chain; - uint32_t handle; -} WGPUSharedFenceVkSemaphoreZirconHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_VK_SEMAPHORE_ZIRCON_HANDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedFenceExportInfo -typedef struct WGPUSharedFenceVkSemaphoreZirconHandleExportInfo { - WGPUChainedStruct chain; - uint32_t handle; -} WGPUSharedFenceVkSemaphoreZirconHandleExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_VK_SEMAPHORE_ZIRCON_HANDLE_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryAHardwareBufferDescriptor { - WGPUChainedStruct chain; - void * handle; -} WGPUSharedTextureMemoryAHardwareBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_A_HARDWARE_BUFFER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryAHardwareBufferDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryBeginAccessDescriptor -typedef struct WGPUSharedTextureMemoryD3D11BeginState { - WGPUChainedStruct chain; - WGPUBool requiresEndAccessFence; -} WGPUSharedTextureMemoryD3D11BeginState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_D3D11_BEGIN_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryD3D11BeginState, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryD3D11BeginState _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.requiresEndAccessFence=*/WGPU_TRUE _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryBeginAccessDescriptor -typedef struct WGPUSharedTextureMemoryD3DSwapchainBeginState { - WGPUChainedStruct chain; - WGPUBool isSwapchain; -} WGPUSharedTextureMemoryD3DSwapchainBeginState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_D3D_SWAPCHAIN_BEGIN_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryD3DSwapchainBeginState, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryD3DSwapchainBeginState _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.isSwapchain=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUSharedTextureMemoryDmaBufPlane { - int fd; - uint64_t offset; - uint32_t stride; -} WGPUSharedTextureMemoryDmaBufPlane WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_DMA_BUF_PLANE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryDmaBufPlane, { \ - /*.fd=*/0 _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.stride=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryDXGISharedHandleDescriptor { - WGPUChainedStruct chain; - void * handle; - WGPUBool useKeyedMutex; -} WGPUSharedTextureMemoryDXGISharedHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_DXGI_SHARED_HANDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryDXGISharedHandleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.handle=*/NULL _wgpu_COMMA \ - /*.useKeyedMutex=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryEGLImageDescriptor { - WGPUChainedStruct chain; - void * image; -} WGPUSharedTextureMemoryEGLImageDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_EGL_IMAGE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEGLImageDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryEGLImageDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.image=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryIOSurfaceDescriptor { - WGPUChainedStruct chain; - void * ioSurface; - WGPUBool allowStorageBinding; -} WGPUSharedTextureMemoryIOSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_IO_SURFACE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryIOSurfaceDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryIOSurfaceDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.ioSurface=*/NULL _wgpu_COMMA \ - /*.allowStorageBinding=*/WGPU_TRUE _wgpu_COMMA \ -}) - -// 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; - -#define WGPU_SHARED_TEXTURE_MEMORY_OPAQUE_FD_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryOpaqueFDDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryOpaqueFDDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.vkImageCreateInfo=*/NULL _wgpu_COMMA \ - /*.memoryFD=*/0 _wgpu_COMMA \ - /*.memoryTypeIndex=*/0 _wgpu_COMMA \ - /*.allocationSize=*/0 _wgpu_COMMA \ - /*.dedicatedAllocation=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor { - WGPUChainedStruct chain; - WGPUBool dedicatedAllocation; -} WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_VK_DEDICATED_ALLOCATION_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.dedicatedAllocation=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryBeginAccessDescriptor -typedef struct WGPUSharedTextureMemoryVkImageLayoutBeginState { - WGPUChainedStruct chain; - int32_t oldLayout; - int32_t newLayout; -} WGPUSharedTextureMemoryVkImageLayoutBeginState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_VK_IMAGE_LAYOUT_BEGIN_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryVkImageLayoutBeginState, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryVkImageLayoutBeginState _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.oldLayout=*/0 _wgpu_COMMA \ - /*.newLayout=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryEndAccessState -typedef struct WGPUSharedTextureMemoryVkImageLayoutEndState { - WGPUChainedStruct chain; - int32_t oldLayout; - int32_t newLayout; -} WGPUSharedTextureMemoryVkImageLayoutEndState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_VK_IMAGE_LAYOUT_END_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryVkImageLayoutEndState, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryVkImageLayoutEndState _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.oldLayout=*/0 _wgpu_COMMA \ - /*.newLayout=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryDescriptor -typedef struct WGPUSharedTextureMemoryZirconHandleDescriptor { - WGPUChainedStruct chain; - uint32_t memoryFD; - uint64_t allocationSize; -} WGPUSharedTextureMemoryZirconHandleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_ZIRCON_HANDLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryZirconHandleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryZirconHandleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.memoryFD=*/0 _wgpu_COMMA \ - /*.allocationSize=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUBindGroupLayoutEntry -typedef struct WGPUStaticSamplerBindingLayout { - WGPUChainedStruct chain; - WGPUSampler sampler; - uint32_t sampledTextureBinding; -} WGPUStaticSamplerBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_STATIC_SAMPLER_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUStaticSamplerBindingLayout, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_StaticSamplerBindingLayout _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.sampler=*/NULL _wgpu_COMMA \ - /*.sampledTextureBinding=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ -}) - -typedef struct WGPUStencilFaceState { - WGPUCompareFunction compare; - WGPUStencilOperation failOp; - WGPUStencilOperation depthFailOp; - WGPUStencilOperation passOp; -} WGPUStencilFaceState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_STENCIL_FACE_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUStencilFaceState, { \ - /*.compare=*/WGPUCompareFunction_Undefined _wgpu_COMMA \ - /*.failOp=*/WGPUStencilOperation_Undefined _wgpu_COMMA \ - /*.depthFailOp=*/WGPUStencilOperation_Undefined _wgpu_COMMA \ - /*.passOp=*/WGPUStencilOperation_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUStorageTextureBindingLayout { - WGPUChainedStruct * nextInChain; - WGPUStorageTextureAccess access; - WGPUTextureFormat format; - WGPUTextureViewDimension viewDimension; -} WGPUStorageTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_STORAGE_TEXTURE_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUStorageTextureBindingLayout, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.access=*/WGPUStorageTextureAccess_Undefined _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.viewDimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUSubgroupMatrixConfig { - WGPUSubgroupMatrixComponentType componentType; - WGPUSubgroupMatrixComponentType resultComponentType; - uint32_t M; - uint32_t N; - uint32_t K; -} WGPUSubgroupMatrixConfig WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SUBGROUP_MATRIX_CONFIG_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSubgroupMatrixConfig, { \ - /*.componentType=*/_wgpu_ENUM_ZERO_INIT(WGPUSubgroupMatrixComponentType) _wgpu_COMMA \ - /*.resultComponentType=*/_wgpu_ENUM_ZERO_INIT(WGPUSubgroupMatrixComponentType) _wgpu_COMMA \ - /*.M=*/0 _wgpu_COMMA \ - /*.N=*/0 _wgpu_COMMA \ - /*.K=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUSupportedFeatures { - size_t featureCount; - WGPUFeatureName const * features; -} WGPUSupportedFeatures WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SUPPORTED_FEATURES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSupportedFeatures, { \ - /*.featureCount=*/0 _wgpu_COMMA \ - /*.features=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSupportedInstanceFeatures { - size_t featureCount; - WGPUInstanceFeatureName const * features; -} WGPUSupportedInstanceFeatures WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SUPPORTED_INSTANCE_FEATURES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSupportedInstanceFeatures, { \ - /*.featureCount=*/0 _wgpu_COMMA \ - /*.features=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSupportedWGSLLanguageFeatures { - size_t featureCount; - WGPUWGSLLanguageFeatureName const * features; -} WGPUSupportedWGSLLanguageFeatures WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SUPPORTED_WGSL_LANGUAGE_FEATURES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSupportedWGSLLanguageFeatures, { \ - /*.featureCount=*/0 _wgpu_COMMA \ - /*.features=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSurfaceCapabilities { - WGPUChainedStruct * nextInChain; - WGPUTextureUsage usages; - size_t formatCount; - WGPUTextureFormat const * formats; - size_t presentModeCount; - WGPUPresentMode const * presentModes; - size_t alphaModeCount; - WGPUCompositeAlphaMode const * alphaModes; -} WGPUSurfaceCapabilities WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_CAPABILITIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceCapabilities, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.usages=*/WGPUTextureUsage_None _wgpu_COMMA \ - /*.formatCount=*/0 _wgpu_COMMA \ - /*.formats=*/NULL _wgpu_COMMA \ - /*.presentModeCount=*/0 _wgpu_COMMA \ - /*.presentModes=*/NULL _wgpu_COMMA \ - /*.alphaModeCount=*/0 _wgpu_COMMA \ - /*.alphaModes=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceColorManagement { - WGPUChainedStruct chain; - WGPUPredefinedColorSpace colorSpace; - WGPUToneMappingMode toneMappingMode; -} WGPUSurfaceColorManagement WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_COLOR_MANAGEMENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceColorManagement, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceColorManagement _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.colorSpace=*/_wgpu_ENUM_ZERO_INIT(WGPUPredefinedColorSpace) _wgpu_COMMA \ - /*.toneMappingMode=*/_wgpu_ENUM_ZERO_INIT(WGPUToneMappingMode) _wgpu_COMMA \ -}) - -typedef struct WGPUSurfaceConfiguration { - WGPUChainedStruct * nextInChain; - WGPUDevice device; - WGPUTextureFormat format; - WGPUTextureUsage usage; - uint32_t width; - uint32_t height; - size_t viewFormatCount; - WGPUTextureFormat const * viewFormats; - WGPUCompositeAlphaMode alphaMode; - WGPUPresentMode presentMode; -} WGPUSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_CONFIGURATION_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceConfiguration, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.device=*/NULL _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.usage=*/WGPUTextureUsage_RenderAttachment _wgpu_COMMA \ - /*.width=*/0 _wgpu_COMMA \ - /*.height=*/0 _wgpu_COMMA \ - /*.viewFormatCount=*/0 _wgpu_COMMA \ - /*.viewFormats=*/NULL _wgpu_COMMA \ - /*.alphaMode=*/WGPUCompositeAlphaMode_Auto _wgpu_COMMA \ - /*.presentMode=*/WGPUPresentMode_Undefined _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceDescriptorFromWindowsCoreWindow { - WGPUChainedStruct chain; - void * coreWindow; -} WGPUSurfaceDescriptorFromWindowsCoreWindow WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_DESCRIPTOR_FROM_WINDOWS_CORE_WINDOW_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceDescriptorFromWindowsCoreWindow, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceDescriptorFromWindowsCoreWindow _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.coreWindow=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel { - WGPUChainedStruct chain; - void * swapChainPanel; -} WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_DESCRIPTOR_FROM_WINDOWS_UWP_SWAP_CHAIN_PANEL_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceDescriptorFromWindowsUWPSwapChainPanel _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.swapChainPanel=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel { - WGPUChainedStruct chain; - void * swapChainPanel; -} WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_DESCRIPTOR_FROM_WINDOWS_WINUI_SWAP_CHAIN_PANEL_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceDescriptorFromWindowsWinUISwapChainPanel _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.swapChainPanel=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceAndroidNativeWindow { - WGPUChainedStruct chain; - void * window; -} WGPUSurfaceSourceAndroidNativeWindow WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_ANDROID_NATIVE_WINDOW_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceAndroidNativeWindow, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceAndroidNativeWindow _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.window=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceMetalLayer { - WGPUChainedStruct chain; - void * layer; -} WGPUSurfaceSourceMetalLayer WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_METAL_LAYER_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceMetalLayer, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceMetalLayer _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.layer=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceWaylandSurface { - WGPUChainedStruct chain; - void * display; - void * surface; -} WGPUSurfaceSourceWaylandSurface WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_WAYLAND_SURFACE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceWaylandSurface, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceWaylandSurface _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.display=*/NULL _wgpu_COMMA \ - /*.surface=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceWindowsHWND { - WGPUChainedStruct chain; - void * hinstance; - void * hwnd; -} WGPUSurfaceSourceWindowsHWND WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_WINDOWS_HWND_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceWindowsHWND, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceWindowsHWND _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.hinstance=*/NULL _wgpu_COMMA \ - /*.hwnd=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceXCBWindow { - WGPUChainedStruct chain; - void * connection; - uint32_t window; -} WGPUSurfaceSourceXCBWindow WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_XCB_WINDOW_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceXCBWindow, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceXCBWindow _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.connection=*/NULL _wgpu_COMMA \ - /*.window=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSurfaceDescriptor -typedef struct WGPUSurfaceSourceXlibWindow { - WGPUChainedStruct chain; - void * display; - uint64_t window; -} WGPUSurfaceSourceXlibWindow WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_SOURCE_XLIB_WINDOW_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceSourceXlibWindow, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SurfaceSourceXlibWindow _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.display=*/NULL _wgpu_COMMA \ - /*.window=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUSurfaceTexture { - WGPUChainedStruct * nextInChain; - WGPUTexture texture; - WGPUSurfaceGetCurrentTextureStatus status; -} WGPUSurfaceTexture WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_TEXTURE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceTexture, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.texture=*/NULL _wgpu_COMMA \ - /*.status=*/_wgpu_ENUM_ZERO_INIT(WGPUSurfaceGetCurrentTextureStatus) _wgpu_COMMA \ -}) - -// Can be chained in WGPUBindGroupEntry -typedef struct WGPUTexelBufferBindingEntry { - WGPUChainedStruct chain; - WGPUTexelBufferView texelBufferView; -} WGPUTexelBufferBindingEntry WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_BUFFER_BINDING_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelBufferBindingEntry, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_TexelBufferBindingEntry _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.texelBufferView=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUBindGroupLayoutEntry -typedef struct WGPUTexelBufferBindingLayout { - WGPUChainedStruct chain; - WGPUTexelBufferAccess access; - WGPUTextureFormat format; -} WGPUTexelBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_BUFFER_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelBufferBindingLayout, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_TexelBufferBindingLayout _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.access=*/WGPUTexelBufferAccess_Undefined _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUTexelBufferViewDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUTextureFormat format; - uint64_t offset; - uint64_t size; -} WGPUTexelBufferViewDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_BUFFER_VIEW_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelBufferViewDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.size=*/WGPU_WHOLE_SIZE _wgpu_COMMA \ -}) - -typedef struct WGPUTexelCopyBufferLayout { - uint64_t offset; - uint32_t bytesPerRow; - uint32_t rowsPerImage; -} WGPUTexelCopyBufferLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_COPY_BUFFER_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelCopyBufferLayout, { \ - /*.offset=*/0 _wgpu_COMMA \ - /*.bytesPerRow=*/WGPU_COPY_STRIDE_UNDEFINED _wgpu_COMMA \ - /*.rowsPerImage=*/WGPU_COPY_STRIDE_UNDEFINED _wgpu_COMMA \ -}) - -typedef struct WGPUTextureBindingLayout { - WGPUChainedStruct * nextInChain; - WGPUTextureSampleType sampleType; - WGPUTextureViewDimension viewDimension; - WGPUBool multisampled; -} WGPUTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureBindingLayout, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.sampleType=*/WGPUTextureSampleType_Undefined _wgpu_COMMA \ - /*.viewDimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \ - /*.multisampled=*/WGPU_FALSE _wgpu_COMMA \ -}) - -// Can be chained in WGPUTextureDescriptor -typedef struct WGPUTextureBindingViewDimension { - WGPUChainedStruct chain; - WGPUTextureViewDimension textureBindingViewDimension; -} WGPUTextureBindingViewDimension WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_BINDING_VIEW_DIMENSION_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureBindingViewDimension, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_TextureBindingViewDimension _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.textureBindingViewDimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUTextureComponentSwizzle { - WGPUComponentSwizzle r; - WGPUComponentSwizzle g; - WGPUComponentSwizzle b; - WGPUComponentSwizzle a; -} WGPUTextureComponentSwizzle WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureComponentSwizzle, { \ - /*.r=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \ - /*.g=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \ - /*.b=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \ - /*.a=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUVertexAttribute { - WGPUChainedStruct * nextInChain; - WGPUVertexFormat format; - uint64_t offset; - uint32_t shaderLocation; -} WGPUVertexAttribute WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_VERTEX_ATTRIBUTE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUVertexAttribute, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.format=*/_wgpu_ENUM_ZERO_INIT(WGPUVertexFormat) _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.shaderLocation=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUSamplerDescriptor -// Can be chained in WGPUTextureViewDescriptor -typedef struct WGPUYCbCrVkDescriptor { - WGPUChainedStruct chain; - uint32_t vkFormat; - uint32_t vkYCbCrModel; - uint32_t vkYCbCrRange; - uint32_t vkComponentSwizzleRed; - uint32_t vkComponentSwizzleGreen; - uint32_t vkComponentSwizzleBlue; - uint32_t vkComponentSwizzleAlpha; - uint32_t vkXChromaOffset; - uint32_t vkYChromaOffset; - WGPUFilterMode vkChromaFilter; - WGPUBool forceExplicitReconstruction; - uint64_t externalFormat; -} WGPUYCbCrVkDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_Y_CB_CR_VK_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUYCbCrVkDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_YCbCrVkDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.vkFormat=*/0 _wgpu_COMMA \ - /*.vkYCbCrModel=*/0 _wgpu_COMMA \ - /*.vkYCbCrRange=*/0 _wgpu_COMMA \ - /*.vkComponentSwizzleRed=*/0 _wgpu_COMMA \ - /*.vkComponentSwizzleGreen=*/0 _wgpu_COMMA \ - /*.vkComponentSwizzleBlue=*/0 _wgpu_COMMA \ - /*.vkComponentSwizzleAlpha=*/0 _wgpu_COMMA \ - /*.vkXChromaOffset=*/0 _wgpu_COMMA \ - /*.vkYChromaOffset=*/0 _wgpu_COMMA \ - /*.vkChromaFilter=*/WGPUFilterMode_Undefined _wgpu_COMMA \ - /*.forceExplicitReconstruction=*/WGPU_FALSE _wgpu_COMMA \ - /*.externalFormat=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesMemoryHeaps { - WGPUChainedStruct chain; - size_t heapCount; - WGPUMemoryHeapInfo const * heapInfo; -} WGPUAdapterPropertiesMemoryHeaps WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_MEMORY_HEAPS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesMemoryHeaps, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesMemoryHeaps _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.heapCount=*/0 _wgpu_COMMA \ - /*.heapInfo=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUAdapterInfo -typedef struct WGPUAdapterPropertiesSubgroupMatrixConfigs { - WGPUChainedStruct chain; - size_t configCount; - WGPUSubgroupMatrixConfig const * configs; -} WGPUAdapterPropertiesSubgroupMatrixConfigs WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_PROPERTIES_SUBGROUP_MATRIX_CONFIGS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesSubgroupMatrixConfigs, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_AdapterPropertiesSubgroupMatrixConfigs _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.configCount=*/0 _wgpu_COMMA \ - /*.configs=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUAHardwareBufferProperties { - WGPUYCbCrVkDescriptor yCbCrInfo; -} WGPUAHardwareBufferProperties WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_A_HARDWARE_BUFFER_PROPERTIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAHardwareBufferProperties, { \ - /*.yCbCrInfo=*/WGPU_Y_CB_CR_VK_DESCRIPTOR_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUBindGroupEntry { - WGPUChainedStruct * nextInChain; - uint32_t binding; - WGPU_NULLABLE WGPUBuffer buffer; - uint64_t offset; - uint64_t size; - WGPU_NULLABLE WGPUSampler sampler; - WGPU_NULLABLE WGPUTextureView textureView; -} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BIND_GROUP_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupEntry, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.binding=*/0 _wgpu_COMMA \ - /*.buffer=*/NULL _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.size=*/WGPU_WHOLE_SIZE _wgpu_COMMA \ - /*.sampler=*/NULL _wgpu_COMMA \ - /*.textureView=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUBindGroupLayoutEntry { - WGPUChainedStruct * nextInChain; - uint32_t binding; - WGPUShaderStage visibility; - uint32_t bindingArraySize; - WGPUBufferBindingLayout buffer; - WGPUSamplerBindingLayout sampler; - WGPUTextureBindingLayout texture; - WGPUStorageTextureBindingLayout storageTexture; -} WGPUBindGroupLayoutEntry WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BIND_GROUP_LAYOUT_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupLayoutEntry, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.binding=*/0 _wgpu_COMMA \ - /*.visibility=*/WGPUShaderStage_None _wgpu_COMMA \ - /*.bindingArraySize=*/0 _wgpu_COMMA \ - /*.buffer=*/_wgpu_STRUCT_ZERO_INIT _wgpu_COMMA \ - /*.sampler=*/_wgpu_STRUCT_ZERO_INIT _wgpu_COMMA \ - /*.texture=*/_wgpu_STRUCT_ZERO_INIT _wgpu_COMMA \ - /*.storageTexture=*/_wgpu_STRUCT_ZERO_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUBlendState { - WGPUBlendComponent color; - WGPUBlendComponent alpha; -} WGPUBlendState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BLEND_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBlendState, { \ - /*.color=*/WGPU_BLEND_COMPONENT_INIT _wgpu_COMMA \ - /*.alpha=*/WGPU_BLEND_COMPONENT_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUBufferDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUBufferUsage usage; - uint64_t size; - WGPUBool mappedAtCreation; -} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BUFFER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBufferDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.usage=*/WGPUBufferUsage_None _wgpu_COMMA \ - /*.size=*/0 _wgpu_COMMA \ - /*.mappedAtCreation=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUCommandEncoderDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMMAND_ENCODER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCommandEncoderDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUCompilationMessage { - WGPUChainedStruct * nextInChain; - WGPUStringView message; - WGPUCompilationMessageType type; - uint64_t lineNum; - uint64_t linePos; - uint64_t offset; - uint64_t length; -} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPILATION_MESSAGE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCompilationMessage, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.message=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.type=*/_wgpu_ENUM_ZERO_INIT(WGPUCompilationMessageType) _wgpu_COMMA \ - /*.lineNum=*/0 _wgpu_COMMA \ - /*.linePos=*/0 _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.length=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUComputePassDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPU_NULLABLE WGPUPassTimestampWrites const * timestampWrites; -} WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPUTE_PASS_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUComputePassDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.timestampWrites=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUComputeState { - WGPUChainedStruct * nextInChain; - WGPUShaderModule module; - WGPUStringView entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; -} WGPUComputeState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPUTE_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUComputeState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.module=*/NULL _wgpu_COMMA \ - /*.entryPoint=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.constantCount=*/0 _wgpu_COMMA \ - /*.constants=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUDawnFormatCapabilities -typedef struct WGPUDawnDrmFormatCapabilities { - WGPUChainedStruct chain; - size_t propertiesCount; - WGPUDawnDrmFormatProperties const * properties; -} WGPUDawnDrmFormatCapabilities WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_DRM_FORMAT_CAPABILITIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnDrmFormatCapabilities, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_DawnDrmFormatCapabilities _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.propertiesCount=*/0 _wgpu_COMMA \ - /*.properties=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUDepthStencilState { - WGPUChainedStruct * nextInChain; - WGPUTextureFormat format; - WGPUOptionalBool depthWriteEnabled; - WGPUCompareFunction depthCompare; - WGPUStencilFaceState stencilFront; - WGPUStencilFaceState stencilBack; - uint32_t stencilReadMask; - uint32_t stencilWriteMask; - int32_t depthBias; - float depthBiasSlopeScale; - float depthBiasClamp; -} WGPUDepthStencilState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DEPTH_STENCIL_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDepthStencilState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.depthWriteEnabled=*/WGPUOptionalBool_Undefined _wgpu_COMMA \ - /*.depthCompare=*/WGPUCompareFunction_Undefined _wgpu_COMMA \ - /*.stencilFront=*/WGPU_STENCIL_FACE_STATE_INIT _wgpu_COMMA \ - /*.stencilBack=*/WGPU_STENCIL_FACE_STATE_INIT _wgpu_COMMA \ - /*.stencilReadMask=*/0xFFFFFFFF _wgpu_COMMA \ - /*.stencilWriteMask=*/0xFFFFFFFF _wgpu_COMMA \ - /*.depthBias=*/0 _wgpu_COMMA \ - /*.depthBiasSlopeScale=*/0.f _wgpu_COMMA \ - /*.depthBiasClamp=*/0.f _wgpu_COMMA \ -}) - -typedef struct WGPUExternalTextureDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUTextureView plane0; - WGPU_NULLABLE WGPUTextureView plane1; - WGPUOrigin2D cropOrigin; - WGPUExtent2D cropSize; - WGPUExtent2D apparentSize; - WGPUBool doYuvToRgbConversionOnly; - WGPU_NULLABLE float const * yuvToRgbConversionMatrix; - float const * srcTransferFunctionParameters; - float const * dstTransferFunctionParameters; - float const * gamutConversionMatrix; - WGPUBool mirrored; - WGPUExternalTextureRotation rotation; -} WGPUExternalTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_EXTERNAL_TEXTURE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExternalTextureDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.plane0=*/NULL _wgpu_COMMA \ - /*.plane1=*/NULL _wgpu_COMMA \ - /*.cropOrigin=*/WGPU_ORIGIN_2D_INIT _wgpu_COMMA \ - /*.cropSize=*/WGPU_EXTENT_2D_INIT _wgpu_COMMA \ - /*.apparentSize=*/WGPU_EXTENT_2D_INIT _wgpu_COMMA \ - /*.doYuvToRgbConversionOnly=*/WGPU_FALSE _wgpu_COMMA \ - /*.yuvToRgbConversionMatrix=*/NULL _wgpu_COMMA \ - /*.srcTransferFunctionParameters=*/NULL _wgpu_COMMA \ - /*.dstTransferFunctionParameters=*/NULL _wgpu_COMMA \ - /*.gamutConversionMatrix=*/NULL _wgpu_COMMA \ - /*.mirrored=*/WGPU_FALSE _wgpu_COMMA \ - /*.rotation=*/WGPUExternalTextureRotation_Rotate0Degrees _wgpu_COMMA \ -}) - -typedef struct WGPUFutureWaitInfo { - WGPUFuture future; - WGPUBool completed; -} WGPUFutureWaitInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_FUTURE_WAIT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUFutureWaitInfo, { \ - /*.future=*/WGPU_FUTURE_INIT _wgpu_COMMA \ - /*.completed=*/WGPU_FALSE _wgpu_COMMA \ -}) - -typedef struct WGPUImageCopyExternalTexture { - WGPUChainedStruct * nextInChain; - WGPUExternalTexture externalTexture; - WGPUOrigin3D origin; - WGPUExtent2D naturalSize; -} WGPUImageCopyExternalTexture WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_IMAGE_COPY_EXTERNAL_TEXTURE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUImageCopyExternalTexture, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.externalTexture=*/NULL _wgpu_COMMA \ - /*.origin=*/WGPU_ORIGIN_3D_INIT _wgpu_COMMA \ - /*.naturalSize=*/WGPU_EXTENT_2D_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUInstanceDescriptor { - WGPUChainedStruct * nextInChain; - size_t requiredFeatureCount; - WGPUInstanceFeatureName const * requiredFeatures; - WGPU_NULLABLE WGPUInstanceLimits const * requiredLimits; -} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_INSTANCE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUInstanceDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.requiredFeatureCount=*/0 _wgpu_COMMA \ - /*.requiredFeatures=*/NULL _wgpu_COMMA \ - /*.requiredLimits=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPULimits { - WGPUChainedStruct * nextInChain; - uint32_t maxTextureDimension1D; - uint32_t maxTextureDimension2D; - uint32_t maxTextureDimension3D; - uint32_t maxTextureArrayLayers; - uint32_t maxBindGroups; - uint32_t maxBindGroupsPlusVertexBuffers; - uint32_t maxBindingsPerBindGroup; - uint32_t maxDynamicUniformBuffersPerPipelineLayout; - uint32_t maxDynamicStorageBuffersPerPipelineLayout; - uint32_t maxSampledTexturesPerShaderStage; - uint32_t maxSamplersPerShaderStage; - uint32_t maxStorageBuffersPerShaderStage; - uint32_t maxStorageTexturesPerShaderStage; - uint32_t maxUniformBuffersPerShaderStage; - uint64_t maxUniformBufferBindingSize; - uint64_t maxStorageBufferBindingSize; - uint32_t minUniformBufferOffsetAlignment; - uint32_t minStorageBufferOffsetAlignment; - uint32_t maxVertexBuffers; - uint64_t maxBufferSize; - uint32_t maxVertexAttributes; - uint32_t maxVertexBufferArrayStride; - uint32_t 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; - uint32_t maxImmediateSize; -} WGPULimits WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPULimits, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.maxTextureDimension1D=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxTextureDimension2D=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxTextureDimension3D=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxTextureArrayLayers=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxBindGroups=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxBindGroupsPlusVertexBuffers=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxBindingsPerBindGroup=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxDynamicUniformBuffersPerPipelineLayout=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxDynamicStorageBuffersPerPipelineLayout=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxSampledTexturesPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxSamplersPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxStorageBuffersPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxStorageTexturesPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxUniformBuffersPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxUniformBufferBindingSize=*/WGPU_LIMIT_U64_UNDEFINED _wgpu_COMMA \ - /*.maxStorageBufferBindingSize=*/WGPU_LIMIT_U64_UNDEFINED _wgpu_COMMA \ - /*.minUniformBufferOffsetAlignment=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.minStorageBufferOffsetAlignment=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxVertexBuffers=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxBufferSize=*/WGPU_LIMIT_U64_UNDEFINED _wgpu_COMMA \ - /*.maxVertexAttributes=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxVertexBufferArrayStride=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxInterStageShaderVariables=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxColorAttachments=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxColorAttachmentBytesPerSample=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeWorkgroupStorageSize=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeInvocationsPerWorkgroup=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeWorkgroupSizeX=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeWorkgroupSizeY=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeWorkgroupSizeZ=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxComputeWorkgroupsPerDimension=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ - /*.maxImmediateSize=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ -}) - -// Can be chained in WGPUPipelineLayoutDescriptor -typedef struct WGPUPipelineLayoutPixelLocalStorage { - WGPUChainedStruct chain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount; - WGPUPipelineLayoutStorageAttachment const * storageAttachments; -} WGPUPipelineLayoutPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PIPELINE_LAYOUT_PIXEL_LOCAL_STORAGE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPipelineLayoutPixelLocalStorage, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_PipelineLayoutPixelLocalStorage _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.totalPixelLocalStorageSize=*/0 _wgpu_COMMA \ - /*.storageAttachmentCount=*/0 _wgpu_COMMA \ - /*.storageAttachments=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPURenderPassColorAttachment { - WGPUChainedStruct * nextInChain; - WGPU_NULLABLE WGPUTextureView view; - uint32_t depthSlice; - WGPU_NULLABLE WGPUTextureView resolveTarget; - WGPULoadOp loadOp; - WGPUStoreOp storeOp; - WGPUColor clearValue; -} WGPURenderPassColorAttachment WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_COLOR_ATTACHMENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassColorAttachment, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.view=*/NULL _wgpu_COMMA \ - /*.depthSlice=*/WGPU_DEPTH_SLICE_UNDEFINED _wgpu_COMMA \ - /*.resolveTarget=*/NULL _wgpu_COMMA \ - /*.loadOp=*/WGPULoadOp_Undefined _wgpu_COMMA \ - /*.storeOp=*/WGPUStoreOp_Undefined _wgpu_COMMA \ - /*.clearValue=*/WGPU_COLOR_INIT _wgpu_COMMA \ -}) - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPURenderPassRenderAreaRect { - WGPUChainedStruct chain; - WGPUOrigin2D origin; - WGPUExtent2D size; -} WGPURenderPassRenderAreaRect WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_RENDER_AREA_RECT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassRenderAreaRect, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RenderPassRenderAreaRect _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.origin=*/WGPU_ORIGIN_2D_INIT _wgpu_COMMA \ - /*.size=*/WGPU_EXTENT_2D_INIT _wgpu_COMMA \ -}) - -typedef struct WGPURenderPassStorageAttachment { - WGPUChainedStruct * nextInChain; - uint64_t offset; - WGPUTextureView storage; - WGPULoadOp loadOp; - WGPUStoreOp storeOp; - WGPUColor clearValue; -} WGPURenderPassStorageAttachment WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_STORAGE_ATTACHMENT_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassStorageAttachment, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.offset=*/0 _wgpu_COMMA \ - /*.storage=*/NULL _wgpu_COMMA \ - /*.loadOp=*/WGPULoadOp_Undefined _wgpu_COMMA \ - /*.storeOp=*/WGPUStoreOp_Undefined _wgpu_COMMA \ - /*.clearValue=*/WGPU_COLOR_INIT _wgpu_COMMA \ -}) - -typedef struct WGPURequestAdapterOptions { - WGPUChainedStruct * nextInChain; - WGPUFeatureLevel featureLevel; - WGPUPowerPreference powerPreference; - WGPUBool forceFallbackAdapter; - WGPUBackendType backendType; - WGPU_NULLABLE WGPUSurface compatibleSurface; -} WGPURequestAdapterOptions WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_REQUEST_ADAPTER_OPTIONS_INIT _wgpu_MAKE_INIT_STRUCT(WGPURequestAdapterOptions, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.featureLevel=*/WGPUFeatureLevel_Undefined _wgpu_COMMA \ - /*.powerPreference=*/WGPUPowerPreference_Undefined _wgpu_COMMA \ - /*.forceFallbackAdapter=*/WGPU_FALSE _wgpu_COMMA \ - /*.backendType=*/WGPUBackendType_Undefined _wgpu_COMMA \ - /*.compatibleSurface=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSamplerDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUAddressMode addressModeU; - WGPUAddressMode addressModeV; - WGPUAddressMode addressModeW; - WGPUFilterMode magFilter; - WGPUFilterMode minFilter; - WGPUMipmapFilterMode mipmapFilter; - float lodMinClamp; - float lodMaxClamp; - WGPUCompareFunction compare; - uint16_t maxAnisotropy; -} WGPUSamplerDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SAMPLER_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSamplerDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.addressModeU=*/WGPUAddressMode_Undefined _wgpu_COMMA \ - /*.addressModeV=*/WGPUAddressMode_Undefined _wgpu_COMMA \ - /*.addressModeW=*/WGPUAddressMode_Undefined _wgpu_COMMA \ - /*.magFilter=*/WGPUFilterMode_Undefined _wgpu_COMMA \ - /*.minFilter=*/WGPUFilterMode_Undefined _wgpu_COMMA \ - /*.mipmapFilter=*/WGPUMipmapFilterMode_Undefined _wgpu_COMMA \ - /*.lodMinClamp=*/0.f _wgpu_COMMA \ - /*.lodMaxClamp=*/32.f _wgpu_COMMA \ - /*.compare=*/WGPUCompareFunction_Undefined _wgpu_COMMA \ - /*.maxAnisotropy=*/1 _wgpu_COMMA \ -}) - -typedef struct WGPUShaderModuleDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHADER_MODULE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUShaderModuleDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedBufferMemoryDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUSharedBufferMemoryDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_BUFFER_MEMORY_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedBufferMemoryDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedFenceDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUSharedFenceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedFenceExportInfo { - WGPUChainedStruct * nextInChain; - WGPUSharedFenceType type; -} WGPUSharedFenceExportInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_FENCE_EXPORT_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedFenceExportInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.type=*/_wgpu_ENUM_ZERO_INIT(WGPUSharedFenceType) _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryProperties -typedef struct WGPUSharedTextureMemoryAHardwareBufferProperties { - WGPUChainedStruct chain; - WGPUYCbCrVkDescriptor yCbCrInfo; -} WGPUSharedTextureMemoryAHardwareBufferProperties WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_A_HARDWARE_BUFFER_PROPERTIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryAHardwareBufferProperties, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryAHardwareBufferProperties _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.yCbCrInfo=*/WGPU_Y_CB_CR_VK_DESCRIPTOR_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedTextureMemoryBeginAccessDescriptor { - WGPUChainedStruct * nextInChain; - WGPUBool concurrentRead; - WGPUBool initialized; - size_t fenceCount; - WGPUSharedFence const * fences; - size_t signaledValueCount; - uint64_t const * signaledValues; -} WGPUSharedTextureMemoryBeginAccessDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_BEGIN_ACCESS_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryBeginAccessDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.concurrentRead=*/WGPU_FALSE _wgpu_COMMA \ - /*.initialized=*/WGPU_FALSE _wgpu_COMMA \ - /*.fenceCount=*/0 _wgpu_COMMA \ - /*.fences=*/NULL _wgpu_COMMA \ - /*.signaledValueCount=*/0 _wgpu_COMMA \ - /*.signaledValues=*/NULL _wgpu_COMMA \ -}) - -// 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; - -#define WGPU_SHARED_TEXTURE_MEMORY_DMA_BUF_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryDmaBufDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryDmaBufDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.size=*/WGPU_EXTENT_3D_INIT _wgpu_COMMA \ - /*.drmFormat=*/0 _wgpu_COMMA \ - /*.drmModifier=*/0 _wgpu_COMMA \ - /*.planeCount=*/0 _wgpu_COMMA \ - /*.planes=*/NULL _wgpu_COMMA \ -}) - -// Can be chained in WGPUSharedTextureMemoryEndAccessState -typedef struct WGPUSharedTextureMemoryMetalEndAccessState { - WGPUChainedStruct chain; - WGPUFuture commandsScheduledFuture; -} WGPUSharedTextureMemoryMetalEndAccessState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_METAL_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryMetalEndAccessState, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_SharedTextureMemoryMetalEndAccessState _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.commandsScheduledFuture=*/WGPU_FUTURE_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSurfaceDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SURFACE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSurfaceDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUTexelCopyBufferInfo { - WGPUTexelCopyBufferLayout layout; - WGPUBuffer buffer; -} WGPUTexelCopyBufferInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_COPY_BUFFER_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelCopyBufferInfo, { \ - /*.layout=*/WGPU_TEXEL_COPY_BUFFER_LAYOUT_INIT _wgpu_COMMA \ - /*.buffer=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUTexelCopyTextureInfo { - WGPUTexture texture; - uint32_t mipLevel; - WGPUOrigin3D origin; - WGPUTextureAspect aspect; -} WGPUTexelCopyTextureInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXEL_COPY_TEXTURE_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelCopyTextureInfo, { \ - /*.texture=*/NULL _wgpu_COMMA \ - /*.mipLevel=*/0 _wgpu_COMMA \ - /*.origin=*/WGPU_ORIGIN_3D_INIT _wgpu_COMMA \ - /*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \ -}) - -// Can be chained in WGPUTextureViewDescriptor -typedef struct WGPUTextureComponentSwizzleDescriptor { - WGPUChainedStruct chain; - WGPUTextureComponentSwizzle swizzle; -} WGPUTextureComponentSwizzleDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_COMPONENT_SWIZZLE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureComponentSwizzleDescriptor, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_TextureComponentSwizzleDescriptor _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.swizzle=*/WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUTextureDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUTextureUsage usage; - WGPUTextureDimension dimension; - WGPUExtent3D size; - WGPUTextureFormat format; - uint32_t mipLevelCount; - uint32_t sampleCount; - size_t viewFormatCount; - WGPUTextureFormat const * viewFormats; -} WGPUTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \ - /*.dimension=*/WGPUTextureDimension_Undefined _wgpu_COMMA \ - /*.size=*/WGPU_EXTENT_3D_INIT _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.mipLevelCount=*/1 _wgpu_COMMA \ - /*.sampleCount=*/1 _wgpu_COMMA \ - /*.viewFormatCount=*/0 _wgpu_COMMA \ - /*.viewFormats=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUVertexBufferLayout { - WGPUChainedStruct * nextInChain; - WGPUVertexStepMode stepMode; - uint64_t arrayStride; - size_t attributeCount; - WGPUVertexAttribute const * attributes; -} WGPUVertexBufferLayout WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_VERTEX_BUFFER_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUVertexBufferLayout, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.stepMode=*/WGPUVertexStepMode_Undefined _wgpu_COMMA \ - /*.arrayStride=*/0 _wgpu_COMMA \ - /*.attributeCount=*/0 _wgpu_COMMA \ - /*.attributes=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUAdapterInfo { - WGPUChainedStruct * nextInChain; - WGPUStringView vendor; - WGPUStringView architecture; - WGPUStringView device; - WGPUStringView description; - WGPUBackendType backendType; - WGPUAdapterType adapterType; - uint32_t vendorID; - uint32_t deviceID; - uint32_t subgroupMinSize; - uint32_t subgroupMaxSize; -} WGPUAdapterInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_ADAPTER_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.vendor=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.architecture=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.device=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.description=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.backendType=*/WGPUBackendType_Undefined _wgpu_COMMA \ - /*.adapterType=*/_wgpu_ENUM_ZERO_INIT(WGPUAdapterType) _wgpu_COMMA \ - /*.vendorID=*/0 _wgpu_COMMA \ - /*.deviceID=*/0 _wgpu_COMMA \ - /*.subgroupMinSize=*/0 _wgpu_COMMA \ - /*.subgroupMaxSize=*/0 _wgpu_COMMA \ -}) - -typedef struct WGPUBindGroupDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUBindGroupLayout layout; - size_t entryCount; - WGPUBindGroupEntry const * entries; -} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BIND_GROUP_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.layout=*/NULL _wgpu_COMMA \ - /*.entryCount=*/0 _wgpu_COMMA \ - /*.entries=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUBindGroupLayoutDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - size_t entryCount; - WGPUBindGroupLayoutEntry const * entries; -} WGPUBindGroupLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_BIND_GROUP_LAYOUT_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupLayoutDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.entryCount=*/0 _wgpu_COMMA \ - /*.entries=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUColorTargetState { - WGPUChainedStruct * nextInChain; - WGPUTextureFormat format; - WGPU_NULLABLE WGPUBlendState const * blend; - WGPUColorWriteMask writeMask; -} WGPUColorTargetState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COLOR_TARGET_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUColorTargetState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.blend=*/NULL _wgpu_COMMA \ - /*.writeMask=*/WGPUColorWriteMask_All _wgpu_COMMA \ -}) - -typedef struct WGPUCompilationInfo { - WGPUChainedStruct * nextInChain; - size_t messageCount; - WGPUCompilationMessage const * messages; -} WGPUCompilationInfo WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPILATION_INFO_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCompilationInfo, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.messageCount=*/0 _wgpu_COMMA \ - /*.messages=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUComputePipelineDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPU_NULLABLE WGPUPipelineLayout layout; - WGPUComputeState compute; -} WGPUComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_COMPUTE_PIPELINE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUComputePipelineDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.layout=*/NULL _wgpu_COMMA \ - /*.compute=*/WGPU_COMPUTE_STATE_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUDawnFormatCapabilities { - WGPUChainedStruct * nextInChain; -} WGPUDawnFormatCapabilities WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DAWN_FORMAT_CAPABILITIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDawnFormatCapabilities, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUDeviceDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - size_t requiredFeatureCount; - WGPUFeatureName const * requiredFeatures; - WGPU_NULLABLE WGPULimits const * requiredLimits; - WGPUQueueDescriptor defaultQueue; - WGPUDeviceLostCallbackInfo deviceLostCallbackInfo; - WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo; -} WGPUDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_DEVICE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUDeviceDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.requiredFeatureCount=*/0 _wgpu_COMMA \ - /*.requiredFeatures=*/NULL _wgpu_COMMA \ - /*.requiredLimits=*/NULL _wgpu_COMMA \ - /*.defaultQueue=*/WGPU_QUEUE_DESCRIPTOR_INIT _wgpu_COMMA \ - /*.deviceLostCallbackInfo=*/WGPU_DEVICE_LOST_CALLBACK_INFO_INIT _wgpu_COMMA \ - /*.uncapturedErrorCallbackInfo=*/WGPU_UNCAPTURED_ERROR_CALLBACK_INFO_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUPipelineLayoutDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - size_t bindGroupLayoutCount; - WGPUBindGroupLayout const * bindGroupLayouts; - uint32_t immediateSize; -} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_PIPELINE_LAYOUT_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUPipelineLayoutDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.bindGroupLayoutCount=*/0 _wgpu_COMMA \ - /*.bindGroupLayouts=*/NULL _wgpu_COMMA \ - /*.immediateSize=*/0 _wgpu_COMMA \ -}) - -// Can be chained in WGPURenderPassDescriptor -typedef struct WGPURenderPassPixelLocalStorage { - WGPUChainedStruct chain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount; - WGPURenderPassStorageAttachment const * storageAttachments; -} WGPURenderPassPixelLocalStorage WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_PIXEL_LOCAL_STORAGE_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassPixelLocalStorage, { \ - /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ - /*.next=*/NULL _wgpu_COMMA \ - /*.sType=*/WGPUSType_RenderPassPixelLocalStorage _wgpu_COMMA \ - }) _wgpu_COMMA \ - /*.totalPixelLocalStorageSize=*/0 _wgpu_COMMA \ - /*.storageAttachmentCount=*/0 _wgpu_COMMA \ - /*.storageAttachments=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSharedTextureMemoryDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; -} WGPUSharedTextureMemoryDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -}) - -typedef struct WGPUSharedTextureMemoryEndAccessState { - WGPUChainedStruct * nextInChain; - WGPUBool initialized; - size_t fenceCount; - WGPUSharedFence const * fences; - size_t signaledValueCount; - uint64_t const * signaledValues; -} WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEndAccessState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.initialized=*/WGPU_FALSE _wgpu_COMMA \ - /*.fenceCount=*/0 _wgpu_COMMA \ - /*.fences=*/NULL _wgpu_COMMA \ - /*.signaledValueCount=*/0 _wgpu_COMMA \ - /*.signaledValues=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUSharedTextureMemoryProperties { - WGPUChainedStruct * nextInChain; - WGPUTextureUsage usage; - WGPUExtent3D size; - WGPUTextureFormat format; -} WGPUSharedTextureMemoryProperties WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_SHARED_TEXTURE_MEMORY_PROPERTIES_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryProperties, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \ - /*.size=*/WGPU_EXTENT_3D_INIT _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ -}) - -typedef struct WGPUTextureViewDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPUTextureFormat format; - WGPUTextureViewDimension dimension; - uint32_t baseMipLevel; - uint32_t mipLevelCount; - uint32_t baseArrayLayer; - uint32_t arrayLayerCount; - WGPUTextureAspect aspect; - WGPUTextureUsage usage; -} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureViewDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \ - /*.dimension=*/WGPUTextureViewDimension_Undefined _wgpu_COMMA \ - /*.baseMipLevel=*/0 _wgpu_COMMA \ - /*.mipLevelCount=*/WGPU_MIP_LEVEL_COUNT_UNDEFINED _wgpu_COMMA \ - /*.baseArrayLayer=*/0 _wgpu_COMMA \ - /*.arrayLayerCount=*/WGPU_ARRAY_LAYER_COUNT_UNDEFINED _wgpu_COMMA \ - /*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \ - /*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \ -}) - -typedef struct WGPUVertexState { - WGPUChainedStruct * nextInChain; - WGPUShaderModule module; - WGPUStringView entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; - size_t bufferCount; - WGPUVertexBufferLayout const * buffers; -} WGPUVertexState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_VERTEX_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUVertexState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.module=*/NULL _wgpu_COMMA \ - /*.entryPoint=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.constantCount=*/0 _wgpu_COMMA \ - /*.constants=*/NULL _wgpu_COMMA \ - /*.bufferCount=*/0 _wgpu_COMMA \ - /*.buffers=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPUFragmentState { - WGPUChainedStruct * nextInChain; - WGPUShaderModule module; - WGPUStringView entryPoint; - size_t constantCount; - WGPUConstantEntry const * constants; - size_t targetCount; - WGPUColorTargetState const * targets; -} WGPUFragmentState WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_FRAGMENT_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUFragmentState, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.module=*/NULL _wgpu_COMMA \ - /*.entryPoint=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.constantCount=*/0 _wgpu_COMMA \ - /*.constants=*/NULL _wgpu_COMMA \ - /*.targetCount=*/0 _wgpu_COMMA \ - /*.targets=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPURenderPassDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - size_t colorAttachmentCount; - WGPURenderPassColorAttachment const * colorAttachments; - WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; - WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; - WGPU_NULLABLE WGPUPassTimestampWrites const * timestampWrites; -} WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PASS_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPassDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.colorAttachmentCount=*/0 _wgpu_COMMA \ - /*.colorAttachments=*/NULL _wgpu_COMMA \ - /*.depthStencilAttachment=*/NULL _wgpu_COMMA \ - /*.occlusionQuerySet=*/NULL _wgpu_COMMA \ - /*.timestampWrites=*/NULL _wgpu_COMMA \ -}) - -typedef struct WGPURenderPipelineDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; - WGPU_NULLABLE WGPUPipelineLayout layout; - WGPUVertexState vertex; - WGPUPrimitiveState primitive; - WGPU_NULLABLE WGPUDepthStencilState const * depthStencil; - WGPUMultisampleState multisample; - WGPU_NULLABLE WGPUFragmentState const * fragment; -} WGPURenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; - -#define WGPU_RENDER_PIPELINE_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPURenderPipelineDescriptor, { \ - /*.nextInChain=*/NULL _wgpu_COMMA \ - /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ - /*.layout=*/NULL _wgpu_COMMA \ - /*.vertex=*/WGPU_VERTEX_STATE_INIT _wgpu_COMMA \ - /*.primitive=*/WGPU_PRIMITIVE_STATE_INIT _wgpu_COMMA \ - /*.depthStencil=*/NULL _wgpu_COMMA \ - /*.multisample=*/WGPU_MULTISAMPLE_STATE_INIT _wgpu_COMMA \ - /*.fragment=*/NULL _wgpu_COMMA \ -}) - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(WGPU_SKIP_PROCS) -// TODO(374150686): Remove these Emscripten specific declarations from the -// header once they are fully deprecated. -WGPU_EXPORT WGPUDevice emscripten_webgpu_get_device(void); -// Global procs -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcGetInstanceFeatures)(WGPUSupportedInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcGetInstanceLimits)(WGPUInstanceLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcHasInstanceFeature)(WGPUInstanceFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE; - - -// Procs of Adapter -typedef WGPUDevice (*WGPUProcAdapterCreateDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterGetFeatures)(WGPUAdapter adapter, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcAdapterGetFormatCapabilities)(WGPUAdapter adapter, WGPUTextureFormat format, WGPUDawnFormatCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcAdapterGetInfo)(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUInstance (*WGPUProcAdapterGetInstance)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterAddRef)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of AdapterInfo -typedef void (*WGPUProcAdapterInfoFreeMembers)(WGPUAdapterInfo adapterInfo) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of AdapterPropertiesMemoryHeaps -typedef void (*WGPUProcAdapterPropertiesMemoryHeapsFreeMembers)(WGPUAdapterPropertiesMemoryHeaps adapterPropertiesMemoryHeaps) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of AdapterPropertiesSubgroupMatrixConfigs -typedef void (*WGPUProcAdapterPropertiesSubgroupMatrixConfigsFreeMembers)(WGPUAdapterPropertiesSubgroupMatrixConfigs adapterPropertiesSubgroupMatrixConfigs) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of BindGroup -typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupAddRef)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of BindGroupLayout -typedef void (*WGPUProcBindGroupLayoutSetLabel)(WGPUBindGroupLayout bindGroupLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupLayoutAddRef)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Buffer -typedef WGPUTexelBufferView (*WGPUProcBufferCreateTexelView)(WGPUBuffer buffer, WGPUTexelBufferViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBufferUsage (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapMode mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcBufferReadMappedRange)(WGPUBuffer buffer, size_t offset, void * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcBufferWriteMappedRange)(WGPUBuffer buffer, size_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferAddRef)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of CommandBuffer -typedef void (*WGPUProcCommandBufferSetLabel)(WGPUCommandBuffer commandBuffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandBufferAddRef)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of CommandEncoder -typedef WGPUComputePassEncoder (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderClearBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUTexelCopyBufferInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyBufferInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo 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, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, WGPUStringView 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, WGPUStringView 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 (*WGPUProcCommandEncoderAddRef)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ComputePassEncoder -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, WGPUStringView 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 (*WGPUProcComputePassEncoderSetImmediates)(WGPUComputePassEncoder computePassEncoder, uint32_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderSetResourceTable)(WGPUComputePassEncoder computePassEncoder, WGPU_NULLABLE WGPUResourceTable table) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderAddRef)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ComputePipeline -typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineAddRef)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of DawnDrmFormatCapabilities -typedef void (*WGPUProcDawnDrmFormatCapabilitiesFreeMembers)(WGPUDawnDrmFormatCapabilities dawnDrmFormatCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Device -typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPU_NULLABLE WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -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, WGPUStringView 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 WGPUFuture (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUResourceTable (*WGPUProcDeviceCreateResourceTable)(WGPUDevice device, WGPUResourceTableDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceForceLoss)(WGPUDevice device, WGPUDeviceLostReason type, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUAdapter (*WGPUProcDeviceGetAdapter)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcDeviceGetAdapterInfo)(WGPUDevice device, WGPUAdapterInfo * adapterInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcDeviceGetAHardwareBufferProperties)(WGPUDevice device, void * handle, WGPUAHardwareBufferProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceGetFeatures)(WGPUDevice device, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcDeviceGetLostFuture)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) 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, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUPopErrorScopeCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceSetLoggingCallback)(WGPUDevice device, WGPULoggingCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceTick)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceValidateTextureDescriptor)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceAddRef)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcExternalTextureAddRef)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcExternalTextureRelease)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Instance -typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceGetWGSLLanguageFeatures)(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcInstanceHasWGSLLanguageFeature)(WGPUInstance instance, WGPUWGSLLanguageFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUWaitStatus (*WGPUProcInstanceWaitAny)(WGPUInstance instance, size_t futureCount, WGPU_NULLABLE WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceAddRef)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of PipelineLayout -typedef void (*WGPUProcPipelineLayoutSetLabel)(WGPUPipelineLayout pipelineLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcPipelineLayoutAddRef)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of QuerySet -typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcQuerySetGetCount)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQueryType (*WGPUProcQuerySetGetType)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetAddRef)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Queue -typedef void (*WGPUProcQueueCopyExternalTextureForBrowser)(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueCopyTextureForBrowser)(WGPUQueue queue, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUFuture (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, WGPUStringView 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, WGPUTexelCopyTextureInfo const * destination, void const * data, size_t dataSize, WGPUTexelCopyBufferLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueAddRef)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueRelease)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderBundle -typedef void (*WGPUProcRenderBundleSetLabel)(WGPURenderBundle renderBundle, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleAddRef)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderBundleEncoder -typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView 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 (*WGPUProcRenderBundleEncoderSetImmediates)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t offset, void const * data, size_t size) 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderSetResourceTable)(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPUResourceTable table) 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 (*WGPUProcRenderBundleEncoderAddRef)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderPassEncoder -typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderMultiDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderMultiDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderPixelLocalStorageBarrier)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, WGPUStringView 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 (*WGPUProcRenderPassEncoderSetImmediates)(WGPURenderPassEncoder renderPassEncoder, uint32_t offset, void const * data, size_t size) 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderSetResourceTable)(WGPURenderPassEncoder renderPassEncoder, WGPU_NULLABLE WGPUResourceTable table) 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 (*WGPUProcRenderPassEncoderAddRef)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of RenderPipeline -typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineAddRef)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ResourceTable -typedef void (*WGPUProcResourceTableDestroy)(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcResourceTableGetSize)(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcResourceTableInsertBinding)(WGPUResourceTable resourceTable, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcResourceTableRemoveBinding)(WGPUResourceTable resourceTable, uint32_t slot) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcResourceTableSetLabel)(WGPUResourceTable resourceTable, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcResourceTableUpdate)(WGPUResourceTable resourceTable, uint32_t slot, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcResourceTableAddRef)(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcResourceTableRelease)(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Sampler -typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSamplerAddRef)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of ShaderModule -typedef WGPUFuture (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleAddRef)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SharedBufferMemory -typedef WGPUStatus (*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 WGPUStatus (*WGPUProcSharedBufferMemoryEndAccess)(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcSharedBufferMemoryGetProperties)(WGPUSharedBufferMemory sharedBufferMemory, WGPUSharedBufferMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcSharedBufferMemoryIsDeviceLost)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedBufferMemorySetLabel)(WGPUSharedBufferMemory sharedBufferMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedBufferMemoryAddRef)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedBufferMemoryRelease)(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SharedBufferMemoryEndAccessState -typedef void (*WGPUProcSharedBufferMemoryEndAccessStateFreeMembers)(WGPUSharedBufferMemoryEndAccessState sharedBufferMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SharedFence -typedef void (*WGPUProcSharedFenceExportInfo)(WGPUSharedFence sharedFence, WGPUSharedFenceExportInfo * info) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedFenceSetLabel)(WGPUSharedFence sharedFence, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedFenceAddRef)(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedFenceRelease)(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SharedTextureMemory -typedef WGPUStatus (*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 WGPUStatus (*WGPUProcSharedTextureMemoryEndAccess)(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcSharedTextureMemoryGetProperties)(WGPUSharedTextureMemory sharedTextureMemory, WGPUSharedTextureMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBool (*WGPUProcSharedTextureMemoryIsDeviceLost)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedTextureMemorySetLabel)(WGPUSharedTextureMemory sharedTextureMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedTextureMemoryAddRef)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSharedTextureMemoryRelease)(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SharedTextureMemoryEndAccessState -typedef void (*WGPUProcSharedTextureMemoryEndAccessStateFreeMembers)(WGPUSharedTextureMemoryEndAccessState sharedTextureMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SupportedFeatures -typedef void (*WGPUProcSupportedFeaturesFreeMembers)(WGPUSupportedFeatures supportedFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SupportedInstanceFeatures -typedef void (*WGPUProcSupportedInstanceFeaturesFreeMembers)(WGPUSupportedInstanceFeatures supportedInstanceFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SupportedWGSLLanguageFeatures -typedef void (*WGPUProcSupportedWGSLLanguageFeaturesFreeMembers)(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of Surface -typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUStatus (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceAddRef)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of SurfaceCapabilities -typedef void (*WGPUProcSurfaceCapabilitiesFreeMembers)(WGPUSurfaceCapabilities surfaceCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of TexelBufferView -typedef void (*WGPUProcTexelBufferViewSetLabel)(WGPUTexelBufferView texelBufferView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTexelBufferViewAddRef)(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTexelBufferViewRelease)(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of 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 WGPUTextureViewDimension (*WGPUProcTextureGetTextureBindingViewDimension)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTextureUsage (*WGPUProcTextureGetUsage)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTexturePin)(WGPUTexture texture, WGPUTextureUsage usage) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureSetOwnershipForMemoryDump)(WGPUTexture texture, uint64_t ownerGuid) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureUnpin)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureAddRef)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureRelease)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; - -// Procs of TextureView -typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureViewAddRef)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; - -#endif // !defined(WGPU_SKIP_PROCS) - -#if !defined(WGPU_SKIP_DECLARATIONS) -WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuGetInstanceFeatures(WGPUSupportedInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuGetInstanceLimits(WGPUInstanceLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuHasInstanceFeature(WGPUInstanceFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Adapter -WGPU_EXPORT WGPUDevice wgpuAdapterCreateDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterGetFeatures(WGPUAdapter adapter, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuAdapterGetFormatCapabilities(WGPUAdapter adapter, WGPUTextureFormat format, WGPUDawnFormatCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuAdapterGetInfo(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUInstance wgpuAdapterGetInstance(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuAdapterGetLimits(WGPUAdapter adapter, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterAddRef(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterInfo -WGPU_EXPORT void wgpuAdapterInfoFreeMembers(WGPUAdapterInfo adapterInfo) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterPropertiesMemoryHeaps -WGPU_EXPORT void wgpuAdapterPropertiesMemoryHeapsFreeMembers(WGPUAdapterPropertiesMemoryHeaps adapterPropertiesMemoryHeaps) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterPropertiesSubgroupMatrixConfigs -WGPU_EXPORT void wgpuAdapterPropertiesSubgroupMatrixConfigsFreeMembers(WGPUAdapterPropertiesSubgroupMatrixConfigs adapterPropertiesSubgroupMatrixConfigs) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroup -WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupAddRef(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroupLayout -WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupLayoutAddRef(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Buffer -WGPU_EXPORT WGPUTexelBufferView wgpuBufferCreateTexelView(WGPUBuffer buffer, WGPUTexelBufferViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -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 void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBufferUsage wgpuBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapMode mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuBufferReadMappedRange(WGPUBuffer buffer, size_t offset, void * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuBufferWriteMappedRange(WGPUBuffer buffer, size_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferAddRef(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandBuffer -WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandBufferAddRef(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandEncoder -WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUTexelCopyBufferInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyBufferInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo 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, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, WGPUStringView 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, WGPUStringView 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 wgpuCommandEncoderAddRef(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePassEncoder -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, WGPUStringView 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 wgpuComputePassEncoderSetImmediates(WGPUComputePassEncoder computePassEncoder, uint32_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderSetResourceTable(WGPUComputePassEncoder computePassEncoder, WGPU_NULLABLE WGPUResourceTable table) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderAddRef(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineAddRef(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of DawnDrmFormatCapabilities -WGPU_EXPORT void wgpuDawnDrmFormatCapabilitiesFreeMembers(WGPUDawnDrmFormatCapabilities dawnDrmFormatCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Device -WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPU_NULLABLE WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -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, WGPUStringView 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 WGPUFuture wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUResourceTable wgpuDeviceCreateResourceTable(WGPUDevice device, WGPUResourceTableDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceForceLoss(WGPUDevice device, WGPUDeviceLostReason type, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUAdapter wgpuDeviceGetAdapter(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuDeviceGetAdapterInfo(WGPUDevice device, WGPUAdapterInfo * adapterInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuDeviceGetAHardwareBufferProperties(WGPUDevice device, void * handle, WGPUAHardwareBufferProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceGetFeatures(WGPUDevice device, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuDeviceGetLimits(WGPUDevice device, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuDeviceGetLostFuture(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT 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, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuDevicePopErrorScope(WGPUDevice device, WGPUPopErrorScopeCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceSetLoggingCallback(WGPUDevice device, WGPULoggingCallbackInfo callbackInfo) 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 wgpuDeviceAddRef(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuExternalTextureAddRef(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_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceGetWGSLLanguageFeatures(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLLanguageFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUWaitStatus wgpuInstanceWaitAny(WGPUInstance instance, size_t futureCount, WGPU_NULLABLE WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceAddRef(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of PipelineLayout -WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuPipelineLayoutAddRef(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of QuerySet -WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQuerySetAddRef(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, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueCopyTextureForBrowser(WGPUQueue queue, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUFuture wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, WGPUStringView 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, WGPUTexelCopyTextureInfo const * destination, void const * data, size_t dataSize, WGPUTexelCopyBufferLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueAddRef(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundle -WGPU_EXPORT void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleAddRef(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundleEncoder -WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView 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 wgpuRenderBundleEncoderSetImmediates(WGPURenderBundleEncoder renderBundleEncoder, uint32_t offset, void const * data, size_t size) 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderSetResourceTable(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPUResourceTable table) 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 wgpuRenderBundleEncoderAddRef(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPassEncoder -WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) 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, WGPUStringView 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 wgpuRenderPassEncoderSetImmediates(WGPURenderPassEncoder renderPassEncoder, uint32_t offset, void const * data, size_t size) 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, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderSetResourceTable(WGPURenderPassEncoder renderPassEncoder, WGPU_NULLABLE WGPUResourceTable table) 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 wgpuRenderPassEncoderAddRef(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineAddRef(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ResourceTable -WGPU_EXPORT void wgpuResourceTableDestroy(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuResourceTableGetSize(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuResourceTableInsertBinding(WGPUResourceTable resourceTable, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuResourceTableRemoveBinding(WGPUResourceTable resourceTable, uint32_t slot) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuResourceTableSetLabel(WGPUResourceTable resourceTable, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuResourceTableUpdate(WGPUResourceTable resourceTable, uint32_t slot, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuResourceTableAddRef(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuResourceTableRelease(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Sampler -WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSamplerAddRef(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ShaderModule -WGPU_EXPORT WGPUFuture wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleAddRef(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedBufferMemory -WGPU_EXPORT WGPUStatus 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 WGPUStatus wgpuSharedBufferMemoryEndAccess(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuSharedBufferMemoryGetProperties(WGPUSharedBufferMemory sharedBufferMemory, WGPUSharedBufferMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuSharedBufferMemoryIsDeviceLost(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedBufferMemorySetLabel(WGPUSharedBufferMemory sharedBufferMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedBufferMemoryAddRef(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedBufferMemoryRelease(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedBufferMemoryEndAccessState -WGPU_EXPORT void wgpuSharedBufferMemoryEndAccessStateFreeMembers(WGPUSharedBufferMemoryEndAccessState sharedBufferMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedFence -WGPU_EXPORT void wgpuSharedFenceExportInfo(WGPUSharedFence sharedFence, WGPUSharedFenceExportInfo * info) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedFenceSetLabel(WGPUSharedFence sharedFence, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedFenceAddRef(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedFenceRelease(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedTextureMemory -WGPU_EXPORT WGPUStatus 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 WGPUStatus wgpuSharedTextureMemoryEndAccess(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuSharedTextureMemoryGetProperties(WGPUSharedTextureMemory sharedTextureMemory, WGPUSharedTextureMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUBool wgpuSharedTextureMemoryIsDeviceLost(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedTextureMemorySetLabel(WGPUSharedTextureMemory sharedTextureMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedTextureMemoryAddRef(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSharedTextureMemoryRelease(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedTextureMemoryEndAccessState -WGPU_EXPORT void wgpuSharedTextureMemoryEndAccessStateFreeMembers(WGPUSharedTextureMemoryEndAccessState sharedTextureMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedFeatures -WGPU_EXPORT void wgpuSupportedFeaturesFreeMembers(WGPUSupportedFeatures supportedFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedInstanceFeatures -WGPU_EXPORT void wgpuSupportedInstanceFeaturesFreeMembers(WGPUSupportedInstanceFeatures supportedInstanceFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedWGSLLanguageFeatures -WGPU_EXPORT void wgpuSupportedWGSLLanguageFeaturesFreeMembers(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Surface -WGPU_EXPORT void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUStatus wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceSetLabel(WGPUSurface surface, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceUnconfigure(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceAddRef(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SurfaceCapabilities -WGPU_EXPORT void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of TexelBufferView -WGPU_EXPORT void wgpuTexelBufferViewSetLabel(WGPUTexelBufferView texelBufferView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTexelBufferViewAddRef(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTexelBufferViewRelease(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of 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 WGPUTextureViewDimension wgpuTextureGetTextureBindingViewDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUTextureUsage wgpuTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTexturePin(WGPUTexture texture, WGPUTextureUsage usage) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureSetOwnershipForMemoryDump(WGPUTexture texture, uint64_t ownerGuid) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureUnpin(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureAddRef(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of TextureView -WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureViewAddRef(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; - -#endif // !defined(WGPU_SKIP_DECLARATIONS) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // WEBGPU_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp.h b/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp.h deleted file mode 100644 index 723f1a1..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp.h +++ /dev/null @@ -1,10180 +0,0 @@ -// Copyright 2017 The Dawn & Tint Authors -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "webgpu/webgpu.h" -#include "webgpu/webgpu_cpp_chained_struct.h" -#include "webgpu/webgpu_enum_class_bitmasks.h" // IWYU pragma: export - -namespace wgpu { - -static constexpr uint32_t kArrayLayerCountUndefined = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; -static constexpr uint32_t kCopyStrideUndefined = WGPU_COPY_STRIDE_UNDEFINED; -static constexpr float kDepthClearValueUndefined = std::numeric_limits::quiet_NaN(); -static constexpr uint32_t kDepthSliceUndefined = WGPU_DEPTH_SLICE_UNDEFINED; -static constexpr uint32_t kInvalidBinding = WGPU_INVALID_BINDING; -static constexpr uint32_t kLimitU32Undefined = WGPU_LIMIT_U32_UNDEFINED; -static constexpr uint64_t kLimitU64Undefined = WGPU_LIMIT_U64_UNDEFINED; -static constexpr uint32_t kMipLevelCountUndefined = WGPU_MIP_LEVEL_COUNT_UNDEFINED; -static constexpr uint32_t kQuerySetIndexUndefined = WGPU_QUERY_SET_INDEX_UNDEFINED; -static constexpr size_t kStrlen = WGPU_STRLEN; -static constexpr size_t kWholeMapSize = WGPU_WHOLE_MAP_SIZE; -static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE; - -enum class AdapterType : uint32_t { - DiscreteGPU = WGPUAdapterType_DiscreteGPU, - IntegratedGPU = WGPUAdapterType_IntegratedGPU, - CPU = WGPUAdapterType_CPU, - Unknown = WGPUAdapterType_Unknown, -}; -static_assert(sizeof(AdapterType) == sizeof(WGPUAdapterType), "sizeof mismatch for AdapterType"); -static_assert(alignof(AdapterType) == alignof(WGPUAdapterType), "alignof mismatch for AdapterType"); - -enum class AddressMode : uint32_t { - Undefined = WGPUAddressMode_Undefined, - ClampToEdge = WGPUAddressMode_ClampToEdge, - Repeat = WGPUAddressMode_Repeat, - MirrorRepeat = WGPUAddressMode_MirrorRepeat, -}; -static_assert(sizeof(AddressMode) == sizeof(WGPUAddressMode), "sizeof mismatch for AddressMode"); -static_assert(alignof(AddressMode) == alignof(WGPUAddressMode), "alignof mismatch for AddressMode"); - -enum class AlphaMode : uint32_t { - Opaque = WGPUAlphaMode_Opaque, - Premultiplied = WGPUAlphaMode_Premultiplied, - Unpremultiplied = WGPUAlphaMode_Unpremultiplied, -}; -static_assert(sizeof(AlphaMode) == sizeof(WGPUAlphaMode), "sizeof mismatch for AlphaMode"); -static_assert(alignof(AlphaMode) == alignof(WGPUAlphaMode), "alignof mismatch for AlphaMode"); - -enum class BackendType : uint32_t { - Undefined = WGPUBackendType_Undefined, - Null = WGPUBackendType_Null, - WebGPU = WGPUBackendType_WebGPU, - D3D11 = WGPUBackendType_D3D11, - D3D12 = WGPUBackendType_D3D12, - Metal = WGPUBackendType_Metal, - Vulkan = WGPUBackendType_Vulkan, - OpenGL = WGPUBackendType_OpenGL, - OpenGLES = WGPUBackendType_OpenGLES, -}; -static_assert(sizeof(BackendType) == sizeof(WGPUBackendType), "sizeof mismatch for BackendType"); -static_assert(alignof(BackendType) == alignof(WGPUBackendType), "alignof mismatch for BackendType"); - -enum class BlendFactor : uint32_t { - Undefined = WGPUBlendFactor_Undefined, - Zero = WGPUBlendFactor_Zero, - One = WGPUBlendFactor_One, - Src = WGPUBlendFactor_Src, - OneMinusSrc = WGPUBlendFactor_OneMinusSrc, - SrcAlpha = WGPUBlendFactor_SrcAlpha, - OneMinusSrcAlpha = WGPUBlendFactor_OneMinusSrcAlpha, - Dst = WGPUBlendFactor_Dst, - OneMinusDst = WGPUBlendFactor_OneMinusDst, - DstAlpha = WGPUBlendFactor_DstAlpha, - OneMinusDstAlpha = WGPUBlendFactor_OneMinusDstAlpha, - SrcAlphaSaturated = WGPUBlendFactor_SrcAlphaSaturated, - Constant = WGPUBlendFactor_Constant, - OneMinusConstant = WGPUBlendFactor_OneMinusConstant, - Src1 = WGPUBlendFactor_Src1, - OneMinusSrc1 = WGPUBlendFactor_OneMinusSrc1, - Src1Alpha = WGPUBlendFactor_Src1Alpha, - OneMinusSrc1Alpha = WGPUBlendFactor_OneMinusSrc1Alpha, -}; -static_assert(sizeof(BlendFactor) == sizeof(WGPUBlendFactor), "sizeof mismatch for BlendFactor"); -static_assert(alignof(BlendFactor) == alignof(WGPUBlendFactor), "alignof mismatch for BlendFactor"); - -enum class BlendOperation : uint32_t { - Undefined = WGPUBlendOperation_Undefined, - Add = WGPUBlendOperation_Add, - Subtract = WGPUBlendOperation_Subtract, - ReverseSubtract = WGPUBlendOperation_ReverseSubtract, - Min = WGPUBlendOperation_Min, - Max = WGPUBlendOperation_Max, -}; -static_assert(sizeof(BlendOperation) == sizeof(WGPUBlendOperation), "sizeof mismatch for BlendOperation"); -static_assert(alignof(BlendOperation) == alignof(WGPUBlendOperation), "alignof mismatch for BlendOperation"); - -enum class BufferBindingType : uint32_t { - BindingNotUsed = WGPUBufferBindingType_BindingNotUsed, - Undefined = WGPUBufferBindingType_Undefined, - Uniform = WGPUBufferBindingType_Uniform, - Storage = WGPUBufferBindingType_Storage, - ReadOnlyStorage = WGPUBufferBindingType_ReadOnlyStorage, -}; -static_assert(sizeof(BufferBindingType) == sizeof(WGPUBufferBindingType), "sizeof mismatch for BufferBindingType"); -static_assert(alignof(BufferBindingType) == alignof(WGPUBufferBindingType), "alignof mismatch for BufferBindingType"); - -enum class BufferMapState : uint32_t { - Unmapped = WGPUBufferMapState_Unmapped, - Pending = WGPUBufferMapState_Pending, - Mapped = WGPUBufferMapState_Mapped, -}; -static_assert(sizeof(BufferMapState) == sizeof(WGPUBufferMapState), "sizeof mismatch for BufferMapState"); -static_assert(alignof(BufferMapState) == alignof(WGPUBufferMapState), "alignof mismatch for BufferMapState"); - -enum class CallbackMode : uint32_t { - WaitAnyOnly = WGPUCallbackMode_WaitAnyOnly, - AllowProcessEvents = WGPUCallbackMode_AllowProcessEvents, - AllowSpontaneous = WGPUCallbackMode_AllowSpontaneous, -}; -static_assert(sizeof(CallbackMode) == sizeof(WGPUCallbackMode), "sizeof mismatch for CallbackMode"); -static_assert(alignof(CallbackMode) == alignof(WGPUCallbackMode), "alignof mismatch for CallbackMode"); - -enum class ColorSpacePrimariesDawn : uint32_t { - SRGB = WGPUColorSpacePrimariesDawn_SRGB, - Rec709 = WGPUColorSpacePrimariesDawn_Rec709, - Rec601 = WGPUColorSpacePrimariesDawn_Rec601, - Rec2020 = WGPUColorSpacePrimariesDawn_Rec2020, - DisplayP3 = WGPUColorSpacePrimariesDawn_DisplayP3, -}; -static_assert(sizeof(ColorSpacePrimariesDawn) == sizeof(WGPUColorSpacePrimariesDawn), "sizeof mismatch for ColorSpacePrimariesDawn"); -static_assert(alignof(ColorSpacePrimariesDawn) == alignof(WGPUColorSpacePrimariesDawn), "alignof mismatch for ColorSpacePrimariesDawn"); - -enum class ColorSpaceTransferDawn : uint32_t { - Identity = WGPUColorSpaceTransferDawn_Identity, - SRGB = WGPUColorSpaceTransferDawn_SRGB, - DisplayP3 = WGPUColorSpaceTransferDawn_DisplayP3, - SMPTE_170M = WGPUColorSpaceTransferDawn_SMPTE_170M, - HLG = WGPUColorSpaceTransferDawn_HLG, - PQ = WGPUColorSpaceTransferDawn_PQ, -}; -static_assert(sizeof(ColorSpaceTransferDawn) == sizeof(WGPUColorSpaceTransferDawn), "sizeof mismatch for ColorSpaceTransferDawn"); -static_assert(alignof(ColorSpaceTransferDawn) == alignof(WGPUColorSpaceTransferDawn), "alignof mismatch for ColorSpaceTransferDawn"); - -enum class ColorSpaceYCbCrMatrixDawn : uint32_t { - Identity = WGPUColorSpaceYCbCrMatrixDawn_Identity, - Rec601 = WGPUColorSpaceYCbCrMatrixDawn_Rec601, - Rec709 = WGPUColorSpaceYCbCrMatrixDawn_Rec709, - Rec2020 = WGPUColorSpaceYCbCrMatrixDawn_Rec2020, -}; -static_assert(sizeof(ColorSpaceYCbCrMatrixDawn) == sizeof(WGPUColorSpaceYCbCrMatrixDawn), "sizeof mismatch for ColorSpaceYCbCrMatrixDawn"); -static_assert(alignof(ColorSpaceYCbCrMatrixDawn) == alignof(WGPUColorSpaceYCbCrMatrixDawn), "alignof mismatch for ColorSpaceYCbCrMatrixDawn"); - -enum class ColorSpaceYCbCrRangeDawn : uint32_t { - Identity = WGPUColorSpaceYCbCrRangeDawn_Identity, - Narrow = WGPUColorSpaceYCbCrRangeDawn_Narrow, - Full = WGPUColorSpaceYCbCrRangeDawn_Full, -}; -static_assert(sizeof(ColorSpaceYCbCrRangeDawn) == sizeof(WGPUColorSpaceYCbCrRangeDawn), "sizeof mismatch for ColorSpaceYCbCrRangeDawn"); -static_assert(alignof(ColorSpaceYCbCrRangeDawn) == alignof(WGPUColorSpaceYCbCrRangeDawn), "alignof mismatch for ColorSpaceYCbCrRangeDawn"); - -enum class CompareFunction : uint32_t { - Undefined = WGPUCompareFunction_Undefined, - Never = WGPUCompareFunction_Never, - Less = WGPUCompareFunction_Less, - Equal = WGPUCompareFunction_Equal, - LessEqual = WGPUCompareFunction_LessEqual, - Greater = WGPUCompareFunction_Greater, - NotEqual = WGPUCompareFunction_NotEqual, - GreaterEqual = WGPUCompareFunction_GreaterEqual, - Always = WGPUCompareFunction_Always, -}; -static_assert(sizeof(CompareFunction) == sizeof(WGPUCompareFunction), "sizeof mismatch for CompareFunction"); -static_assert(alignof(CompareFunction) == alignof(WGPUCompareFunction), "alignof mismatch for CompareFunction"); - -enum class CompilationInfoRequestStatus : uint32_t { - Success = WGPUCompilationInfoRequestStatus_Success, - CallbackCancelled = WGPUCompilationInfoRequestStatus_CallbackCancelled, -}; -static_assert(sizeof(CompilationInfoRequestStatus) == sizeof(WGPUCompilationInfoRequestStatus), "sizeof mismatch for CompilationInfoRequestStatus"); -static_assert(alignof(CompilationInfoRequestStatus) == alignof(WGPUCompilationInfoRequestStatus), "alignof mismatch for CompilationInfoRequestStatus"); - -enum class CompilationMessageType : uint32_t { - Error = WGPUCompilationMessageType_Error, - Warning = WGPUCompilationMessageType_Warning, - Info = WGPUCompilationMessageType_Info, -}; -static_assert(sizeof(CompilationMessageType) == sizeof(WGPUCompilationMessageType), "sizeof mismatch for CompilationMessageType"); -static_assert(alignof(CompilationMessageType) == alignof(WGPUCompilationMessageType), "alignof mismatch for CompilationMessageType"); - -enum class ComponentSwizzle : uint32_t { - Undefined = WGPUComponentSwizzle_Undefined, - Zero = WGPUComponentSwizzle_Zero, - One = WGPUComponentSwizzle_One, - R = WGPUComponentSwizzle_R, - G = WGPUComponentSwizzle_G, - B = WGPUComponentSwizzle_B, - A = WGPUComponentSwizzle_A, -}; -static_assert(sizeof(ComponentSwizzle) == sizeof(WGPUComponentSwizzle), "sizeof mismatch for ComponentSwizzle"); -static_assert(alignof(ComponentSwizzle) == alignof(WGPUComponentSwizzle), "alignof mismatch for ComponentSwizzle"); - -enum class CompositeAlphaMode : uint32_t { - Auto = WGPUCompositeAlphaMode_Auto, - Opaque = WGPUCompositeAlphaMode_Opaque, - Premultiplied = WGPUCompositeAlphaMode_Premultiplied, - Unpremultiplied = WGPUCompositeAlphaMode_Unpremultiplied, - Inherit = WGPUCompositeAlphaMode_Inherit, -}; -static_assert(sizeof(CompositeAlphaMode) == sizeof(WGPUCompositeAlphaMode), "sizeof mismatch for CompositeAlphaMode"); -static_assert(alignof(CompositeAlphaMode) == alignof(WGPUCompositeAlphaMode), "alignof mismatch for CompositeAlphaMode"); - -enum class CreatePipelineAsyncStatus : uint32_t { - Success = WGPUCreatePipelineAsyncStatus_Success, - CallbackCancelled = WGPUCreatePipelineAsyncStatus_CallbackCancelled, - ValidationError = WGPUCreatePipelineAsyncStatus_ValidationError, - InternalError = WGPUCreatePipelineAsyncStatus_InternalError, -}; -static_assert(sizeof(CreatePipelineAsyncStatus) == sizeof(WGPUCreatePipelineAsyncStatus), "sizeof mismatch for CreatePipelineAsyncStatus"); -static_assert(alignof(CreatePipelineAsyncStatus) == alignof(WGPUCreatePipelineAsyncStatus), "alignof mismatch for CreatePipelineAsyncStatus"); - -enum class CullMode : uint32_t { - Undefined = WGPUCullMode_Undefined, - None = WGPUCullMode_None, - Front = WGPUCullMode_Front, - Back = WGPUCullMode_Back, -}; -static_assert(sizeof(CullMode) == sizeof(WGPUCullMode), "sizeof mismatch for CullMode"); -static_assert(alignof(CullMode) == alignof(WGPUCullMode), "alignof mismatch for CullMode"); - -enum class DeviceLostReason : uint32_t { - Unknown = WGPUDeviceLostReason_Unknown, - Destroyed = WGPUDeviceLostReason_Destroyed, - CallbackCancelled = WGPUDeviceLostReason_CallbackCancelled, - FailedCreation = WGPUDeviceLostReason_FailedCreation, -}; -static_assert(sizeof(DeviceLostReason) == sizeof(WGPUDeviceLostReason), "sizeof mismatch for DeviceLostReason"); -static_assert(alignof(DeviceLostReason) == alignof(WGPUDeviceLostReason), "alignof mismatch for DeviceLostReason"); - -enum class ErrorFilter : uint32_t { - Validation = WGPUErrorFilter_Validation, - OutOfMemory = WGPUErrorFilter_OutOfMemory, - Internal = WGPUErrorFilter_Internal, -}; -static_assert(sizeof(ErrorFilter) == sizeof(WGPUErrorFilter), "sizeof mismatch for ErrorFilter"); -static_assert(alignof(ErrorFilter) == alignof(WGPUErrorFilter), "alignof mismatch for ErrorFilter"); - -enum class ErrorType : uint32_t { - NoError = WGPUErrorType_NoError, - Validation = WGPUErrorType_Validation, - OutOfMemory = WGPUErrorType_OutOfMemory, - Internal = WGPUErrorType_Internal, - Unknown = WGPUErrorType_Unknown, -}; -static_assert(sizeof(ErrorType) == sizeof(WGPUErrorType), "sizeof mismatch for ErrorType"); -static_assert(alignof(ErrorType) == alignof(WGPUErrorType), "alignof mismatch for ErrorType"); - -enum class ExternalTextureRotation : uint32_t { - Rotate0Degrees = WGPUExternalTextureRotation_Rotate0Degrees, - Rotate90Degrees = WGPUExternalTextureRotation_Rotate90Degrees, - Rotate180Degrees = WGPUExternalTextureRotation_Rotate180Degrees, - Rotate270Degrees = WGPUExternalTextureRotation_Rotate270Degrees, -}; -static_assert(sizeof(ExternalTextureRotation) == sizeof(WGPUExternalTextureRotation), "sizeof mismatch for ExternalTextureRotation"); -static_assert(alignof(ExternalTextureRotation) == alignof(WGPUExternalTextureRotation), "alignof mismatch for ExternalTextureRotation"); - -enum class FeatureLevel : uint32_t { - Undefined = WGPUFeatureLevel_Undefined, - Compatibility = WGPUFeatureLevel_Compatibility, - Core = WGPUFeatureLevel_Core, -}; -static_assert(sizeof(FeatureLevel) == sizeof(WGPUFeatureLevel), "sizeof mismatch for FeatureLevel"); -static_assert(alignof(FeatureLevel) == alignof(WGPUFeatureLevel), "alignof mismatch for FeatureLevel"); - -enum class FeatureName : uint32_t { - CoreFeaturesAndLimits = WGPUFeatureName_CoreFeaturesAndLimits, - DepthClipControl = WGPUFeatureName_DepthClipControl, - Depth32FloatStencil8 = WGPUFeatureName_Depth32FloatStencil8, - TextureCompressionBC = WGPUFeatureName_TextureCompressionBC, - TextureCompressionBCSliced3D = WGPUFeatureName_TextureCompressionBCSliced3D, - TextureCompressionETC2 = WGPUFeatureName_TextureCompressionETC2, - TextureCompressionASTC = WGPUFeatureName_TextureCompressionASTC, - TextureCompressionASTCSliced3D = WGPUFeatureName_TextureCompressionASTCSliced3D, - TimestampQuery = WGPUFeatureName_TimestampQuery, - IndirectFirstInstance = WGPUFeatureName_IndirectFirstInstance, - ShaderF16 = WGPUFeatureName_ShaderF16, - RG11B10UfloatRenderable = WGPUFeatureName_RG11B10UfloatRenderable, - BGRA8UnormStorage = WGPUFeatureName_BGRA8UnormStorage, - Float32Filterable = WGPUFeatureName_Float32Filterable, - Float32Blendable = WGPUFeatureName_Float32Blendable, - ClipDistances = WGPUFeatureName_ClipDistances, - DualSourceBlending = WGPUFeatureName_DualSourceBlending, - Subgroups = WGPUFeatureName_Subgroups, - TextureFormatsTier1 = WGPUFeatureName_TextureFormatsTier1, - TextureFormatsTier2 = WGPUFeatureName_TextureFormatsTier2, - PrimitiveIndex = WGPUFeatureName_PrimitiveIndex, - TextureComponentSwizzle = WGPUFeatureName_TextureComponentSwizzle, - DawnInternalUsages = WGPUFeatureName_DawnInternalUsages, - DawnMultiPlanarFormats = WGPUFeatureName_DawnMultiPlanarFormats, - DawnNative = WGPUFeatureName_DawnNative, - ChromiumExperimentalTimestampQueryInsidePasses = WGPUFeatureName_ChromiumExperimentalTimestampQueryInsidePasses, - ImplicitDeviceSynchronization = WGPUFeatureName_ImplicitDeviceSynchronization, - TransientAttachments = WGPUFeatureName_TransientAttachments, - MSAARenderToSingleSampled = WGPUFeatureName_MSAARenderToSingleSampled, - D3D11MultithreadProtected = WGPUFeatureName_D3D11MultithreadProtected, - ANGLETextureSharing = WGPUFeatureName_ANGLETextureSharing, - PixelLocalStorageCoherent = WGPUFeatureName_PixelLocalStorageCoherent, - PixelLocalStorageNonCoherent = WGPUFeatureName_PixelLocalStorageNonCoherent, - Unorm16TextureFormats = WGPUFeatureName_Unorm16TextureFormats, - MultiPlanarFormatExtendedUsages = WGPUFeatureName_MultiPlanarFormatExtendedUsages, - MultiPlanarFormatP010 = WGPUFeatureName_MultiPlanarFormatP010, - HostMappedPointer = WGPUFeatureName_HostMappedPointer, - MultiPlanarRenderTargets = WGPUFeatureName_MultiPlanarRenderTargets, - MultiPlanarFormatNv12a = WGPUFeatureName_MultiPlanarFormatNv12a, - FramebufferFetch = WGPUFeatureName_FramebufferFetch, - BufferMapExtendedUsages = WGPUFeatureName_BufferMapExtendedUsages, - AdapterPropertiesMemoryHeaps = WGPUFeatureName_AdapterPropertiesMemoryHeaps, - AdapterPropertiesD3D = WGPUFeatureName_AdapterPropertiesD3D, - AdapterPropertiesVk = WGPUFeatureName_AdapterPropertiesVk, - DawnFormatCapabilities = WGPUFeatureName_DawnFormatCapabilities, - DawnDrmFormatCapabilities = WGPUFeatureName_DawnDrmFormatCapabilities, - MultiPlanarFormatNv16 = WGPUFeatureName_MultiPlanarFormatNv16, - MultiPlanarFormatNv24 = WGPUFeatureName_MultiPlanarFormatNv24, - MultiPlanarFormatP210 = WGPUFeatureName_MultiPlanarFormatP210, - MultiPlanarFormatP410 = WGPUFeatureName_MultiPlanarFormatP410, - SharedTextureMemoryVkDedicatedAllocation = WGPUFeatureName_SharedTextureMemoryVkDedicatedAllocation, - SharedTextureMemoryAHardwareBuffer = WGPUFeatureName_SharedTextureMemoryAHardwareBuffer, - SharedTextureMemoryDmaBuf = WGPUFeatureName_SharedTextureMemoryDmaBuf, - SharedTextureMemoryOpaqueFD = WGPUFeatureName_SharedTextureMemoryOpaqueFD, - SharedTextureMemoryZirconHandle = WGPUFeatureName_SharedTextureMemoryZirconHandle, - SharedTextureMemoryDXGISharedHandle = WGPUFeatureName_SharedTextureMemoryDXGISharedHandle, - SharedTextureMemoryD3D11Texture2D = WGPUFeatureName_SharedTextureMemoryD3D11Texture2D, - SharedTextureMemoryIOSurface = WGPUFeatureName_SharedTextureMemoryIOSurface, - SharedTextureMemoryEGLImage = WGPUFeatureName_SharedTextureMemoryEGLImage, - SharedFenceVkSemaphoreOpaqueFD = WGPUFeatureName_SharedFenceVkSemaphoreOpaqueFD, - SharedFenceSyncFD = WGPUFeatureName_SharedFenceSyncFD, - SharedFenceVkSemaphoreZirconHandle = WGPUFeatureName_SharedFenceVkSemaphoreZirconHandle, - SharedFenceDXGISharedHandle = WGPUFeatureName_SharedFenceDXGISharedHandle, - SharedFenceMTLSharedEvent = WGPUFeatureName_SharedFenceMTLSharedEvent, - SharedBufferMemoryD3D12Resource = WGPUFeatureName_SharedBufferMemoryD3D12Resource, - StaticSamplers = WGPUFeatureName_StaticSamplers, - YCbCrVulkanSamplers = WGPUFeatureName_YCbCrVulkanSamplers, - ShaderModuleCompilationOptions = WGPUFeatureName_ShaderModuleCompilationOptions, - DawnLoadResolveTexture = WGPUFeatureName_DawnLoadResolveTexture, - DawnPartialLoadResolveTexture = WGPUFeatureName_DawnPartialLoadResolveTexture, - MultiDrawIndirect = WGPUFeatureName_MultiDrawIndirect, - DawnTexelCopyBufferRowAlignment = WGPUFeatureName_DawnTexelCopyBufferRowAlignment, - FlexibleTextureViews = WGPUFeatureName_FlexibleTextureViews, - ChromiumExperimentalSubgroupMatrix = WGPUFeatureName_ChromiumExperimentalSubgroupMatrix, - SharedFenceEGLSync = WGPUFeatureName_SharedFenceEGLSync, - DawnDeviceAllocatorControl = WGPUFeatureName_DawnDeviceAllocatorControl, - AdapterPropertiesWGPU = WGPUFeatureName_AdapterPropertiesWGPU, - SharedBufferMemoryD3D12SharedMemoryFileMappingHandle = WGPUFeatureName_SharedBufferMemoryD3D12SharedMemoryFileMappingHandle, - SharedTextureMemoryD3D12Resource = WGPUFeatureName_SharedTextureMemoryD3D12Resource, - ChromiumExperimentalSamplingResourceTable = WGPUFeatureName_ChromiumExperimentalSamplingResourceTable, - SubgroupSizeControl = WGPUFeatureName_SubgroupSizeControl, - AtomicVec2uMinMax = WGPUFeatureName_AtomicVec2uMinMax, - Unorm16FormatsForExternalTexture = WGPUFeatureName_Unorm16FormatsForExternalTexture, - OpaqueYCbCrAndroidForExternalTexture = WGPUFeatureName_OpaqueYCbCrAndroidForExternalTexture, - Unorm16Filterable = WGPUFeatureName_Unorm16Filterable, - RenderPassRenderArea = WGPUFeatureName_RenderPassRenderArea, - AdapterPropertiesDrm = WGPUFeatureName_AdapterPropertiesDrm, -}; -static_assert(sizeof(FeatureName) == sizeof(WGPUFeatureName), "sizeof mismatch for FeatureName"); -static_assert(alignof(FeatureName) == alignof(WGPUFeatureName), "alignof mismatch for FeatureName"); - -enum class FilterMode : uint32_t { - Undefined = WGPUFilterMode_Undefined, - Nearest = WGPUFilterMode_Nearest, - Linear = WGPUFilterMode_Linear, -}; -static_assert(sizeof(FilterMode) == sizeof(WGPUFilterMode), "sizeof mismatch for FilterMode"); -static_assert(alignof(FilterMode) == alignof(WGPUFilterMode), "alignof mismatch for FilterMode"); - -enum class FrontFace : uint32_t { - Undefined = WGPUFrontFace_Undefined, - CCW = WGPUFrontFace_CCW, - CW = WGPUFrontFace_CW, -}; -static_assert(sizeof(FrontFace) == sizeof(WGPUFrontFace), "sizeof mismatch for FrontFace"); -static_assert(alignof(FrontFace) == alignof(WGPUFrontFace), "alignof mismatch for FrontFace"); - -enum class IndexFormat : uint32_t { - Undefined = WGPUIndexFormat_Undefined, - Uint16 = WGPUIndexFormat_Uint16, - Uint32 = WGPUIndexFormat_Uint32, -}; -static_assert(sizeof(IndexFormat) == sizeof(WGPUIndexFormat), "sizeof mismatch for IndexFormat"); -static_assert(alignof(IndexFormat) == alignof(WGPUIndexFormat), "alignof mismatch for IndexFormat"); - -enum class InstanceFeatureName : uint32_t { - TimedWaitAny = WGPUInstanceFeatureName_TimedWaitAny, - ShaderSourceSPIRV = WGPUInstanceFeatureName_ShaderSourceSPIRV, - MultipleDevicesPerAdapter = WGPUInstanceFeatureName_MultipleDevicesPerAdapter, -}; -static_assert(sizeof(InstanceFeatureName) == sizeof(WGPUInstanceFeatureName), "sizeof mismatch for InstanceFeatureName"); -static_assert(alignof(InstanceFeatureName) == alignof(WGPUInstanceFeatureName), "alignof mismatch for InstanceFeatureName"); - -enum class LoadOp : uint32_t { - Undefined = WGPULoadOp_Undefined, - Load = WGPULoadOp_Load, - Clear = WGPULoadOp_Clear, - ExpandResolveTexture = WGPULoadOp_ExpandResolveTexture, -}; -static_assert(sizeof(LoadOp) == sizeof(WGPULoadOp), "sizeof mismatch for LoadOp"); -static_assert(alignof(LoadOp) == alignof(WGPULoadOp), "alignof mismatch for LoadOp"); - -enum class LoggingType : uint32_t { - Verbose = WGPULoggingType_Verbose, - Info = WGPULoggingType_Info, - Warning = WGPULoggingType_Warning, - Error = WGPULoggingType_Error, -}; -static_assert(sizeof(LoggingType) == sizeof(WGPULoggingType), "sizeof mismatch for LoggingType"); -static_assert(alignof(LoggingType) == alignof(WGPULoggingType), "alignof mismatch for LoggingType"); - -enum class MapAsyncStatus : uint32_t { - Success = WGPUMapAsyncStatus_Success, - CallbackCancelled = WGPUMapAsyncStatus_CallbackCancelled, - Error = WGPUMapAsyncStatus_Error, - Aborted = WGPUMapAsyncStatus_Aborted, -}; -static_assert(sizeof(MapAsyncStatus) == sizeof(WGPUMapAsyncStatus), "sizeof mismatch for MapAsyncStatus"); -static_assert(alignof(MapAsyncStatus) == alignof(WGPUMapAsyncStatus), "alignof mismatch for MapAsyncStatus"); - -enum class MipmapFilterMode : uint32_t { - Undefined = WGPUMipmapFilterMode_Undefined, - Nearest = WGPUMipmapFilterMode_Nearest, - Linear = WGPUMipmapFilterMode_Linear, -}; -static_assert(sizeof(MipmapFilterMode) == sizeof(WGPUMipmapFilterMode), "sizeof mismatch for MipmapFilterMode"); -static_assert(alignof(MipmapFilterMode) == alignof(WGPUMipmapFilterMode), "alignof mismatch for MipmapFilterMode"); - -enum class PopErrorScopeStatus : uint32_t { - Success = WGPUPopErrorScopeStatus_Success, - CallbackCancelled = WGPUPopErrorScopeStatus_CallbackCancelled, - Error = WGPUPopErrorScopeStatus_Error, -}; -static_assert(sizeof(PopErrorScopeStatus) == sizeof(WGPUPopErrorScopeStatus), "sizeof mismatch for PopErrorScopeStatus"); -static_assert(alignof(PopErrorScopeStatus) == alignof(WGPUPopErrorScopeStatus), "alignof mismatch for PopErrorScopeStatus"); - -enum class PowerPreference : uint32_t { - Undefined = WGPUPowerPreference_Undefined, - LowPower = WGPUPowerPreference_LowPower, - HighPerformance = WGPUPowerPreference_HighPerformance, -}; -static_assert(sizeof(PowerPreference) == sizeof(WGPUPowerPreference), "sizeof mismatch for PowerPreference"); -static_assert(alignof(PowerPreference) == alignof(WGPUPowerPreference), "alignof mismatch for PowerPreference"); - -enum class PredefinedColorSpace : uint32_t { - SRGB = WGPUPredefinedColorSpace_SRGB, - DisplayP3 = WGPUPredefinedColorSpace_DisplayP3, - SRGBLinear = WGPUPredefinedColorSpace_SRGBLinear, - DisplayP3Linear = WGPUPredefinedColorSpace_DisplayP3Linear, -}; -static_assert(sizeof(PredefinedColorSpace) == sizeof(WGPUPredefinedColorSpace), "sizeof mismatch for PredefinedColorSpace"); -static_assert(alignof(PredefinedColorSpace) == alignof(WGPUPredefinedColorSpace), "alignof mismatch for PredefinedColorSpace"); - -enum class PresentMode : uint32_t { - Undefined = WGPUPresentMode_Undefined, - Fifo = WGPUPresentMode_Fifo, - FifoRelaxed = WGPUPresentMode_FifoRelaxed, - Immediate = WGPUPresentMode_Immediate, - Mailbox = WGPUPresentMode_Mailbox, -}; -static_assert(sizeof(PresentMode) == sizeof(WGPUPresentMode), "sizeof mismatch for PresentMode"); -static_assert(alignof(PresentMode) == alignof(WGPUPresentMode), "alignof mismatch for PresentMode"); - -enum class PrimitiveTopology : uint32_t { - Undefined = WGPUPrimitiveTopology_Undefined, - PointList = WGPUPrimitiveTopology_PointList, - LineList = WGPUPrimitiveTopology_LineList, - LineStrip = WGPUPrimitiveTopology_LineStrip, - TriangleList = WGPUPrimitiveTopology_TriangleList, - TriangleStrip = WGPUPrimitiveTopology_TriangleStrip, -}; -static_assert(sizeof(PrimitiveTopology) == sizeof(WGPUPrimitiveTopology), "sizeof mismatch for PrimitiveTopology"); -static_assert(alignof(PrimitiveTopology) == alignof(WGPUPrimitiveTopology), "alignof mismatch for PrimitiveTopology"); - -enum class QueryType : uint32_t { - Occlusion = WGPUQueryType_Occlusion, - Timestamp = WGPUQueryType_Timestamp, -}; -static_assert(sizeof(QueryType) == sizeof(WGPUQueryType), "sizeof mismatch for QueryType"); -static_assert(alignof(QueryType) == alignof(WGPUQueryType), "alignof mismatch for QueryType"); - -enum class QueueWorkDoneStatus : uint32_t { - Success = WGPUQueueWorkDoneStatus_Success, - CallbackCancelled = WGPUQueueWorkDoneStatus_CallbackCancelled, - Error = WGPUQueueWorkDoneStatus_Error, -}; -static_assert(sizeof(QueueWorkDoneStatus) == sizeof(WGPUQueueWorkDoneStatus), "sizeof mismatch for QueueWorkDoneStatus"); -static_assert(alignof(QueueWorkDoneStatus) == alignof(WGPUQueueWorkDoneStatus), "alignof mismatch for QueueWorkDoneStatus"); - -enum class RequestAdapterStatus : uint32_t { - Success = WGPURequestAdapterStatus_Success, - CallbackCancelled = WGPURequestAdapterStatus_CallbackCancelled, - Unavailable = WGPURequestAdapterStatus_Unavailable, - Error = WGPURequestAdapterStatus_Error, -}; -static_assert(sizeof(RequestAdapterStatus) == sizeof(WGPURequestAdapterStatus), "sizeof mismatch for RequestAdapterStatus"); -static_assert(alignof(RequestAdapterStatus) == alignof(WGPURequestAdapterStatus), "alignof mismatch for RequestAdapterStatus"); - -enum class RequestDeviceStatus : uint32_t { - Success = WGPURequestDeviceStatus_Success, - CallbackCancelled = WGPURequestDeviceStatus_CallbackCancelled, - Error = WGPURequestDeviceStatus_Error, -}; -static_assert(sizeof(RequestDeviceStatus) == sizeof(WGPURequestDeviceStatus), "sizeof mismatch for RequestDeviceStatus"); -static_assert(alignof(RequestDeviceStatus) == alignof(WGPURequestDeviceStatus), "alignof mismatch for RequestDeviceStatus"); - -enum class SamplerBindingType : uint32_t { - BindingNotUsed = WGPUSamplerBindingType_BindingNotUsed, - Undefined = WGPUSamplerBindingType_Undefined, - Filtering = WGPUSamplerBindingType_Filtering, - NonFiltering = WGPUSamplerBindingType_NonFiltering, - Comparison = WGPUSamplerBindingType_Comparison, -}; -static_assert(sizeof(SamplerBindingType) == sizeof(WGPUSamplerBindingType), "sizeof mismatch for SamplerBindingType"); -static_assert(alignof(SamplerBindingType) == alignof(WGPUSamplerBindingType), "alignof mismatch for SamplerBindingType"); - -enum class SharedFenceType : uint32_t { - VkSemaphoreOpaqueFD = WGPUSharedFenceType_VkSemaphoreOpaqueFD, - SyncFD = WGPUSharedFenceType_SyncFD, - VkSemaphoreZirconHandle = WGPUSharedFenceType_VkSemaphoreZirconHandle, - DXGISharedHandle = WGPUSharedFenceType_DXGISharedHandle, - MTLSharedEvent = WGPUSharedFenceType_MTLSharedEvent, - EGLSync = WGPUSharedFenceType_EGLSync, -}; -static_assert(sizeof(SharedFenceType) == sizeof(WGPUSharedFenceType), "sizeof mismatch for SharedFenceType"); -static_assert(alignof(SharedFenceType) == alignof(WGPUSharedFenceType), "alignof mismatch for SharedFenceType"); - -enum class Status : uint32_t { - Success = WGPUStatus_Success, - Error = WGPUStatus_Error, -}; -static_assert(sizeof(Status) == sizeof(WGPUStatus), "sizeof mismatch for Status"); -static_assert(alignof(Status) == alignof(WGPUStatus), "alignof mismatch for Status"); - -enum class StencilOperation : uint32_t { - Undefined = WGPUStencilOperation_Undefined, - Keep = WGPUStencilOperation_Keep, - Zero = WGPUStencilOperation_Zero, - Replace = WGPUStencilOperation_Replace, - Invert = WGPUStencilOperation_Invert, - IncrementClamp = WGPUStencilOperation_IncrementClamp, - DecrementClamp = WGPUStencilOperation_DecrementClamp, - IncrementWrap = WGPUStencilOperation_IncrementWrap, - DecrementWrap = WGPUStencilOperation_DecrementWrap, -}; -static_assert(sizeof(StencilOperation) == sizeof(WGPUStencilOperation), "sizeof mismatch for StencilOperation"); -static_assert(alignof(StencilOperation) == alignof(WGPUStencilOperation), "alignof mismatch for StencilOperation"); - -enum class StorageTextureAccess : uint32_t { - BindingNotUsed = WGPUStorageTextureAccess_BindingNotUsed, - Undefined = WGPUStorageTextureAccess_Undefined, - WriteOnly = WGPUStorageTextureAccess_WriteOnly, - ReadOnly = WGPUStorageTextureAccess_ReadOnly, - ReadWrite = WGPUStorageTextureAccess_ReadWrite, -}; -static_assert(sizeof(StorageTextureAccess) == sizeof(WGPUStorageTextureAccess), "sizeof mismatch for StorageTextureAccess"); -static_assert(alignof(StorageTextureAccess) == alignof(WGPUStorageTextureAccess), "alignof mismatch for StorageTextureAccess"); - -enum class StoreOp : uint32_t { - Undefined = WGPUStoreOp_Undefined, - Store = WGPUStoreOp_Store, - Discard = WGPUStoreOp_Discard, -}; -static_assert(sizeof(StoreOp) == sizeof(WGPUStoreOp), "sizeof mismatch for StoreOp"); -static_assert(alignof(StoreOp) == alignof(WGPUStoreOp), "alignof mismatch for StoreOp"); - -enum class SType : uint32_t { - ShaderSourceSPIRV = WGPUSType_ShaderSourceSPIRV, - ShaderSourceWGSL = WGPUSType_ShaderSourceWGSL, - RenderPassMaxDrawCount = WGPUSType_RenderPassMaxDrawCount, - SurfaceSourceMetalLayer = WGPUSType_SurfaceSourceMetalLayer, - SurfaceSourceWindowsHWND = WGPUSType_SurfaceSourceWindowsHWND, - SurfaceSourceXlibWindow = WGPUSType_SurfaceSourceXlibWindow, - SurfaceSourceWaylandSurface = WGPUSType_SurfaceSourceWaylandSurface, - SurfaceSourceAndroidNativeWindow = WGPUSType_SurfaceSourceAndroidNativeWindow, - SurfaceSourceXCBWindow = WGPUSType_SurfaceSourceXCBWindow, - SurfaceColorManagement = WGPUSType_SurfaceColorManagement, - RequestAdapterWebXROptions = WGPUSType_RequestAdapterWebXROptions, - TextureComponentSwizzleDescriptor = WGPUSType_TextureComponentSwizzleDescriptor, - ExternalTextureBindingLayout = WGPUSType_ExternalTextureBindingLayout, - ExternalTextureBindingEntry = WGPUSType_ExternalTextureBindingEntry, - CompatibilityModeLimits = WGPUSType_CompatibilityModeLimits, - TextureBindingViewDimension = WGPUSType_TextureBindingViewDimension, - EmscriptenSurfaceSourceCanvasHTMLSelector = WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector, - SurfaceDescriptorFromWindowsCoreWindow = WGPUSType_SurfaceDescriptorFromWindowsCoreWindow, - SurfaceDescriptorFromWindowsUWPSwapChainPanel = WGPUSType_SurfaceDescriptorFromWindowsUWPSwapChainPanel, - DawnTextureInternalUsageDescriptor = WGPUSType_DawnTextureInternalUsageDescriptor, - DawnEncoderInternalUsageDescriptor = WGPUSType_DawnEncoderInternalUsageDescriptor, - DawnInstanceDescriptor = WGPUSType_DawnInstanceDescriptor, - DawnCacheDeviceDescriptor = WGPUSType_DawnCacheDeviceDescriptor, - DawnAdapterPropertiesPowerPreference = WGPUSType_DawnAdapterPropertiesPowerPreference, - DawnBufferDescriptorErrorInfoFromWireClient = WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient, - DawnTogglesDescriptor = WGPUSType_DawnTogglesDescriptor, - DawnShaderModuleSPIRVOptionsDescriptor = WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor, - RequestAdapterOptionsLUID = WGPUSType_RequestAdapterOptionsLUID, - RequestAdapterOptionsGetGLProc = WGPUSType_RequestAdapterOptionsGetGLProc, - RequestAdapterOptionsD3D11Device = WGPUSType_RequestAdapterOptionsD3D11Device, - DawnRenderPassSampleCount = WGPUSType_DawnRenderPassSampleCount, - RenderPassPixelLocalStorage = WGPUSType_RenderPassPixelLocalStorage, - PipelineLayoutPixelLocalStorage = WGPUSType_PipelineLayoutPixelLocalStorage, - BufferHostMappedPointer = WGPUSType_BufferHostMappedPointer, - AdapterPropertiesMemoryHeaps = WGPUSType_AdapterPropertiesMemoryHeaps, - AdapterPropertiesD3D = WGPUSType_AdapterPropertiesD3D, - AdapterPropertiesVk = WGPUSType_AdapterPropertiesVk, - DawnWireWGSLControl = WGPUSType_DawnWireWGSLControl, - DawnWGSLBlocklist = WGPUSType_DawnWGSLBlocklist, - DawnDrmFormatCapabilities = WGPUSType_DawnDrmFormatCapabilities, - ShaderModuleCompilationOptions = WGPUSType_ShaderModuleCompilationOptions, - ColorTargetStateExpandResolveTextureDawn = WGPUSType_ColorTargetStateExpandResolveTextureDawn, - RenderPassRenderAreaRect = WGPUSType_RenderPassRenderAreaRect, - SharedTextureMemoryVkDedicatedAllocationDescriptor = WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor, - SharedTextureMemoryAHardwareBufferDescriptor = WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor, - SharedTextureMemoryDmaBufDescriptor = WGPUSType_SharedTextureMemoryDmaBufDescriptor, - SharedTextureMemoryOpaqueFDDescriptor = WGPUSType_SharedTextureMemoryOpaqueFDDescriptor, - SharedTextureMemoryZirconHandleDescriptor = WGPUSType_SharedTextureMemoryZirconHandleDescriptor, - SharedTextureMemoryDXGISharedHandleDescriptor = WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor, - SharedTextureMemoryD3D11Texture2DDescriptor = WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor, - SharedTextureMemoryIOSurfaceDescriptor = WGPUSType_SharedTextureMemoryIOSurfaceDescriptor, - SharedTextureMemoryEGLImageDescriptor = WGPUSType_SharedTextureMemoryEGLImageDescriptor, - SharedTextureMemoryInitializedBeginState = WGPUSType_SharedTextureMemoryInitializedBeginState, - SharedTextureMemoryInitializedEndState = WGPUSType_SharedTextureMemoryInitializedEndState, - SharedTextureMemoryVkImageLayoutBeginState = WGPUSType_SharedTextureMemoryVkImageLayoutBeginState, - SharedTextureMemoryVkImageLayoutEndState = WGPUSType_SharedTextureMemoryVkImageLayoutEndState, - SharedTextureMemoryD3DSwapchainBeginState = WGPUSType_SharedTextureMemoryD3DSwapchainBeginState, - SharedFenceVkSemaphoreOpaqueFDDescriptor = WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor, - SharedFenceVkSemaphoreOpaqueFDExportInfo = WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo, - SharedFenceSyncFDDescriptor = WGPUSType_SharedFenceSyncFDDescriptor, - SharedFenceSyncFDExportInfo = WGPUSType_SharedFenceSyncFDExportInfo, - SharedFenceVkSemaphoreZirconHandleDescriptor = WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor, - SharedFenceVkSemaphoreZirconHandleExportInfo = WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo, - SharedFenceDXGISharedHandleDescriptor = WGPUSType_SharedFenceDXGISharedHandleDescriptor, - SharedFenceDXGISharedHandleExportInfo = WGPUSType_SharedFenceDXGISharedHandleExportInfo, - SharedFenceMTLSharedEventDescriptor = WGPUSType_SharedFenceMTLSharedEventDescriptor, - SharedFenceMTLSharedEventExportInfo = WGPUSType_SharedFenceMTLSharedEventExportInfo, - SharedBufferMemoryD3D12ResourceDescriptor = WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor, - StaticSamplerBindingLayout = WGPUSType_StaticSamplerBindingLayout, - YCbCrVkDescriptor = WGPUSType_YCbCrVkDescriptor, - SharedTextureMemoryAHardwareBufferProperties = WGPUSType_SharedTextureMemoryAHardwareBufferProperties, - AHardwareBufferProperties = WGPUSType_AHardwareBufferProperties, - DawnTexelCopyBufferRowAlignmentLimits = WGPUSType_DawnTexelCopyBufferRowAlignmentLimits, - AdapterPropertiesSubgroupMatrixConfigs = WGPUSType_AdapterPropertiesSubgroupMatrixConfigs, - SharedFenceEGLSyncDescriptor = WGPUSType_SharedFenceEGLSyncDescriptor, - SharedFenceEGLSyncExportInfo = WGPUSType_SharedFenceEGLSyncExportInfo, - DawnInjectedInvalidSType = WGPUSType_DawnInjectedInvalidSType, - DawnCompilationMessageUtf16 = WGPUSType_DawnCompilationMessageUtf16, - DawnFakeBufferOOMForTesting = WGPUSType_DawnFakeBufferOOMForTesting, - SurfaceDescriptorFromWindowsWinUISwapChainPanel = WGPUSType_SurfaceDescriptorFromWindowsWinUISwapChainPanel, - DawnDeviceAllocatorControl = WGPUSType_DawnDeviceAllocatorControl, - DawnHostMappedPointerLimits = WGPUSType_DawnHostMappedPointerLimits, - RenderPassDescriptorResolveRect = WGPUSType_RenderPassDescriptorResolveRect, - RequestAdapterWebGPUBackendOptions = WGPUSType_RequestAdapterWebGPUBackendOptions, - DawnFakeDeviceInitializeErrorForTesting = WGPUSType_DawnFakeDeviceInitializeErrorForTesting, - SharedTextureMemoryD3D11BeginState = WGPUSType_SharedTextureMemoryD3D11BeginState, - DawnConsumeAdapterDescriptor = WGPUSType_DawnConsumeAdapterDescriptor, - TexelBufferBindingEntry = WGPUSType_TexelBufferBindingEntry, - TexelBufferBindingLayout = WGPUSType_TexelBufferBindingLayout, - SharedTextureMemoryMetalEndAccessState = WGPUSType_SharedTextureMemoryMetalEndAccessState, - AdapterPropertiesWGPU = WGPUSType_AdapterPropertiesWGPU, - SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor = WGPUSType_SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, - SharedTextureMemoryD3D12ResourceDescriptor = WGPUSType_SharedTextureMemoryD3D12ResourceDescriptor, - RequestAdapterOptionsAngleVirtualizationGroup = WGPUSType_RequestAdapterOptionsAngleVirtualizationGroup, - PipelineLayoutResourceTable = WGPUSType_PipelineLayoutResourceTable, - AdapterPropertiesDrm = WGPUSType_AdapterPropertiesDrm, -}; -static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType"); -static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType"); - -enum class SubgroupMatrixComponentType : uint32_t { - F32 = WGPUSubgroupMatrixComponentType_F32, - F16 = WGPUSubgroupMatrixComponentType_F16, - U32 = WGPUSubgroupMatrixComponentType_U32, - I32 = WGPUSubgroupMatrixComponentType_I32, - U8 = WGPUSubgroupMatrixComponentType_U8, - I8 = WGPUSubgroupMatrixComponentType_I8, -}; -static_assert(sizeof(SubgroupMatrixComponentType) == sizeof(WGPUSubgroupMatrixComponentType), "sizeof mismatch for SubgroupMatrixComponentType"); -static_assert(alignof(SubgroupMatrixComponentType) == alignof(WGPUSubgroupMatrixComponentType), "alignof mismatch for SubgroupMatrixComponentType"); - -enum class SurfaceGetCurrentTextureStatus : uint32_t { - SuccessOptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal, - SuccessSuboptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal, - Timeout = WGPUSurfaceGetCurrentTextureStatus_Timeout, - Outdated = WGPUSurfaceGetCurrentTextureStatus_Outdated, - Lost = WGPUSurfaceGetCurrentTextureStatus_Lost, - Error = WGPUSurfaceGetCurrentTextureStatus_Error, -}; -static_assert(sizeof(SurfaceGetCurrentTextureStatus) == sizeof(WGPUSurfaceGetCurrentTextureStatus), "sizeof mismatch for SurfaceGetCurrentTextureStatus"); -static_assert(alignof(SurfaceGetCurrentTextureStatus) == alignof(WGPUSurfaceGetCurrentTextureStatus), "alignof mismatch for SurfaceGetCurrentTextureStatus"); - -enum class TexelBufferAccess : uint32_t { - Undefined = WGPUTexelBufferAccess_Undefined, - ReadOnly = WGPUTexelBufferAccess_ReadOnly, - ReadWrite = WGPUTexelBufferAccess_ReadWrite, -}; -static_assert(sizeof(TexelBufferAccess) == sizeof(WGPUTexelBufferAccess), "sizeof mismatch for TexelBufferAccess"); -static_assert(alignof(TexelBufferAccess) == alignof(WGPUTexelBufferAccess), "alignof mismatch for TexelBufferAccess"); - -enum class TextureAspect : uint32_t { - Undefined = WGPUTextureAspect_Undefined, - All = WGPUTextureAspect_All, - StencilOnly = WGPUTextureAspect_StencilOnly, - DepthOnly = WGPUTextureAspect_DepthOnly, - Plane0Only = WGPUTextureAspect_Plane0Only, - Plane1Only = WGPUTextureAspect_Plane1Only, - Plane2Only = WGPUTextureAspect_Plane2Only, -}; -static_assert(sizeof(TextureAspect) == sizeof(WGPUTextureAspect), "sizeof mismatch for TextureAspect"); -static_assert(alignof(TextureAspect) == alignof(WGPUTextureAspect), "alignof mismatch for TextureAspect"); - -enum class TextureDimension : uint32_t { - Undefined = WGPUTextureDimension_Undefined, - e1D = WGPUTextureDimension_1D, - e2D = WGPUTextureDimension_2D, - e3D = WGPUTextureDimension_3D, -}; -static_assert(sizeof(TextureDimension) == sizeof(WGPUTextureDimension), "sizeof mismatch for TextureDimension"); -static_assert(alignof(TextureDimension) == alignof(WGPUTextureDimension), "alignof mismatch for TextureDimension"); - -enum class TextureFormat : uint32_t { - Undefined = WGPUTextureFormat_Undefined, - R8Unorm = WGPUTextureFormat_R8Unorm, - R8Snorm = WGPUTextureFormat_R8Snorm, - R8Uint = WGPUTextureFormat_R8Uint, - R8Sint = WGPUTextureFormat_R8Sint, - R16Unorm = WGPUTextureFormat_R16Unorm, - R16Snorm = WGPUTextureFormat_R16Snorm, - R16Uint = WGPUTextureFormat_R16Uint, - R16Sint = WGPUTextureFormat_R16Sint, - R16Float = WGPUTextureFormat_R16Float, - RG8Unorm = WGPUTextureFormat_RG8Unorm, - RG8Snorm = WGPUTextureFormat_RG8Snorm, - RG8Uint = WGPUTextureFormat_RG8Uint, - RG8Sint = WGPUTextureFormat_RG8Sint, - R32Float = WGPUTextureFormat_R32Float, - R32Uint = WGPUTextureFormat_R32Uint, - R32Sint = WGPUTextureFormat_R32Sint, - RG16Unorm = WGPUTextureFormat_RG16Unorm, - RG16Snorm = WGPUTextureFormat_RG16Snorm, - RG16Uint = WGPUTextureFormat_RG16Uint, - RG16Sint = WGPUTextureFormat_RG16Sint, - RG16Float = WGPUTextureFormat_RG16Float, - RGBA8Unorm = WGPUTextureFormat_RGBA8Unorm, - RGBA8UnormSrgb = WGPUTextureFormat_RGBA8UnormSrgb, - RGBA8Snorm = WGPUTextureFormat_RGBA8Snorm, - RGBA8Uint = WGPUTextureFormat_RGBA8Uint, - RGBA8Sint = WGPUTextureFormat_RGBA8Sint, - BGRA8Unorm = WGPUTextureFormat_BGRA8Unorm, - BGRA8UnormSrgb = WGPUTextureFormat_BGRA8UnormSrgb, - RGB10A2Uint = WGPUTextureFormat_RGB10A2Uint, - RGB10A2Unorm = WGPUTextureFormat_RGB10A2Unorm, - RG11B10Ufloat = WGPUTextureFormat_RG11B10Ufloat, - RGB9E5Ufloat = WGPUTextureFormat_RGB9E5Ufloat, - RG32Float = WGPUTextureFormat_RG32Float, - RG32Uint = WGPUTextureFormat_RG32Uint, - RG32Sint = WGPUTextureFormat_RG32Sint, - RGBA16Unorm = WGPUTextureFormat_RGBA16Unorm, - RGBA16Snorm = WGPUTextureFormat_RGBA16Snorm, - RGBA16Uint = WGPUTextureFormat_RGBA16Uint, - RGBA16Sint = WGPUTextureFormat_RGBA16Sint, - RGBA16Float = WGPUTextureFormat_RGBA16Float, - RGBA32Float = WGPUTextureFormat_RGBA32Float, - RGBA32Uint = WGPUTextureFormat_RGBA32Uint, - RGBA32Sint = WGPUTextureFormat_RGBA32Sint, - Stencil8 = WGPUTextureFormat_Stencil8, - Depth16Unorm = WGPUTextureFormat_Depth16Unorm, - Depth24Plus = WGPUTextureFormat_Depth24Plus, - Depth24PlusStencil8 = WGPUTextureFormat_Depth24PlusStencil8, - Depth32Float = WGPUTextureFormat_Depth32Float, - Depth32FloatStencil8 = WGPUTextureFormat_Depth32FloatStencil8, - BC1RGBAUnorm = WGPUTextureFormat_BC1RGBAUnorm, - BC1RGBAUnormSrgb = WGPUTextureFormat_BC1RGBAUnormSrgb, - BC2RGBAUnorm = WGPUTextureFormat_BC2RGBAUnorm, - BC2RGBAUnormSrgb = WGPUTextureFormat_BC2RGBAUnormSrgb, - BC3RGBAUnorm = WGPUTextureFormat_BC3RGBAUnorm, - BC3RGBAUnormSrgb = WGPUTextureFormat_BC3RGBAUnormSrgb, - BC4RUnorm = WGPUTextureFormat_BC4RUnorm, - BC4RSnorm = WGPUTextureFormat_BC4RSnorm, - BC5RGUnorm = WGPUTextureFormat_BC5RGUnorm, - BC5RGSnorm = WGPUTextureFormat_BC5RGSnorm, - BC6HRGBUfloat = WGPUTextureFormat_BC6HRGBUfloat, - BC6HRGBFloat = WGPUTextureFormat_BC6HRGBFloat, - BC7RGBAUnorm = WGPUTextureFormat_BC7RGBAUnorm, - BC7RGBAUnormSrgb = WGPUTextureFormat_BC7RGBAUnormSrgb, - ETC2RGB8Unorm = WGPUTextureFormat_ETC2RGB8Unorm, - ETC2RGB8UnormSrgb = WGPUTextureFormat_ETC2RGB8UnormSrgb, - ETC2RGB8A1Unorm = WGPUTextureFormat_ETC2RGB8A1Unorm, - ETC2RGB8A1UnormSrgb = WGPUTextureFormat_ETC2RGB8A1UnormSrgb, - ETC2RGBA8Unorm = WGPUTextureFormat_ETC2RGBA8Unorm, - ETC2RGBA8UnormSrgb = WGPUTextureFormat_ETC2RGBA8UnormSrgb, - EACR11Unorm = WGPUTextureFormat_EACR11Unorm, - EACR11Snorm = WGPUTextureFormat_EACR11Snorm, - EACRG11Unorm = WGPUTextureFormat_EACRG11Unorm, - EACRG11Snorm = WGPUTextureFormat_EACRG11Snorm, - ASTC4x4Unorm = WGPUTextureFormat_ASTC4x4Unorm, - ASTC4x4UnormSrgb = WGPUTextureFormat_ASTC4x4UnormSrgb, - ASTC5x4Unorm = WGPUTextureFormat_ASTC5x4Unorm, - ASTC5x4UnormSrgb = WGPUTextureFormat_ASTC5x4UnormSrgb, - ASTC5x5Unorm = WGPUTextureFormat_ASTC5x5Unorm, - ASTC5x5UnormSrgb = WGPUTextureFormat_ASTC5x5UnormSrgb, - ASTC6x5Unorm = WGPUTextureFormat_ASTC6x5Unorm, - ASTC6x5UnormSrgb = WGPUTextureFormat_ASTC6x5UnormSrgb, - ASTC6x6Unorm = WGPUTextureFormat_ASTC6x6Unorm, - ASTC6x6UnormSrgb = WGPUTextureFormat_ASTC6x6UnormSrgb, - ASTC8x5Unorm = WGPUTextureFormat_ASTC8x5Unorm, - ASTC8x5UnormSrgb = WGPUTextureFormat_ASTC8x5UnormSrgb, - ASTC8x6Unorm = WGPUTextureFormat_ASTC8x6Unorm, - ASTC8x6UnormSrgb = WGPUTextureFormat_ASTC8x6UnormSrgb, - ASTC8x8Unorm = WGPUTextureFormat_ASTC8x8Unorm, - ASTC8x8UnormSrgb = WGPUTextureFormat_ASTC8x8UnormSrgb, - ASTC10x5Unorm = WGPUTextureFormat_ASTC10x5Unorm, - ASTC10x5UnormSrgb = WGPUTextureFormat_ASTC10x5UnormSrgb, - ASTC10x6Unorm = WGPUTextureFormat_ASTC10x6Unorm, - ASTC10x6UnormSrgb = WGPUTextureFormat_ASTC10x6UnormSrgb, - ASTC10x8Unorm = WGPUTextureFormat_ASTC10x8Unorm, - ASTC10x8UnormSrgb = WGPUTextureFormat_ASTC10x8UnormSrgb, - ASTC10x10Unorm = WGPUTextureFormat_ASTC10x10Unorm, - ASTC10x10UnormSrgb = WGPUTextureFormat_ASTC10x10UnormSrgb, - ASTC12x10Unorm = WGPUTextureFormat_ASTC12x10Unorm, - ASTC12x10UnormSrgb = WGPUTextureFormat_ASTC12x10UnormSrgb, - ASTC12x12Unorm = WGPUTextureFormat_ASTC12x12Unorm, - ASTC12x12UnormSrgb = WGPUTextureFormat_ASTC12x12UnormSrgb, - R8BG8Biplanar420Unorm = WGPUTextureFormat_R8BG8Biplanar420Unorm, - R10X6BG10X6Biplanar420Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar420Unorm, - R8BG8A8Triplanar420Unorm = WGPUTextureFormat_R8BG8A8Triplanar420Unorm, - R8BG8Biplanar422Unorm = WGPUTextureFormat_R8BG8Biplanar422Unorm, - R8BG8Biplanar444Unorm = WGPUTextureFormat_R8BG8Biplanar444Unorm, - R10X6BG10X6Biplanar422Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar422Unorm, - R10X6BG10X6Biplanar444Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar444Unorm, - OpaqueYCbCrAndroid = WGPUTextureFormat_OpaqueYCbCrAndroid, -}; -static_assert(sizeof(TextureFormat) == sizeof(WGPUTextureFormat), "sizeof mismatch for TextureFormat"); -static_assert(alignof(TextureFormat) == alignof(WGPUTextureFormat), "alignof mismatch for TextureFormat"); - -enum class TextureSampleType : uint32_t { - BindingNotUsed = WGPUTextureSampleType_BindingNotUsed, - Undefined = WGPUTextureSampleType_Undefined, - Float = WGPUTextureSampleType_Float, - UnfilterableFloat = WGPUTextureSampleType_UnfilterableFloat, - Depth = WGPUTextureSampleType_Depth, - Sint = WGPUTextureSampleType_Sint, - Uint = WGPUTextureSampleType_Uint, -}; -static_assert(sizeof(TextureSampleType) == sizeof(WGPUTextureSampleType), "sizeof mismatch for TextureSampleType"); -static_assert(alignof(TextureSampleType) == alignof(WGPUTextureSampleType), "alignof mismatch for TextureSampleType"); - -enum class TextureViewDimension : uint32_t { - Undefined = WGPUTextureViewDimension_Undefined, - e1D = WGPUTextureViewDimension_1D, - e2D = WGPUTextureViewDimension_2D, - e2DArray = WGPUTextureViewDimension_2DArray, - Cube = WGPUTextureViewDimension_Cube, - CubeArray = WGPUTextureViewDimension_CubeArray, - e3D = WGPUTextureViewDimension_3D, -}; -static_assert(sizeof(TextureViewDimension) == sizeof(WGPUTextureViewDimension), "sizeof mismatch for TextureViewDimension"); -static_assert(alignof(TextureViewDimension) == alignof(WGPUTextureViewDimension), "alignof mismatch for TextureViewDimension"); - -enum class ToneMappingMode : uint32_t { - Standard = WGPUToneMappingMode_Standard, - Extended = WGPUToneMappingMode_Extended, -}; -static_assert(sizeof(ToneMappingMode) == sizeof(WGPUToneMappingMode), "sizeof mismatch for ToneMappingMode"); -static_assert(alignof(ToneMappingMode) == alignof(WGPUToneMappingMode), "alignof mismatch for ToneMappingMode"); - -enum class VertexFormat : uint32_t { - Uint8 = WGPUVertexFormat_Uint8, - Uint8x2 = WGPUVertexFormat_Uint8x2, - Uint8x4 = WGPUVertexFormat_Uint8x4, - Sint8 = WGPUVertexFormat_Sint8, - Sint8x2 = WGPUVertexFormat_Sint8x2, - Sint8x4 = WGPUVertexFormat_Sint8x4, - Unorm8 = WGPUVertexFormat_Unorm8, - Unorm8x2 = WGPUVertexFormat_Unorm8x2, - Unorm8x4 = WGPUVertexFormat_Unorm8x4, - Snorm8 = WGPUVertexFormat_Snorm8, - Snorm8x2 = WGPUVertexFormat_Snorm8x2, - Snorm8x4 = WGPUVertexFormat_Snorm8x4, - Uint16 = WGPUVertexFormat_Uint16, - Uint16x2 = WGPUVertexFormat_Uint16x2, - Uint16x4 = WGPUVertexFormat_Uint16x4, - Sint16 = WGPUVertexFormat_Sint16, - Sint16x2 = WGPUVertexFormat_Sint16x2, - Sint16x4 = WGPUVertexFormat_Sint16x4, - Unorm16 = WGPUVertexFormat_Unorm16, - Unorm16x2 = WGPUVertexFormat_Unorm16x2, - Unorm16x4 = WGPUVertexFormat_Unorm16x4, - Snorm16 = WGPUVertexFormat_Snorm16, - Snorm16x2 = WGPUVertexFormat_Snorm16x2, - Snorm16x4 = WGPUVertexFormat_Snorm16x4, - Float16 = WGPUVertexFormat_Float16, - Float16x2 = WGPUVertexFormat_Float16x2, - Float16x4 = WGPUVertexFormat_Float16x4, - Float32 = WGPUVertexFormat_Float32, - Float32x2 = WGPUVertexFormat_Float32x2, - Float32x3 = WGPUVertexFormat_Float32x3, - Float32x4 = WGPUVertexFormat_Float32x4, - Uint32 = WGPUVertexFormat_Uint32, - Uint32x2 = WGPUVertexFormat_Uint32x2, - Uint32x3 = WGPUVertexFormat_Uint32x3, - Uint32x4 = WGPUVertexFormat_Uint32x4, - Sint32 = WGPUVertexFormat_Sint32, - Sint32x2 = WGPUVertexFormat_Sint32x2, - Sint32x3 = WGPUVertexFormat_Sint32x3, - Sint32x4 = WGPUVertexFormat_Sint32x4, - Unorm10_10_10_2 = WGPUVertexFormat_Unorm10_10_10_2, - Unorm8x4BGRA = WGPUVertexFormat_Unorm8x4BGRA, -}; -static_assert(sizeof(VertexFormat) == sizeof(WGPUVertexFormat), "sizeof mismatch for VertexFormat"); -static_assert(alignof(VertexFormat) == alignof(WGPUVertexFormat), "alignof mismatch for VertexFormat"); - -enum class VertexStepMode : uint32_t { - Undefined = WGPUVertexStepMode_Undefined, - Vertex = WGPUVertexStepMode_Vertex, - Instance = WGPUVertexStepMode_Instance, -}; -static_assert(sizeof(VertexStepMode) == sizeof(WGPUVertexStepMode), "sizeof mismatch for VertexStepMode"); -static_assert(alignof(VertexStepMode) == alignof(WGPUVertexStepMode), "alignof mismatch for VertexStepMode"); - -enum class WaitStatus : uint32_t { - Success = WGPUWaitStatus_Success, - TimedOut = WGPUWaitStatus_TimedOut, - Error = WGPUWaitStatus_Error, -}; -static_assert(sizeof(WaitStatus) == sizeof(WGPUWaitStatus), "sizeof mismatch for WaitStatus"); -static_assert(alignof(WaitStatus) == alignof(WGPUWaitStatus), "alignof mismatch for WaitStatus"); - -enum class WGSLLanguageFeatureName : uint32_t { - ReadonlyAndReadwriteStorageTextures = WGPUWGSLLanguageFeatureName_ReadonlyAndReadwriteStorageTextures, - Packed4x8IntegerDotProduct = WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct, - UnrestrictedPointerParameters = WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters, - PointerCompositeAccess = WGPUWGSLLanguageFeatureName_PointerCompositeAccess, - UniformBufferStandardLayout = WGPUWGSLLanguageFeatureName_UniformBufferStandardLayout, - SubgroupId = WGPUWGSLLanguageFeatureName_SubgroupId, - TextureAndSamplerLet = WGPUWGSLLanguageFeatureName_TextureAndSamplerLet, - SubgroupUniformity = WGPUWGSLLanguageFeatureName_SubgroupUniformity, - TextureFormatsTier1 = WGPUWGSLLanguageFeatureName_TextureFormatsTier1, - LinearIndexing = WGPUWGSLLanguageFeatureName_LinearIndexing, - ImmediateAddressSpace = WGPUWGSLLanguageFeatureName_ImmediateAddressSpace, - ChromiumTestingUnimplemented = WGPUWGSLLanguageFeatureName_ChromiumTestingUnimplemented, - ChromiumTestingUnsafeExperimental = WGPUWGSLLanguageFeatureName_ChromiumTestingUnsafeExperimental, - ChromiumTestingExperimental = WGPUWGSLLanguageFeatureName_ChromiumTestingExperimental, - ChromiumTestingShippedWithKillswitch = WGPUWGSLLanguageFeatureName_ChromiumTestingShippedWithKillswitch, - ChromiumTestingShipped = WGPUWGSLLanguageFeatureName_ChromiumTestingShipped, - SizedBindingArray = WGPUWGSLLanguageFeatureName_SizedBindingArray, - TexelBuffers = WGPUWGSLLanguageFeatureName_TexelBuffers, - ChromiumPrint = WGPUWGSLLanguageFeatureName_ChromiumPrint, - FragmentDepth = WGPUWGSLLanguageFeatureName_FragmentDepth, - BufferView = WGPUWGSLLanguageFeatureName_BufferView, - SwizzleAssignment = WGPUWGSLLanguageFeatureName_SwizzleAssignment, -}; -static_assert(sizeof(WGSLLanguageFeatureName) == sizeof(WGPUWGSLLanguageFeatureName), "sizeof mismatch for WGSLLanguageFeatureName"); -static_assert(alignof(WGSLLanguageFeatureName) == alignof(WGPUWGSLLanguageFeatureName), "alignof mismatch for WGSLLanguageFeatureName"); - - -enum class BufferUsage : uint64_t { - None = WGPUBufferUsage_None, - MapRead = WGPUBufferUsage_MapRead, - MapWrite = WGPUBufferUsage_MapWrite, - CopySrc = WGPUBufferUsage_CopySrc, - CopyDst = WGPUBufferUsage_CopyDst, - Index = WGPUBufferUsage_Index, - Vertex = WGPUBufferUsage_Vertex, - Uniform = WGPUBufferUsage_Uniform, - Storage = WGPUBufferUsage_Storage, - Indirect = WGPUBufferUsage_Indirect, - QueryResolve = WGPUBufferUsage_QueryResolve, - TexelBuffer = WGPUBufferUsage_TexelBuffer, -}; -static_assert(sizeof(BufferUsage) == sizeof(WGPUBufferUsage), "sizeof mismatch for BufferUsage"); -static_assert(alignof(BufferUsage) == alignof(WGPUBufferUsage), "alignof mismatch for BufferUsage"); - -enum class ColorWriteMask : uint64_t { - None = WGPUColorWriteMask_None, - Red = WGPUColorWriteMask_Red, - Green = WGPUColorWriteMask_Green, - Blue = WGPUColorWriteMask_Blue, - Alpha = WGPUColorWriteMask_Alpha, - All = WGPUColorWriteMask_All, -}; -static_assert(sizeof(ColorWriteMask) == sizeof(WGPUColorWriteMask), "sizeof mismatch for ColorWriteMask"); -static_assert(alignof(ColorWriteMask) == alignof(WGPUColorWriteMask), "alignof mismatch for ColorWriteMask"); - -enum class HeapProperty : uint64_t { - None = WGPUHeapProperty_None, - DeviceLocal = WGPUHeapProperty_DeviceLocal, - HostVisible = WGPUHeapProperty_HostVisible, - HostCoherent = WGPUHeapProperty_HostCoherent, - HostUncached = WGPUHeapProperty_HostUncached, - HostCached = WGPUHeapProperty_HostCached, -}; -static_assert(sizeof(HeapProperty) == sizeof(WGPUHeapProperty), "sizeof mismatch for HeapProperty"); -static_assert(alignof(HeapProperty) == alignof(WGPUHeapProperty), "alignof mismatch for HeapProperty"); - -enum class MapMode : uint64_t { - None = WGPUMapMode_None, - Read = WGPUMapMode_Read, - Write = WGPUMapMode_Write, -}; -static_assert(sizeof(MapMode) == sizeof(WGPUMapMode), "sizeof mismatch for MapMode"); -static_assert(alignof(MapMode) == alignof(WGPUMapMode), "alignof mismatch for MapMode"); - -enum class ShaderStage : uint64_t { - None = WGPUShaderStage_None, - Vertex = WGPUShaderStage_Vertex, - Fragment = WGPUShaderStage_Fragment, - Compute = WGPUShaderStage_Compute, -}; -static_assert(sizeof(ShaderStage) == sizeof(WGPUShaderStage), "sizeof mismatch for ShaderStage"); -static_assert(alignof(ShaderStage) == alignof(WGPUShaderStage), "alignof mismatch for ShaderStage"); - -enum class TextureUsage : uint64_t { - None = WGPUTextureUsage_None, - CopySrc = WGPUTextureUsage_CopySrc, - CopyDst = WGPUTextureUsage_CopyDst, - TextureBinding = WGPUTextureUsage_TextureBinding, - StorageBinding = WGPUTextureUsage_StorageBinding, - RenderAttachment = WGPUTextureUsage_RenderAttachment, - TransientAttachment = WGPUTextureUsage_TransientAttachment, - StorageAttachment = WGPUTextureUsage_StorageAttachment, -}; -static_assert(sizeof(TextureUsage) == sizeof(WGPUTextureUsage), "sizeof mismatch for TextureUsage"); -static_assert(alignof(TextureUsage) == alignof(WGPUTextureUsage), "alignof mismatch for TextureUsage"); - - -// TODO(crbug.com/42241461): Update these to not be using the C callback types, and instead be -// defined using C++ types instead. Note that when we remove these, the C++ callback info types -// should also all be removed as they will no longer be necessary given the C++ templated -// functions calls and setter utilities. -using Callback = WGPUCallback; -using DawnLoadCacheDataFunction = WGPUDawnLoadCacheDataFunction; -using DawnStoreCacheDataFunction = WGPUDawnStoreCacheDataFunction; -using Proc = WGPUProc; - -// 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); -}; - -// Special class for optional booleans in order to allow conversions. -class OptionalBool { - public: - constexpr OptionalBool() = default; - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(bool value) : mValue(static_cast(value)) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(std::optional value) : - mValue(value ? static_cast(*value) : WGPUOptionalBool_Undefined) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(WGPUOptionalBool value): mValue(value) {} - - // Define the values that are equivalent to the enums. - static const OptionalBool False; - static const OptionalBool True; - static const OptionalBool Undefined; - - // Assignment operators. - OptionalBool& operator=(const bool& value) { - mValue = static_cast(value); - return *this; - } - OptionalBool& operator=(const std::optional& value) { - mValue = value ? static_cast(*value) : WGPUOptionalBool_Undefined; - return *this; - } - OptionalBool& operator=(const WGPUOptionalBool& value) { - mValue = value; - return *this; - } - - // Conversion functions. - operator WGPUOptionalBool() const { return mValue; } - operator std::optional() const { - if (mValue == WGPUOptionalBool_Undefined) { - return std::nullopt; - } - return static_cast(mValue); - } - - // Comparison functions. - friend bool operator==(const OptionalBool& lhs, const OptionalBool& rhs) { - return lhs.mValue == rhs.mValue; - } - friend bool operator!=(const OptionalBool& lhs, const OptionalBool& rhs) { - return lhs.mValue != rhs.mValue; - } - - private: - friend struct std::hash; - // Default to undefined. - WGPUOptionalBool mValue = WGPUOptionalBool_Undefined; -}; -inline const OptionalBool OptionalBool::False = OptionalBool(WGPUOptionalBool_False); -inline const OptionalBool OptionalBool::True = OptionalBool(WGPUOptionalBool_True); -inline const OptionalBool OptionalBool::Undefined = OptionalBool(WGPUOptionalBool_Undefined); - -// Helper class to wrap Status which allows implicit conversion to bool. -// Used while callers switch to checking the Status enum instead of booleans. -// TODO(crbug.com/42241199): Remove when all callers check the enum. -struct ConvertibleStatus { - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr ConvertibleStatus(Status status) : status(status) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - constexpr operator bool() const { - return status == Status::Success; - } - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - constexpr operator Status() const { - return status; - } - Status status; -}; - -template -class ObjectBase { - public: - ObjectBase() = default; - ObjectBase(CType handle): mHandle(handle) { - if (mHandle) Derived::WGPUAddRef(mHandle); - } - ~ObjectBase() { - if (mHandle) Derived::WGPURelease(mHandle); - } - - ObjectBase(ObjectBase const& other) - : ObjectBase(other.Get()) { - } - Derived& operator=(ObjectBase const& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - if (mHandle) Derived::WGPUAddRef(mHandle); - } - - return static_cast(*this); - } - - ObjectBase(ObjectBase&& other) { - mHandle = other.mHandle; - other.mHandle = 0; - } - Derived& operator=(ObjectBase&& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - other.mHandle = 0; - } - - return static_cast(*this); - } - - ObjectBase(std::nullptr_t) {} - Derived& operator=(std::nullptr_t) { - if (mHandle != nullptr) { - Derived::WGPURelease(mHandle); - mHandle = nullptr; - } - return static_cast(*this); - } - - bool operator==(std::nullptr_t) const { - return mHandle == nullptr; - } - bool operator!=(std::nullptr_t) const { - return mHandle != nullptr; - } - - explicit operator bool() const { - return mHandle != nullptr; - } - CType Get() const { - return mHandle; - } - CType MoveToCHandle() { - CType result = mHandle; - mHandle = 0; - return result; - } - static Derived Acquire(CType handle) { - Derived result; - result.mHandle = handle; - return result; - } - - protected: - CType mHandle = nullptr; -}; - -class Adapter; -class BindGroup; -class BindGroupLayout; -class Buffer; -class CommandBuffer; -class CommandEncoder; -class ComputePipeline; -class Device; -class ExternalTexture; -class Instance; -class PipelineLayout; -class QuerySet; -class Queue; -class RenderBundle; -class RenderPipeline; -class ResourceTable; -class Sampler; -class ShaderModule; -class SharedBufferMemory; -class SharedFence; -class SharedTextureMemory; -class Surface; -class TexelBufferView; -class Texture; -class TextureView; -class ComputePassEncoder; -class RenderBundleEncoder; -class RenderPassEncoder; - -struct StringView; -struct AdapterPropertiesD3D; -struct AdapterPropertiesDrm; -struct AdapterPropertiesVk; -struct AdapterPropertiesWGPU; -struct BindingResource; -struct BlendComponent; -struct BufferBindingLayout; -struct BufferHostMappedPointer; -struct Color; -struct ColorSpaceDawn; -struct ColorTargetStateExpandResolveTextureDawn; -struct CommandBufferDescriptor; -struct CompatibilityModeLimits; -struct ConstantEntry; -struct CopyTextureForBrowserOptions; -struct DawnAdapterPropertiesPowerPreference; -struct DawnBufferDescriptorErrorInfoFromWireClient; -struct DawnCacheDeviceDescriptor; -struct DawnCompilationMessageUtf16; -struct DawnConsumeAdapterDescriptor; -struct DawnDeviceAllocatorControl; -struct DawnDrmFormatProperties; -struct DawnEncoderInternalUsageDescriptor; -struct DawnFakeBufferOOMForTesting; -struct DawnFakeDeviceInitializeErrorForTesting; -struct DawnHostMappedPointerLimits; -struct DawnInjectedInvalidSType; -struct DawnRenderPassSampleCount; -struct DawnShaderModuleSPIRVOptionsDescriptor; -struct DawnTexelCopyBufferRowAlignmentLimits; -struct DawnTextureInternalUsageDescriptor; -struct DawnTogglesDescriptor; -struct DawnWGSLBlocklist; -struct DawnWireWGSLControl; -struct EmscriptenSurfaceSourceCanvasHTMLSelector; -struct Extent2D; -struct Extent3D; -struct ExternalTextureBindingEntry; -struct ExternalTextureBindingLayout; -struct Future; -struct InstanceLimits; -struct INTERNAL_HAVE_EMDAWNWEBGPU_HEADER; -struct MemoryHeapInfo; -struct MultisampleState; -struct Origin2D; -struct Origin3D; -struct PassTimestampWrites; -struct PipelineLayoutResourceTable; -struct PipelineLayoutStorageAttachment; -struct PrimitiveState; -struct QuerySetDescriptor; -struct QueueDescriptor; -struct RenderBundleDescriptor; -struct RenderBundleEncoderDescriptor; -struct RenderPassDepthStencilAttachment; -struct RenderPassDescriptorResolveRect; -struct RenderPassMaxDrawCount; -struct RequestAdapterWebGPUBackendOptions; -struct RequestAdapterWebXROptions; -struct ResourceTableDescriptor; -struct SamplerBindingLayout; -struct ShaderModuleCompilationOptions; -struct ShaderSourceSPIRV; -struct ShaderSourceWGSL; -struct SharedBufferMemoryBeginAccessDescriptor; -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor; -struct SharedBufferMemoryEndAccessState; -struct SharedBufferMemoryProperties; -struct SharedFenceDXGISharedHandleDescriptor; -struct SharedFenceDXGISharedHandleExportInfo; -struct SharedFenceEGLSyncDescriptor; -struct SharedFenceEGLSyncExportInfo; -struct SharedFenceMTLSharedEventDescriptor; -struct SharedFenceMTLSharedEventExportInfo; -struct SharedFenceSyncFDDescriptor; -struct SharedFenceSyncFDExportInfo; -struct SharedFenceVkSemaphoreOpaqueFDDescriptor; -struct SharedFenceVkSemaphoreOpaqueFDExportInfo; -struct SharedFenceVkSemaphoreZirconHandleDescriptor; -struct SharedFenceVkSemaphoreZirconHandleExportInfo; -struct SharedTextureMemoryAHardwareBufferDescriptor; -struct SharedTextureMemoryD3D11BeginState; -struct SharedTextureMemoryD3DSwapchainBeginState; -struct SharedTextureMemoryDmaBufPlane; -struct SharedTextureMemoryDXGISharedHandleDescriptor; -struct SharedTextureMemoryEGLImageDescriptor; -struct SharedTextureMemoryIOSurfaceDescriptor; -struct SharedTextureMemoryOpaqueFDDescriptor; -struct SharedTextureMemoryVkDedicatedAllocationDescriptor; -struct SharedTextureMemoryVkImageLayoutBeginState; -struct SharedTextureMemoryVkImageLayoutEndState; -struct SharedTextureMemoryZirconHandleDescriptor; -struct StaticSamplerBindingLayout; -struct StencilFaceState; -struct StorageTextureBindingLayout; -struct SubgroupMatrixConfig; -struct SupportedFeatures; -struct SupportedInstanceFeatures; -struct SupportedWGSLLanguageFeatures; -struct SurfaceCapabilities; -struct SurfaceColorManagement; -struct SurfaceConfiguration; -struct SurfaceDescriptorFromWindowsCoreWindow; -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel; -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel; -struct SurfaceSourceAndroidNativeWindow; -struct SurfaceSourceMetalLayer; -struct SurfaceSourceWaylandSurface; -struct SurfaceSourceWindowsHWND; -struct SurfaceSourceXCBWindow; -struct SurfaceSourceXlibWindow; -struct SurfaceTexture; -struct TexelBufferBindingEntry; -struct TexelBufferBindingLayout; -struct TexelBufferViewDescriptor; -struct TexelCopyBufferLayout; -struct TextureBindingLayout; -struct TextureBindingViewDimension; -struct TextureComponentSwizzle; -struct VertexAttribute; -struct YCbCrVkDescriptor; -struct AdapterPropertiesMemoryHeaps; -struct AdapterPropertiesSubgroupMatrixConfigs; -struct AHardwareBufferProperties; -struct BindGroupEntry; -struct BindGroupLayoutEntry; -struct BlendState; -struct BufferDescriptor; -struct CommandEncoderDescriptor; -struct CompilationMessage; -struct ComputePassDescriptor; -struct ComputeState; -struct DawnDrmFormatCapabilities; -struct DepthStencilState; -struct ExternalTextureDescriptor; -struct FutureWaitInfo; -struct ImageCopyExternalTexture; -struct InstanceDescriptor; -struct Limits; -struct PipelineLayoutPixelLocalStorage; -struct RenderPassColorAttachment; -struct RenderPassRenderAreaRect; -struct RenderPassStorageAttachment; -struct RequestAdapterOptions; -struct SamplerDescriptor; -struct ShaderModuleDescriptor; -struct SharedBufferMemoryDescriptor; -struct SharedFenceDescriptor; -struct SharedFenceExportInfo; -struct SharedTextureMemoryAHardwareBufferProperties; -struct SharedTextureMemoryBeginAccessDescriptor; -struct SharedTextureMemoryDmaBufDescriptor; -struct SharedTextureMemoryMetalEndAccessState; -struct SurfaceDescriptor; -struct TexelCopyBufferInfo; -struct TexelCopyTextureInfo; -struct TextureComponentSwizzleDescriptor; -struct TextureDescriptor; -struct VertexBufferLayout; -struct AdapterInfo; -struct BindGroupDescriptor; -struct BindGroupLayoutDescriptor; -struct ColorTargetState; -struct CompilationInfo; -struct ComputePipelineDescriptor; -struct DawnFormatCapabilities; -struct DeviceDescriptor; -struct PipelineLayoutDescriptor; -struct RenderPassPixelLocalStorage; -struct SharedTextureMemoryDescriptor; -struct SharedTextureMemoryEndAccessState; -struct SharedTextureMemoryProperties; -struct TextureViewDescriptor; -struct VertexState; -struct FragmentState; -struct RenderPassDescriptor; -struct RenderPipelineDescriptor; - -// TODO(42241188): Remove once all clients use StringView versions of the callbacks. -// To make MSVC happy we need a StringView constructor from the adapter, so we first need to -// forward declare StringViewAdapter here. Otherwise MSVC complains about an ambiguous conversion. -namespace detail { - struct StringViewAdapter; -} // namespace detail - -struct StringView { - char const * data = nullptr; - size_t length = WGPU_STRLEN; - - inline constexpr StringView() noexcept = default; - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(const std::string_view& sv) noexcept { - this->data = sv.data(); - this->length = sv.length(); - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(const char* s) { - this->data = s; - this->length = WGPU_STRLEN; // use strlen - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(WGPUStringView s) { - this->data = s.data; - this->length = s.length; - } - - inline constexpr StringView(const char* data, size_t length) { - this->data = data; - this->length = length; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(std::nullptr_t) { - this->data = nullptr; - this->length = WGPU_STRLEN; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(std::nullopt_t) { - this->data = nullptr; - this->length = WGPU_STRLEN; - } - - bool IsUndefined() const { - return this->data == nullptr && this->length == wgpu::kStrlen; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - operator std::string_view() const { - if (this->length == wgpu::kStrlen) { - if (IsUndefined()) { - return {}; - } - return {this->data}; - } - return {this->data, this->length}; - } - - template >> - explicit operator View() const { - if (this->length == wgpu::kStrlen) { - if (IsUndefined()) { - return {}; - } - return {this->data}; - } - return {this->data, this->length}; - } - - - StringView(const detail::StringViewAdapter& s); -}; - -namespace detail { -constexpr size_t ConstexprMax(size_t a, size_t b) { - return a > b ? a : b; -} - -template -static T& AsNonConstReference(const T& value) { - return const_cast(value); -} - -// A wrapper around StringView that can be implicitly converted to const char* with temporary -// storage that adds the \0 for output strings that are all explicitly-sized. -// TODO(42241188): Remove once all clients use StringView versions of the callbacks. -struct StringViewAdapter { - WGPUStringView sv; - char* nullTerminated = nullptr; - - StringViewAdapter(WGPUStringView sv) : sv(sv) {} - ~StringViewAdapter() { delete[] nullTerminated; } - operator ::WGPUStringView() { return sv; } - operator StringView() { return {sv.data, sv.length}; } - operator const char*() { - assert(sv.length != WGPU_STRLEN); - assert(nullTerminated == nullptr); - nullTerminated = new char[sv.length + 1]; - for (size_t i = 0; i < sv.length; i++) { - nullTerminated[i] = sv.data[i]; - } - nullTerminated[sv.length] = 0; - return nullTerminated; - } -}; -} // namespace detail - -inline StringView::StringView(const detail::StringViewAdapter& s): data(s.sv.data), length(s.sv.length) {} - -namespace detail { -// For callbacks, we support two modes: -// 1) No userdata where we allow a std::function type that can include argument captures. -// 2) Explicit typed userdata where we only allow non-capturing lambdas or function pointers. -template -struct CallbackTypeBase; -template -struct CallbackTypeBase> { - using Callback = std::function; -}; -template -struct CallbackTypeBase, void> { - using Callback = R (Args...); -}; -template -struct CallbackTypeBase, T> { - using Callback = R (Args..., T); -}; -} // namespace detail -template -using BufferMapCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CompilationInfoCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using DawnLoadCacheDataCallback = typename detail::CallbackTypeBase< - size_t, - std::tuple, T...>::Callback; -template -using DawnStoreCacheDataCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using LoggingCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using PopErrorScopeCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using QueueWorkDoneCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using RequestAdapterCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using RequestDeviceCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using DeviceLostCallback = typename detail::CallbackTypeBase, T...>::Callback; -template -using UncapturedErrorCallback = typename detail::CallbackTypeBase, T...>::Callback; - -class Adapter : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline Device CreateDevice(DeviceDescriptor const * descriptor = nullptr) const; - inline void GetFeatures(SupportedFeatures * features) const; - inline ConvertibleStatus GetFormatCapabilities(TextureFormat format, DawnFormatCapabilities * capabilities) const; - inline ConvertibleStatus GetInfo(AdapterInfo * info) const; - inline Instance GetInstance() const; - inline ConvertibleStatus GetLimits(Limits * limits) const; - inline Bool HasFeature(FeatureName feature) const; - template - Future RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUAdapter handle); - static inline void WGPURelease(WGPUAdapter handle); -}; - -class BindGroup : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBindGroup handle); - static inline void WGPURelease(WGPUBindGroup handle); -}; - -class BindGroupLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBindGroupLayout handle); - static inline void WGPURelease(WGPUBindGroupLayout handle); -}; - -class Buffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline TexelBufferView CreateTexelView(TexelBufferViewDescriptor const * descriptor) const; - inline void Destroy() const; - inline void const * GetConstMappedRange(size_t offset = 0, size_t size = kWholeMapSize) const; - inline void * GetMappedRange(size_t offset = 0, size_t size = kWholeMapSize) const; - inline BufferMapState GetMapState() const; - inline uint64_t GetSize() const; - inline BufferUsage GetUsage() const; - template - Future MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback, T userdata) const; - template - Future MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback) const; - inline ConvertibleStatus ReadMappedRange(size_t offset, void * data, size_t size) const; - inline void SetLabel(StringView label) const; - inline void Unmap() const; - inline ConvertibleStatus WriteMappedRange(size_t offset, void const * data, size_t size) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBuffer handle); - static inline void WGPURelease(WGPUBuffer handle); -}; - -class CommandBuffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUCommandBuffer handle); - static inline void WGPURelease(WGPUCommandBuffer handle); -}; - -class CommandEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ComputePassEncoder BeginComputePass(ComputePassDescriptor const * descriptor = nullptr) const; - inline RenderPassEncoder BeginRenderPass(RenderPassDescriptor const * descriptor) const; - inline void ClearBuffer(Buffer const& buffer, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const; - inline void CopyBufferToTexture(TexelCopyBufferInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const; - inline void CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const; - inline void CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const; - inline CommandBuffer Finish(CommandBufferDescriptor const * descriptor = nullptr) const; - inline void InjectValidationError(StringView message) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const; - inline void SetLabel(StringView label) const; - inline void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUCommandEncoder handle); - static inline void WGPURelease(WGPUCommandEncoder handle); -}; - -class ComputePipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUComputePipeline handle); - static inline void WGPURelease(WGPUComputePipeline handle); -}; - -class Device : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroup CreateBindGroup(BindGroupDescriptor const * descriptor) const; - inline BindGroupLayout CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const; - inline Buffer CreateBuffer(BufferDescriptor const * descriptor) const; - inline CommandEncoder CreateCommandEncoder(CommandEncoderDescriptor const * descriptor = nullptr) const; - inline ComputePipeline CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const; - template - Future CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - inline Buffer CreateErrorBuffer(BufferDescriptor const * descriptor) const; - inline ExternalTexture CreateErrorExternalTexture() const; - inline ShaderModule CreateErrorShaderModule(ShaderModuleDescriptor const * descriptor, StringView errorMessage) const; - inline Texture CreateErrorTexture(TextureDescriptor const * descriptor) const; - inline ExternalTexture CreateExternalTexture(ExternalTextureDescriptor const * externalTextureDescriptor) const; - inline PipelineLayout CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const; - inline QuerySet CreateQuerySet(QuerySetDescriptor const * descriptor) const; - inline RenderBundleEncoder CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const; - inline RenderPipeline CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const; - template - Future CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - inline ResourceTable CreateResourceTable(ResourceTableDescriptor const * descriptor) const; - inline Sampler CreateSampler(SamplerDescriptor const * descriptor = nullptr) const; - inline ShaderModule CreateShaderModule(ShaderModuleDescriptor const * descriptor) const; - inline Texture CreateTexture(TextureDescriptor const * descriptor) const; - inline void Destroy() const; - inline void ForceLoss(DeviceLostReason type, StringView message) const; - inline Adapter GetAdapter() const; - inline ConvertibleStatus GetAdapterInfo(AdapterInfo * adapterInfo) const; - inline ConvertibleStatus GetAHardwareBufferProperties(void * handle, AHardwareBufferProperties * properties) const; - inline void GetFeatures(SupportedFeatures * features) const; - inline ConvertibleStatus GetLimits(Limits * limits) const; - inline Future GetLostFuture() const; - inline Queue GetQueue() const; - inline Bool HasFeature(FeatureName feature) const; - inline SharedBufferMemory ImportSharedBufferMemory(SharedBufferMemoryDescriptor const * descriptor) const; - inline SharedFence ImportSharedFence(SharedFenceDescriptor const * descriptor) const; - inline SharedTextureMemory ImportSharedTextureMemory(SharedTextureMemoryDescriptor const * descriptor) const; - inline void InjectError(ErrorType type, StringView message) const; - template - Future PopErrorScope(CallbackMode callbackMode, F callback, T userdata) const; - template - Future PopErrorScope(CallbackMode callbackMode, F callback) const; - inline void PushErrorScope(ErrorFilter filter) const; - inline void SetLabel(StringView label) const; - template - void SetLoggingCallback(F callback, T userdata) const; - template - void SetLoggingCallback(F callback) const; - inline void Tick() const; - inline void ValidateTextureDescriptor(TextureDescriptor const * descriptor) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUDevice handle); - static inline void WGPURelease(WGPUDevice handle); -}; - -class ExternalTexture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline void Expire() const; - inline void Refresh() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUExternalTexture handle); - static inline void WGPURelease(WGPUExternalTexture handle); -}; - -class Instance : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline Surface CreateSurface(SurfaceDescriptor const * descriptor) const; - inline void GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const; - inline Bool HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const; - inline void ProcessEvents() const; - template - Future RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback, T userdata) const; - template - Future RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback) const; - inline WaitStatus WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const; - - inline WaitStatus WaitAny(Future f, uint64_t timeout) const; - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUInstance handle); - static inline void WGPURelease(WGPUInstance handle); -}; - -class PipelineLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUPipelineLayout handle); - static inline void WGPURelease(WGPUPipelineLayout handle); -}; - -class QuerySet : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline uint32_t GetCount() const; - inline QueryType GetType() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUQuerySet handle); - static inline void WGPURelease(WGPUQuerySet handle); -}; - -class Queue : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void CopyExternalTextureForBrowser(ImageCopyExternalTexture const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - inline void CopyTextureForBrowser(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - template - Future OnSubmittedWorkDone(CallbackMode callbackMode, F callback, T userdata) const; - template - Future OnSubmittedWorkDone(CallbackMode callbackMode, F callback) const; - inline void SetLabel(StringView label) const; - inline void Submit(size_t commandCount, CommandBuffer const * commands) const; - inline void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const; - inline void WriteTexture(TexelCopyTextureInfo const * destination, void const * data, size_t dataSize, TexelCopyBufferLayout const * dataLayout, Extent3D const * writeSize) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUQueue handle); - static inline void WGPURelease(WGPUQueue handle); -}; - -class RenderBundle : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderBundle handle); - static inline void WGPURelease(WGPURenderBundle handle); -}; - -class RenderPipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderPipeline handle); - static inline void WGPURelease(WGPURenderPipeline handle); -}; - -class ResourceTable : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline uint32_t GetSize() const; - inline uint32_t InsertBinding(BindingResource const * resource) const; - inline ConvertibleStatus RemoveBinding(uint32_t slot) const; - inline void SetLabel(StringView label) const; - inline ConvertibleStatus Update(uint32_t slot, BindingResource const * resource) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUResourceTable handle); - static inline void WGPURelease(WGPUResourceTable handle); -}; - -class Sampler : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSampler handle); - static inline void WGPURelease(WGPUSampler handle); -}; - -class ShaderModule : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - template - Future GetCompilationInfo(CallbackMode callbackMode, F callback, T userdata) const; - template - Future GetCompilationInfo(CallbackMode callbackMode, F callback) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUShaderModule handle); - static inline void WGPURelease(WGPUShaderModule handle); -}; - -class SharedBufferMemory : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ConvertibleStatus BeginAccess(Buffer const& buffer, SharedBufferMemoryBeginAccessDescriptor const * descriptor) const; - inline Buffer CreateBuffer(BufferDescriptor const * descriptor = nullptr) const; - inline ConvertibleStatus EndAccess(Buffer const& buffer, SharedBufferMemoryEndAccessState * descriptor) const; - inline ConvertibleStatus GetProperties(SharedBufferMemoryProperties * properties) const; - inline Bool IsDeviceLost() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedBufferMemory handle); - static inline void WGPURelease(WGPUSharedBufferMemory handle); -}; - -class SharedFence : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void ExportInfo(SharedFenceExportInfo * info) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedFence handle); - static inline void WGPURelease(WGPUSharedFence handle); -}; - -class SharedTextureMemory : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ConvertibleStatus BeginAccess(Texture const& texture, SharedTextureMemoryBeginAccessDescriptor const * descriptor) const; - inline Texture CreateTexture(TextureDescriptor const * descriptor = nullptr) const; - inline ConvertibleStatus EndAccess(Texture const& texture, SharedTextureMemoryEndAccessState * descriptor) const; - inline ConvertibleStatus GetProperties(SharedTextureMemoryProperties * properties) const; - inline Bool IsDeviceLost() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedTextureMemory handle); - static inline void WGPURelease(WGPUSharedTextureMemory handle); -}; - -class Surface : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Configure(SurfaceConfiguration const * config) const; - inline ConvertibleStatus GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const; - inline void GetCurrentTexture(SurfaceTexture * surfaceTexture) const; - inline ConvertibleStatus Present() const; - inline void SetLabel(StringView label) const; - inline void Unconfigure() const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSurface handle); - static inline void WGPURelease(WGPUSurface handle); -}; - -class TexelBufferView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTexelBufferView handle); - static inline void WGPURelease(WGPUTexelBufferView handle); -}; - -class Texture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline TextureView CreateErrorView(TextureViewDescriptor const * descriptor = nullptr) const; - inline TextureView CreateView(TextureViewDescriptor const * descriptor = nullptr) const; - inline void Destroy() const; - inline uint32_t GetDepthOrArrayLayers() const; - inline TextureDimension GetDimension() const; - inline TextureFormat GetFormat() const; - inline uint32_t GetHeight() const; - inline uint32_t GetMipLevelCount() const; - inline uint32_t GetSampleCount() const; - inline TextureViewDimension GetTextureBindingViewDimension() const; - inline TextureUsage GetUsage() const; - inline uint32_t GetWidth() const; - inline void Pin(TextureUsage usage) const; - inline void SetLabel(StringView label) const; - inline void SetOwnershipForMemoryDump(uint64_t ownerGuid = 0) const; - inline void Unpin() const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTexture handle); - static inline void WGPURelease(WGPUTexture handle); -}; - -class TextureView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTextureView handle); - static inline void WGPURelease(WGPUTextureView handle); -}; - -class ComputePassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const; - inline void DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void End() const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(ComputePipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUComputePassEncoder handle); - static inline void WGPURelease(WGPUComputePassEncoder handle); -}; - -class RenderBundleEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline RenderBundle Finish(RenderBundleDescriptor const * descriptor = nullptr) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(RenderPipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void SetVertexBuffer(uint32_t slot, Buffer const& buffer = nullptr, uint64_t offset = 0, uint64_t size = kWholeSize) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderBundleEncoder handle); - static inline void WGPURelease(WGPURenderBundleEncoder handle); -}; - -class RenderPassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void BeginOcclusionQuery(uint32_t queryIndex) const; - inline void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void End() const; - inline void EndOcclusionQuery() const; - inline void ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void MultiDrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer = nullptr, uint64_t drawCountBufferOffset = 0) const; - inline void MultiDrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer = nullptr, uint64_t drawCountBufferOffset = 0) const; - inline void PixelLocalStorageBarrier() const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetBlendConstant(Color const * color) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(RenderPipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; - inline void SetStencilReference(uint32_t reference) const; - inline void SetVertexBuffer(uint32_t slot, Buffer const& buffer = nullptr, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderPassEncoder handle); - static inline void WGPURelease(WGPURenderPassEncoder handle); -}; - - -// ChainedStruct -static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct), - "sizeof mismatch for ChainedStruct"); -static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), - "alignof mismatch for ChainedStruct"); -static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next), - "offsetof mismatch for ChainedStruct::nextInChain"); -static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), - "offsetof mismatch for ChainedStruct::sType"); - -// Can be chained in AdapterInfo -struct AdapterPropertiesD3D : ChainedStructOut { - inline AdapterPropertiesD3D(); - struct Init; - inline AdapterPropertiesD3D(Init&& init); - inline operator const WGPUAdapterPropertiesD3D&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t shaderModel; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesDrm : ChainedStructOut { - inline AdapterPropertiesDrm(); - struct Init; - inline AdapterPropertiesDrm(Init&& init); - inline operator const WGPUAdapterPropertiesDrm&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool hasPrimary = false; - Bool hasRender = false; - uint64_t primaryMajor = 0; - uint64_t primaryMinor = 0; - uint64_t renderMajor = 0; - uint64_t renderMinor = 0; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesVk : ChainedStructOut { - inline AdapterPropertiesVk(); - struct Init; - inline AdapterPropertiesVk(Init&& init); - inline operator const WGPUAdapterPropertiesVk&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t driverVersion; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesWGPU : ChainedStructOut { - inline AdapterPropertiesWGPU(); - struct Init; - inline AdapterPropertiesWGPU(Init&& init); - inline operator const WGPUAdapterPropertiesWGPU&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(BackendType)); - alignas(kFirstMemberAlignment) BackendType backendType = BackendType::Undefined; -}; - -struct BindingResource { - inline operator const WGPUBindingResource&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size = kWholeSize; - Sampler sampler = nullptr; - TextureView textureView = nullptr; -}; - -struct BlendComponent { - inline operator const WGPUBlendComponent&() const noexcept; - - BlendOperation operation = BlendOperation::Undefined; - BlendFactor srcFactor = BlendFactor::Undefined; - BlendFactor dstFactor = BlendFactor::Undefined; -}; - -struct BufferBindingLayout { - inline operator const WGPUBufferBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - BufferBindingType type = BufferBindingType::Undefined; - Bool hasDynamicOffset = false; - uint64_t minBindingSize = 0; -}; - -// Can be chained in BufferDescriptor -struct BufferHostMappedPointer : ChainedStruct { - inline BufferHostMappedPointer(); - struct Init; - inline BufferHostMappedPointer(Init&& init); - inline operator const WGPUBufferHostMappedPointer&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * pointer; - Callback disposeCallback; - void * userdata; -}; - -struct Color { - inline operator const WGPUColor&() const noexcept; - - double r; - double g; - double b; - double a; -}; - -struct ColorSpaceDawn { - inline operator const WGPUColorSpaceDawn&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ColorSpacePrimariesDawn primaries = {}; - ColorSpaceTransferDawn transfer = ColorSpaceTransferDawn::Identity; - ColorSpaceYCbCrRangeDawn yCbCrRange = ColorSpaceYCbCrRangeDawn::Identity; - ColorSpaceYCbCrMatrixDawn yCbCrMatrix = ColorSpaceYCbCrMatrixDawn::Identity; -}; - -// Can be chained in ColorTargetState -struct ColorTargetStateExpandResolveTextureDawn : ChainedStruct { - inline ColorTargetStateExpandResolveTextureDawn(); - struct Init; - inline ColorTargetStateExpandResolveTextureDawn(Init&& init); - inline operator const WGPUColorTargetStateExpandResolveTextureDawn&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool enabled = false; -}; - -struct CommandBufferDescriptor { - inline operator const WGPUCommandBufferDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -// Can be chained in Limits -struct CompatibilityModeLimits : ChainedStructOut { - inline CompatibilityModeLimits(); - struct Init; - inline CompatibilityModeLimits(Init&& init); - inline operator const WGPUCompatibilityModeLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t maxStorageBuffersInVertexStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInVertexStage = kLimitU32Undefined; - uint32_t maxStorageBuffersInFragmentStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInFragmentStage = kLimitU32Undefined; -}; - -struct ConstantEntry { - inline operator const WGPUConstantEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView key = {}; - double value; -}; - -struct CopyTextureForBrowserOptions { - inline operator const WGPUCopyTextureForBrowserOptions&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - 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; -}; - -// Can be chained in AdapterInfo -struct DawnAdapterPropertiesPowerPreference : ChainedStructOut { - inline DawnAdapterPropertiesPowerPreference(); - struct Init; - inline DawnAdapterPropertiesPowerPreference(Init&& init); - inline operator const WGPUDawnAdapterPropertiesPowerPreference&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(PowerPreference)); - alignas(kFirstMemberAlignment) PowerPreference powerPreference = PowerPreference::Undefined; -}; - -// Can be chained in BufferDescriptor -struct DawnBufferDescriptorErrorInfoFromWireClient : ChainedStruct { - inline DawnBufferDescriptorErrorInfoFromWireClient(); - struct Init; - inline DawnBufferDescriptorErrorInfoFromWireClient(Init&& init); - inline operator const WGPUDawnBufferDescriptorErrorInfoFromWireClient&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool outOfMemory = false; -}; - -namespace detail { -struct DawnCacheDeviceDescriptor { - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView)); - alignas(kFirstMemberAlignment) StringView isolationKey = {}; - DawnLoadCacheDataFunction loadDataFunction = nullptr; - DawnStoreCacheDataFunction storeDataFunction = nullptr; - void * functionUserdata = nullptr; - WGPUDawnLoadCacheDataCallbackInfo dawnLoadCacheDataCallbackInfo = WGPU_DAWN_LOAD_CACHE_DATA_CALLBACK_INFO_INIT; - WGPUDawnStoreCacheDataCallbackInfo dawnStoreCacheDataCallbackInfo = WGPU_DAWN_STORE_CACHE_DATA_CALLBACK_INFO_INIT; -}; -} // namespace detail -// Can be chained in DeviceDescriptor -struct DawnCacheDeviceDescriptor : ChainedStruct, protected detail::DawnCacheDeviceDescriptor { - inline DawnCacheDeviceDescriptor(); - struct Init; - inline DawnCacheDeviceDescriptor(Init&& init); - inline operator const WGPUDawnCacheDeviceDescriptor&() const noexcept; - - using detail::DawnCacheDeviceDescriptor::kFirstMemberAlignment; - using detail::DawnCacheDeviceDescriptor::isolationKey; - using detail::DawnCacheDeviceDescriptor::loadDataFunction; - using detail::DawnCacheDeviceDescriptor::storeDataFunction; - using detail::DawnCacheDeviceDescriptor::functionUserdata; - - template - void SetDawnLoadCacheDataCallback(F callback, T userdata); - template - void SetDawnLoadCacheDataCallback(F callback); - template - void SetDawnStoreCacheDataCallback(F callback, T userdata); - template - void SetDawnStoreCacheDataCallback(F callback); -}; - -// Can be chained in CompilationMessage -struct DawnCompilationMessageUtf16 : ChainedStruct { - inline DawnCompilationMessageUtf16(); - struct Init; - inline DawnCompilationMessageUtf16(Init&& init); - inline operator const WGPUDawnCompilationMessageUtf16&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t linePos; - uint64_t offset; - uint64_t length; -}; - -// Can be chained in DeviceDescriptor -struct DawnConsumeAdapterDescriptor : ChainedStruct { - inline DawnConsumeAdapterDescriptor(); - struct Init; - inline DawnConsumeAdapterDescriptor(Init&& init); - inline operator const WGPUDawnConsumeAdapterDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool consumeAdapter = false; -}; - -// Can be chained in DeviceDescriptor -struct DawnDeviceAllocatorControl : ChainedStruct { - inline DawnDeviceAllocatorControl(); - struct Init; - inline DawnDeviceAllocatorControl(Init&& init); - inline operator const WGPUDawnDeviceAllocatorControl&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t allocatorHeapBlockSize = 0; -}; - -struct DawnDrmFormatProperties { - inline operator const WGPUDawnDrmFormatProperties&() const noexcept; - - uint64_t modifier; - uint32_t modifierPlaneCount; -}; - -// Can be chained in CommandEncoderDescriptor -struct DawnEncoderInternalUsageDescriptor : ChainedStruct { - inline DawnEncoderInternalUsageDescriptor(); - struct Init; - inline DawnEncoderInternalUsageDescriptor(Init&& init); - inline operator const WGPUDawnEncoderInternalUsageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool useInternalUsages = false; -}; - -// Can be chained in BufferDescriptor -struct DawnFakeBufferOOMForTesting : ChainedStruct { - inline DawnFakeBufferOOMForTesting(); - struct Init; - inline DawnFakeBufferOOMForTesting(Init&& init); - inline operator const WGPUDawnFakeBufferOOMForTesting&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool fakeOOMAtWireClientMap; - Bool fakeOOMAtNativeMap; - Bool fakeOOMAtDevice; -}; - -// Can be chained in DeviceDescriptor -struct DawnFakeDeviceInitializeErrorForTesting : ChainedStruct { - inline DawnFakeDeviceInitializeErrorForTesting(); - struct Init; - inline DawnFakeDeviceInitializeErrorForTesting(Init&& init); - inline operator const WGPUDawnFakeDeviceInitializeErrorForTesting&() const noexcept; - - }; - -// Can be chained in Limits -struct DawnHostMappedPointerLimits : ChainedStructOut { - inline DawnHostMappedPointerLimits(); - struct Init; - inline DawnHostMappedPointerLimits(Init&& init); - inline operator const WGPUDawnHostMappedPointerLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t hostMappedPointerAlignment = kLimitU32Undefined; -}; - -struct DawnInjectedInvalidSType : ChainedStruct { - inline DawnInjectedInvalidSType(); - struct Init; - inline DawnInjectedInvalidSType(Init&& init); - inline operator const WGPUDawnInjectedInvalidSType&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(SType)); - alignas(kFirstMemberAlignment) SType invalidSType = {}; -}; - -// Can be chained in RenderPassDescriptor -struct DawnRenderPassSampleCount : ChainedStruct { - inline DawnRenderPassSampleCount(); - struct Init; - inline DawnRenderPassSampleCount(Init&& init); - inline operator const WGPUDawnRenderPassSampleCount&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t sampleCount = 1; -}; - -// Can be chained in ShaderModuleDescriptor -struct DawnShaderModuleSPIRVOptionsDescriptor : ChainedStruct { - inline DawnShaderModuleSPIRVOptionsDescriptor(); - struct Init; - inline DawnShaderModuleSPIRVOptionsDescriptor(Init&& init); - inline operator const WGPUDawnShaderModuleSPIRVOptionsDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool allowNonUniformDerivatives = false; -}; - -// Can be chained in Limits -struct DawnTexelCopyBufferRowAlignmentLimits : ChainedStructOut { - inline DawnTexelCopyBufferRowAlignmentLimits(); - struct Init; - inline DawnTexelCopyBufferRowAlignmentLimits(Init&& init); - inline operator const WGPUDawnTexelCopyBufferRowAlignmentLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t minTexelCopyBufferRowAlignment = kLimitU32Undefined; -}; - -// Can be chained in TextureDescriptor -struct DawnTextureInternalUsageDescriptor : ChainedStruct { - inline DawnTextureInternalUsageDescriptor(); - struct Init; - inline DawnTextureInternalUsageDescriptor(Init&& init); - inline operator const WGPUDawnTextureInternalUsageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureUsage)); - alignas(kFirstMemberAlignment) TextureUsage internalUsage = TextureUsage::None; -}; - -// Can be chained in InstanceDescriptor -// Can be chained in RequestAdapterOptions -// Can be chained in DeviceDescriptor -struct DawnTogglesDescriptor : ChainedStruct { - inline DawnTogglesDescriptor(); - struct Init; - inline DawnTogglesDescriptor(Init&& init); - inline operator const WGPUDawnTogglesDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t enabledToggleCount = 0; - const char* const * enabledToggles = nullptr; - size_t disabledToggleCount = 0; - const char* const * disabledToggles = nullptr; -}; - -// Can be chained in InstanceDescriptor -struct DawnWGSLBlocklist : ChainedStruct { - inline DawnWGSLBlocklist(); - struct Init; - inline DawnWGSLBlocklist(Init&& init); - inline operator const WGPUDawnWGSLBlocklist&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t blocklistedFeatureCount = 0; - const char* const * blocklistedFeatures = nullptr; -}; - -// Can be chained in InstanceDescriptor -struct DawnWireWGSLControl : ChainedStruct { - inline DawnWireWGSLControl(); - struct Init; - inline DawnWireWGSLControl(Init&& init); - inline operator const WGPUDawnWireWGSLControl&() const noexcept; - - 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 SurfaceDescriptor -struct EmscriptenSurfaceSourceCanvasHTMLSelector : ChainedStruct { - inline EmscriptenSurfaceSourceCanvasHTMLSelector(); - struct Init; - inline EmscriptenSurfaceSourceCanvasHTMLSelector(Init&& init); - inline operator const WGPUEmscriptenSurfaceSourceCanvasHTMLSelector&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView)); - alignas(kFirstMemberAlignment) StringView selector = {}; -}; - -struct Extent2D { - inline operator const WGPUExtent2D&() const noexcept; - - uint32_t width; - uint32_t height; -}; - -struct Extent3D { - inline operator const WGPUExtent3D&() const noexcept; - - uint32_t width; - uint32_t height = 1; - uint32_t depthOrArrayLayers = 1; -}; - -// Can be chained in BindGroupEntry -struct ExternalTextureBindingEntry : ChainedStruct { - inline ExternalTextureBindingEntry(); - struct Init; - inline ExternalTextureBindingEntry(Init&& init); - inline operator const WGPUExternalTextureBindingEntry&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(ExternalTexture)); - alignas(kFirstMemberAlignment) ExternalTexture externalTexture = nullptr; -}; - -// Can be chained in BindGroupLayoutEntry -struct ExternalTextureBindingLayout : ChainedStruct { - inline ExternalTextureBindingLayout(); - struct Init; - inline ExternalTextureBindingLayout(Init&& init); - inline operator const WGPUExternalTextureBindingLayout&() const noexcept; - - }; - -struct Future { - inline operator const WGPUFuture&() const noexcept; - - uint64_t id; -}; - -struct InstanceLimits { - inline operator const WGPUInstanceLimits&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - size_t timedWaitAnyMaxCount = 0; -}; - -struct INTERNAL_HAVE_EMDAWNWEBGPU_HEADER { - inline operator const WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER&() const noexcept; - - Bool unused = false; -}; - -struct MemoryHeapInfo { - inline operator const WGPUMemoryHeapInfo&() const noexcept; - - HeapProperty properties = HeapProperty::None; - uint64_t size; -}; - -struct MultisampleState { - inline operator const WGPUMultisampleState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t count = 1; - uint32_t mask = 0xFFFFFFFF; - Bool alphaToCoverageEnabled = false; -}; - -struct Origin2D { - inline operator const WGPUOrigin2D&() const noexcept; - - uint32_t x = 0; - uint32_t y = 0; -}; - -struct Origin3D { - inline operator const WGPUOrigin3D&() const noexcept; - - uint32_t x = 0; - uint32_t y = 0; - uint32_t z = 0; -}; - -struct PassTimestampWrites { - inline operator const WGPUPassTimestampWrites&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - QuerySet querySet = nullptr; - uint32_t beginningOfPassWriteIndex = kQuerySetIndexUndefined; - uint32_t endOfPassWriteIndex = kQuerySetIndexUndefined; -}; - -// Can be chained in PipelineLayoutDescriptor -struct PipelineLayoutResourceTable : ChainedStruct { - inline PipelineLayoutResourceTable(); - struct Init; - inline PipelineLayoutResourceTable(Init&& init); - inline operator const WGPUPipelineLayoutResourceTable&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool usesResourceTable = false; -}; - -struct PipelineLayoutStorageAttachment { - inline operator const WGPUPipelineLayoutStorageAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - TextureFormat format = TextureFormat::Undefined; -}; - -struct PrimitiveState { - inline operator const WGPUPrimitiveState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - PrimitiveTopology topology = PrimitiveTopology::Undefined; - IndexFormat stripIndexFormat = IndexFormat::Undefined; - FrontFace frontFace = FrontFace::Undefined; - CullMode cullMode = CullMode::Undefined; - Bool unclippedDepth = false; -}; - -struct QuerySetDescriptor { - inline operator const WGPUQuerySetDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - QueryType type = {}; - uint32_t count; -}; - -struct QueueDescriptor { - inline operator const WGPUQueueDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct RenderBundleDescriptor { - inline operator const WGPURenderBundleDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct RenderBundleEncoderDescriptor { - inline operator const WGPURenderBundleEncoderDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t colorFormatCount; - TextureFormat const * colorFormats = nullptr; - TextureFormat depthStencilFormat = TextureFormat::Undefined; - uint32_t sampleCount = 1; - Bool depthReadOnly = false; - Bool stencilReadOnly = false; -}; - -struct RenderPassDepthStencilAttachment { - inline operator const WGPURenderPassDepthStencilAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureView view = nullptr; - LoadOp depthLoadOp = LoadOp::Undefined; - StoreOp depthStoreOp = StoreOp::Undefined; - float depthClearValue = kDepthClearValueUndefined; - Bool depthReadOnly = false; - LoadOp stencilLoadOp = LoadOp::Undefined; - StoreOp stencilStoreOp = StoreOp::Undefined; - uint32_t stencilClearValue = 0; - Bool stencilReadOnly = false; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassDescriptorResolveRect : ChainedStruct { - inline RenderPassDescriptorResolveRect(); - struct Init; - inline RenderPassDescriptorResolveRect(Init&& init); - inline operator const WGPURenderPassDescriptorResolveRect&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t colorOffsetX; - uint32_t colorOffsetY; - uint32_t resolveOffsetX; - uint32_t resolveOffsetY; - uint32_t width; - uint32_t height; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassMaxDrawCount : ChainedStruct { - inline RenderPassMaxDrawCount(); - struct Init; - inline RenderPassMaxDrawCount(Init&& init); - inline operator const WGPURenderPassMaxDrawCount&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t maxDrawCount = 50000000; -}; - -// Can be chained in RequestAdapterOptions -struct RequestAdapterWebGPUBackendOptions : ChainedStruct { - inline RequestAdapterWebGPUBackendOptions(); - struct Init; - inline RequestAdapterWebGPUBackendOptions(Init&& init); - inline operator const WGPURequestAdapterWebGPUBackendOptions&() const noexcept; - - }; - -// Can be chained in RequestAdapterOptions -struct RequestAdapterWebXROptions : ChainedStruct { - inline RequestAdapterWebXROptions(); - struct Init; - inline RequestAdapterWebXROptions(Init&& init); - inline operator const WGPURequestAdapterWebXROptions&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool xrCompatible; -}; - -struct ResourceTableDescriptor { - inline operator const WGPUResourceTableDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - uint32_t size; -}; - -struct SamplerBindingLayout { - inline operator const WGPUSamplerBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - SamplerBindingType type = SamplerBindingType::Undefined; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderModuleCompilationOptions : ChainedStruct { - inline ShaderModuleCompilationOptions(); - struct Init; - inline ShaderModuleCompilationOptions(Init&& init); - inline operator const WGPUShaderModuleCompilationOptions&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool strictMath; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderSourceSPIRV : ChainedStruct { - inline ShaderSourceSPIRV(); - struct Init; - inline ShaderSourceSPIRV(Init&& init); - inline operator const WGPUShaderSourceSPIRV&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t codeSize; - uint32_t const * code = nullptr; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderSourceWGSL : ChainedStruct { - inline ShaderSourceWGSL(); - struct Init; - inline ShaderSourceWGSL(Init&& init); - inline operator const WGPUShaderSourceWGSL&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView)); - alignas(kFirstMemberAlignment) StringView code = {}; -}; - -struct SharedBufferMemoryBeginAccessDescriptor { - inline operator const WGPUSharedBufferMemoryBeginAccessDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Bool initialized; - size_t fenceCount = 0; - SharedFence const * fences = nullptr; - size_t signaledValueCount = 0; - uint64_t const * signaledValues = nullptr; -}; - -// Can be chained in SharedBufferMemoryDescriptor -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor : ChainedStruct { - inline SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(); - struct Init; - inline SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(Init&& init); - inline operator const WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; - uint64_t size; -}; - -struct SharedBufferMemoryEndAccessState { - inline SharedBufferMemoryEndAccessState(); - inline ~SharedBufferMemoryEndAccessState(); - SharedBufferMemoryEndAccessState(const SharedBufferMemoryEndAccessState&) = delete; - SharedBufferMemoryEndAccessState& operator=(const SharedBufferMemoryEndAccessState&) = delete; - inline SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&&); - inline SharedBufferMemoryEndAccessState& operator=(SharedBufferMemoryEndAccessState&&); - inline operator const WGPUSharedBufferMemoryEndAccessState&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Bool const initialized = {}; - size_t const fenceCount = 0; - SharedFence const * const fences = nullptr; - size_t const signaledValueCount = 0; - uint64_t const * const signaledValues = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SharedBufferMemoryEndAccessState& value); -}; - -struct SharedBufferMemoryProperties { - inline operator const WGPUSharedBufferMemoryProperties&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - BufferUsage usage = BufferUsage::None; - uint64_t size; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceDXGISharedHandleDescriptor : ChainedStruct { - inline SharedFenceDXGISharedHandleDescriptor(); - struct Init; - inline SharedFenceDXGISharedHandleDescriptor(Init&& init); - inline operator const WGPUSharedFenceDXGISharedHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceDXGISharedHandleExportInfo : ChainedStructOut { - inline SharedFenceDXGISharedHandleExportInfo(); - struct Init; - inline SharedFenceDXGISharedHandleExportInfo(Init&& init); - inline operator const WGPUSharedFenceDXGISharedHandleExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceEGLSyncDescriptor : ChainedStruct { - inline SharedFenceEGLSyncDescriptor(); - struct Init; - inline SharedFenceEGLSyncDescriptor(Init&& init); - inline operator const WGPUSharedFenceEGLSyncDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * sync; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceEGLSyncExportInfo : ChainedStructOut { - inline SharedFenceEGLSyncExportInfo(); - struct Init; - inline SharedFenceEGLSyncExportInfo(Init&& init); - inline operator const WGPUSharedFenceEGLSyncExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * sync; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceMTLSharedEventDescriptor : ChainedStruct { - inline SharedFenceMTLSharedEventDescriptor(); - struct Init; - inline SharedFenceMTLSharedEventDescriptor(Init&& init); - inline operator const WGPUSharedFenceMTLSharedEventDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * sharedEvent; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceMTLSharedEventExportInfo : ChainedStructOut { - inline SharedFenceMTLSharedEventExportInfo(); - struct Init; - inline SharedFenceMTLSharedEventExportInfo(Init&& init); - inline operator const WGPUSharedFenceMTLSharedEventExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * sharedEvent; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceSyncFDDescriptor : ChainedStruct { - inline SharedFenceSyncFDDescriptor(); - struct Init; - inline SharedFenceSyncFDDescriptor(Init&& init); - inline operator const WGPUSharedFenceSyncFDDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceSyncFDExportInfo : ChainedStructOut { - inline SharedFenceSyncFDExportInfo(); - struct Init; - inline SharedFenceSyncFDExportInfo(Init&& init); - inline operator const WGPUSharedFenceSyncFDExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceVkSemaphoreOpaqueFDDescriptor : ChainedStruct { - inline SharedFenceVkSemaphoreOpaqueFDDescriptor(); - struct Init; - inline SharedFenceVkSemaphoreOpaqueFDDescriptor(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceVkSemaphoreOpaqueFDExportInfo : ChainedStructOut { - inline SharedFenceVkSemaphoreOpaqueFDExportInfo(); - struct Init; - inline SharedFenceVkSemaphoreOpaqueFDExportInfo(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceVkSemaphoreZirconHandleDescriptor : ChainedStruct { - inline SharedFenceVkSemaphoreZirconHandleDescriptor(); - struct Init; - inline SharedFenceVkSemaphoreZirconHandleDescriptor(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreZirconHandleDescriptor&() const noexcept; - - 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 { - inline SharedFenceVkSemaphoreZirconHandleExportInfo(); - struct Init; - inline SharedFenceVkSemaphoreZirconHandleExportInfo(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreZirconHandleExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t handle; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryAHardwareBufferDescriptor : ChainedStruct { - inline SharedTextureMemoryAHardwareBufferDescriptor(); - struct Init; - inline SharedTextureMemoryAHardwareBufferDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryAHardwareBufferDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryD3D11BeginState : ChainedStruct { - inline SharedTextureMemoryD3D11BeginState(); - struct Init; - inline SharedTextureMemoryD3D11BeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryD3D11BeginState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool requiresEndAccessFence = true; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryD3DSwapchainBeginState : ChainedStruct { - inline SharedTextureMemoryD3DSwapchainBeginState(); - struct Init; - inline SharedTextureMemoryD3DSwapchainBeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryD3DSwapchainBeginState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool isSwapchain = false; -}; - -struct SharedTextureMemoryDmaBufPlane { - inline operator const WGPUSharedTextureMemoryDmaBufPlane&() const noexcept; - - int fd; - uint64_t offset; - uint32_t stride; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryDXGISharedHandleDescriptor : ChainedStruct { - inline SharedTextureMemoryDXGISharedHandleDescriptor(); - struct Init; - inline SharedTextureMemoryDXGISharedHandleDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryDXGISharedHandleDescriptor&() const noexcept; - - 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 { - inline SharedTextureMemoryEGLImageDescriptor(); - struct Init; - inline SharedTextureMemoryEGLImageDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryEGLImageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * image; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryIOSurfaceDescriptor : ChainedStruct { - inline SharedTextureMemoryIOSurfaceDescriptor(); - struct Init; - inline SharedTextureMemoryIOSurfaceDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryIOSurfaceDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * ioSurface; - Bool allowStorageBinding = true; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryOpaqueFDDescriptor : ChainedStruct { - inline SharedTextureMemoryOpaqueFDDescriptor(); - struct Init; - inline SharedTextureMemoryOpaqueFDDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryOpaqueFDDescriptor&() const noexcept; - - 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 { - inline SharedTextureMemoryVkDedicatedAllocationDescriptor(); - struct Init; - inline SharedTextureMemoryVkDedicatedAllocationDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool dedicatedAllocation; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryVkImageLayoutBeginState : ChainedStruct { - inline SharedTextureMemoryVkImageLayoutBeginState(); - struct Init; - inline SharedTextureMemoryVkImageLayoutBeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryVkImageLayoutBeginState&() const noexcept; - - 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 { - inline SharedTextureMemoryVkImageLayoutEndState(); - struct Init; - inline SharedTextureMemoryVkImageLayoutEndState(Init&& init); - inline operator const WGPUSharedTextureMemoryVkImageLayoutEndState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int32_t)); - alignas(kFirstMemberAlignment) int32_t oldLayout; - int32_t newLayout; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryZirconHandleDescriptor : ChainedStruct { - inline SharedTextureMemoryZirconHandleDescriptor(); - struct Init; - inline SharedTextureMemoryZirconHandleDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryZirconHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t memoryFD; - uint64_t allocationSize; -}; - -// Can be chained in BindGroupLayoutEntry -struct StaticSamplerBindingLayout : ChainedStruct { - inline StaticSamplerBindingLayout(); - struct Init; - inline StaticSamplerBindingLayout(Init&& init); - inline operator const WGPUStaticSamplerBindingLayout&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Sampler)); - alignas(kFirstMemberAlignment) Sampler sampler = nullptr; - uint32_t sampledTextureBinding = kLimitU32Undefined; -}; - -struct StencilFaceState { - inline operator const WGPUStencilFaceState&() const noexcept; - - CompareFunction compare = CompareFunction::Undefined; - StencilOperation failOp = StencilOperation::Undefined; - StencilOperation depthFailOp = StencilOperation::Undefined; - StencilOperation passOp = StencilOperation::Undefined; -}; - -struct StorageTextureBindingLayout { - inline operator const WGPUStorageTextureBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StorageTextureAccess access = StorageTextureAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; -}; - -struct SubgroupMatrixConfig { - inline operator const WGPUSubgroupMatrixConfig&() const noexcept; - - SubgroupMatrixComponentType componentType = {}; - SubgroupMatrixComponentType resultComponentType = {}; - uint32_t M; - uint32_t N; - uint32_t K; -}; - -struct SupportedFeatures { - inline SupportedFeatures(); - inline ~SupportedFeatures(); - SupportedFeatures(const SupportedFeatures&) = delete; - SupportedFeatures& operator=(const SupportedFeatures&) = delete; - inline SupportedFeatures(SupportedFeatures&&); - inline SupportedFeatures& operator=(SupportedFeatures&&); - inline operator const WGPUSupportedFeatures&() const noexcept; - - size_t const featureCount = {}; - FeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedFeatures& value); -}; - -struct SupportedInstanceFeatures { - inline SupportedInstanceFeatures(); - inline ~SupportedInstanceFeatures(); - SupportedInstanceFeatures(const SupportedInstanceFeatures&) = delete; - SupportedInstanceFeatures& operator=(const SupportedInstanceFeatures&) = delete; - inline SupportedInstanceFeatures(SupportedInstanceFeatures&&); - inline SupportedInstanceFeatures& operator=(SupportedInstanceFeatures&&); - inline operator const WGPUSupportedInstanceFeatures&() const noexcept; - - size_t const featureCount = {}; - InstanceFeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedInstanceFeatures& value); -}; - -struct SupportedWGSLLanguageFeatures { - inline SupportedWGSLLanguageFeatures(); - inline ~SupportedWGSLLanguageFeatures(); - SupportedWGSLLanguageFeatures(const SupportedWGSLLanguageFeatures&) = delete; - SupportedWGSLLanguageFeatures& operator=(const SupportedWGSLLanguageFeatures&) = delete; - inline SupportedWGSLLanguageFeatures(SupportedWGSLLanguageFeatures&&); - inline SupportedWGSLLanguageFeatures& operator=(SupportedWGSLLanguageFeatures&&); - inline operator const WGPUSupportedWGSLLanguageFeatures&() const noexcept; - - size_t const featureCount = {}; - WGSLLanguageFeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedWGSLLanguageFeatures& value); -}; - -struct SurfaceCapabilities { - inline SurfaceCapabilities(); - inline ~SurfaceCapabilities(); - SurfaceCapabilities(const SurfaceCapabilities&) = delete; - SurfaceCapabilities& operator=(const SurfaceCapabilities&) = delete; - inline SurfaceCapabilities(SurfaceCapabilities&&); - inline SurfaceCapabilities& operator=(SurfaceCapabilities&&); - inline operator const WGPUSurfaceCapabilities&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - TextureUsage const usages = TextureUsage::None; - size_t const formatCount = {}; - TextureFormat const * const formats = nullptr; - size_t const presentModeCount = {}; - PresentMode const * const presentModes = nullptr; - size_t const alphaModeCount = {}; - CompositeAlphaMode const * const alphaModes = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SurfaceCapabilities& value); -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceColorManagement : ChainedStruct { - inline SurfaceColorManagement(); - struct Init; - inline SurfaceColorManagement(Init&& init); - inline operator const WGPUSurfaceColorManagement&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(PredefinedColorSpace)); - alignas(kFirstMemberAlignment) PredefinedColorSpace colorSpace = {}; - ToneMappingMode toneMappingMode = {}; -}; - -struct SurfaceConfiguration { - inline operator const WGPUSurfaceConfiguration&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Device device = nullptr; - TextureFormat format = TextureFormat::Undefined; - TextureUsage usage = TextureUsage::RenderAttachment; - uint32_t width; - uint32_t height; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats = nullptr; - CompositeAlphaMode alphaMode = CompositeAlphaMode::Auto; - PresentMode presentMode = PresentMode::Undefined; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsCoreWindow : ChainedStruct { - inline SurfaceDescriptorFromWindowsCoreWindow(); - struct Init; - inline SurfaceDescriptorFromWindowsCoreWindow(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsCoreWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * coreWindow = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel : ChainedStruct { - inline SurfaceDescriptorFromWindowsUWPSwapChainPanel(); - struct Init; - inline SurfaceDescriptorFromWindowsUWPSwapChainPanel(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * swapChainPanel = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel : ChainedStruct { - inline SurfaceDescriptorFromWindowsWinUISwapChainPanel(); - struct Init; - inline SurfaceDescriptorFromWindowsWinUISwapChainPanel(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * swapChainPanel = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceAndroidNativeWindow : ChainedStruct { - inline SurfaceSourceAndroidNativeWindow(); - struct Init; - inline SurfaceSourceAndroidNativeWindow(Init&& init); - inline operator const WGPUSurfaceSourceAndroidNativeWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * window; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceMetalLayer : ChainedStruct { - inline SurfaceSourceMetalLayer(); - struct Init; - inline SurfaceSourceMetalLayer(Init&& init); - inline operator const WGPUSurfaceSourceMetalLayer&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * layer = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceWaylandSurface : ChainedStruct { - inline SurfaceSourceWaylandSurface(); - struct Init; - inline SurfaceSourceWaylandSurface(Init&& init); - inline operator const WGPUSurfaceSourceWaylandSurface&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * display = nullptr; - void * surface = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceWindowsHWND : ChainedStruct { - inline SurfaceSourceWindowsHWND(); - struct Init; - inline SurfaceSourceWindowsHWND(Init&& init); - inline operator const WGPUSurfaceSourceWindowsHWND&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * hinstance = nullptr; - void * hwnd = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceXCBWindow : ChainedStruct { - inline SurfaceSourceXCBWindow(); - struct Init; - inline SurfaceSourceXCBWindow(Init&& init); - inline operator const WGPUSurfaceSourceXCBWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * connection = nullptr; - uint32_t window; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceXlibWindow : ChainedStruct { - inline SurfaceSourceXlibWindow(); - struct Init; - inline SurfaceSourceXlibWindow(Init&& init); - inline operator const WGPUSurfaceSourceXlibWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * display = nullptr; - uint64_t window; -}; - -struct SurfaceTexture { - inline operator const WGPUSurfaceTexture&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Texture texture = nullptr; - SurfaceGetCurrentTextureStatus status = {}; -}; - -// Can be chained in BindGroupEntry -struct TexelBufferBindingEntry : ChainedStruct { - inline TexelBufferBindingEntry(); - struct Init; - inline TexelBufferBindingEntry(Init&& init); - inline operator const WGPUTexelBufferBindingEntry&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TexelBufferView)); - alignas(kFirstMemberAlignment) TexelBufferView texelBufferView = nullptr; -}; - -// Can be chained in BindGroupLayoutEntry -struct TexelBufferBindingLayout : ChainedStruct { - inline TexelBufferBindingLayout(); - struct Init; - inline TexelBufferBindingLayout(Init&& init); - inline operator const WGPUTexelBufferBindingLayout&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TexelBufferAccess)); - alignas(kFirstMemberAlignment) TexelBufferAccess access = TexelBufferAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; -}; - -struct TexelBufferViewDescriptor { - inline operator const WGPUTexelBufferViewDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureFormat format = TextureFormat::Undefined; - uint64_t offset = 0; - uint64_t size = kWholeSize; -}; - -struct TexelCopyBufferLayout { - inline operator const WGPUTexelCopyBufferLayout&() const noexcept; - - uint64_t offset = 0; - uint32_t bytesPerRow = kCopyStrideUndefined; - uint32_t rowsPerImage = kCopyStrideUndefined; -}; - -struct TextureBindingLayout { - inline operator const WGPUTextureBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureSampleType sampleType = TextureSampleType::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - Bool multisampled = false; -}; - -// Can be chained in TextureDescriptor -struct TextureBindingViewDimension : ChainedStruct { - inline TextureBindingViewDimension(); - struct Init; - inline TextureBindingViewDimension(Init&& init); - inline operator const WGPUTextureBindingViewDimension&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension)); - alignas(kFirstMemberAlignment) TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; -}; - -struct TextureComponentSwizzle { - inline operator const WGPUTextureComponentSwizzle&() const noexcept; - - ComponentSwizzle r = ComponentSwizzle::Undefined; - ComponentSwizzle g = ComponentSwizzle::Undefined; - ComponentSwizzle b = ComponentSwizzle::Undefined; - ComponentSwizzle a = ComponentSwizzle::Undefined; -}; - -struct VertexAttribute { - inline operator const WGPUVertexAttribute&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - VertexFormat format = {}; - uint64_t offset; - uint32_t shaderLocation; -}; - -// Can be chained in SamplerDescriptor -// Can be chained in TextureViewDescriptor -struct YCbCrVkDescriptor : ChainedStruct { - inline YCbCrVkDescriptor(); - struct Init; - inline YCbCrVkDescriptor(Init&& init); - inline operator const WGPUYCbCrVkDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t vkFormat = 0; - uint32_t vkYCbCrModel = 0; - uint32_t vkYCbCrRange = 0; - uint32_t vkComponentSwizzleRed = 0; - uint32_t vkComponentSwizzleGreen = 0; - uint32_t vkComponentSwizzleBlue = 0; - uint32_t vkComponentSwizzleAlpha = 0; - uint32_t vkXChromaOffset = 0; - uint32_t vkYChromaOffset = 0; - FilterMode vkChromaFilter = FilterMode::Undefined; - Bool forceExplicitReconstruction = false; - uint64_t externalFormat = 0; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesMemoryHeaps : ChainedStructOut { - inline AdapterPropertiesMemoryHeaps(); - struct Init; - inline AdapterPropertiesMemoryHeaps(Init&& init); - inline ~AdapterPropertiesMemoryHeaps(); - AdapterPropertiesMemoryHeaps(const AdapterPropertiesMemoryHeaps&) = delete; - AdapterPropertiesMemoryHeaps& operator=(const AdapterPropertiesMemoryHeaps&) = delete; - inline AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&&); - inline AdapterPropertiesMemoryHeaps& operator=(AdapterPropertiesMemoryHeaps&&); - inline operator const WGPUAdapterPropertiesMemoryHeaps&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const heapCount = {}; - MemoryHeapInfo const * const heapInfo = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterPropertiesMemoryHeaps& value); -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesSubgroupMatrixConfigs : ChainedStructOut { - inline AdapterPropertiesSubgroupMatrixConfigs(); - struct Init; - inline AdapterPropertiesSubgroupMatrixConfigs(Init&& init); - inline ~AdapterPropertiesSubgroupMatrixConfigs(); - AdapterPropertiesSubgroupMatrixConfigs(const AdapterPropertiesSubgroupMatrixConfigs&) = delete; - AdapterPropertiesSubgroupMatrixConfigs& operator=(const AdapterPropertiesSubgroupMatrixConfigs&) = delete; - inline AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs&&); - inline AdapterPropertiesSubgroupMatrixConfigs& operator=(AdapterPropertiesSubgroupMatrixConfigs&&); - inline operator const WGPUAdapterPropertiesSubgroupMatrixConfigs&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const configCount = {}; - SubgroupMatrixConfig const * const configs = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterPropertiesSubgroupMatrixConfigs& value); -}; - -struct AHardwareBufferProperties { - inline operator const WGPUAHardwareBufferProperties&() const noexcept; - - YCbCrVkDescriptor yCbCrInfo = {}; -}; - -struct BindGroupEntry { - inline operator const WGPUBindGroupEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size = kWholeSize; - Sampler sampler = nullptr; - TextureView textureView = nullptr; -}; - -struct BindGroupLayoutEntry { - inline operator const WGPUBindGroupLayoutEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - ShaderStage visibility = ShaderStage::None; - uint32_t bindingArraySize = 0; - BufferBindingLayout buffer = { nullptr, BufferBindingType::BindingNotUsed, false, 0 }; - SamplerBindingLayout sampler = { nullptr, SamplerBindingType::BindingNotUsed }; - TextureBindingLayout texture = { nullptr, TextureSampleType::BindingNotUsed, TextureViewDimension::e2D, false }; - StorageTextureBindingLayout storageTexture = { nullptr, StorageTextureAccess::BindingNotUsed, TextureFormat::Undefined, TextureViewDimension::e2D }; -}; - -struct BlendState { - inline operator const WGPUBlendState&() const noexcept; - - BlendComponent color = {}; - BlendComponent alpha = {}; -}; - -struct BufferDescriptor { - inline operator const WGPUBufferDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - BufferUsage usage = BufferUsage::None; - uint64_t size; - Bool mappedAtCreation = false; -}; - -struct CommandEncoderDescriptor { - inline operator const WGPUCommandEncoderDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct CompilationMessage { - inline operator const WGPUCompilationMessage&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView message = {}; - CompilationMessageType type = {}; - uint64_t lineNum; - uint64_t linePos; - uint64_t offset; - uint64_t length; -}; - -struct ComputePassDescriptor { - inline operator const WGPUComputePassDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PassTimestampWrites const * timestampWrites = nullptr; -}; - -struct ComputeState { - inline operator const WGPUComputeState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; -}; - -// Can be chained in DawnFormatCapabilities -struct DawnDrmFormatCapabilities : ChainedStructOut { - inline DawnDrmFormatCapabilities(); - struct Init; - inline DawnDrmFormatCapabilities(Init&& init); - inline ~DawnDrmFormatCapabilities(); - DawnDrmFormatCapabilities(const DawnDrmFormatCapabilities&) = delete; - DawnDrmFormatCapabilities& operator=(const DawnDrmFormatCapabilities&) = delete; - inline DawnDrmFormatCapabilities(DawnDrmFormatCapabilities&&); - inline DawnDrmFormatCapabilities& operator=(DawnDrmFormatCapabilities&&); - inline operator const WGPUDawnDrmFormatCapabilities&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const propertiesCount = {}; - DawnDrmFormatProperties const * const properties = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(DawnDrmFormatCapabilities& value); -}; - -struct DepthStencilState { - inline operator const WGPUDepthStencilState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureFormat format = TextureFormat::Undefined; - OptionalBool depthWriteEnabled = OptionalBool::Undefined; - CompareFunction depthCompare = CompareFunction::Undefined; - StencilFaceState stencilFront = {}; - StencilFaceState stencilBack = {}; - uint32_t stencilReadMask = 0xFFFFFFFF; - uint32_t stencilWriteMask = 0xFFFFFFFF; - int32_t depthBias = 0; - float depthBiasSlopeScale = 0.f; - float depthBiasClamp = 0.f; -}; - -struct ExternalTextureDescriptor { - inline operator const WGPUExternalTextureDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureView plane0 = nullptr; - TextureView plane1 = nullptr; - Origin2D cropOrigin = {}; - Extent2D cropSize = {}; - Extent2D apparentSize = {}; - Bool doYuvToRgbConversionOnly = false; - float const * yuvToRgbConversionMatrix = nullptr; - float const * srcTransferFunctionParameters = nullptr; - float const * dstTransferFunctionParameters = nullptr; - float const * gamutConversionMatrix = nullptr; - Bool mirrored = false; - ExternalTextureRotation rotation = ExternalTextureRotation::Rotate0Degrees; -}; - -struct FutureWaitInfo { - inline operator const WGPUFutureWaitInfo&() const noexcept; - - Future future = {}; - Bool completed = false; -}; - -struct ImageCopyExternalTexture { - inline operator const WGPUImageCopyExternalTexture&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ExternalTexture externalTexture = nullptr; - Origin3D origin = {}; - Extent2D naturalSize = {}; -}; - -struct InstanceDescriptor { - inline operator const WGPUInstanceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - size_t requiredFeatureCount = 0; - InstanceFeatureName const * requiredFeatures = nullptr; - InstanceLimits const * requiredLimits = nullptr; -}; - -struct Limits { - inline operator const WGPULimits&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - uint32_t maxTextureDimension1D = kLimitU32Undefined; - uint32_t maxTextureDimension2D = kLimitU32Undefined; - uint32_t maxTextureDimension3D = kLimitU32Undefined; - uint32_t maxTextureArrayLayers = kLimitU32Undefined; - uint32_t maxBindGroups = kLimitU32Undefined; - uint32_t maxBindGroupsPlusVertexBuffers = kLimitU32Undefined; - uint32_t maxBindingsPerBindGroup = kLimitU32Undefined; - uint32_t maxDynamicUniformBuffersPerPipelineLayout = kLimitU32Undefined; - uint32_t maxDynamicStorageBuffersPerPipelineLayout = kLimitU32Undefined; - uint32_t maxSampledTexturesPerShaderStage = kLimitU32Undefined; - uint32_t maxSamplersPerShaderStage = kLimitU32Undefined; - uint32_t maxStorageBuffersPerShaderStage = kLimitU32Undefined; - uint32_t maxStorageTexturesPerShaderStage = kLimitU32Undefined; - uint32_t maxUniformBuffersPerShaderStage = kLimitU32Undefined; - uint64_t maxUniformBufferBindingSize = kLimitU64Undefined; - uint64_t maxStorageBufferBindingSize = kLimitU64Undefined; - uint32_t minUniformBufferOffsetAlignment = kLimitU32Undefined; - uint32_t minStorageBufferOffsetAlignment = kLimitU32Undefined; - uint32_t maxVertexBuffers = kLimitU32Undefined; - uint64_t maxBufferSize = kLimitU64Undefined; - uint32_t maxVertexAttributes = kLimitU32Undefined; - uint32_t maxVertexBufferArrayStride = kLimitU32Undefined; - uint32_t maxInterStageShaderVariables = kLimitU32Undefined; - uint32_t maxColorAttachments = kLimitU32Undefined; - uint32_t maxColorAttachmentBytesPerSample = kLimitU32Undefined; - uint32_t maxComputeWorkgroupStorageSize = kLimitU32Undefined; - uint32_t maxComputeInvocationsPerWorkgroup = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeX = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeY = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeZ = kLimitU32Undefined; - uint32_t maxComputeWorkgroupsPerDimension = kLimitU32Undefined; - uint32_t maxImmediateSize = kLimitU32Undefined; -}; - -// Can be chained in PipelineLayoutDescriptor -struct PipelineLayoutPixelLocalStorage : ChainedStruct { - inline PipelineLayoutPixelLocalStorage(); - struct Init; - inline PipelineLayoutPixelLocalStorage(Init&& init); - inline operator const WGPUPipelineLayoutPixelLocalStorage&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - PipelineLayoutStorageAttachment const * storageAttachments = nullptr; -}; - -struct RenderPassColorAttachment { - inline operator const WGPURenderPassColorAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureView view = nullptr; - uint32_t depthSlice = kDepthSliceUndefined; - TextureView resolveTarget = nullptr; - LoadOp loadOp = LoadOp::Undefined; - StoreOp storeOp = StoreOp::Undefined; - Color clearValue = {}; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassRenderAreaRect : ChainedStruct { - inline RenderPassRenderAreaRect(); - struct Init; - inline RenderPassRenderAreaRect(Init&& init); - inline operator const WGPURenderPassRenderAreaRect&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Origin2D)); - alignas(kFirstMemberAlignment) Origin2D origin = {}; - Extent2D size = {}; -}; - -struct RenderPassStorageAttachment { - inline operator const WGPURenderPassStorageAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - TextureView storage = nullptr; - LoadOp loadOp = LoadOp::Undefined; - StoreOp storeOp = StoreOp::Undefined; - Color clearValue = {}; -}; - -struct RequestAdapterOptions { - inline operator const WGPURequestAdapterOptions&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - FeatureLevel featureLevel = FeatureLevel::Undefined; - PowerPreference powerPreference = PowerPreference::Undefined; - Bool forceFallbackAdapter = false; - BackendType backendType = BackendType::Undefined; - Surface compatibleSurface = nullptr; -}; - -struct SamplerDescriptor { - inline operator const WGPUSamplerDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - AddressMode addressModeU = AddressMode::Undefined; - AddressMode addressModeV = AddressMode::Undefined; - AddressMode addressModeW = AddressMode::Undefined; - FilterMode magFilter = FilterMode::Undefined; - FilterMode minFilter = FilterMode::Undefined; - MipmapFilterMode mipmapFilter = MipmapFilterMode::Undefined; - float lodMinClamp = 0.f; - float lodMaxClamp = 32.f; - CompareFunction compare = CompareFunction::Undefined; - uint16_t maxAnisotropy = 1; -}; - -struct ShaderModuleDescriptor { - inline operator const WGPUShaderModuleDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedBufferMemoryDescriptor { - inline operator const WGPUSharedBufferMemoryDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedFenceDescriptor { - inline operator const WGPUSharedFenceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedFenceExportInfo { - inline operator const WGPUSharedFenceExportInfo&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - SharedFenceType type = {}; -}; - -// Can be chained in SharedTextureMemoryProperties -struct SharedTextureMemoryAHardwareBufferProperties : ChainedStructOut { - inline SharedTextureMemoryAHardwareBufferProperties(); - struct Init; - inline SharedTextureMemoryAHardwareBufferProperties(Init&& init); - inline operator const WGPUSharedTextureMemoryAHardwareBufferProperties&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(YCbCrVkDescriptor)); - alignas(kFirstMemberAlignment) YCbCrVkDescriptor yCbCrInfo = {}; -}; - -struct SharedTextureMemoryBeginAccessDescriptor { - inline operator const WGPUSharedTextureMemoryBeginAccessDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Bool concurrentRead; - Bool initialized; - size_t fenceCount; - SharedFence const * fences = nullptr; - size_t signaledValueCount = 0; - uint64_t const * signaledValues = nullptr; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryDmaBufDescriptor : ChainedStruct { - inline SharedTextureMemoryDmaBufDescriptor(); - struct Init; - inline SharedTextureMemoryDmaBufDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryDmaBufDescriptor&() const noexcept; - - 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 = nullptr; -}; - -// Can be chained in SharedTextureMemoryEndAccessState -struct SharedTextureMemoryMetalEndAccessState : ChainedStructOut { - inline SharedTextureMemoryMetalEndAccessState(); - struct Init; - inline SharedTextureMemoryMetalEndAccessState(Init&& init); - inline operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(Future)); - alignas(kFirstMemberAlignment) Future commandsScheduledFuture = {}; -}; - -struct SurfaceDescriptor { - inline operator const WGPUSurfaceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct TexelCopyBufferInfo { - inline operator const WGPUTexelCopyBufferInfo&() const noexcept; - - TexelCopyBufferLayout layout = {}; - Buffer buffer = nullptr; -}; - -struct TexelCopyTextureInfo { - inline operator const WGPUTexelCopyTextureInfo&() const noexcept; - - Texture texture = nullptr; - uint32_t mipLevel = 0; - Origin3D origin = {}; - TextureAspect aspect = TextureAspect::Undefined; -}; - -// Can be chained in TextureViewDescriptor -struct TextureComponentSwizzleDescriptor : ChainedStruct { - inline TextureComponentSwizzleDescriptor(); - struct Init; - inline TextureComponentSwizzleDescriptor(Init&& init); - inline operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureComponentSwizzle)); - alignas(kFirstMemberAlignment) TextureComponentSwizzle swizzle = {}; -}; - -struct TextureDescriptor { - inline operator const WGPUTextureDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureUsage usage = TextureUsage::None; - TextureDimension dimension = TextureDimension::Undefined; - Extent3D size = {}; - TextureFormat format = TextureFormat::Undefined; - uint32_t mipLevelCount = 1; - uint32_t sampleCount = 1; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats = nullptr; -}; - -struct VertexBufferLayout { - inline operator const WGPUVertexBufferLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - VertexStepMode stepMode = VertexStepMode::Undefined; - uint64_t arrayStride; - size_t attributeCount; - VertexAttribute const * attributes = nullptr; -}; - -struct AdapterInfo { - inline AdapterInfo(); - inline ~AdapterInfo(); - AdapterInfo(const AdapterInfo&) = delete; - AdapterInfo& operator=(const AdapterInfo&) = delete; - inline AdapterInfo(AdapterInfo&&); - inline AdapterInfo& operator=(AdapterInfo&&); - inline operator const WGPUAdapterInfo&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - StringView const vendor = {}; - StringView const architecture = {}; - StringView const device = {}; - StringView const description = {}; - BackendType const backendType = BackendType::Undefined; - AdapterType const adapterType = {}; - uint32_t const vendorID = {}; - uint32_t const deviceID = {}; - uint32_t const subgroupMinSize = {}; - uint32_t const subgroupMaxSize = {}; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterInfo& value); -}; - -struct BindGroupDescriptor { - inline operator const WGPUBindGroupDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - BindGroupLayout layout = nullptr; - size_t entryCount = 0; - BindGroupEntry const * entries = nullptr; -}; - -struct BindGroupLayoutDescriptor { - inline operator const WGPUBindGroupLayoutDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t entryCount = 0; - BindGroupLayoutEntry const * entries = nullptr; -}; - -struct ColorTargetState { - inline operator const WGPUColorTargetState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureFormat format = TextureFormat::Undefined; - BlendState const * blend = nullptr; - ColorWriteMask writeMask = ColorWriteMask::All; -}; - -struct CompilationInfo { - inline operator const WGPUCompilationInfo&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - size_t messageCount; - CompilationMessage const * messages = nullptr; -}; - -struct ComputePipelineDescriptor { - inline operator const WGPUComputePipelineDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PipelineLayout layout = nullptr; - ComputeState compute = {}; -}; - -struct DawnFormatCapabilities { - inline operator const WGPUDawnFormatCapabilities&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; -}; - -namespace detail { -struct DeviceDescriptor { - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t requiredFeatureCount = 0; - FeatureName const * requiredFeatures = nullptr; - Limits const * requiredLimits = nullptr; - QueueDescriptor defaultQueue = {}; - WGPUDeviceLostCallbackInfo deviceLostCallbackInfo = WGPU_DEVICE_LOST_CALLBACK_INFO_INIT; - WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo = WGPU_UNCAPTURED_ERROR_CALLBACK_INFO_INIT; -}; -} // namespace detail -struct DeviceDescriptor : protected detail::DeviceDescriptor { - inline DeviceDescriptor(); - struct Init; - inline DeviceDescriptor(Init&& init); - inline operator const WGPUDeviceDescriptor&() const noexcept; - - using detail::DeviceDescriptor::nextInChain; - using detail::DeviceDescriptor::label; - using detail::DeviceDescriptor::requiredFeatureCount; - using detail::DeviceDescriptor::requiredFeatures; - using detail::DeviceDescriptor::requiredLimits; - using detail::DeviceDescriptor::defaultQueue; - - template - void SetDeviceLostCallback(CallbackMode callbackMode, F callback, T userdata); - template - void SetDeviceLostCallback(CallbackMode callbackMode, F callback); - template - void SetUncapturedErrorCallback(F callback, T userdata); - template - void SetUncapturedErrorCallback(F callback); -}; - -struct PipelineLayoutDescriptor { - inline operator const WGPUPipelineLayoutDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t bindGroupLayoutCount; - BindGroupLayout const * bindGroupLayouts = nullptr; - uint32_t immediateSize = 0; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassPixelLocalStorage : ChainedStruct { - inline RenderPassPixelLocalStorage(); - struct Init; - inline RenderPassPixelLocalStorage(Init&& init); - inline operator const WGPURenderPassPixelLocalStorage&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - RenderPassStorageAttachment const * storageAttachments = nullptr; -}; - -struct SharedTextureMemoryDescriptor { - inline operator const WGPUSharedTextureMemoryDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedTextureMemoryEndAccessState { - inline SharedTextureMemoryEndAccessState(); - inline ~SharedTextureMemoryEndAccessState(); - SharedTextureMemoryEndAccessState(const SharedTextureMemoryEndAccessState&) = delete; - SharedTextureMemoryEndAccessState& operator=(const SharedTextureMemoryEndAccessState&) = delete; - inline SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&&); - inline SharedTextureMemoryEndAccessState& operator=(SharedTextureMemoryEndAccessState&&); - inline operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Bool const initialized = {}; - size_t const fenceCount = {}; - SharedFence const * const fences = nullptr; - size_t const signaledValueCount = 0; - uint64_t const * const signaledValues = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SharedTextureMemoryEndAccessState& value); -}; - -struct SharedTextureMemoryProperties { - inline operator const WGPUSharedTextureMemoryProperties&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - TextureUsage usage = TextureUsage::None; - Extent3D size = {}; - TextureFormat format = TextureFormat::Undefined; -}; - -struct TextureViewDescriptor { - inline operator const WGPUTextureViewDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension dimension = TextureViewDimension::Undefined; - uint32_t baseMipLevel = 0; - uint32_t mipLevelCount = kMipLevelCountUndefined; - uint32_t baseArrayLayer = 0; - uint32_t arrayLayerCount = kArrayLayerCountUndefined; - TextureAspect aspect = TextureAspect::Undefined; - TextureUsage usage = TextureUsage::None; -}; - -struct VertexState { - inline operator const WGPUVertexState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; - size_t bufferCount = 0; - VertexBufferLayout const * buffers = nullptr; -}; - -struct FragmentState { - inline operator const WGPUFragmentState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; - size_t targetCount; - ColorTargetState const * targets = nullptr; -}; - -struct RenderPassDescriptor { - inline operator const WGPURenderPassDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t colorAttachmentCount; - RenderPassColorAttachment const * colorAttachments = nullptr; - RenderPassDepthStencilAttachment const * depthStencilAttachment = nullptr; - QuerySet occlusionQuerySet = nullptr; - PassTimestampWrites const * timestampWrites = nullptr; -}; - -struct RenderPipelineDescriptor { - inline operator const WGPURenderPipelineDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PipelineLayout layout = nullptr; - VertexState vertex = {}; - PrimitiveState primitive = {}; - DepthStencilState const * depthStencil = nullptr; - MultisampleState multisample = {}; - FragmentState const * fragment = nullptr; -}; - - -// Callback info handling is generated and/or custom implemented here to convert the types between C and C++. -namespace detail { -struct Untyped {}; - -// The current interface of CppFTraits exposes the following values: -// - CppFTraits::capturing: true if the callback is a capturing callback (i.e. a lambda that -// captures its environment). -// - CppFTraits::PtrT: The C++ callback function pointer type. -// - CppFTraits::ReturnT: The return type of the C++ callback function pointer. -// - CppFTraits::BaseArgsTuple: A tuple of the C++ arguments minus the user specified typed -// parameter. -// -// Implementation notes: -// - The |Untyped| struct is only used to differentiate whether |T| is a user specified type -// in which case we need to strip the type from the callback arguments for speecialization -// deduction. -template -struct CppFTraitsImpl; -// Specialization for raw function pointers. -template -struct CppFTraitsImpl { - using PtrT = R(*)(CppArgs...); - using ReturnT = R; - static constexpr bool capturing = false; - - static constexpr size_t NumCppArgs = sizeof...(CppArgs); - using BaseArgsTuple = typename decltype([](std::index_sequence) { - return std::type_identity>...>>{}; - }(std::make_index_sequence ? NumCppArgs : NumCppArgs - 1>{}) - )::type; -}; -// Specialization for member function pointers (lambdas); -template -struct CppFTraitsImpl { - using PtrT = R(*)(CppArgs...); - using ReturnT = R; - static constexpr bool capturing = !std::is_convertible_v; - - static constexpr size_t NumCppArgs = sizeof...(CppArgs); - using BaseArgsTuple = typename decltype([](std::index_sequence) { - return std::type_identity>...>>{}; - }(std::make_index_sequence ? NumCppArgs : NumCppArgs - 1>{}) - )::type; -}; -template -struct CppFTraits : CppFTraitsImpl {}; -template -struct CppFTraits : - CppFTraitsImpl {}; - -// CArgConverter are specialization structs that specialize a conversion from a C CallbackInfo's -// callback argument types to a set of valid C++ types. These specializations provide us a way to -// support additional C++ callback types, i.e. converting raw pointers to more C++ friendly -// structures when applicable. -template -struct CArgConverter; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUMapAsyncStatus status, WGPUStringView message) { - return std::make_tuple(static_cast(status), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo) { - return std::make_tuple(static_cast(status), reinterpret_cast(compilationInfo)); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, WGPUStringView message) { - return std::make_tuple(static_cast(status), ComputePipeline::Acquire(pipeline), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, WGPUStringView message) { - return std::make_tuple(static_cast(status), RenderPipeline::Acquire(pipeline), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPULoggingType type, WGPUStringView message) { - return std::make_tuple(static_cast(type), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUPopErrorScopeStatus status, WGPUErrorType type, WGPUStringView message) { - return std::make_tuple(static_cast(status), static_cast(type), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUQueueWorkDoneStatus status, WGPUStringView message) { - return std::make_tuple(static_cast(status), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView message) { - return std::make_tuple(static_cast(status), Adapter::Acquire(adapter), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView message) { - return std::make_tuple(static_cast(status), Device::Acquire(device), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUDevice const* device, - WGPUDeviceLostReason reason, - WGPUStringView message) { - return std::make_tuple(std::cref(*reinterpret_cast(device)), - static_cast(reason), message); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUDevice const* device, WGPUErrorType type, WGPUStringView message) { - return std::make_tuple(std::cref(*reinterpret_cast(device)), - static_cast(type), message); - } -}; -template <> -struct CArgConverter, std::span>> { - using Result = std::tuple, std::span>; - static Result Convert(size_t keySize, uint8_t const* key, size_t valueSize, uint8_t* value) { - return std::make_tuple( - std::span(reinterpret_cast(key), keySize), - std::span(reinterpret_cast(value), valueSize) - ); - } -}; -template <> -struct CArgConverter, std::span>> { - using Result = std::tuple, std::span>; - static Result Convert(size_t keySize, uint8_t const* key, size_t valueSize, uint8_t const* value) { - return std::make_tuple( - std::span(reinterpret_cast(key), keySize), - std::span(reinterpret_cast(value), valueSize) - ); - } -}; - -// The CallbackHelper struct implements the static functions needed to convert the base C callbacks -// into the user provided C++ callbacks. More than anything, it handles converting the real C -// callback arguments (i.e. not the userdata pointers we use internally) to C++ arguments, and -// casts the userdata pointers appropriately to ensure that everything is typed. -template -struct CallbackHelperImpl; -template -struct CallbackHelperImpl, std::index_sequence> { - // Implementation for callbacks without an additional typed argument. We support capturing - // lambdas if users can specify a callback mode in this case and make an allocation. - static R Call(std::tuple_element_t>... cArgs, - void* callbackParam, void*) { - using CppFTraits = CppFTraits; - using Converter = CArgConverter; - - if constexpr (CppFTraits::capturing) { - std::unique_ptr callback(reinterpret_cast(callbackParam)); - return std::apply(*callback, Converter::Convert(cArgs...)); - } else { - auto callback = reinterpret_cast(callbackParam); - return std::apply(callback, Converter::Convert(cArgs...)); - } - } - - // Implementation for callbacks where the user specifies an additional typed argument. We do - // not support capturing lambdas in this case since the user is already providing a typed - // argument and would make more sense for any other state to be capturing by that argument - // instead. - template - static R Call(std::tuple_element_t>... cArgs, - void* callbackParam, void* userdataParam) { - using CppFTraits = CppFTraits; - using Converter = CArgConverter; - - auto callback = reinterpret_cast(callbackParam); - auto param = std::make_tuple(static_cast(userdataParam)); - return std::apply(callback, std::tuple_cat(Converter::Convert(cArgs...), param)); - } -}; -template -struct CallbackHelper; -template -struct CallbackHelper { - static constexpr size_t NumCArgs = sizeof...(CArgs); - using CArgsTuple = std::tuple; - static_assert(NumCArgs >= 2, "C Function pointers must have two void* trailing arguments."); - static_assert( - std::is_same_v, void*>, - "C Function pointer's last argument must be void*." - ); - static_assert( - std::is_same_v, void*>, - "C Function pointer's second to last argument must be void*." - ); - - using Impl = CallbackHelperImpl>; - static R Call(CArgs... args) { - return Impl::Call(std::forward(args)...); - } - template - static R Call(CArgs... args) { - return Impl::template Call(std::forward(args)...); - } -}; - -// The CallbackInfoHelper provides a utility to create a C CallbackInfo struct type from a C++ -// callback. This allows us to de-duplicates the logic used for WebGPU structs that have -// CallbackInfo members and WebGPU API functions that return a Future. -template -struct CallbackInfoHelper { - static CInfoT Create(F lambda) { - CInfoT info = {}; - if constexpr (CppFTraits::capturing) { - if constexpr (requires(CInfoT x) { x.mode; }) { - // If we have a mode argument, then the callback is guaranteed to be called only - // once so we can support it by moving it and making an allocation for it. - std::unique_ptr alloc = std::make_unique(std::move(lambda)); - info.userdata1 = reinterpret_cast(alloc.release()); - } else { - // MSVC <=19.39 doesn't support static_assert(false) and this was fixed in later C++ - // standards https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html - constexpr bool kAlwaysFalse = sizeof(F) == 0; - static_assert( - kAlwaysFalse, "capturing lambdas aren't supported for repeatable callbacks" - ); - } - } else { - // Otherwise, if the lambda is not capturing, that means we can refer to it as a - // pointer directly. - info.userdata1 = reinterpret_cast(+lambda); - } - info.callback = CallbackHelper::Call; - info.userdata2 = nullptr; - return info; - } - - template - requires (!CppFTraits::capturing) - static CInfoT Create(F lambda, T userdata) { - CInfoT info = {}; - info.callback = CallbackHelper::template Call; - info.userdata1 = reinterpret_cast(+lambda); - info.userdata2 = userdata; - return info; - } -}; - -} // namespace detail - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported -#pragma GCC diagnostic ignored "-Winvalid-offsetof" -#endif - -// AdapterPropertiesD3D implementation -AdapterPropertiesD3D::AdapterPropertiesD3D() -: ChainedStructOut { nullptr, SType::AdapterPropertiesD3D } {} -struct AdapterPropertiesD3D::Init { - ChainedStructOut * nextInChain; - uint32_t shaderModel; -}; -AdapterPropertiesD3D::AdapterPropertiesD3D(AdapterPropertiesD3D::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesD3D }, - shaderModel(std::move(init.shaderModel)) {} - -AdapterPropertiesD3D::operator const WGPUAdapterPropertiesD3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesD3D) == sizeof(WGPUAdapterPropertiesD3D), "sizeof mismatch for AdapterPropertiesD3D"); -static_assert(alignof(AdapterPropertiesD3D) == alignof(WGPUAdapterPropertiesD3D), "alignof mismatch for AdapterPropertiesD3D"); -static_assert(offsetof(AdapterPropertiesD3D, shaderModel) == offsetof(WGPUAdapterPropertiesD3D, shaderModel), - "offsetof mismatch for AdapterPropertiesD3D::shaderModel"); - -// AdapterPropertiesDrm implementation -AdapterPropertiesDrm::AdapterPropertiesDrm() -: ChainedStructOut { nullptr, SType::AdapterPropertiesDrm } {} -struct AdapterPropertiesDrm::Init { - ChainedStructOut * nextInChain; - Bool hasPrimary = false; - Bool hasRender = false; - uint64_t primaryMajor = 0; - uint64_t primaryMinor = 0; - uint64_t renderMajor = 0; - uint64_t renderMinor = 0; -}; -AdapterPropertiesDrm::AdapterPropertiesDrm(AdapterPropertiesDrm::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesDrm }, - hasPrimary(std::move(init.hasPrimary)), - hasRender(std::move(init.hasRender)), - primaryMajor(std::move(init.primaryMajor)), - primaryMinor(std::move(init.primaryMinor)), - renderMajor(std::move(init.renderMajor)), - renderMinor(std::move(init.renderMinor)) {} - -AdapterPropertiesDrm::operator const WGPUAdapterPropertiesDrm&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesDrm) == sizeof(WGPUAdapterPropertiesDrm), "sizeof mismatch for AdapterPropertiesDrm"); -static_assert(alignof(AdapterPropertiesDrm) == alignof(WGPUAdapterPropertiesDrm), "alignof mismatch for AdapterPropertiesDrm"); -static_assert(offsetof(AdapterPropertiesDrm, hasPrimary) == offsetof(WGPUAdapterPropertiesDrm, hasPrimary), - "offsetof mismatch for AdapterPropertiesDrm::hasPrimary"); -static_assert(offsetof(AdapterPropertiesDrm, hasRender) == offsetof(WGPUAdapterPropertiesDrm, hasRender), - "offsetof mismatch for AdapterPropertiesDrm::hasRender"); -static_assert(offsetof(AdapterPropertiesDrm, primaryMajor) == offsetof(WGPUAdapterPropertiesDrm, primaryMajor), - "offsetof mismatch for AdapterPropertiesDrm::primaryMajor"); -static_assert(offsetof(AdapterPropertiesDrm, primaryMinor) == offsetof(WGPUAdapterPropertiesDrm, primaryMinor), - "offsetof mismatch for AdapterPropertiesDrm::primaryMinor"); -static_assert(offsetof(AdapterPropertiesDrm, renderMajor) == offsetof(WGPUAdapterPropertiesDrm, renderMajor), - "offsetof mismatch for AdapterPropertiesDrm::renderMajor"); -static_assert(offsetof(AdapterPropertiesDrm, renderMinor) == offsetof(WGPUAdapterPropertiesDrm, renderMinor), - "offsetof mismatch for AdapterPropertiesDrm::renderMinor"); - -// AdapterPropertiesVk implementation -AdapterPropertiesVk::AdapterPropertiesVk() -: ChainedStructOut { nullptr, SType::AdapterPropertiesVk } {} -struct AdapterPropertiesVk::Init { - ChainedStructOut * nextInChain; - uint32_t driverVersion; -}; -AdapterPropertiesVk::AdapterPropertiesVk(AdapterPropertiesVk::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesVk }, - driverVersion(std::move(init.driverVersion)) {} - -AdapterPropertiesVk::operator const WGPUAdapterPropertiesVk&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesVk) == sizeof(WGPUAdapterPropertiesVk), "sizeof mismatch for AdapterPropertiesVk"); -static_assert(alignof(AdapterPropertiesVk) == alignof(WGPUAdapterPropertiesVk), "alignof mismatch for AdapterPropertiesVk"); -static_assert(offsetof(AdapterPropertiesVk, driverVersion) == offsetof(WGPUAdapterPropertiesVk, driverVersion), - "offsetof mismatch for AdapterPropertiesVk::driverVersion"); - -// AdapterPropertiesWGPU implementation -AdapterPropertiesWGPU::AdapterPropertiesWGPU() -: ChainedStructOut { nullptr, SType::AdapterPropertiesWGPU } {} -struct AdapterPropertiesWGPU::Init { - ChainedStructOut * nextInChain; - BackendType backendType = BackendType::Undefined; -}; -AdapterPropertiesWGPU::AdapterPropertiesWGPU(AdapterPropertiesWGPU::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesWGPU }, - backendType(std::move(init.backendType)) {} - -AdapterPropertiesWGPU::operator const WGPUAdapterPropertiesWGPU&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesWGPU) == sizeof(WGPUAdapterPropertiesWGPU), "sizeof mismatch for AdapterPropertiesWGPU"); -static_assert(alignof(AdapterPropertiesWGPU) == alignof(WGPUAdapterPropertiesWGPU), "alignof mismatch for AdapterPropertiesWGPU"); -static_assert(offsetof(AdapterPropertiesWGPU, backendType) == offsetof(WGPUAdapterPropertiesWGPU, backendType), - "offsetof mismatch for AdapterPropertiesWGPU::backendType"); - -// BindingResource implementation - -BindingResource::operator const WGPUBindingResource&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindingResource) == sizeof(WGPUBindingResource), "sizeof mismatch for BindingResource"); -static_assert(alignof(BindingResource) == alignof(WGPUBindingResource), "alignof mismatch for BindingResource"); -static_assert(offsetof(BindingResource, nextInChain) == offsetof(WGPUBindingResource, nextInChain), - "offsetof mismatch for BindingResource::nextInChain"); -static_assert(offsetof(BindingResource, buffer) == offsetof(WGPUBindingResource, buffer), - "offsetof mismatch for BindingResource::buffer"); -static_assert(offsetof(BindingResource, offset) == offsetof(WGPUBindingResource, offset), - "offsetof mismatch for BindingResource::offset"); -static_assert(offsetof(BindingResource, size) == offsetof(WGPUBindingResource, size), - "offsetof mismatch for BindingResource::size"); -static_assert(offsetof(BindingResource, sampler) == offsetof(WGPUBindingResource, sampler), - "offsetof mismatch for BindingResource::sampler"); -static_assert(offsetof(BindingResource, textureView) == offsetof(WGPUBindingResource, textureView), - "offsetof mismatch for BindingResource::textureView"); - -// BlendComponent implementation - -BlendComponent::operator const WGPUBlendComponent&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BlendComponent) == sizeof(WGPUBlendComponent), "sizeof mismatch for BlendComponent"); -static_assert(alignof(BlendComponent) == alignof(WGPUBlendComponent), "alignof mismatch for BlendComponent"); -static_assert(offsetof(BlendComponent, operation) == offsetof(WGPUBlendComponent, operation), - "offsetof mismatch for BlendComponent::operation"); -static_assert(offsetof(BlendComponent, srcFactor) == offsetof(WGPUBlendComponent, srcFactor), - "offsetof mismatch for BlendComponent::srcFactor"); -static_assert(offsetof(BlendComponent, dstFactor) == offsetof(WGPUBlendComponent, dstFactor), - "offsetof mismatch for BlendComponent::dstFactor"); - -// BufferBindingLayout implementation - -BufferBindingLayout::operator const WGPUBufferBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferBindingLayout) == sizeof(WGPUBufferBindingLayout), "sizeof mismatch for BufferBindingLayout"); -static_assert(alignof(BufferBindingLayout) == alignof(WGPUBufferBindingLayout), "alignof mismatch for BufferBindingLayout"); -static_assert(offsetof(BufferBindingLayout, nextInChain) == offsetof(WGPUBufferBindingLayout, nextInChain), - "offsetof mismatch for BufferBindingLayout::nextInChain"); -static_assert(offsetof(BufferBindingLayout, type) == offsetof(WGPUBufferBindingLayout, type), - "offsetof mismatch for BufferBindingLayout::type"); -static_assert(offsetof(BufferBindingLayout, hasDynamicOffset) == offsetof(WGPUBufferBindingLayout, hasDynamicOffset), - "offsetof mismatch for BufferBindingLayout::hasDynamicOffset"); -static_assert(offsetof(BufferBindingLayout, minBindingSize) == offsetof(WGPUBufferBindingLayout, minBindingSize), - "offsetof mismatch for BufferBindingLayout::minBindingSize"); - -// BufferHostMappedPointer implementation -BufferHostMappedPointer::BufferHostMappedPointer() -: ChainedStruct { nullptr, SType::BufferHostMappedPointer } {} -struct BufferHostMappedPointer::Init { - ChainedStruct * const nextInChain; - void * pointer; - Callback disposeCallback; - void * userdata; -}; -BufferHostMappedPointer::BufferHostMappedPointer(BufferHostMappedPointer::Init&& init) : - ChainedStruct { init.nextInChain, SType::BufferHostMappedPointer }, - pointer(std::move(init.pointer)), - disposeCallback(std::move(init.disposeCallback)), - userdata(std::move(init.userdata)) {} - -BufferHostMappedPointer::operator const WGPUBufferHostMappedPointer&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferHostMappedPointer) == sizeof(WGPUBufferHostMappedPointer), "sizeof mismatch for BufferHostMappedPointer"); -static_assert(alignof(BufferHostMappedPointer) == alignof(WGPUBufferHostMappedPointer), "alignof mismatch for BufferHostMappedPointer"); -static_assert(offsetof(BufferHostMappedPointer, pointer) == offsetof(WGPUBufferHostMappedPointer, pointer), - "offsetof mismatch for BufferHostMappedPointer::pointer"); -static_assert(offsetof(BufferHostMappedPointer, disposeCallback) == offsetof(WGPUBufferHostMappedPointer, disposeCallback), - "offsetof mismatch for BufferHostMappedPointer::disposeCallback"); -static_assert(offsetof(BufferHostMappedPointer, userdata) == offsetof(WGPUBufferHostMappedPointer, userdata), - "offsetof mismatch for BufferHostMappedPointer::userdata"); - -// Color implementation - -Color::operator const WGPUColor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Color) == sizeof(WGPUColor), "sizeof mismatch for Color"); -static_assert(alignof(Color) == alignof(WGPUColor), "alignof mismatch for Color"); -static_assert(offsetof(Color, r) == offsetof(WGPUColor, r), - "offsetof mismatch for Color::r"); -static_assert(offsetof(Color, g) == offsetof(WGPUColor, g), - "offsetof mismatch for Color::g"); -static_assert(offsetof(Color, b) == offsetof(WGPUColor, b), - "offsetof mismatch for Color::b"); -static_assert(offsetof(Color, a) == offsetof(WGPUColor, a), - "offsetof mismatch for Color::a"); - -// ColorSpaceDawn implementation - -ColorSpaceDawn::operator const WGPUColorSpaceDawn&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorSpaceDawn) == sizeof(WGPUColorSpaceDawn), "sizeof mismatch for ColorSpaceDawn"); -static_assert(alignof(ColorSpaceDawn) == alignof(WGPUColorSpaceDawn), "alignof mismatch for ColorSpaceDawn"); -static_assert(offsetof(ColorSpaceDawn, nextInChain) == offsetof(WGPUColorSpaceDawn, nextInChain), - "offsetof mismatch for ColorSpaceDawn::nextInChain"); -static_assert(offsetof(ColorSpaceDawn, primaries) == offsetof(WGPUColorSpaceDawn, primaries), - "offsetof mismatch for ColorSpaceDawn::primaries"); -static_assert(offsetof(ColorSpaceDawn, transfer) == offsetof(WGPUColorSpaceDawn, transfer), - "offsetof mismatch for ColorSpaceDawn::transfer"); -static_assert(offsetof(ColorSpaceDawn, yCbCrRange) == offsetof(WGPUColorSpaceDawn, yCbCrRange), - "offsetof mismatch for ColorSpaceDawn::yCbCrRange"); -static_assert(offsetof(ColorSpaceDawn, yCbCrMatrix) == offsetof(WGPUColorSpaceDawn, yCbCrMatrix), - "offsetof mismatch for ColorSpaceDawn::yCbCrMatrix"); - -// ColorTargetStateExpandResolveTextureDawn implementation -ColorTargetStateExpandResolveTextureDawn::ColorTargetStateExpandResolveTextureDawn() -: ChainedStruct { nullptr, SType::ColorTargetStateExpandResolveTextureDawn } {} -struct ColorTargetStateExpandResolveTextureDawn::Init { - ChainedStruct * const nextInChain; - Bool enabled = false; -}; -ColorTargetStateExpandResolveTextureDawn::ColorTargetStateExpandResolveTextureDawn(ColorTargetStateExpandResolveTextureDawn::Init&& init) : - ChainedStruct { init.nextInChain, SType::ColorTargetStateExpandResolveTextureDawn }, - enabled(std::move(init.enabled)) {} - -ColorTargetStateExpandResolveTextureDawn::operator const WGPUColorTargetStateExpandResolveTextureDawn&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorTargetStateExpandResolveTextureDawn) == sizeof(WGPUColorTargetStateExpandResolveTextureDawn), "sizeof mismatch for ColorTargetStateExpandResolveTextureDawn"); -static_assert(alignof(ColorTargetStateExpandResolveTextureDawn) == alignof(WGPUColorTargetStateExpandResolveTextureDawn), "alignof mismatch for ColorTargetStateExpandResolveTextureDawn"); -static_assert(offsetof(ColorTargetStateExpandResolveTextureDawn, enabled) == offsetof(WGPUColorTargetStateExpandResolveTextureDawn, enabled), - "offsetof mismatch for ColorTargetStateExpandResolveTextureDawn::enabled"); - -// CommandBufferDescriptor implementation - -CommandBufferDescriptor::operator const WGPUCommandBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CommandBufferDescriptor) == sizeof(WGPUCommandBufferDescriptor), "sizeof mismatch for CommandBufferDescriptor"); -static_assert(alignof(CommandBufferDescriptor) == alignof(WGPUCommandBufferDescriptor), "alignof mismatch for CommandBufferDescriptor"); -static_assert(offsetof(CommandBufferDescriptor, nextInChain) == offsetof(WGPUCommandBufferDescriptor, nextInChain), - "offsetof mismatch for CommandBufferDescriptor::nextInChain"); -static_assert(offsetof(CommandBufferDescriptor, label) == offsetof(WGPUCommandBufferDescriptor, label), - "offsetof mismatch for CommandBufferDescriptor::label"); - -// CompatibilityModeLimits implementation -CompatibilityModeLimits::CompatibilityModeLimits() -: ChainedStructOut { nullptr, SType::CompatibilityModeLimits } {} -struct CompatibilityModeLimits::Init { - ChainedStructOut * nextInChain; - uint32_t maxStorageBuffersInVertexStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInVertexStage = kLimitU32Undefined; - uint32_t maxStorageBuffersInFragmentStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInFragmentStage = kLimitU32Undefined; -}; -CompatibilityModeLimits::CompatibilityModeLimits(CompatibilityModeLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::CompatibilityModeLimits }, - maxStorageBuffersInVertexStage(std::move(init.maxStorageBuffersInVertexStage)), - maxStorageTexturesInVertexStage(std::move(init.maxStorageTexturesInVertexStage)), - maxStorageBuffersInFragmentStage(std::move(init.maxStorageBuffersInFragmentStage)), - maxStorageTexturesInFragmentStage(std::move(init.maxStorageTexturesInFragmentStage)) {} - -CompatibilityModeLimits::operator const WGPUCompatibilityModeLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompatibilityModeLimits) == sizeof(WGPUCompatibilityModeLimits), "sizeof mismatch for CompatibilityModeLimits"); -static_assert(alignof(CompatibilityModeLimits) == alignof(WGPUCompatibilityModeLimits), "alignof mismatch for CompatibilityModeLimits"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageBuffersInVertexStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageBuffersInVertexStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageBuffersInVertexStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageTexturesInVertexStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageTexturesInVertexStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageTexturesInVertexStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageBuffersInFragmentStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageBuffersInFragmentStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageBuffersInFragmentStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageTexturesInFragmentStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageTexturesInFragmentStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageTexturesInFragmentStage"); - -// ConstantEntry implementation - -ConstantEntry::operator const WGPUConstantEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ConstantEntry) == sizeof(WGPUConstantEntry), "sizeof mismatch for ConstantEntry"); -static_assert(alignof(ConstantEntry) == alignof(WGPUConstantEntry), "alignof mismatch for ConstantEntry"); -static_assert(offsetof(ConstantEntry, nextInChain) == offsetof(WGPUConstantEntry, nextInChain), - "offsetof mismatch for ConstantEntry::nextInChain"); -static_assert(offsetof(ConstantEntry, key) == offsetof(WGPUConstantEntry, key), - "offsetof mismatch for ConstantEntry::key"); -static_assert(offsetof(ConstantEntry, value) == offsetof(WGPUConstantEntry, value), - "offsetof mismatch for ConstantEntry::value"); - -// CopyTextureForBrowserOptions implementation - -CopyTextureForBrowserOptions::operator const WGPUCopyTextureForBrowserOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CopyTextureForBrowserOptions) == sizeof(WGPUCopyTextureForBrowserOptions), "sizeof mismatch for CopyTextureForBrowserOptions"); -static_assert(alignof(CopyTextureForBrowserOptions) == alignof(WGPUCopyTextureForBrowserOptions), "alignof mismatch for CopyTextureForBrowserOptions"); -static_assert(offsetof(CopyTextureForBrowserOptions, nextInChain) == offsetof(WGPUCopyTextureForBrowserOptions, nextInChain), - "offsetof mismatch for CopyTextureForBrowserOptions::nextInChain"); -static_assert(offsetof(CopyTextureForBrowserOptions, flipY) == offsetof(WGPUCopyTextureForBrowserOptions, flipY), - "offsetof mismatch for CopyTextureForBrowserOptions::flipY"); -static_assert(offsetof(CopyTextureForBrowserOptions, needsColorSpaceConversion) == offsetof(WGPUCopyTextureForBrowserOptions, needsColorSpaceConversion), - "offsetof mismatch for CopyTextureForBrowserOptions::needsColorSpaceConversion"); -static_assert(offsetof(CopyTextureForBrowserOptions, srcAlphaMode) == offsetof(WGPUCopyTextureForBrowserOptions, srcAlphaMode), - "offsetof mismatch for CopyTextureForBrowserOptions::srcAlphaMode"); -static_assert(offsetof(CopyTextureForBrowserOptions, srcTransferFunctionParameters) == offsetof(WGPUCopyTextureForBrowserOptions, srcTransferFunctionParameters), - "offsetof mismatch for CopyTextureForBrowserOptions::srcTransferFunctionParameters"); -static_assert(offsetof(CopyTextureForBrowserOptions, conversionMatrix) == offsetof(WGPUCopyTextureForBrowserOptions, conversionMatrix), - "offsetof mismatch for CopyTextureForBrowserOptions::conversionMatrix"); -static_assert(offsetof(CopyTextureForBrowserOptions, dstTransferFunctionParameters) == offsetof(WGPUCopyTextureForBrowserOptions, dstTransferFunctionParameters), - "offsetof mismatch for CopyTextureForBrowserOptions::dstTransferFunctionParameters"); -static_assert(offsetof(CopyTextureForBrowserOptions, dstAlphaMode) == offsetof(WGPUCopyTextureForBrowserOptions, dstAlphaMode), - "offsetof mismatch for CopyTextureForBrowserOptions::dstAlphaMode"); -static_assert(offsetof(CopyTextureForBrowserOptions, internalUsage) == offsetof(WGPUCopyTextureForBrowserOptions, internalUsage), - "offsetof mismatch for CopyTextureForBrowserOptions::internalUsage"); - -// DawnAdapterPropertiesPowerPreference implementation -DawnAdapterPropertiesPowerPreference::DawnAdapterPropertiesPowerPreference() -: ChainedStructOut { nullptr, SType::DawnAdapterPropertiesPowerPreference } {} -struct DawnAdapterPropertiesPowerPreference::Init { - ChainedStructOut * nextInChain; - PowerPreference powerPreference = PowerPreference::Undefined; -}; -DawnAdapterPropertiesPowerPreference::DawnAdapterPropertiesPowerPreference(DawnAdapterPropertiesPowerPreference::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnAdapterPropertiesPowerPreference }, - powerPreference(std::move(init.powerPreference)) {} - -DawnAdapterPropertiesPowerPreference::operator const WGPUDawnAdapterPropertiesPowerPreference&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnAdapterPropertiesPowerPreference) == sizeof(WGPUDawnAdapterPropertiesPowerPreference), "sizeof mismatch for DawnAdapterPropertiesPowerPreference"); -static_assert(alignof(DawnAdapterPropertiesPowerPreference) == alignof(WGPUDawnAdapterPropertiesPowerPreference), "alignof mismatch for DawnAdapterPropertiesPowerPreference"); -static_assert(offsetof(DawnAdapterPropertiesPowerPreference, powerPreference) == offsetof(WGPUDawnAdapterPropertiesPowerPreference, powerPreference), - "offsetof mismatch for DawnAdapterPropertiesPowerPreference::powerPreference"); - -// DawnBufferDescriptorErrorInfoFromWireClient implementation -DawnBufferDescriptorErrorInfoFromWireClient::DawnBufferDescriptorErrorInfoFromWireClient() -: ChainedStruct { nullptr, SType::DawnBufferDescriptorErrorInfoFromWireClient } {} -struct DawnBufferDescriptorErrorInfoFromWireClient::Init { - ChainedStruct * const nextInChain; - Bool outOfMemory = false; -}; -DawnBufferDescriptorErrorInfoFromWireClient::DawnBufferDescriptorErrorInfoFromWireClient(DawnBufferDescriptorErrorInfoFromWireClient::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnBufferDescriptorErrorInfoFromWireClient }, - outOfMemory(std::move(init.outOfMemory)) {} - -DawnBufferDescriptorErrorInfoFromWireClient::operator const WGPUDawnBufferDescriptorErrorInfoFromWireClient&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnBufferDescriptorErrorInfoFromWireClient) == sizeof(WGPUDawnBufferDescriptorErrorInfoFromWireClient), "sizeof mismatch for DawnBufferDescriptorErrorInfoFromWireClient"); -static_assert(alignof(DawnBufferDescriptorErrorInfoFromWireClient) == alignof(WGPUDawnBufferDescriptorErrorInfoFromWireClient), "alignof mismatch for DawnBufferDescriptorErrorInfoFromWireClient"); -static_assert(offsetof(DawnBufferDescriptorErrorInfoFromWireClient, outOfMemory) == offsetof(WGPUDawnBufferDescriptorErrorInfoFromWireClient, outOfMemory), - "offsetof mismatch for DawnBufferDescriptorErrorInfoFromWireClient::outOfMemory"); - -// DawnCacheDeviceDescriptor implementation -DawnCacheDeviceDescriptor::DawnCacheDeviceDescriptor() -: ChainedStruct { nullptr, SType::DawnCacheDeviceDescriptor } {} -struct DawnCacheDeviceDescriptor::Init { - ChainedStruct * const nextInChain; - StringView isolationKey = {}; - DawnLoadCacheDataFunction loadDataFunction = nullptr; - DawnStoreCacheDataFunction storeDataFunction = nullptr; - void * functionUserdata = nullptr; -}; -DawnCacheDeviceDescriptor::DawnCacheDeviceDescriptor(DawnCacheDeviceDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnCacheDeviceDescriptor }, - detail::DawnCacheDeviceDescriptor { - std::move(init.isolationKey), - std::move(init.loadDataFunction), - std::move(init.storeDataFunction), - std::move(init.functionUserdata), - } {} -template -void DawnCacheDeviceDescriptor::SetDawnLoadCacheDataCallback(F callback, T userdata) { - static_assert(offsetof(DawnCacheDeviceDescriptor, dawnLoadCacheDataCallbackInfo) == offsetof(WGPUDawnCacheDeviceDescriptor, dawnLoadCacheDataCallbackInfo), - "offsetof mismatch for DawnCacheDeviceDescriptor::dawnLoadCacheDataCallbackInfo"); - - assert(dawnLoadCacheDataCallbackInfo.callback == nullptr); - dawnLoadCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DawnCacheDeviceDescriptor::SetDawnLoadCacheDataCallback(F callback) { - assert(dawnLoadCacheDataCallbackInfo.callback == nullptr); - dawnLoadCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} -template -void DawnCacheDeviceDescriptor::SetDawnStoreCacheDataCallback(F callback, T userdata) { - static_assert(offsetof(DawnCacheDeviceDescriptor, dawnStoreCacheDataCallbackInfo) == offsetof(WGPUDawnCacheDeviceDescriptor, dawnStoreCacheDataCallbackInfo), - "offsetof mismatch for DawnCacheDeviceDescriptor::dawnStoreCacheDataCallbackInfo"); - - assert(dawnStoreCacheDataCallbackInfo.callback == nullptr); - dawnStoreCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DawnCacheDeviceDescriptor::SetDawnStoreCacheDataCallback(F callback) { - assert(dawnStoreCacheDataCallbackInfo.callback == nullptr); - dawnStoreCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} - -DawnCacheDeviceDescriptor::operator const WGPUDawnCacheDeviceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnCacheDeviceDescriptor) == sizeof(WGPUDawnCacheDeviceDescriptor), "sizeof mismatch for DawnCacheDeviceDescriptor"); -static_assert(alignof(DawnCacheDeviceDescriptor) == alignof(WGPUDawnCacheDeviceDescriptor), "alignof mismatch for DawnCacheDeviceDescriptor"); -static_assert(offsetof(DawnCacheDeviceDescriptor, isolationKey) == offsetof(WGPUDawnCacheDeviceDescriptor, isolationKey), - "offsetof mismatch for DawnCacheDeviceDescriptor::isolationKey"); -static_assert(offsetof(DawnCacheDeviceDescriptor, loadDataFunction) == offsetof(WGPUDawnCacheDeviceDescriptor, loadDataFunction), - "offsetof mismatch for DawnCacheDeviceDescriptor::loadDataFunction"); -static_assert(offsetof(DawnCacheDeviceDescriptor, storeDataFunction) == offsetof(WGPUDawnCacheDeviceDescriptor, storeDataFunction), - "offsetof mismatch for DawnCacheDeviceDescriptor::storeDataFunction"); -static_assert(offsetof(DawnCacheDeviceDescriptor, functionUserdata) == offsetof(WGPUDawnCacheDeviceDescriptor, functionUserdata), - "offsetof mismatch for DawnCacheDeviceDescriptor::functionUserdata"); - -// DawnCompilationMessageUtf16 implementation -DawnCompilationMessageUtf16::DawnCompilationMessageUtf16() -: ChainedStruct { nullptr, SType::DawnCompilationMessageUtf16 } {} -struct DawnCompilationMessageUtf16::Init { - ChainedStruct * const nextInChain; - uint64_t linePos; - uint64_t offset; - uint64_t length; -}; -DawnCompilationMessageUtf16::DawnCompilationMessageUtf16(DawnCompilationMessageUtf16::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnCompilationMessageUtf16 }, - linePos(std::move(init.linePos)), - offset(std::move(init.offset)), - length(std::move(init.length)) {} - -DawnCompilationMessageUtf16::operator const WGPUDawnCompilationMessageUtf16&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnCompilationMessageUtf16) == sizeof(WGPUDawnCompilationMessageUtf16), "sizeof mismatch for DawnCompilationMessageUtf16"); -static_assert(alignof(DawnCompilationMessageUtf16) == alignof(WGPUDawnCompilationMessageUtf16), "alignof mismatch for DawnCompilationMessageUtf16"); -static_assert(offsetof(DawnCompilationMessageUtf16, linePos) == offsetof(WGPUDawnCompilationMessageUtf16, linePos), - "offsetof mismatch for DawnCompilationMessageUtf16::linePos"); -static_assert(offsetof(DawnCompilationMessageUtf16, offset) == offsetof(WGPUDawnCompilationMessageUtf16, offset), - "offsetof mismatch for DawnCompilationMessageUtf16::offset"); -static_assert(offsetof(DawnCompilationMessageUtf16, length) == offsetof(WGPUDawnCompilationMessageUtf16, length), - "offsetof mismatch for DawnCompilationMessageUtf16::length"); - -// DawnConsumeAdapterDescriptor implementation -DawnConsumeAdapterDescriptor::DawnConsumeAdapterDescriptor() -: ChainedStruct { nullptr, SType::DawnConsumeAdapterDescriptor } {} -struct DawnConsumeAdapterDescriptor::Init { - ChainedStruct * const nextInChain; - Bool consumeAdapter = false; -}; -DawnConsumeAdapterDescriptor::DawnConsumeAdapterDescriptor(DawnConsumeAdapterDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnConsumeAdapterDescriptor }, - consumeAdapter(std::move(init.consumeAdapter)) {} - -DawnConsumeAdapterDescriptor::operator const WGPUDawnConsumeAdapterDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnConsumeAdapterDescriptor) == sizeof(WGPUDawnConsumeAdapterDescriptor), "sizeof mismatch for DawnConsumeAdapterDescriptor"); -static_assert(alignof(DawnConsumeAdapterDescriptor) == alignof(WGPUDawnConsumeAdapterDescriptor), "alignof mismatch for DawnConsumeAdapterDescriptor"); -static_assert(offsetof(DawnConsumeAdapterDescriptor, consumeAdapter) == offsetof(WGPUDawnConsumeAdapterDescriptor, consumeAdapter), - "offsetof mismatch for DawnConsumeAdapterDescriptor::consumeAdapter"); - -// DawnDeviceAllocatorControl implementation -DawnDeviceAllocatorControl::DawnDeviceAllocatorControl() -: ChainedStruct { nullptr, SType::DawnDeviceAllocatorControl } {} -struct DawnDeviceAllocatorControl::Init { - ChainedStruct * const nextInChain; - size_t allocatorHeapBlockSize = 0; -}; -DawnDeviceAllocatorControl::DawnDeviceAllocatorControl(DawnDeviceAllocatorControl::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnDeviceAllocatorControl }, - allocatorHeapBlockSize(std::move(init.allocatorHeapBlockSize)) {} - -DawnDeviceAllocatorControl::operator const WGPUDawnDeviceAllocatorControl&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDeviceAllocatorControl) == sizeof(WGPUDawnDeviceAllocatorControl), "sizeof mismatch for DawnDeviceAllocatorControl"); -static_assert(alignof(DawnDeviceAllocatorControl) == alignof(WGPUDawnDeviceAllocatorControl), "alignof mismatch for DawnDeviceAllocatorControl"); -static_assert(offsetof(DawnDeviceAllocatorControl, allocatorHeapBlockSize) == offsetof(WGPUDawnDeviceAllocatorControl, allocatorHeapBlockSize), - "offsetof mismatch for DawnDeviceAllocatorControl::allocatorHeapBlockSize"); - -// DawnDrmFormatProperties implementation - -DawnDrmFormatProperties::operator const WGPUDawnDrmFormatProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDrmFormatProperties) == sizeof(WGPUDawnDrmFormatProperties), "sizeof mismatch for DawnDrmFormatProperties"); -static_assert(alignof(DawnDrmFormatProperties) == alignof(WGPUDawnDrmFormatProperties), "alignof mismatch for DawnDrmFormatProperties"); -static_assert(offsetof(DawnDrmFormatProperties, modifier) == offsetof(WGPUDawnDrmFormatProperties, modifier), - "offsetof mismatch for DawnDrmFormatProperties::modifier"); -static_assert(offsetof(DawnDrmFormatProperties, modifierPlaneCount) == offsetof(WGPUDawnDrmFormatProperties, modifierPlaneCount), - "offsetof mismatch for DawnDrmFormatProperties::modifierPlaneCount"); - -// DawnEncoderInternalUsageDescriptor implementation -DawnEncoderInternalUsageDescriptor::DawnEncoderInternalUsageDescriptor() -: ChainedStruct { nullptr, SType::DawnEncoderInternalUsageDescriptor } {} -struct DawnEncoderInternalUsageDescriptor::Init { - ChainedStruct * const nextInChain; - Bool useInternalUsages = false; -}; -DawnEncoderInternalUsageDescriptor::DawnEncoderInternalUsageDescriptor(DawnEncoderInternalUsageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnEncoderInternalUsageDescriptor }, - useInternalUsages(std::move(init.useInternalUsages)) {} - -DawnEncoderInternalUsageDescriptor::operator const WGPUDawnEncoderInternalUsageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnEncoderInternalUsageDescriptor) == sizeof(WGPUDawnEncoderInternalUsageDescriptor), "sizeof mismatch for DawnEncoderInternalUsageDescriptor"); -static_assert(alignof(DawnEncoderInternalUsageDescriptor) == alignof(WGPUDawnEncoderInternalUsageDescriptor), "alignof mismatch for DawnEncoderInternalUsageDescriptor"); -static_assert(offsetof(DawnEncoderInternalUsageDescriptor, useInternalUsages) == offsetof(WGPUDawnEncoderInternalUsageDescriptor, useInternalUsages), - "offsetof mismatch for DawnEncoderInternalUsageDescriptor::useInternalUsages"); - -// DawnFakeBufferOOMForTesting implementation -DawnFakeBufferOOMForTesting::DawnFakeBufferOOMForTesting() -: ChainedStruct { nullptr, SType::DawnFakeBufferOOMForTesting } {} -struct DawnFakeBufferOOMForTesting::Init { - ChainedStruct * const nextInChain; - Bool fakeOOMAtWireClientMap; - Bool fakeOOMAtNativeMap; - Bool fakeOOMAtDevice; -}; -DawnFakeBufferOOMForTesting::DawnFakeBufferOOMForTesting(DawnFakeBufferOOMForTesting::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnFakeBufferOOMForTesting }, - fakeOOMAtWireClientMap(std::move(init.fakeOOMAtWireClientMap)), - fakeOOMAtNativeMap(std::move(init.fakeOOMAtNativeMap)), - fakeOOMAtDevice(std::move(init.fakeOOMAtDevice)) {} - -DawnFakeBufferOOMForTesting::operator const WGPUDawnFakeBufferOOMForTesting&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFakeBufferOOMForTesting) == sizeof(WGPUDawnFakeBufferOOMForTesting), "sizeof mismatch for DawnFakeBufferOOMForTesting"); -static_assert(alignof(DawnFakeBufferOOMForTesting) == alignof(WGPUDawnFakeBufferOOMForTesting), "alignof mismatch for DawnFakeBufferOOMForTesting"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtWireClientMap) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtWireClientMap), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtWireClientMap"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtNativeMap) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtNativeMap), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtNativeMap"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtDevice) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtDevice), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtDevice"); - -// DawnFakeDeviceInitializeErrorForTesting implementation -DawnFakeDeviceInitializeErrorForTesting::DawnFakeDeviceInitializeErrorForTesting() -: ChainedStruct { nullptr, SType::DawnFakeDeviceInitializeErrorForTesting } {} -struct DawnFakeDeviceInitializeErrorForTesting::Init { - ChainedStruct * const nextInChain; -}; -DawnFakeDeviceInitializeErrorForTesting::DawnFakeDeviceInitializeErrorForTesting(DawnFakeDeviceInitializeErrorForTesting::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnFakeDeviceInitializeErrorForTesting } {} - -DawnFakeDeviceInitializeErrorForTesting::operator const WGPUDawnFakeDeviceInitializeErrorForTesting&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFakeDeviceInitializeErrorForTesting) == sizeof(WGPUDawnFakeDeviceInitializeErrorForTesting), "sizeof mismatch for DawnFakeDeviceInitializeErrorForTesting"); -static_assert(alignof(DawnFakeDeviceInitializeErrorForTesting) == alignof(WGPUDawnFakeDeviceInitializeErrorForTesting), "alignof mismatch for DawnFakeDeviceInitializeErrorForTesting"); - -// DawnHostMappedPointerLimits implementation -DawnHostMappedPointerLimits::DawnHostMappedPointerLimits() -: ChainedStructOut { nullptr, SType::DawnHostMappedPointerLimits } {} -struct DawnHostMappedPointerLimits::Init { - ChainedStructOut * nextInChain; - uint32_t hostMappedPointerAlignment = kLimitU32Undefined; -}; -DawnHostMappedPointerLimits::DawnHostMappedPointerLimits(DawnHostMappedPointerLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnHostMappedPointerLimits }, - hostMappedPointerAlignment(std::move(init.hostMappedPointerAlignment)) {} - -DawnHostMappedPointerLimits::operator const WGPUDawnHostMappedPointerLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnHostMappedPointerLimits) == sizeof(WGPUDawnHostMappedPointerLimits), "sizeof mismatch for DawnHostMappedPointerLimits"); -static_assert(alignof(DawnHostMappedPointerLimits) == alignof(WGPUDawnHostMappedPointerLimits), "alignof mismatch for DawnHostMappedPointerLimits"); -static_assert(offsetof(DawnHostMappedPointerLimits, hostMappedPointerAlignment) == offsetof(WGPUDawnHostMappedPointerLimits, hostMappedPointerAlignment), - "offsetof mismatch for DawnHostMappedPointerLimits::hostMappedPointerAlignment"); - -// DawnInjectedInvalidSType implementation -DawnInjectedInvalidSType::DawnInjectedInvalidSType() -: ChainedStruct { nullptr, SType::DawnInjectedInvalidSType } {} -struct DawnInjectedInvalidSType::Init { - ChainedStruct * const nextInChain; - SType invalidSType = {}; -}; -DawnInjectedInvalidSType::DawnInjectedInvalidSType(DawnInjectedInvalidSType::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnInjectedInvalidSType }, - invalidSType(std::move(init.invalidSType)) {} - -DawnInjectedInvalidSType::operator const WGPUDawnInjectedInvalidSType&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnInjectedInvalidSType) == sizeof(WGPUDawnInjectedInvalidSType), "sizeof mismatch for DawnInjectedInvalidSType"); -static_assert(alignof(DawnInjectedInvalidSType) == alignof(WGPUDawnInjectedInvalidSType), "alignof mismatch for DawnInjectedInvalidSType"); -static_assert(offsetof(DawnInjectedInvalidSType, invalidSType) == offsetof(WGPUDawnInjectedInvalidSType, invalidSType), - "offsetof mismatch for DawnInjectedInvalidSType::invalidSType"); - -// DawnRenderPassSampleCount implementation -DawnRenderPassSampleCount::DawnRenderPassSampleCount() -: ChainedStruct { nullptr, SType::DawnRenderPassSampleCount } {} -struct DawnRenderPassSampleCount::Init { - ChainedStruct * const nextInChain; - uint32_t sampleCount = 1; -}; -DawnRenderPassSampleCount::DawnRenderPassSampleCount(DawnRenderPassSampleCount::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnRenderPassSampleCount }, - sampleCount(std::move(init.sampleCount)) {} - -DawnRenderPassSampleCount::operator const WGPUDawnRenderPassSampleCount&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnRenderPassSampleCount) == sizeof(WGPUDawnRenderPassSampleCount), "sizeof mismatch for DawnRenderPassSampleCount"); -static_assert(alignof(DawnRenderPassSampleCount) == alignof(WGPUDawnRenderPassSampleCount), "alignof mismatch for DawnRenderPassSampleCount"); -static_assert(offsetof(DawnRenderPassSampleCount, sampleCount) == offsetof(WGPUDawnRenderPassSampleCount, sampleCount), - "offsetof mismatch for DawnRenderPassSampleCount::sampleCount"); - -// DawnShaderModuleSPIRVOptionsDescriptor implementation -DawnShaderModuleSPIRVOptionsDescriptor::DawnShaderModuleSPIRVOptionsDescriptor() -: ChainedStruct { nullptr, SType::DawnShaderModuleSPIRVOptionsDescriptor } {} -struct DawnShaderModuleSPIRVOptionsDescriptor::Init { - ChainedStruct * const nextInChain; - Bool allowNonUniformDerivatives = false; -}; -DawnShaderModuleSPIRVOptionsDescriptor::DawnShaderModuleSPIRVOptionsDescriptor(DawnShaderModuleSPIRVOptionsDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnShaderModuleSPIRVOptionsDescriptor }, - allowNonUniformDerivatives(std::move(init.allowNonUniformDerivatives)) {} - -DawnShaderModuleSPIRVOptionsDescriptor::operator const WGPUDawnShaderModuleSPIRVOptionsDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnShaderModuleSPIRVOptionsDescriptor) == sizeof(WGPUDawnShaderModuleSPIRVOptionsDescriptor), "sizeof mismatch for DawnShaderModuleSPIRVOptionsDescriptor"); -static_assert(alignof(DawnShaderModuleSPIRVOptionsDescriptor) == alignof(WGPUDawnShaderModuleSPIRVOptionsDescriptor), "alignof mismatch for DawnShaderModuleSPIRVOptionsDescriptor"); -static_assert(offsetof(DawnShaderModuleSPIRVOptionsDescriptor, allowNonUniformDerivatives) == offsetof(WGPUDawnShaderModuleSPIRVOptionsDescriptor, allowNonUniformDerivatives), - "offsetof mismatch for DawnShaderModuleSPIRVOptionsDescriptor::allowNonUniformDerivatives"); - -// DawnTexelCopyBufferRowAlignmentLimits implementation -DawnTexelCopyBufferRowAlignmentLimits::DawnTexelCopyBufferRowAlignmentLimits() -: ChainedStructOut { nullptr, SType::DawnTexelCopyBufferRowAlignmentLimits } {} -struct DawnTexelCopyBufferRowAlignmentLimits::Init { - ChainedStructOut * nextInChain; - uint32_t minTexelCopyBufferRowAlignment = kLimitU32Undefined; -}; -DawnTexelCopyBufferRowAlignmentLimits::DawnTexelCopyBufferRowAlignmentLimits(DawnTexelCopyBufferRowAlignmentLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnTexelCopyBufferRowAlignmentLimits }, - minTexelCopyBufferRowAlignment(std::move(init.minTexelCopyBufferRowAlignment)) {} - -DawnTexelCopyBufferRowAlignmentLimits::operator const WGPUDawnTexelCopyBufferRowAlignmentLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTexelCopyBufferRowAlignmentLimits) == sizeof(WGPUDawnTexelCopyBufferRowAlignmentLimits), "sizeof mismatch for DawnTexelCopyBufferRowAlignmentLimits"); -static_assert(alignof(DawnTexelCopyBufferRowAlignmentLimits) == alignof(WGPUDawnTexelCopyBufferRowAlignmentLimits), "alignof mismatch for DawnTexelCopyBufferRowAlignmentLimits"); -static_assert(offsetof(DawnTexelCopyBufferRowAlignmentLimits, minTexelCopyBufferRowAlignment) == offsetof(WGPUDawnTexelCopyBufferRowAlignmentLimits, minTexelCopyBufferRowAlignment), - "offsetof mismatch for DawnTexelCopyBufferRowAlignmentLimits::minTexelCopyBufferRowAlignment"); - -// DawnTextureInternalUsageDescriptor implementation -DawnTextureInternalUsageDescriptor::DawnTextureInternalUsageDescriptor() -: ChainedStruct { nullptr, SType::DawnTextureInternalUsageDescriptor } {} -struct DawnTextureInternalUsageDescriptor::Init { - ChainedStruct * const nextInChain; - TextureUsage internalUsage = TextureUsage::None; -}; -DawnTextureInternalUsageDescriptor::DawnTextureInternalUsageDescriptor(DawnTextureInternalUsageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnTextureInternalUsageDescriptor }, - internalUsage(std::move(init.internalUsage)) {} - -DawnTextureInternalUsageDescriptor::operator const WGPUDawnTextureInternalUsageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTextureInternalUsageDescriptor) == sizeof(WGPUDawnTextureInternalUsageDescriptor), "sizeof mismatch for DawnTextureInternalUsageDescriptor"); -static_assert(alignof(DawnTextureInternalUsageDescriptor) == alignof(WGPUDawnTextureInternalUsageDescriptor), "alignof mismatch for DawnTextureInternalUsageDescriptor"); -static_assert(offsetof(DawnTextureInternalUsageDescriptor, internalUsage) == offsetof(WGPUDawnTextureInternalUsageDescriptor, internalUsage), - "offsetof mismatch for DawnTextureInternalUsageDescriptor::internalUsage"); - -// DawnTogglesDescriptor implementation -DawnTogglesDescriptor::DawnTogglesDescriptor() -: ChainedStruct { nullptr, SType::DawnTogglesDescriptor } {} -struct DawnTogglesDescriptor::Init { - ChainedStruct * const nextInChain; - size_t enabledToggleCount = 0; - const char* const * enabledToggles = nullptr; - size_t disabledToggleCount = 0; - const char* const * disabledToggles = nullptr; -}; -DawnTogglesDescriptor::DawnTogglesDescriptor(DawnTogglesDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnTogglesDescriptor }, - enabledToggleCount(std::move(init.enabledToggleCount)), - enabledToggles(std::move(init.enabledToggles)), - disabledToggleCount(std::move(init.disabledToggleCount)), - disabledToggles(std::move(init.disabledToggles)) {} - -DawnTogglesDescriptor::operator const WGPUDawnTogglesDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTogglesDescriptor) == sizeof(WGPUDawnTogglesDescriptor), "sizeof mismatch for DawnTogglesDescriptor"); -static_assert(alignof(DawnTogglesDescriptor) == alignof(WGPUDawnTogglesDescriptor), "alignof mismatch for DawnTogglesDescriptor"); -static_assert(offsetof(DawnTogglesDescriptor, enabledToggleCount) == offsetof(WGPUDawnTogglesDescriptor, enabledToggleCount), - "offsetof mismatch for DawnTogglesDescriptor::enabledToggleCount"); -static_assert(offsetof(DawnTogglesDescriptor, enabledToggles) == offsetof(WGPUDawnTogglesDescriptor, enabledToggles), - "offsetof mismatch for DawnTogglesDescriptor::enabledToggles"); -static_assert(offsetof(DawnTogglesDescriptor, disabledToggleCount) == offsetof(WGPUDawnTogglesDescriptor, disabledToggleCount), - "offsetof mismatch for DawnTogglesDescriptor::disabledToggleCount"); -static_assert(offsetof(DawnTogglesDescriptor, disabledToggles) == offsetof(WGPUDawnTogglesDescriptor, disabledToggles), - "offsetof mismatch for DawnTogglesDescriptor::disabledToggles"); - -// DawnWGSLBlocklist implementation -DawnWGSLBlocklist::DawnWGSLBlocklist() -: ChainedStruct { nullptr, SType::DawnWGSLBlocklist } {} -struct DawnWGSLBlocklist::Init { - ChainedStruct * const nextInChain; - size_t blocklistedFeatureCount = 0; - const char* const * blocklistedFeatures = nullptr; -}; -DawnWGSLBlocklist::DawnWGSLBlocklist(DawnWGSLBlocklist::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnWGSLBlocklist }, - blocklistedFeatureCount(std::move(init.blocklistedFeatureCount)), - blocklistedFeatures(std::move(init.blocklistedFeatures)) {} - -DawnWGSLBlocklist::operator const WGPUDawnWGSLBlocklist&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnWGSLBlocklist) == sizeof(WGPUDawnWGSLBlocklist), "sizeof mismatch for DawnWGSLBlocklist"); -static_assert(alignof(DawnWGSLBlocklist) == alignof(WGPUDawnWGSLBlocklist), "alignof mismatch for DawnWGSLBlocklist"); -static_assert(offsetof(DawnWGSLBlocklist, blocklistedFeatureCount) == offsetof(WGPUDawnWGSLBlocklist, blocklistedFeatureCount), - "offsetof mismatch for DawnWGSLBlocklist::blocklistedFeatureCount"); -static_assert(offsetof(DawnWGSLBlocklist, blocklistedFeatures) == offsetof(WGPUDawnWGSLBlocklist, blocklistedFeatures), - "offsetof mismatch for DawnWGSLBlocklist::blocklistedFeatures"); - -// DawnWireWGSLControl implementation -DawnWireWGSLControl::DawnWireWGSLControl() -: ChainedStruct { nullptr, SType::DawnWireWGSLControl } {} -struct DawnWireWGSLControl::Init { - ChainedStruct * const nextInChain; - Bool enableExperimental = false; - Bool enableUnsafe = false; - Bool enableTesting = false; -}; -DawnWireWGSLControl::DawnWireWGSLControl(DawnWireWGSLControl::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnWireWGSLControl }, - enableExperimental(std::move(init.enableExperimental)), - enableUnsafe(std::move(init.enableUnsafe)), - enableTesting(std::move(init.enableTesting)) {} - -DawnWireWGSLControl::operator const WGPUDawnWireWGSLControl&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnWireWGSLControl) == sizeof(WGPUDawnWireWGSLControl), "sizeof mismatch for DawnWireWGSLControl"); -static_assert(alignof(DawnWireWGSLControl) == alignof(WGPUDawnWireWGSLControl), "alignof mismatch for DawnWireWGSLControl"); -static_assert(offsetof(DawnWireWGSLControl, enableExperimental) == offsetof(WGPUDawnWireWGSLControl, enableExperimental), - "offsetof mismatch for DawnWireWGSLControl::enableExperimental"); -static_assert(offsetof(DawnWireWGSLControl, enableUnsafe) == offsetof(WGPUDawnWireWGSLControl, enableUnsafe), - "offsetof mismatch for DawnWireWGSLControl::enableUnsafe"); -static_assert(offsetof(DawnWireWGSLControl, enableTesting) == offsetof(WGPUDawnWireWGSLControl, enableTesting), - "offsetof mismatch for DawnWireWGSLControl::enableTesting"); - -// EmscriptenSurfaceSourceCanvasHTMLSelector implementation -EmscriptenSurfaceSourceCanvasHTMLSelector::EmscriptenSurfaceSourceCanvasHTMLSelector() -: ChainedStruct { nullptr, SType::EmscriptenSurfaceSourceCanvasHTMLSelector } {} -struct EmscriptenSurfaceSourceCanvasHTMLSelector::Init { - ChainedStruct * const nextInChain; - StringView selector = {}; -}; -EmscriptenSurfaceSourceCanvasHTMLSelector::EmscriptenSurfaceSourceCanvasHTMLSelector(EmscriptenSurfaceSourceCanvasHTMLSelector::Init&& init) : - ChainedStruct { init.nextInChain, SType::EmscriptenSurfaceSourceCanvasHTMLSelector }, - selector(std::move(init.selector)) {} - -EmscriptenSurfaceSourceCanvasHTMLSelector::operator const WGPUEmscriptenSurfaceSourceCanvasHTMLSelector&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(EmscriptenSurfaceSourceCanvasHTMLSelector) == sizeof(WGPUEmscriptenSurfaceSourceCanvasHTMLSelector), "sizeof mismatch for EmscriptenSurfaceSourceCanvasHTMLSelector"); -static_assert(alignof(EmscriptenSurfaceSourceCanvasHTMLSelector) == alignof(WGPUEmscriptenSurfaceSourceCanvasHTMLSelector), "alignof mismatch for EmscriptenSurfaceSourceCanvasHTMLSelector"); -static_assert(offsetof(EmscriptenSurfaceSourceCanvasHTMLSelector, selector) == offsetof(WGPUEmscriptenSurfaceSourceCanvasHTMLSelector, selector), - "offsetof mismatch for EmscriptenSurfaceSourceCanvasHTMLSelector::selector"); - -// Extent2D implementation - -Extent2D::operator const WGPUExtent2D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Extent2D) == sizeof(WGPUExtent2D), "sizeof mismatch for Extent2D"); -static_assert(alignof(Extent2D) == alignof(WGPUExtent2D), "alignof mismatch for Extent2D"); -static_assert(offsetof(Extent2D, width) == offsetof(WGPUExtent2D, width), - "offsetof mismatch for Extent2D::width"); -static_assert(offsetof(Extent2D, height) == offsetof(WGPUExtent2D, height), - "offsetof mismatch for Extent2D::height"); - -// Extent3D implementation - -Extent3D::operator const WGPUExtent3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Extent3D) == sizeof(WGPUExtent3D), "sizeof mismatch for Extent3D"); -static_assert(alignof(Extent3D) == alignof(WGPUExtent3D), "alignof mismatch for Extent3D"); -static_assert(offsetof(Extent3D, width) == offsetof(WGPUExtent3D, width), - "offsetof mismatch for Extent3D::width"); -static_assert(offsetof(Extent3D, height) == offsetof(WGPUExtent3D, height), - "offsetof mismatch for Extent3D::height"); -static_assert(offsetof(Extent3D, depthOrArrayLayers) == offsetof(WGPUExtent3D, depthOrArrayLayers), - "offsetof mismatch for Extent3D::depthOrArrayLayers"); - -// ExternalTextureBindingEntry implementation -ExternalTextureBindingEntry::ExternalTextureBindingEntry() -: ChainedStruct { nullptr, SType::ExternalTextureBindingEntry } {} -struct ExternalTextureBindingEntry::Init { - ChainedStruct * const nextInChain; - ExternalTexture externalTexture = nullptr; -}; -ExternalTextureBindingEntry::ExternalTextureBindingEntry(ExternalTextureBindingEntry::Init&& init) : - ChainedStruct { init.nextInChain, SType::ExternalTextureBindingEntry }, - externalTexture(std::move(init.externalTexture)) {} - -ExternalTextureBindingEntry::operator const WGPUExternalTextureBindingEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureBindingEntry) == sizeof(WGPUExternalTextureBindingEntry), "sizeof mismatch for ExternalTextureBindingEntry"); -static_assert(alignof(ExternalTextureBindingEntry) == alignof(WGPUExternalTextureBindingEntry), "alignof mismatch for ExternalTextureBindingEntry"); -static_assert(offsetof(ExternalTextureBindingEntry, externalTexture) == offsetof(WGPUExternalTextureBindingEntry, externalTexture), - "offsetof mismatch for ExternalTextureBindingEntry::externalTexture"); - -// ExternalTextureBindingLayout implementation -ExternalTextureBindingLayout::ExternalTextureBindingLayout() -: ChainedStruct { nullptr, SType::ExternalTextureBindingLayout } {} -struct ExternalTextureBindingLayout::Init { - ChainedStruct * const nextInChain; -}; -ExternalTextureBindingLayout::ExternalTextureBindingLayout(ExternalTextureBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::ExternalTextureBindingLayout } {} - -ExternalTextureBindingLayout::operator const WGPUExternalTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureBindingLayout) == sizeof(WGPUExternalTextureBindingLayout), "sizeof mismatch for ExternalTextureBindingLayout"); -static_assert(alignof(ExternalTextureBindingLayout) == alignof(WGPUExternalTextureBindingLayout), "alignof mismatch for ExternalTextureBindingLayout"); - -// Future implementation - -Future::operator const WGPUFuture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Future) == sizeof(WGPUFuture), "sizeof mismatch for Future"); -static_assert(alignof(Future) == alignof(WGPUFuture), "alignof mismatch for Future"); -static_assert(offsetof(Future, id) == offsetof(WGPUFuture, id), - "offsetof mismatch for Future::id"); - -// InstanceLimits implementation - -InstanceLimits::operator const WGPUInstanceLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(InstanceLimits) == sizeof(WGPUInstanceLimits), "sizeof mismatch for InstanceLimits"); -static_assert(alignof(InstanceLimits) == alignof(WGPUInstanceLimits), "alignof mismatch for InstanceLimits"); -static_assert(offsetof(InstanceLimits, nextInChain) == offsetof(WGPUInstanceLimits, nextInChain), - "offsetof mismatch for InstanceLimits::nextInChain"); -static_assert(offsetof(InstanceLimits, timedWaitAnyMaxCount) == offsetof(WGPUInstanceLimits, timedWaitAnyMaxCount), - "offsetof mismatch for InstanceLimits::timedWaitAnyMaxCount"); - -// INTERNAL_HAVE_EMDAWNWEBGPU_HEADER implementation - -INTERNAL_HAVE_EMDAWNWEBGPU_HEADER::operator const WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(INTERNAL_HAVE_EMDAWNWEBGPU_HEADER) == sizeof(WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER), "sizeof mismatch for INTERNAL_HAVE_EMDAWNWEBGPU_HEADER"); -static_assert(alignof(INTERNAL_HAVE_EMDAWNWEBGPU_HEADER) == alignof(WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER), "alignof mismatch for INTERNAL_HAVE_EMDAWNWEBGPU_HEADER"); -static_assert(offsetof(INTERNAL_HAVE_EMDAWNWEBGPU_HEADER, unused) == offsetof(WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER, unused), - "offsetof mismatch for INTERNAL_HAVE_EMDAWNWEBGPU_HEADER::unused"); - -// MemoryHeapInfo implementation - -MemoryHeapInfo::operator const WGPUMemoryHeapInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(MemoryHeapInfo) == sizeof(WGPUMemoryHeapInfo), "sizeof mismatch for MemoryHeapInfo"); -static_assert(alignof(MemoryHeapInfo) == alignof(WGPUMemoryHeapInfo), "alignof mismatch for MemoryHeapInfo"); -static_assert(offsetof(MemoryHeapInfo, properties) == offsetof(WGPUMemoryHeapInfo, properties), - "offsetof mismatch for MemoryHeapInfo::properties"); -static_assert(offsetof(MemoryHeapInfo, size) == offsetof(WGPUMemoryHeapInfo, size), - "offsetof mismatch for MemoryHeapInfo::size"); - -// MultisampleState implementation - -MultisampleState::operator const WGPUMultisampleState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(MultisampleState) == sizeof(WGPUMultisampleState), "sizeof mismatch for MultisampleState"); -static_assert(alignof(MultisampleState) == alignof(WGPUMultisampleState), "alignof mismatch for MultisampleState"); -static_assert(offsetof(MultisampleState, nextInChain) == offsetof(WGPUMultisampleState, nextInChain), - "offsetof mismatch for MultisampleState::nextInChain"); -static_assert(offsetof(MultisampleState, count) == offsetof(WGPUMultisampleState, count), - "offsetof mismatch for MultisampleState::count"); -static_assert(offsetof(MultisampleState, mask) == offsetof(WGPUMultisampleState, mask), - "offsetof mismatch for MultisampleState::mask"); -static_assert(offsetof(MultisampleState, alphaToCoverageEnabled) == offsetof(WGPUMultisampleState, alphaToCoverageEnabled), - "offsetof mismatch for MultisampleState::alphaToCoverageEnabled"); - -// Origin2D implementation - -Origin2D::operator const WGPUOrigin2D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Origin2D) == sizeof(WGPUOrigin2D), "sizeof mismatch for Origin2D"); -static_assert(alignof(Origin2D) == alignof(WGPUOrigin2D), "alignof mismatch for Origin2D"); -static_assert(offsetof(Origin2D, x) == offsetof(WGPUOrigin2D, x), - "offsetof mismatch for Origin2D::x"); -static_assert(offsetof(Origin2D, y) == offsetof(WGPUOrigin2D, y), - "offsetof mismatch for Origin2D::y"); - -// Origin3D implementation - -Origin3D::operator const WGPUOrigin3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Origin3D) == sizeof(WGPUOrigin3D), "sizeof mismatch for Origin3D"); -static_assert(alignof(Origin3D) == alignof(WGPUOrigin3D), "alignof mismatch for Origin3D"); -static_assert(offsetof(Origin3D, x) == offsetof(WGPUOrigin3D, x), - "offsetof mismatch for Origin3D::x"); -static_assert(offsetof(Origin3D, y) == offsetof(WGPUOrigin3D, y), - "offsetof mismatch for Origin3D::y"); -static_assert(offsetof(Origin3D, z) == offsetof(WGPUOrigin3D, z), - "offsetof mismatch for Origin3D::z"); - -// PassTimestampWrites implementation - -PassTimestampWrites::operator const WGPUPassTimestampWrites&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PassTimestampWrites) == sizeof(WGPUPassTimestampWrites), "sizeof mismatch for PassTimestampWrites"); -static_assert(alignof(PassTimestampWrites) == alignof(WGPUPassTimestampWrites), "alignof mismatch for PassTimestampWrites"); -static_assert(offsetof(PassTimestampWrites, nextInChain) == offsetof(WGPUPassTimestampWrites, nextInChain), - "offsetof mismatch for PassTimestampWrites::nextInChain"); -static_assert(offsetof(PassTimestampWrites, querySet) == offsetof(WGPUPassTimestampWrites, querySet), - "offsetof mismatch for PassTimestampWrites::querySet"); -static_assert(offsetof(PassTimestampWrites, beginningOfPassWriteIndex) == offsetof(WGPUPassTimestampWrites, beginningOfPassWriteIndex), - "offsetof mismatch for PassTimestampWrites::beginningOfPassWriteIndex"); -static_assert(offsetof(PassTimestampWrites, endOfPassWriteIndex) == offsetof(WGPUPassTimestampWrites, endOfPassWriteIndex), - "offsetof mismatch for PassTimestampWrites::endOfPassWriteIndex"); - -// PipelineLayoutResourceTable implementation -PipelineLayoutResourceTable::PipelineLayoutResourceTable() -: ChainedStruct { nullptr, SType::PipelineLayoutResourceTable } {} -struct PipelineLayoutResourceTable::Init { - ChainedStruct * const nextInChain; - Bool usesResourceTable = false; -}; -PipelineLayoutResourceTable::PipelineLayoutResourceTable(PipelineLayoutResourceTable::Init&& init) : - ChainedStruct { init.nextInChain, SType::PipelineLayoutResourceTable }, - usesResourceTable(std::move(init.usesResourceTable)) {} - -PipelineLayoutResourceTable::operator const WGPUPipelineLayoutResourceTable&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutResourceTable) == sizeof(WGPUPipelineLayoutResourceTable), "sizeof mismatch for PipelineLayoutResourceTable"); -static_assert(alignof(PipelineLayoutResourceTable) == alignof(WGPUPipelineLayoutResourceTable), "alignof mismatch for PipelineLayoutResourceTable"); -static_assert(offsetof(PipelineLayoutResourceTable, usesResourceTable) == offsetof(WGPUPipelineLayoutResourceTable, usesResourceTable), - "offsetof mismatch for PipelineLayoutResourceTable::usesResourceTable"); - -// PipelineLayoutStorageAttachment implementation - -PipelineLayoutStorageAttachment::operator const WGPUPipelineLayoutStorageAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutStorageAttachment) == sizeof(WGPUPipelineLayoutStorageAttachment), "sizeof mismatch for PipelineLayoutStorageAttachment"); -static_assert(alignof(PipelineLayoutStorageAttachment) == alignof(WGPUPipelineLayoutStorageAttachment), "alignof mismatch for PipelineLayoutStorageAttachment"); -static_assert(offsetof(PipelineLayoutStorageAttachment, nextInChain) == offsetof(WGPUPipelineLayoutStorageAttachment, nextInChain), - "offsetof mismatch for PipelineLayoutStorageAttachment::nextInChain"); -static_assert(offsetof(PipelineLayoutStorageAttachment, offset) == offsetof(WGPUPipelineLayoutStorageAttachment, offset), - "offsetof mismatch for PipelineLayoutStorageAttachment::offset"); -static_assert(offsetof(PipelineLayoutStorageAttachment, format) == offsetof(WGPUPipelineLayoutStorageAttachment, format), - "offsetof mismatch for PipelineLayoutStorageAttachment::format"); - -// PrimitiveState implementation - -PrimitiveState::operator const WGPUPrimitiveState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PrimitiveState) == sizeof(WGPUPrimitiveState), "sizeof mismatch for PrimitiveState"); -static_assert(alignof(PrimitiveState) == alignof(WGPUPrimitiveState), "alignof mismatch for PrimitiveState"); -static_assert(offsetof(PrimitiveState, nextInChain) == offsetof(WGPUPrimitiveState, nextInChain), - "offsetof mismatch for PrimitiveState::nextInChain"); -static_assert(offsetof(PrimitiveState, topology) == offsetof(WGPUPrimitiveState, topology), - "offsetof mismatch for PrimitiveState::topology"); -static_assert(offsetof(PrimitiveState, stripIndexFormat) == offsetof(WGPUPrimitiveState, stripIndexFormat), - "offsetof mismatch for PrimitiveState::stripIndexFormat"); -static_assert(offsetof(PrimitiveState, frontFace) == offsetof(WGPUPrimitiveState, frontFace), - "offsetof mismatch for PrimitiveState::frontFace"); -static_assert(offsetof(PrimitiveState, cullMode) == offsetof(WGPUPrimitiveState, cullMode), - "offsetof mismatch for PrimitiveState::cullMode"); -static_assert(offsetof(PrimitiveState, unclippedDepth) == offsetof(WGPUPrimitiveState, unclippedDepth), - "offsetof mismatch for PrimitiveState::unclippedDepth"); - -// QuerySetDescriptor implementation - -QuerySetDescriptor::operator const WGPUQuerySetDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(QuerySetDescriptor) == sizeof(WGPUQuerySetDescriptor), "sizeof mismatch for QuerySetDescriptor"); -static_assert(alignof(QuerySetDescriptor) == alignof(WGPUQuerySetDescriptor), "alignof mismatch for QuerySetDescriptor"); -static_assert(offsetof(QuerySetDescriptor, nextInChain) == offsetof(WGPUQuerySetDescriptor, nextInChain), - "offsetof mismatch for QuerySetDescriptor::nextInChain"); -static_assert(offsetof(QuerySetDescriptor, label) == offsetof(WGPUQuerySetDescriptor, label), - "offsetof mismatch for QuerySetDescriptor::label"); -static_assert(offsetof(QuerySetDescriptor, type) == offsetof(WGPUQuerySetDescriptor, type), - "offsetof mismatch for QuerySetDescriptor::type"); -static_assert(offsetof(QuerySetDescriptor, count) == offsetof(WGPUQuerySetDescriptor, count), - "offsetof mismatch for QuerySetDescriptor::count"); - -// QueueDescriptor implementation - -QueueDescriptor::operator const WGPUQueueDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(QueueDescriptor) == sizeof(WGPUQueueDescriptor), "sizeof mismatch for QueueDescriptor"); -static_assert(alignof(QueueDescriptor) == alignof(WGPUQueueDescriptor), "alignof mismatch for QueueDescriptor"); -static_assert(offsetof(QueueDescriptor, nextInChain) == offsetof(WGPUQueueDescriptor, nextInChain), - "offsetof mismatch for QueueDescriptor::nextInChain"); -static_assert(offsetof(QueueDescriptor, label) == offsetof(WGPUQueueDescriptor, label), - "offsetof mismatch for QueueDescriptor::label"); - -// RenderBundleDescriptor implementation - -RenderBundleDescriptor::operator const WGPURenderBundleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderBundleDescriptor) == sizeof(WGPURenderBundleDescriptor), "sizeof mismatch for RenderBundleDescriptor"); -static_assert(alignof(RenderBundleDescriptor) == alignof(WGPURenderBundleDescriptor), "alignof mismatch for RenderBundleDescriptor"); -static_assert(offsetof(RenderBundleDescriptor, nextInChain) == offsetof(WGPURenderBundleDescriptor, nextInChain), - "offsetof mismatch for RenderBundleDescriptor::nextInChain"); -static_assert(offsetof(RenderBundleDescriptor, label) == offsetof(WGPURenderBundleDescriptor, label), - "offsetof mismatch for RenderBundleDescriptor::label"); - -// RenderBundleEncoderDescriptor implementation - -RenderBundleEncoderDescriptor::operator const WGPURenderBundleEncoderDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderBundleEncoderDescriptor) == sizeof(WGPURenderBundleEncoderDescriptor), "sizeof mismatch for RenderBundleEncoderDescriptor"); -static_assert(alignof(RenderBundleEncoderDescriptor) == alignof(WGPURenderBundleEncoderDescriptor), "alignof mismatch for RenderBundleEncoderDescriptor"); -static_assert(offsetof(RenderBundleEncoderDescriptor, nextInChain) == offsetof(WGPURenderBundleEncoderDescriptor, nextInChain), - "offsetof mismatch for RenderBundleEncoderDescriptor::nextInChain"); -static_assert(offsetof(RenderBundleEncoderDescriptor, label) == offsetof(WGPURenderBundleEncoderDescriptor, label), - "offsetof mismatch for RenderBundleEncoderDescriptor::label"); -static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormatCount) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormatCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormatCount"); -static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormats) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormats), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormats"); -static_assert(offsetof(RenderBundleEncoderDescriptor, depthStencilFormat) == offsetof(WGPURenderBundleEncoderDescriptor, depthStencilFormat), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthStencilFormat"); -static_assert(offsetof(RenderBundleEncoderDescriptor, sampleCount) == offsetof(WGPURenderBundleEncoderDescriptor, sampleCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::sampleCount"); -static_assert(offsetof(RenderBundleEncoderDescriptor, depthReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, depthReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthReadOnly"); -static_assert(offsetof(RenderBundleEncoderDescriptor, stencilReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, stencilReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::stencilReadOnly"); - -// RenderPassDepthStencilAttachment implementation - -RenderPassDepthStencilAttachment::operator const WGPURenderPassDepthStencilAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDepthStencilAttachment) == sizeof(WGPURenderPassDepthStencilAttachment), "sizeof mismatch for RenderPassDepthStencilAttachment"); -static_assert(alignof(RenderPassDepthStencilAttachment) == alignof(WGPURenderPassDepthStencilAttachment), "alignof mismatch for RenderPassDepthStencilAttachment"); -static_assert(offsetof(RenderPassDepthStencilAttachment, nextInChain) == offsetof(WGPURenderPassDepthStencilAttachment, nextInChain), - "offsetof mismatch for RenderPassDepthStencilAttachment::nextInChain"); -static_assert(offsetof(RenderPassDepthStencilAttachment, view) == offsetof(WGPURenderPassDepthStencilAttachment, view), - "offsetof mismatch for RenderPassDepthStencilAttachment::view"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthLoadOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthStoreOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, depthClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthClearValue"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, depthReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthReadOnly"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilLoadOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilStoreOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, stencilClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilClearValue"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, stencilReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilReadOnly"); - -// RenderPassDescriptorResolveRect implementation -RenderPassDescriptorResolveRect::RenderPassDescriptorResolveRect() -: ChainedStruct { nullptr, SType::RenderPassDescriptorResolveRect } {} -struct RenderPassDescriptorResolveRect::Init { - ChainedStruct * const nextInChain; - uint32_t colorOffsetX; - uint32_t colorOffsetY; - uint32_t resolveOffsetX; - uint32_t resolveOffsetY; - uint32_t width; - uint32_t height; -}; -RenderPassDescriptorResolveRect::RenderPassDescriptorResolveRect(RenderPassDescriptorResolveRect::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassDescriptorResolveRect }, - colorOffsetX(std::move(init.colorOffsetX)), - colorOffsetY(std::move(init.colorOffsetY)), - resolveOffsetX(std::move(init.resolveOffsetX)), - resolveOffsetY(std::move(init.resolveOffsetY)), - width(std::move(init.width)), - height(std::move(init.height)) {} - -RenderPassDescriptorResolveRect::operator const WGPURenderPassDescriptorResolveRect&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDescriptorResolveRect) == sizeof(WGPURenderPassDescriptorResolveRect), "sizeof mismatch for RenderPassDescriptorResolveRect"); -static_assert(alignof(RenderPassDescriptorResolveRect) == alignof(WGPURenderPassDescriptorResolveRect), "alignof mismatch for RenderPassDescriptorResolveRect"); -static_assert(offsetof(RenderPassDescriptorResolveRect, colorOffsetX) == offsetof(WGPURenderPassDescriptorResolveRect, colorOffsetX), - "offsetof mismatch for RenderPassDescriptorResolveRect::colorOffsetX"); -static_assert(offsetof(RenderPassDescriptorResolveRect, colorOffsetY) == offsetof(WGPURenderPassDescriptorResolveRect, colorOffsetY), - "offsetof mismatch for RenderPassDescriptorResolveRect::colorOffsetY"); -static_assert(offsetof(RenderPassDescriptorResolveRect, resolveOffsetX) == offsetof(WGPURenderPassDescriptorResolveRect, resolveOffsetX), - "offsetof mismatch for RenderPassDescriptorResolveRect::resolveOffsetX"); -static_assert(offsetof(RenderPassDescriptorResolveRect, resolveOffsetY) == offsetof(WGPURenderPassDescriptorResolveRect, resolveOffsetY), - "offsetof mismatch for RenderPassDescriptorResolveRect::resolveOffsetY"); -static_assert(offsetof(RenderPassDescriptorResolveRect, width) == offsetof(WGPURenderPassDescriptorResolveRect, width), - "offsetof mismatch for RenderPassDescriptorResolveRect::width"); -static_assert(offsetof(RenderPassDescriptorResolveRect, height) == offsetof(WGPURenderPassDescriptorResolveRect, height), - "offsetof mismatch for RenderPassDescriptorResolveRect::height"); - -// RenderPassMaxDrawCount implementation -RenderPassMaxDrawCount::RenderPassMaxDrawCount() -: ChainedStruct { nullptr, SType::RenderPassMaxDrawCount } {} -struct RenderPassMaxDrawCount::Init { - ChainedStruct * const nextInChain; - uint64_t maxDrawCount = 50000000; -}; -RenderPassMaxDrawCount::RenderPassMaxDrawCount(RenderPassMaxDrawCount::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassMaxDrawCount }, - maxDrawCount(std::move(init.maxDrawCount)) {} - -RenderPassMaxDrawCount::operator const WGPURenderPassMaxDrawCount&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassMaxDrawCount) == sizeof(WGPURenderPassMaxDrawCount), "sizeof mismatch for RenderPassMaxDrawCount"); -static_assert(alignof(RenderPassMaxDrawCount) == alignof(WGPURenderPassMaxDrawCount), "alignof mismatch for RenderPassMaxDrawCount"); -static_assert(offsetof(RenderPassMaxDrawCount, maxDrawCount) == offsetof(WGPURenderPassMaxDrawCount, maxDrawCount), - "offsetof mismatch for RenderPassMaxDrawCount::maxDrawCount"); - -// RequestAdapterWebGPUBackendOptions implementation -RequestAdapterWebGPUBackendOptions::RequestAdapterWebGPUBackendOptions() -: ChainedStruct { nullptr, SType::RequestAdapterWebGPUBackendOptions } {} -struct RequestAdapterWebGPUBackendOptions::Init { - ChainedStruct * const nextInChain; -}; -RequestAdapterWebGPUBackendOptions::RequestAdapterWebGPUBackendOptions(RequestAdapterWebGPUBackendOptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::RequestAdapterWebGPUBackendOptions } {} - -RequestAdapterWebGPUBackendOptions::operator const WGPURequestAdapterWebGPUBackendOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterWebGPUBackendOptions) == sizeof(WGPURequestAdapterWebGPUBackendOptions), "sizeof mismatch for RequestAdapterWebGPUBackendOptions"); -static_assert(alignof(RequestAdapterWebGPUBackendOptions) == alignof(WGPURequestAdapterWebGPUBackendOptions), "alignof mismatch for RequestAdapterWebGPUBackendOptions"); - -// RequestAdapterWebXROptions implementation -RequestAdapterWebXROptions::RequestAdapterWebXROptions() -: ChainedStruct { nullptr, SType::RequestAdapterWebXROptions } {} -struct RequestAdapterWebXROptions::Init { - ChainedStruct * const nextInChain; - Bool xrCompatible; -}; -RequestAdapterWebXROptions::RequestAdapterWebXROptions(RequestAdapterWebXROptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::RequestAdapterWebXROptions }, - xrCompatible(std::move(init.xrCompatible)) {} - -RequestAdapterWebXROptions::operator const WGPURequestAdapterWebXROptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterWebXROptions) == sizeof(WGPURequestAdapterWebXROptions), "sizeof mismatch for RequestAdapterWebXROptions"); -static_assert(alignof(RequestAdapterWebXROptions) == alignof(WGPURequestAdapterWebXROptions), "alignof mismatch for RequestAdapterWebXROptions"); -static_assert(offsetof(RequestAdapterWebXROptions, xrCompatible) == offsetof(WGPURequestAdapterWebXROptions, xrCompatible), - "offsetof mismatch for RequestAdapterWebXROptions::xrCompatible"); - -// ResourceTableDescriptor implementation - -ResourceTableDescriptor::operator const WGPUResourceTableDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ResourceTableDescriptor) == sizeof(WGPUResourceTableDescriptor), "sizeof mismatch for ResourceTableDescriptor"); -static_assert(alignof(ResourceTableDescriptor) == alignof(WGPUResourceTableDescriptor), "alignof mismatch for ResourceTableDescriptor"); -static_assert(offsetof(ResourceTableDescriptor, nextInChain) == offsetof(WGPUResourceTableDescriptor, nextInChain), - "offsetof mismatch for ResourceTableDescriptor::nextInChain"); -static_assert(offsetof(ResourceTableDescriptor, label) == offsetof(WGPUResourceTableDescriptor, label), - "offsetof mismatch for ResourceTableDescriptor::label"); -static_assert(offsetof(ResourceTableDescriptor, size) == offsetof(WGPUResourceTableDescriptor, size), - "offsetof mismatch for ResourceTableDescriptor::size"); - -// SamplerBindingLayout implementation - -SamplerBindingLayout::operator const WGPUSamplerBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SamplerBindingLayout) == sizeof(WGPUSamplerBindingLayout), "sizeof mismatch for SamplerBindingLayout"); -static_assert(alignof(SamplerBindingLayout) == alignof(WGPUSamplerBindingLayout), "alignof mismatch for SamplerBindingLayout"); -static_assert(offsetof(SamplerBindingLayout, nextInChain) == offsetof(WGPUSamplerBindingLayout, nextInChain), - "offsetof mismatch for SamplerBindingLayout::nextInChain"); -static_assert(offsetof(SamplerBindingLayout, type) == offsetof(WGPUSamplerBindingLayout, type), - "offsetof mismatch for SamplerBindingLayout::type"); - -// ShaderModuleCompilationOptions implementation -ShaderModuleCompilationOptions::ShaderModuleCompilationOptions() -: ChainedStruct { nullptr, SType::ShaderModuleCompilationOptions } {} -struct ShaderModuleCompilationOptions::Init { - ChainedStruct * const nextInChain; - Bool strictMath; -}; -ShaderModuleCompilationOptions::ShaderModuleCompilationOptions(ShaderModuleCompilationOptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderModuleCompilationOptions }, - strictMath(std::move(init.strictMath)) {} - -ShaderModuleCompilationOptions::operator const WGPUShaderModuleCompilationOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderModuleCompilationOptions) == sizeof(WGPUShaderModuleCompilationOptions), "sizeof mismatch for ShaderModuleCompilationOptions"); -static_assert(alignof(ShaderModuleCompilationOptions) == alignof(WGPUShaderModuleCompilationOptions), "alignof mismatch for ShaderModuleCompilationOptions"); -static_assert(offsetof(ShaderModuleCompilationOptions, strictMath) == offsetof(WGPUShaderModuleCompilationOptions, strictMath), - "offsetof mismatch for ShaderModuleCompilationOptions::strictMath"); - -// ShaderSourceSPIRV implementation -ShaderSourceSPIRV::ShaderSourceSPIRV() -: ChainedStruct { nullptr, SType::ShaderSourceSPIRV } {} -struct ShaderSourceSPIRV::Init { - ChainedStruct * const nextInChain; - uint32_t codeSize; - uint32_t const * code = nullptr; -}; -ShaderSourceSPIRV::ShaderSourceSPIRV(ShaderSourceSPIRV::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderSourceSPIRV }, - codeSize(std::move(init.codeSize)), - code(std::move(init.code)) {} - -ShaderSourceSPIRV::operator const WGPUShaderSourceSPIRV&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderSourceSPIRV) == sizeof(WGPUShaderSourceSPIRV), "sizeof mismatch for ShaderSourceSPIRV"); -static_assert(alignof(ShaderSourceSPIRV) == alignof(WGPUShaderSourceSPIRV), "alignof mismatch for ShaderSourceSPIRV"); -static_assert(offsetof(ShaderSourceSPIRV, codeSize) == offsetof(WGPUShaderSourceSPIRV, codeSize), - "offsetof mismatch for ShaderSourceSPIRV::codeSize"); -static_assert(offsetof(ShaderSourceSPIRV, code) == offsetof(WGPUShaderSourceSPIRV, code), - "offsetof mismatch for ShaderSourceSPIRV::code"); - -// ShaderSourceWGSL implementation -ShaderSourceWGSL::ShaderSourceWGSL() -: ChainedStruct { nullptr, SType::ShaderSourceWGSL } {} -struct ShaderSourceWGSL::Init { - ChainedStruct * const nextInChain; - StringView code = {}; -}; -ShaderSourceWGSL::ShaderSourceWGSL(ShaderSourceWGSL::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderSourceWGSL }, - code(std::move(init.code)) {} - -ShaderSourceWGSL::operator const WGPUShaderSourceWGSL&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderSourceWGSL) == sizeof(WGPUShaderSourceWGSL), "sizeof mismatch for ShaderSourceWGSL"); -static_assert(alignof(ShaderSourceWGSL) == alignof(WGPUShaderSourceWGSL), "alignof mismatch for ShaderSourceWGSL"); -static_assert(offsetof(ShaderSourceWGSL, code) == offsetof(WGPUShaderSourceWGSL, code), - "offsetof mismatch for ShaderSourceWGSL::code"); - -// SharedBufferMemoryBeginAccessDescriptor implementation - -SharedBufferMemoryBeginAccessDescriptor::operator const WGPUSharedBufferMemoryBeginAccessDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryBeginAccessDescriptor) == sizeof(WGPUSharedBufferMemoryBeginAccessDescriptor), "sizeof mismatch for SharedBufferMemoryBeginAccessDescriptor"); -static_assert(alignof(SharedBufferMemoryBeginAccessDescriptor) == alignof(WGPUSharedBufferMemoryBeginAccessDescriptor), "alignof mismatch for SharedBufferMemoryBeginAccessDescriptor"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, nextInChain) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, nextInChain), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::nextInChain"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, initialized) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, initialized), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::initialized"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, fenceCount) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, fenceCount), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::fenceCount"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, fences) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, fences), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::fences"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, signaledValueCount) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, signaledValueCount), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::signaledValueCount"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, signaledValues) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, signaledValues), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::signaledValues"); - -// SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor implementation -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor } {} -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; - uint64_t size; -}; -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor }, - handle(std::move(init.handle)), - size(std::move(init.size)) {} - -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::operator const WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor) == sizeof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor), "sizeof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"); -static_assert(alignof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor) == alignof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor), "alignof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"); -static_assert(offsetof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, handle) == offsetof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, handle), - "offsetof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::handle"); -static_assert(offsetof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, size) == offsetof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, size), - "offsetof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::size"); - -// SharedBufferMemoryEndAccessState implementation -SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState() = default; -SharedBufferMemoryEndAccessState::~SharedBufferMemoryEndAccessState() { - FreeMembers(); -} - -SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&& rhs) - : initialized(rhs.initialized), - fenceCount(rhs.fenceCount), - fences(rhs.fences), - signaledValueCount(rhs.signaledValueCount), - signaledValues(rhs.signaledValues){ - Reset(rhs); -} - -SharedBufferMemoryEndAccessState& SharedBufferMemoryEndAccessState::operator=(SharedBufferMemoryEndAccessState&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized); - detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount); - detail::AsNonConstReference(this->fences) = std::move(rhs.fences); - detail::AsNonConstReference(this->signaledValueCount) = std::move(rhs.signaledValueCount); - detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues); - Reset(rhs); - return *this; -} - -void SharedBufferMemoryEndAccessState::FreeMembers() { - bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSharedBufferMemoryEndAccessStateFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SharedBufferMemoryEndAccessState::Reset(SharedBufferMemoryEndAccessState& value) { - SharedBufferMemoryEndAccessState defaultValue{}; - detail::AsNonConstReference(value.initialized) = defaultValue.initialized; - detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount; - detail::AsNonConstReference(value.fences) = defaultValue.fences; - detail::AsNonConstReference(value.signaledValueCount) = defaultValue.signaledValueCount; - detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues; -} - -SharedBufferMemoryEndAccessState::operator const WGPUSharedBufferMemoryEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryEndAccessState) == sizeof(WGPUSharedBufferMemoryEndAccessState), "sizeof mismatch for SharedBufferMemoryEndAccessState"); -static_assert(alignof(SharedBufferMemoryEndAccessState) == alignof(WGPUSharedBufferMemoryEndAccessState), "alignof mismatch for SharedBufferMemoryEndAccessState"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedBufferMemoryEndAccessState, nextInChain), - "offsetof mismatch for SharedBufferMemoryEndAccessState::nextInChain"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, initialized) == offsetof(WGPUSharedBufferMemoryEndAccessState, initialized), - "offsetof mismatch for SharedBufferMemoryEndAccessState::initialized"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedBufferMemoryEndAccessState, fenceCount), - "offsetof mismatch for SharedBufferMemoryEndAccessState::fenceCount"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, fences) == offsetof(WGPUSharedBufferMemoryEndAccessState, fences), - "offsetof mismatch for SharedBufferMemoryEndAccessState::fences"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, signaledValueCount) == offsetof(WGPUSharedBufferMemoryEndAccessState, signaledValueCount), - "offsetof mismatch for SharedBufferMemoryEndAccessState::signaledValueCount"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedBufferMemoryEndAccessState, signaledValues), - "offsetof mismatch for SharedBufferMemoryEndAccessState::signaledValues"); - -// SharedBufferMemoryProperties implementation - -SharedBufferMemoryProperties::operator const WGPUSharedBufferMemoryProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryProperties) == sizeof(WGPUSharedBufferMemoryProperties), "sizeof mismatch for SharedBufferMemoryProperties"); -static_assert(alignof(SharedBufferMemoryProperties) == alignof(WGPUSharedBufferMemoryProperties), "alignof mismatch for SharedBufferMemoryProperties"); -static_assert(offsetof(SharedBufferMemoryProperties, nextInChain) == offsetof(WGPUSharedBufferMemoryProperties, nextInChain), - "offsetof mismatch for SharedBufferMemoryProperties::nextInChain"); -static_assert(offsetof(SharedBufferMemoryProperties, usage) == offsetof(WGPUSharedBufferMemoryProperties, usage), - "offsetof mismatch for SharedBufferMemoryProperties::usage"); -static_assert(offsetof(SharedBufferMemoryProperties, size) == offsetof(WGPUSharedBufferMemoryProperties, size), - "offsetof mismatch for SharedBufferMemoryProperties::size"); - -// SharedFenceDXGISharedHandleDescriptor implementation -SharedFenceDXGISharedHandleDescriptor::SharedFenceDXGISharedHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceDXGISharedHandleDescriptor } {} -struct SharedFenceDXGISharedHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; -}; -SharedFenceDXGISharedHandleDescriptor::SharedFenceDXGISharedHandleDescriptor(SharedFenceDXGISharedHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceDXGISharedHandleDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceDXGISharedHandleDescriptor::operator const WGPUSharedFenceDXGISharedHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDXGISharedHandleDescriptor) == sizeof(WGPUSharedFenceDXGISharedHandleDescriptor), "sizeof mismatch for SharedFenceDXGISharedHandleDescriptor"); -static_assert(alignof(SharedFenceDXGISharedHandleDescriptor) == alignof(WGPUSharedFenceDXGISharedHandleDescriptor), "alignof mismatch for SharedFenceDXGISharedHandleDescriptor"); -static_assert(offsetof(SharedFenceDXGISharedHandleDescriptor, handle) == offsetof(WGPUSharedFenceDXGISharedHandleDescriptor, handle), - "offsetof mismatch for SharedFenceDXGISharedHandleDescriptor::handle"); - -// SharedFenceDXGISharedHandleExportInfo implementation -SharedFenceDXGISharedHandleExportInfo::SharedFenceDXGISharedHandleExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceDXGISharedHandleExportInfo } {} -struct SharedFenceDXGISharedHandleExportInfo::Init { - ChainedStructOut * nextInChain; - void * handle; -}; -SharedFenceDXGISharedHandleExportInfo::SharedFenceDXGISharedHandleExportInfo(SharedFenceDXGISharedHandleExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceDXGISharedHandleExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceDXGISharedHandleExportInfo::operator const WGPUSharedFenceDXGISharedHandleExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDXGISharedHandleExportInfo) == sizeof(WGPUSharedFenceDXGISharedHandleExportInfo), "sizeof mismatch for SharedFenceDXGISharedHandleExportInfo"); -static_assert(alignof(SharedFenceDXGISharedHandleExportInfo) == alignof(WGPUSharedFenceDXGISharedHandleExportInfo), "alignof mismatch for SharedFenceDXGISharedHandleExportInfo"); -static_assert(offsetof(SharedFenceDXGISharedHandleExportInfo, handle) == offsetof(WGPUSharedFenceDXGISharedHandleExportInfo, handle), - "offsetof mismatch for SharedFenceDXGISharedHandleExportInfo::handle"); - -// SharedFenceEGLSyncDescriptor implementation -SharedFenceEGLSyncDescriptor::SharedFenceEGLSyncDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceEGLSyncDescriptor } {} -struct SharedFenceEGLSyncDescriptor::Init { - ChainedStruct * const nextInChain; - void * sync; -}; -SharedFenceEGLSyncDescriptor::SharedFenceEGLSyncDescriptor(SharedFenceEGLSyncDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceEGLSyncDescriptor }, - sync(std::move(init.sync)) {} - -SharedFenceEGLSyncDescriptor::operator const WGPUSharedFenceEGLSyncDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceEGLSyncDescriptor) == sizeof(WGPUSharedFenceEGLSyncDescriptor), "sizeof mismatch for SharedFenceEGLSyncDescriptor"); -static_assert(alignof(SharedFenceEGLSyncDescriptor) == alignof(WGPUSharedFenceEGLSyncDescriptor), "alignof mismatch for SharedFenceEGLSyncDescriptor"); -static_assert(offsetof(SharedFenceEGLSyncDescriptor, sync) == offsetof(WGPUSharedFenceEGLSyncDescriptor, sync), - "offsetof mismatch for SharedFenceEGLSyncDescriptor::sync"); - -// SharedFenceEGLSyncExportInfo implementation -SharedFenceEGLSyncExportInfo::SharedFenceEGLSyncExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceEGLSyncExportInfo } {} -struct SharedFenceEGLSyncExportInfo::Init { - ChainedStructOut * nextInChain; - void * sync; -}; -SharedFenceEGLSyncExportInfo::SharedFenceEGLSyncExportInfo(SharedFenceEGLSyncExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceEGLSyncExportInfo }, - sync(std::move(init.sync)) {} - -SharedFenceEGLSyncExportInfo::operator const WGPUSharedFenceEGLSyncExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceEGLSyncExportInfo) == sizeof(WGPUSharedFenceEGLSyncExportInfo), "sizeof mismatch for SharedFenceEGLSyncExportInfo"); -static_assert(alignof(SharedFenceEGLSyncExportInfo) == alignof(WGPUSharedFenceEGLSyncExportInfo), "alignof mismatch for SharedFenceEGLSyncExportInfo"); -static_assert(offsetof(SharedFenceEGLSyncExportInfo, sync) == offsetof(WGPUSharedFenceEGLSyncExportInfo, sync), - "offsetof mismatch for SharedFenceEGLSyncExportInfo::sync"); - -// SharedFenceMTLSharedEventDescriptor implementation -SharedFenceMTLSharedEventDescriptor::SharedFenceMTLSharedEventDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceMTLSharedEventDescriptor } {} -struct SharedFenceMTLSharedEventDescriptor::Init { - ChainedStruct * const nextInChain; - void * sharedEvent; -}; -SharedFenceMTLSharedEventDescriptor::SharedFenceMTLSharedEventDescriptor(SharedFenceMTLSharedEventDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceMTLSharedEventDescriptor }, - sharedEvent(std::move(init.sharedEvent)) {} - -SharedFenceMTLSharedEventDescriptor::operator const WGPUSharedFenceMTLSharedEventDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceMTLSharedEventDescriptor) == sizeof(WGPUSharedFenceMTLSharedEventDescriptor), "sizeof mismatch for SharedFenceMTLSharedEventDescriptor"); -static_assert(alignof(SharedFenceMTLSharedEventDescriptor) == alignof(WGPUSharedFenceMTLSharedEventDescriptor), "alignof mismatch for SharedFenceMTLSharedEventDescriptor"); -static_assert(offsetof(SharedFenceMTLSharedEventDescriptor, sharedEvent) == offsetof(WGPUSharedFenceMTLSharedEventDescriptor, sharedEvent), - "offsetof mismatch for SharedFenceMTLSharedEventDescriptor::sharedEvent"); - -// SharedFenceMTLSharedEventExportInfo implementation -SharedFenceMTLSharedEventExportInfo::SharedFenceMTLSharedEventExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceMTLSharedEventExportInfo } {} -struct SharedFenceMTLSharedEventExportInfo::Init { - ChainedStructOut * nextInChain; - void * sharedEvent; -}; -SharedFenceMTLSharedEventExportInfo::SharedFenceMTLSharedEventExportInfo(SharedFenceMTLSharedEventExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceMTLSharedEventExportInfo }, - sharedEvent(std::move(init.sharedEvent)) {} - -SharedFenceMTLSharedEventExportInfo::operator const WGPUSharedFenceMTLSharedEventExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceMTLSharedEventExportInfo) == sizeof(WGPUSharedFenceMTLSharedEventExportInfo), "sizeof mismatch for SharedFenceMTLSharedEventExportInfo"); -static_assert(alignof(SharedFenceMTLSharedEventExportInfo) == alignof(WGPUSharedFenceMTLSharedEventExportInfo), "alignof mismatch for SharedFenceMTLSharedEventExportInfo"); -static_assert(offsetof(SharedFenceMTLSharedEventExportInfo, sharedEvent) == offsetof(WGPUSharedFenceMTLSharedEventExportInfo, sharedEvent), - "offsetof mismatch for SharedFenceMTLSharedEventExportInfo::sharedEvent"); - -// SharedFenceSyncFDDescriptor implementation -SharedFenceSyncFDDescriptor::SharedFenceSyncFDDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceSyncFDDescriptor } {} -struct SharedFenceSyncFDDescriptor::Init { - ChainedStruct * const nextInChain; - int handle; -}; -SharedFenceSyncFDDescriptor::SharedFenceSyncFDDescriptor(SharedFenceSyncFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceSyncFDDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceSyncFDDescriptor::operator const WGPUSharedFenceSyncFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceSyncFDDescriptor) == sizeof(WGPUSharedFenceSyncFDDescriptor), "sizeof mismatch for SharedFenceSyncFDDescriptor"); -static_assert(alignof(SharedFenceSyncFDDescriptor) == alignof(WGPUSharedFenceSyncFDDescriptor), "alignof mismatch for SharedFenceSyncFDDescriptor"); -static_assert(offsetof(SharedFenceSyncFDDescriptor, handle) == offsetof(WGPUSharedFenceSyncFDDescriptor, handle), - "offsetof mismatch for SharedFenceSyncFDDescriptor::handle"); - -// SharedFenceSyncFDExportInfo implementation -SharedFenceSyncFDExportInfo::SharedFenceSyncFDExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceSyncFDExportInfo } {} -struct SharedFenceSyncFDExportInfo::Init { - ChainedStructOut * nextInChain; - int handle; -}; -SharedFenceSyncFDExportInfo::SharedFenceSyncFDExportInfo(SharedFenceSyncFDExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceSyncFDExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceSyncFDExportInfo::operator const WGPUSharedFenceSyncFDExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceSyncFDExportInfo) == sizeof(WGPUSharedFenceSyncFDExportInfo), "sizeof mismatch for SharedFenceSyncFDExportInfo"); -static_assert(alignof(SharedFenceSyncFDExportInfo) == alignof(WGPUSharedFenceSyncFDExportInfo), "alignof mismatch for SharedFenceSyncFDExportInfo"); -static_assert(offsetof(SharedFenceSyncFDExportInfo, handle) == offsetof(WGPUSharedFenceSyncFDExportInfo, handle), - "offsetof mismatch for SharedFenceSyncFDExportInfo::handle"); - -// SharedFenceVkSemaphoreOpaqueFDDescriptor implementation -SharedFenceVkSemaphoreOpaqueFDDescriptor::SharedFenceVkSemaphoreOpaqueFDDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceVkSemaphoreOpaqueFDDescriptor } {} -struct SharedFenceVkSemaphoreOpaqueFDDescriptor::Init { - ChainedStruct * const nextInChain; - int handle; -}; -SharedFenceVkSemaphoreOpaqueFDDescriptor::SharedFenceVkSemaphoreOpaqueFDDescriptor(SharedFenceVkSemaphoreOpaqueFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceVkSemaphoreOpaqueFDDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreOpaqueFDDescriptor::operator const WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreOpaqueFDDescriptor) == sizeof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor), "sizeof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor"); -static_assert(alignof(SharedFenceVkSemaphoreOpaqueFDDescriptor) == alignof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor), "alignof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor"); -static_assert(offsetof(SharedFenceVkSemaphoreOpaqueFDDescriptor, handle) == offsetof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor, handle), - "offsetof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor::handle"); - -// SharedFenceVkSemaphoreOpaqueFDExportInfo implementation -SharedFenceVkSemaphoreOpaqueFDExportInfo::SharedFenceVkSemaphoreOpaqueFDExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceVkSemaphoreOpaqueFDExportInfo } {} -struct SharedFenceVkSemaphoreOpaqueFDExportInfo::Init { - ChainedStructOut * nextInChain; - int handle; -}; -SharedFenceVkSemaphoreOpaqueFDExportInfo::SharedFenceVkSemaphoreOpaqueFDExportInfo(SharedFenceVkSemaphoreOpaqueFDExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceVkSemaphoreOpaqueFDExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreOpaqueFDExportInfo::operator const WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreOpaqueFDExportInfo) == sizeof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo), "sizeof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo"); -static_assert(alignof(SharedFenceVkSemaphoreOpaqueFDExportInfo) == alignof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo), "alignof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo"); -static_assert(offsetof(SharedFenceVkSemaphoreOpaqueFDExportInfo, handle) == offsetof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo, handle), - "offsetof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo::handle"); - -// SharedFenceVkSemaphoreZirconHandleDescriptor implementation -SharedFenceVkSemaphoreZirconHandleDescriptor::SharedFenceVkSemaphoreZirconHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceVkSemaphoreZirconHandleDescriptor } {} -struct SharedFenceVkSemaphoreZirconHandleDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t handle; -}; -SharedFenceVkSemaphoreZirconHandleDescriptor::SharedFenceVkSemaphoreZirconHandleDescriptor(SharedFenceVkSemaphoreZirconHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceVkSemaphoreZirconHandleDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreZirconHandleDescriptor::operator const WGPUSharedFenceVkSemaphoreZirconHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreZirconHandleDescriptor) == sizeof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor), "sizeof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor"); -static_assert(alignof(SharedFenceVkSemaphoreZirconHandleDescriptor) == alignof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor), "alignof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor"); -static_assert(offsetof(SharedFenceVkSemaphoreZirconHandleDescriptor, handle) == offsetof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor, handle), - "offsetof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor::handle"); - -// SharedFenceVkSemaphoreZirconHandleExportInfo implementation -SharedFenceVkSemaphoreZirconHandleExportInfo::SharedFenceVkSemaphoreZirconHandleExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceVkSemaphoreZirconHandleExportInfo } {} -struct SharedFenceVkSemaphoreZirconHandleExportInfo::Init { - ChainedStructOut * nextInChain; - uint32_t handle; -}; -SharedFenceVkSemaphoreZirconHandleExportInfo::SharedFenceVkSemaphoreZirconHandleExportInfo(SharedFenceVkSemaphoreZirconHandleExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceVkSemaphoreZirconHandleExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreZirconHandleExportInfo::operator const WGPUSharedFenceVkSemaphoreZirconHandleExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreZirconHandleExportInfo) == sizeof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo), "sizeof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo"); -static_assert(alignof(SharedFenceVkSemaphoreZirconHandleExportInfo) == alignof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo), "alignof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo"); -static_assert(offsetof(SharedFenceVkSemaphoreZirconHandleExportInfo, handle) == offsetof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo, handle), - "offsetof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo::handle"); - -// SharedTextureMemoryAHardwareBufferDescriptor implementation -SharedTextureMemoryAHardwareBufferDescriptor::SharedTextureMemoryAHardwareBufferDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryAHardwareBufferDescriptor } {} -struct SharedTextureMemoryAHardwareBufferDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; -}; -SharedTextureMemoryAHardwareBufferDescriptor::SharedTextureMemoryAHardwareBufferDescriptor(SharedTextureMemoryAHardwareBufferDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryAHardwareBufferDescriptor }, - handle(std::move(init.handle)) {} - -SharedTextureMemoryAHardwareBufferDescriptor::operator const WGPUSharedTextureMemoryAHardwareBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryAHardwareBufferDescriptor) == sizeof(WGPUSharedTextureMemoryAHardwareBufferDescriptor), "sizeof mismatch for SharedTextureMemoryAHardwareBufferDescriptor"); -static_assert(alignof(SharedTextureMemoryAHardwareBufferDescriptor) == alignof(WGPUSharedTextureMemoryAHardwareBufferDescriptor), "alignof mismatch for SharedTextureMemoryAHardwareBufferDescriptor"); -static_assert(offsetof(SharedTextureMemoryAHardwareBufferDescriptor, handle) == offsetof(WGPUSharedTextureMemoryAHardwareBufferDescriptor, handle), - "offsetof mismatch for SharedTextureMemoryAHardwareBufferDescriptor::handle"); - -// SharedTextureMemoryD3D11BeginState implementation -SharedTextureMemoryD3D11BeginState::SharedTextureMemoryD3D11BeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryD3D11BeginState } {} -struct SharedTextureMemoryD3D11BeginState::Init { - ChainedStruct * const nextInChain; - Bool requiresEndAccessFence = true; -}; -SharedTextureMemoryD3D11BeginState::SharedTextureMemoryD3D11BeginState(SharedTextureMemoryD3D11BeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryD3D11BeginState }, - requiresEndAccessFence(std::move(init.requiresEndAccessFence)) {} - -SharedTextureMemoryD3D11BeginState::operator const WGPUSharedTextureMemoryD3D11BeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryD3D11BeginState) == sizeof(WGPUSharedTextureMemoryD3D11BeginState), "sizeof mismatch for SharedTextureMemoryD3D11BeginState"); -static_assert(alignof(SharedTextureMemoryD3D11BeginState) == alignof(WGPUSharedTextureMemoryD3D11BeginState), "alignof mismatch for SharedTextureMemoryD3D11BeginState"); -static_assert(offsetof(SharedTextureMemoryD3D11BeginState, requiresEndAccessFence) == offsetof(WGPUSharedTextureMemoryD3D11BeginState, requiresEndAccessFence), - "offsetof mismatch for SharedTextureMemoryD3D11BeginState::requiresEndAccessFence"); - -// SharedTextureMemoryD3DSwapchainBeginState implementation -SharedTextureMemoryD3DSwapchainBeginState::SharedTextureMemoryD3DSwapchainBeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryD3DSwapchainBeginState } {} -struct SharedTextureMemoryD3DSwapchainBeginState::Init { - ChainedStruct * const nextInChain; - Bool isSwapchain = false; -}; -SharedTextureMemoryD3DSwapchainBeginState::SharedTextureMemoryD3DSwapchainBeginState(SharedTextureMemoryD3DSwapchainBeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryD3DSwapchainBeginState }, - isSwapchain(std::move(init.isSwapchain)) {} - -SharedTextureMemoryD3DSwapchainBeginState::operator const WGPUSharedTextureMemoryD3DSwapchainBeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryD3DSwapchainBeginState) == sizeof(WGPUSharedTextureMemoryD3DSwapchainBeginState), "sizeof mismatch for SharedTextureMemoryD3DSwapchainBeginState"); -static_assert(alignof(SharedTextureMemoryD3DSwapchainBeginState) == alignof(WGPUSharedTextureMemoryD3DSwapchainBeginState), "alignof mismatch for SharedTextureMemoryD3DSwapchainBeginState"); -static_assert(offsetof(SharedTextureMemoryD3DSwapchainBeginState, isSwapchain) == offsetof(WGPUSharedTextureMemoryD3DSwapchainBeginState, isSwapchain), - "offsetof mismatch for SharedTextureMemoryD3DSwapchainBeginState::isSwapchain"); - -// SharedTextureMemoryDmaBufPlane implementation - -SharedTextureMemoryDmaBufPlane::operator const WGPUSharedTextureMemoryDmaBufPlane&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDmaBufPlane) == sizeof(WGPUSharedTextureMemoryDmaBufPlane), "sizeof mismatch for SharedTextureMemoryDmaBufPlane"); -static_assert(alignof(SharedTextureMemoryDmaBufPlane) == alignof(WGPUSharedTextureMemoryDmaBufPlane), "alignof mismatch for SharedTextureMemoryDmaBufPlane"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, fd) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, fd), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::fd"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, offset) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, offset), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::offset"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, stride) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, stride), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::stride"); - -// SharedTextureMemoryDXGISharedHandleDescriptor implementation -SharedTextureMemoryDXGISharedHandleDescriptor::SharedTextureMemoryDXGISharedHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryDXGISharedHandleDescriptor } {} -struct SharedTextureMemoryDXGISharedHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; - Bool useKeyedMutex; -}; -SharedTextureMemoryDXGISharedHandleDescriptor::SharedTextureMemoryDXGISharedHandleDescriptor(SharedTextureMemoryDXGISharedHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryDXGISharedHandleDescriptor }, - handle(std::move(init.handle)), - useKeyedMutex(std::move(init.useKeyedMutex)) {} - -SharedTextureMemoryDXGISharedHandleDescriptor::operator const WGPUSharedTextureMemoryDXGISharedHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDXGISharedHandleDescriptor) == sizeof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor), "sizeof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor"); -static_assert(alignof(SharedTextureMemoryDXGISharedHandleDescriptor) == alignof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor), "alignof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor"); -static_assert(offsetof(SharedTextureMemoryDXGISharedHandleDescriptor, handle) == offsetof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor, handle), - "offsetof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor::handle"); -static_assert(offsetof(SharedTextureMemoryDXGISharedHandleDescriptor, useKeyedMutex) == offsetof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor, useKeyedMutex), - "offsetof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor::useKeyedMutex"); - -// SharedTextureMemoryEGLImageDescriptor implementation -SharedTextureMemoryEGLImageDescriptor::SharedTextureMemoryEGLImageDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryEGLImageDescriptor } {} -struct SharedTextureMemoryEGLImageDescriptor::Init { - ChainedStruct * const nextInChain; - void * image; -}; -SharedTextureMemoryEGLImageDescriptor::SharedTextureMemoryEGLImageDescriptor(SharedTextureMemoryEGLImageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryEGLImageDescriptor }, - image(std::move(init.image)) {} - -SharedTextureMemoryEGLImageDescriptor::operator const WGPUSharedTextureMemoryEGLImageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryEGLImageDescriptor) == sizeof(WGPUSharedTextureMemoryEGLImageDescriptor), "sizeof mismatch for SharedTextureMemoryEGLImageDescriptor"); -static_assert(alignof(SharedTextureMemoryEGLImageDescriptor) == alignof(WGPUSharedTextureMemoryEGLImageDescriptor), "alignof mismatch for SharedTextureMemoryEGLImageDescriptor"); -static_assert(offsetof(SharedTextureMemoryEGLImageDescriptor, image) == offsetof(WGPUSharedTextureMemoryEGLImageDescriptor, image), - "offsetof mismatch for SharedTextureMemoryEGLImageDescriptor::image"); - -// SharedTextureMemoryIOSurfaceDescriptor implementation -SharedTextureMemoryIOSurfaceDescriptor::SharedTextureMemoryIOSurfaceDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryIOSurfaceDescriptor } {} -struct SharedTextureMemoryIOSurfaceDescriptor::Init { - ChainedStruct * const nextInChain; - void * ioSurface; - Bool allowStorageBinding = true; -}; -SharedTextureMemoryIOSurfaceDescriptor::SharedTextureMemoryIOSurfaceDescriptor(SharedTextureMemoryIOSurfaceDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryIOSurfaceDescriptor }, - ioSurface(std::move(init.ioSurface)), - allowStorageBinding(std::move(init.allowStorageBinding)) {} - -SharedTextureMemoryIOSurfaceDescriptor::operator const WGPUSharedTextureMemoryIOSurfaceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryIOSurfaceDescriptor) == sizeof(WGPUSharedTextureMemoryIOSurfaceDescriptor), "sizeof mismatch for SharedTextureMemoryIOSurfaceDescriptor"); -static_assert(alignof(SharedTextureMemoryIOSurfaceDescriptor) == alignof(WGPUSharedTextureMemoryIOSurfaceDescriptor), "alignof mismatch for SharedTextureMemoryIOSurfaceDescriptor"); -static_assert(offsetof(SharedTextureMemoryIOSurfaceDescriptor, ioSurface) == offsetof(WGPUSharedTextureMemoryIOSurfaceDescriptor, ioSurface), - "offsetof mismatch for SharedTextureMemoryIOSurfaceDescriptor::ioSurface"); -static_assert(offsetof(SharedTextureMemoryIOSurfaceDescriptor, allowStorageBinding) == offsetof(WGPUSharedTextureMemoryIOSurfaceDescriptor, allowStorageBinding), - "offsetof mismatch for SharedTextureMemoryIOSurfaceDescriptor::allowStorageBinding"); - -// SharedTextureMemoryOpaqueFDDescriptor implementation -SharedTextureMemoryOpaqueFDDescriptor::SharedTextureMemoryOpaqueFDDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryOpaqueFDDescriptor } {} -struct SharedTextureMemoryOpaqueFDDescriptor::Init { - ChainedStruct * const nextInChain; - void const * vkImageCreateInfo; - int memoryFD; - uint32_t memoryTypeIndex; - uint64_t allocationSize; - Bool dedicatedAllocation; -}; -SharedTextureMemoryOpaqueFDDescriptor::SharedTextureMemoryOpaqueFDDescriptor(SharedTextureMemoryOpaqueFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryOpaqueFDDescriptor }, - vkImageCreateInfo(std::move(init.vkImageCreateInfo)), - memoryFD(std::move(init.memoryFD)), - memoryTypeIndex(std::move(init.memoryTypeIndex)), - allocationSize(std::move(init.allocationSize)), - dedicatedAllocation(std::move(init.dedicatedAllocation)) {} - -SharedTextureMemoryOpaqueFDDescriptor::operator const WGPUSharedTextureMemoryOpaqueFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryOpaqueFDDescriptor) == sizeof(WGPUSharedTextureMemoryOpaqueFDDescriptor), "sizeof mismatch for SharedTextureMemoryOpaqueFDDescriptor"); -static_assert(alignof(SharedTextureMemoryOpaqueFDDescriptor) == alignof(WGPUSharedTextureMemoryOpaqueFDDescriptor), "alignof mismatch for SharedTextureMemoryOpaqueFDDescriptor"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, vkImageCreateInfo) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, vkImageCreateInfo), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::vkImageCreateInfo"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, memoryFD) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, memoryFD), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::memoryFD"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, memoryTypeIndex) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, memoryTypeIndex), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::memoryTypeIndex"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, allocationSize) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, allocationSize), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::allocationSize"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, dedicatedAllocation) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, dedicatedAllocation), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::dedicatedAllocation"); - -// SharedTextureMemoryVkDedicatedAllocationDescriptor implementation -SharedTextureMemoryVkDedicatedAllocationDescriptor::SharedTextureMemoryVkDedicatedAllocationDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryVkDedicatedAllocationDescriptor } {} -struct SharedTextureMemoryVkDedicatedAllocationDescriptor::Init { - ChainedStruct * const nextInChain; - Bool dedicatedAllocation; -}; -SharedTextureMemoryVkDedicatedAllocationDescriptor::SharedTextureMemoryVkDedicatedAllocationDescriptor(SharedTextureMemoryVkDedicatedAllocationDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryVkDedicatedAllocationDescriptor }, - dedicatedAllocation(std::move(init.dedicatedAllocation)) {} - -SharedTextureMemoryVkDedicatedAllocationDescriptor::operator const WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkDedicatedAllocationDescriptor) == sizeof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor), "sizeof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor"); -static_assert(alignof(SharedTextureMemoryVkDedicatedAllocationDescriptor) == alignof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor), "alignof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor"); -static_assert(offsetof(SharedTextureMemoryVkDedicatedAllocationDescriptor, dedicatedAllocation) == offsetof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor, dedicatedAllocation), - "offsetof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor::dedicatedAllocation"); - -// SharedTextureMemoryVkImageLayoutBeginState implementation -SharedTextureMemoryVkImageLayoutBeginState::SharedTextureMemoryVkImageLayoutBeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryVkImageLayoutBeginState } {} -struct SharedTextureMemoryVkImageLayoutBeginState::Init { - ChainedStruct * const nextInChain; - int32_t oldLayout; - int32_t newLayout; -}; -SharedTextureMemoryVkImageLayoutBeginState::SharedTextureMemoryVkImageLayoutBeginState(SharedTextureMemoryVkImageLayoutBeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryVkImageLayoutBeginState }, - oldLayout(std::move(init.oldLayout)), - newLayout(std::move(init.newLayout)) {} - -SharedTextureMemoryVkImageLayoutBeginState::operator const WGPUSharedTextureMemoryVkImageLayoutBeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkImageLayoutBeginState) == sizeof(WGPUSharedTextureMemoryVkImageLayoutBeginState), "sizeof mismatch for SharedTextureMemoryVkImageLayoutBeginState"); -static_assert(alignof(SharedTextureMemoryVkImageLayoutBeginState) == alignof(WGPUSharedTextureMemoryVkImageLayoutBeginState), "alignof mismatch for SharedTextureMemoryVkImageLayoutBeginState"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutBeginState, oldLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutBeginState, oldLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutBeginState::oldLayout"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutBeginState, newLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutBeginState, newLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutBeginState::newLayout"); - -// SharedTextureMemoryVkImageLayoutEndState implementation -SharedTextureMemoryVkImageLayoutEndState::SharedTextureMemoryVkImageLayoutEndState() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryVkImageLayoutEndState } {} -struct SharedTextureMemoryVkImageLayoutEndState::Init { - ChainedStructOut * nextInChain; - int32_t oldLayout; - int32_t newLayout; -}; -SharedTextureMemoryVkImageLayoutEndState::SharedTextureMemoryVkImageLayoutEndState(SharedTextureMemoryVkImageLayoutEndState::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryVkImageLayoutEndState }, - oldLayout(std::move(init.oldLayout)), - newLayout(std::move(init.newLayout)) {} - -SharedTextureMemoryVkImageLayoutEndState::operator const WGPUSharedTextureMemoryVkImageLayoutEndState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkImageLayoutEndState) == sizeof(WGPUSharedTextureMemoryVkImageLayoutEndState), "sizeof mismatch for SharedTextureMemoryVkImageLayoutEndState"); -static_assert(alignof(SharedTextureMemoryVkImageLayoutEndState) == alignof(WGPUSharedTextureMemoryVkImageLayoutEndState), "alignof mismatch for SharedTextureMemoryVkImageLayoutEndState"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutEndState, oldLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutEndState, oldLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutEndState::oldLayout"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutEndState, newLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutEndState, newLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutEndState::newLayout"); - -// SharedTextureMemoryZirconHandleDescriptor implementation -SharedTextureMemoryZirconHandleDescriptor::SharedTextureMemoryZirconHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryZirconHandleDescriptor } {} -struct SharedTextureMemoryZirconHandleDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t memoryFD; - uint64_t allocationSize; -}; -SharedTextureMemoryZirconHandleDescriptor::SharedTextureMemoryZirconHandleDescriptor(SharedTextureMemoryZirconHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryZirconHandleDescriptor }, - memoryFD(std::move(init.memoryFD)), - allocationSize(std::move(init.allocationSize)) {} - -SharedTextureMemoryZirconHandleDescriptor::operator const WGPUSharedTextureMemoryZirconHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryZirconHandleDescriptor) == sizeof(WGPUSharedTextureMemoryZirconHandleDescriptor), "sizeof mismatch for SharedTextureMemoryZirconHandleDescriptor"); -static_assert(alignof(SharedTextureMemoryZirconHandleDescriptor) == alignof(WGPUSharedTextureMemoryZirconHandleDescriptor), "alignof mismatch for SharedTextureMemoryZirconHandleDescriptor"); -static_assert(offsetof(SharedTextureMemoryZirconHandleDescriptor, memoryFD) == offsetof(WGPUSharedTextureMemoryZirconHandleDescriptor, memoryFD), - "offsetof mismatch for SharedTextureMemoryZirconHandleDescriptor::memoryFD"); -static_assert(offsetof(SharedTextureMemoryZirconHandleDescriptor, allocationSize) == offsetof(WGPUSharedTextureMemoryZirconHandleDescriptor, allocationSize), - "offsetof mismatch for SharedTextureMemoryZirconHandleDescriptor::allocationSize"); - -// StaticSamplerBindingLayout implementation -StaticSamplerBindingLayout::StaticSamplerBindingLayout() -: ChainedStruct { nullptr, SType::StaticSamplerBindingLayout } {} -struct StaticSamplerBindingLayout::Init { - ChainedStruct * const nextInChain; - Sampler sampler = nullptr; - uint32_t sampledTextureBinding = kLimitU32Undefined; -}; -StaticSamplerBindingLayout::StaticSamplerBindingLayout(StaticSamplerBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::StaticSamplerBindingLayout }, - sampler(std::move(init.sampler)), - sampledTextureBinding(std::move(init.sampledTextureBinding)) {} - -StaticSamplerBindingLayout::operator const WGPUStaticSamplerBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StaticSamplerBindingLayout) == sizeof(WGPUStaticSamplerBindingLayout), "sizeof mismatch for StaticSamplerBindingLayout"); -static_assert(alignof(StaticSamplerBindingLayout) == alignof(WGPUStaticSamplerBindingLayout), "alignof mismatch for StaticSamplerBindingLayout"); -static_assert(offsetof(StaticSamplerBindingLayout, sampler) == offsetof(WGPUStaticSamplerBindingLayout, sampler), - "offsetof mismatch for StaticSamplerBindingLayout::sampler"); -static_assert(offsetof(StaticSamplerBindingLayout, sampledTextureBinding) == offsetof(WGPUStaticSamplerBindingLayout, sampledTextureBinding), - "offsetof mismatch for StaticSamplerBindingLayout::sampledTextureBinding"); - -// StencilFaceState implementation - -StencilFaceState::operator const WGPUStencilFaceState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StencilFaceState) == sizeof(WGPUStencilFaceState), "sizeof mismatch for StencilFaceState"); -static_assert(alignof(StencilFaceState) == alignof(WGPUStencilFaceState), "alignof mismatch for StencilFaceState"); -static_assert(offsetof(StencilFaceState, compare) == offsetof(WGPUStencilFaceState, compare), - "offsetof mismatch for StencilFaceState::compare"); -static_assert(offsetof(StencilFaceState, failOp) == offsetof(WGPUStencilFaceState, failOp), - "offsetof mismatch for StencilFaceState::failOp"); -static_assert(offsetof(StencilFaceState, depthFailOp) == offsetof(WGPUStencilFaceState, depthFailOp), - "offsetof mismatch for StencilFaceState::depthFailOp"); -static_assert(offsetof(StencilFaceState, passOp) == offsetof(WGPUStencilFaceState, passOp), - "offsetof mismatch for StencilFaceState::passOp"); - -// StorageTextureBindingLayout implementation - -StorageTextureBindingLayout::operator const WGPUStorageTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StorageTextureBindingLayout) == sizeof(WGPUStorageTextureBindingLayout), "sizeof mismatch for StorageTextureBindingLayout"); -static_assert(alignof(StorageTextureBindingLayout) == alignof(WGPUStorageTextureBindingLayout), "alignof mismatch for StorageTextureBindingLayout"); -static_assert(offsetof(StorageTextureBindingLayout, nextInChain) == offsetof(WGPUStorageTextureBindingLayout, nextInChain), - "offsetof mismatch for StorageTextureBindingLayout::nextInChain"); -static_assert(offsetof(StorageTextureBindingLayout, access) == offsetof(WGPUStorageTextureBindingLayout, access), - "offsetof mismatch for StorageTextureBindingLayout::access"); -static_assert(offsetof(StorageTextureBindingLayout, format) == offsetof(WGPUStorageTextureBindingLayout, format), - "offsetof mismatch for StorageTextureBindingLayout::format"); -static_assert(offsetof(StorageTextureBindingLayout, viewDimension) == offsetof(WGPUStorageTextureBindingLayout, viewDimension), - "offsetof mismatch for StorageTextureBindingLayout::viewDimension"); - -// SubgroupMatrixConfig implementation - -SubgroupMatrixConfig::operator const WGPUSubgroupMatrixConfig&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SubgroupMatrixConfig) == sizeof(WGPUSubgroupMatrixConfig), "sizeof mismatch for SubgroupMatrixConfig"); -static_assert(alignof(SubgroupMatrixConfig) == alignof(WGPUSubgroupMatrixConfig), "alignof mismatch for SubgroupMatrixConfig"); -static_assert(offsetof(SubgroupMatrixConfig, componentType) == offsetof(WGPUSubgroupMatrixConfig, componentType), - "offsetof mismatch for SubgroupMatrixConfig::componentType"); -static_assert(offsetof(SubgroupMatrixConfig, resultComponentType) == offsetof(WGPUSubgroupMatrixConfig, resultComponentType), - "offsetof mismatch for SubgroupMatrixConfig::resultComponentType"); -static_assert(offsetof(SubgroupMatrixConfig, M) == offsetof(WGPUSubgroupMatrixConfig, M), - "offsetof mismatch for SubgroupMatrixConfig::M"); -static_assert(offsetof(SubgroupMatrixConfig, N) == offsetof(WGPUSubgroupMatrixConfig, N), - "offsetof mismatch for SubgroupMatrixConfig::N"); -static_assert(offsetof(SubgroupMatrixConfig, K) == offsetof(WGPUSubgroupMatrixConfig, K), - "offsetof mismatch for SubgroupMatrixConfig::K"); - -// SupportedFeatures implementation -SupportedFeatures::SupportedFeatures() = default; -SupportedFeatures::~SupportedFeatures() { - FreeMembers(); -} - -SupportedFeatures::SupportedFeatures(SupportedFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedFeatures& SupportedFeatures::operator=(SupportedFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSupportedFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedFeatures::Reset(SupportedFeatures& value) { - SupportedFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedFeatures::operator const WGPUSupportedFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedFeatures) == sizeof(WGPUSupportedFeatures), "sizeof mismatch for SupportedFeatures"); -static_assert(alignof(SupportedFeatures) == alignof(WGPUSupportedFeatures), "alignof mismatch for SupportedFeatures"); -static_assert(offsetof(SupportedFeatures, featureCount) == offsetof(WGPUSupportedFeatures, featureCount), - "offsetof mismatch for SupportedFeatures::featureCount"); -static_assert(offsetof(SupportedFeatures, features) == offsetof(WGPUSupportedFeatures, features), - "offsetof mismatch for SupportedFeatures::features"); - -// SupportedInstanceFeatures implementation -SupportedInstanceFeatures::SupportedInstanceFeatures() = default; -SupportedInstanceFeatures::~SupportedInstanceFeatures() { - FreeMembers(); -} - -SupportedInstanceFeatures::SupportedInstanceFeatures(SupportedInstanceFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedInstanceFeatures& SupportedInstanceFeatures::operator=(SupportedInstanceFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedInstanceFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSupportedInstanceFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedInstanceFeatures::Reset(SupportedInstanceFeatures& value) { - SupportedInstanceFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedInstanceFeatures::operator const WGPUSupportedInstanceFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedInstanceFeatures) == sizeof(WGPUSupportedInstanceFeatures), "sizeof mismatch for SupportedInstanceFeatures"); -static_assert(alignof(SupportedInstanceFeatures) == alignof(WGPUSupportedInstanceFeatures), "alignof mismatch for SupportedInstanceFeatures"); -static_assert(offsetof(SupportedInstanceFeatures, featureCount) == offsetof(WGPUSupportedInstanceFeatures, featureCount), - "offsetof mismatch for SupportedInstanceFeatures::featureCount"); -static_assert(offsetof(SupportedInstanceFeatures, features) == offsetof(WGPUSupportedInstanceFeatures, features), - "offsetof mismatch for SupportedInstanceFeatures::features"); - -// SupportedWGSLLanguageFeatures implementation -SupportedWGSLLanguageFeatures::SupportedWGSLLanguageFeatures() = default; -SupportedWGSLLanguageFeatures::~SupportedWGSLLanguageFeatures() { - FreeMembers(); -} - -SupportedWGSLLanguageFeatures::SupportedWGSLLanguageFeatures(SupportedWGSLLanguageFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedWGSLLanguageFeatures& SupportedWGSLLanguageFeatures::operator=(SupportedWGSLLanguageFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedWGSLLanguageFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSupportedWGSLLanguageFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedWGSLLanguageFeatures::Reset(SupportedWGSLLanguageFeatures& value) { - SupportedWGSLLanguageFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedWGSLLanguageFeatures::operator const WGPUSupportedWGSLLanguageFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedWGSLLanguageFeatures) == sizeof(WGPUSupportedWGSLLanguageFeatures), "sizeof mismatch for SupportedWGSLLanguageFeatures"); -static_assert(alignof(SupportedWGSLLanguageFeatures) == alignof(WGPUSupportedWGSLLanguageFeatures), "alignof mismatch for SupportedWGSLLanguageFeatures"); -static_assert(offsetof(SupportedWGSLLanguageFeatures, featureCount) == offsetof(WGPUSupportedWGSLLanguageFeatures, featureCount), - "offsetof mismatch for SupportedWGSLLanguageFeatures::featureCount"); -static_assert(offsetof(SupportedWGSLLanguageFeatures, features) == offsetof(WGPUSupportedWGSLLanguageFeatures, features), - "offsetof mismatch for SupportedWGSLLanguageFeatures::features"); - -// SurfaceCapabilities implementation -SurfaceCapabilities::SurfaceCapabilities() = default; -SurfaceCapabilities::~SurfaceCapabilities() { - FreeMembers(); -} - -SurfaceCapabilities::SurfaceCapabilities(SurfaceCapabilities&& rhs) - : usages(rhs.usages), - formatCount(rhs.formatCount), - formats(rhs.formats), - presentModeCount(rhs.presentModeCount), - presentModes(rhs.presentModes), - alphaModeCount(rhs.alphaModeCount), - alphaModes(rhs.alphaModes){ - Reset(rhs); -} - -SurfaceCapabilities& SurfaceCapabilities::operator=(SurfaceCapabilities&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->usages) = std::move(rhs.usages); - detail::AsNonConstReference(this->formatCount) = std::move(rhs.formatCount); - detail::AsNonConstReference(this->formats) = std::move(rhs.formats); - detail::AsNonConstReference(this->presentModeCount) = std::move(rhs.presentModeCount); - detail::AsNonConstReference(this->presentModes) = std::move(rhs.presentModes); - detail::AsNonConstReference(this->alphaModeCount) = std::move(rhs.alphaModeCount); - detail::AsNonConstReference(this->alphaModes) = std::move(rhs.alphaModes); - Reset(rhs); - return *this; -} - -void SurfaceCapabilities::FreeMembers() { - bool needsFreeing = false; if (this->formats != nullptr) { needsFreeing = true; } if (this->presentModes != nullptr) { needsFreeing = true; } if (this->alphaModes != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSurfaceCapabilitiesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SurfaceCapabilities::Reset(SurfaceCapabilities& value) { - SurfaceCapabilities defaultValue{}; - detail::AsNonConstReference(value.usages) = defaultValue.usages; - detail::AsNonConstReference(value.formatCount) = defaultValue.formatCount; - detail::AsNonConstReference(value.formats) = defaultValue.formats; - detail::AsNonConstReference(value.presentModeCount) = defaultValue.presentModeCount; - detail::AsNonConstReference(value.presentModes) = defaultValue.presentModes; - detail::AsNonConstReference(value.alphaModeCount) = defaultValue.alphaModeCount; - detail::AsNonConstReference(value.alphaModes) = defaultValue.alphaModes; -} - -SurfaceCapabilities::operator const WGPUSurfaceCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceCapabilities) == sizeof(WGPUSurfaceCapabilities), "sizeof mismatch for SurfaceCapabilities"); -static_assert(alignof(SurfaceCapabilities) == alignof(WGPUSurfaceCapabilities), "alignof mismatch for SurfaceCapabilities"); -static_assert(offsetof(SurfaceCapabilities, nextInChain) == offsetof(WGPUSurfaceCapabilities, nextInChain), - "offsetof mismatch for SurfaceCapabilities::nextInChain"); -static_assert(offsetof(SurfaceCapabilities, usages) == offsetof(WGPUSurfaceCapabilities, usages), - "offsetof mismatch for SurfaceCapabilities::usages"); -static_assert(offsetof(SurfaceCapabilities, formatCount) == offsetof(WGPUSurfaceCapabilities, formatCount), - "offsetof mismatch for SurfaceCapabilities::formatCount"); -static_assert(offsetof(SurfaceCapabilities, formats) == offsetof(WGPUSurfaceCapabilities, formats), - "offsetof mismatch for SurfaceCapabilities::formats"); -static_assert(offsetof(SurfaceCapabilities, presentModeCount) == offsetof(WGPUSurfaceCapabilities, presentModeCount), - "offsetof mismatch for SurfaceCapabilities::presentModeCount"); -static_assert(offsetof(SurfaceCapabilities, presentModes) == offsetof(WGPUSurfaceCapabilities, presentModes), - "offsetof mismatch for SurfaceCapabilities::presentModes"); -static_assert(offsetof(SurfaceCapabilities, alphaModeCount) == offsetof(WGPUSurfaceCapabilities, alphaModeCount), - "offsetof mismatch for SurfaceCapabilities::alphaModeCount"); -static_assert(offsetof(SurfaceCapabilities, alphaModes) == offsetof(WGPUSurfaceCapabilities, alphaModes), - "offsetof mismatch for SurfaceCapabilities::alphaModes"); - -// SurfaceColorManagement implementation -SurfaceColorManagement::SurfaceColorManagement() -: ChainedStruct { nullptr, SType::SurfaceColorManagement } {} -struct SurfaceColorManagement::Init { - ChainedStruct * const nextInChain; - PredefinedColorSpace colorSpace = {}; - ToneMappingMode toneMappingMode = {}; -}; -SurfaceColorManagement::SurfaceColorManagement(SurfaceColorManagement::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceColorManagement }, - colorSpace(std::move(init.colorSpace)), - toneMappingMode(std::move(init.toneMappingMode)) {} - -SurfaceColorManagement::operator const WGPUSurfaceColorManagement&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceColorManagement) == sizeof(WGPUSurfaceColorManagement), "sizeof mismatch for SurfaceColorManagement"); -static_assert(alignof(SurfaceColorManagement) == alignof(WGPUSurfaceColorManagement), "alignof mismatch for SurfaceColorManagement"); -static_assert(offsetof(SurfaceColorManagement, colorSpace) == offsetof(WGPUSurfaceColorManagement, colorSpace), - "offsetof mismatch for SurfaceColorManagement::colorSpace"); -static_assert(offsetof(SurfaceColorManagement, toneMappingMode) == offsetof(WGPUSurfaceColorManagement, toneMappingMode), - "offsetof mismatch for SurfaceColorManagement::toneMappingMode"); - -// SurfaceConfiguration implementation - -SurfaceConfiguration::operator const WGPUSurfaceConfiguration&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceConfiguration) == sizeof(WGPUSurfaceConfiguration), "sizeof mismatch for SurfaceConfiguration"); -static_assert(alignof(SurfaceConfiguration) == alignof(WGPUSurfaceConfiguration), "alignof mismatch for SurfaceConfiguration"); -static_assert(offsetof(SurfaceConfiguration, nextInChain) == offsetof(WGPUSurfaceConfiguration, nextInChain), - "offsetof mismatch for SurfaceConfiguration::nextInChain"); -static_assert(offsetof(SurfaceConfiguration, device) == offsetof(WGPUSurfaceConfiguration, device), - "offsetof mismatch for SurfaceConfiguration::device"); -static_assert(offsetof(SurfaceConfiguration, format) == offsetof(WGPUSurfaceConfiguration, format), - "offsetof mismatch for SurfaceConfiguration::format"); -static_assert(offsetof(SurfaceConfiguration, usage) == offsetof(WGPUSurfaceConfiguration, usage), - "offsetof mismatch for SurfaceConfiguration::usage"); -static_assert(offsetof(SurfaceConfiguration, width) == offsetof(WGPUSurfaceConfiguration, width), - "offsetof mismatch for SurfaceConfiguration::width"); -static_assert(offsetof(SurfaceConfiguration, height) == offsetof(WGPUSurfaceConfiguration, height), - "offsetof mismatch for SurfaceConfiguration::height"); -static_assert(offsetof(SurfaceConfiguration, viewFormatCount) == offsetof(WGPUSurfaceConfiguration, viewFormatCount), - "offsetof mismatch for SurfaceConfiguration::viewFormatCount"); -static_assert(offsetof(SurfaceConfiguration, viewFormats) == offsetof(WGPUSurfaceConfiguration, viewFormats), - "offsetof mismatch for SurfaceConfiguration::viewFormats"); -static_assert(offsetof(SurfaceConfiguration, alphaMode) == offsetof(WGPUSurfaceConfiguration, alphaMode), - "offsetof mismatch for SurfaceConfiguration::alphaMode"); -static_assert(offsetof(SurfaceConfiguration, presentMode) == offsetof(WGPUSurfaceConfiguration, presentMode), - "offsetof mismatch for SurfaceConfiguration::presentMode"); - -// SurfaceDescriptorFromWindowsCoreWindow implementation -SurfaceDescriptorFromWindowsCoreWindow::SurfaceDescriptorFromWindowsCoreWindow() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsCoreWindow } {} -struct SurfaceDescriptorFromWindowsCoreWindow::Init { - ChainedStruct * const nextInChain; - void * coreWindow = nullptr; -}; -SurfaceDescriptorFromWindowsCoreWindow::SurfaceDescriptorFromWindowsCoreWindow(SurfaceDescriptorFromWindowsCoreWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsCoreWindow }, - coreWindow(std::move(init.coreWindow)) {} - -SurfaceDescriptorFromWindowsCoreWindow::operator const WGPUSurfaceDescriptorFromWindowsCoreWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsCoreWindow) == sizeof(WGPUSurfaceDescriptorFromWindowsCoreWindow), "sizeof mismatch for SurfaceDescriptorFromWindowsCoreWindow"); -static_assert(alignof(SurfaceDescriptorFromWindowsCoreWindow) == alignof(WGPUSurfaceDescriptorFromWindowsCoreWindow), "alignof mismatch for SurfaceDescriptorFromWindowsCoreWindow"); -static_assert(offsetof(SurfaceDescriptorFromWindowsCoreWindow, coreWindow) == offsetof(WGPUSurfaceDescriptorFromWindowsCoreWindow, coreWindow), - "offsetof mismatch for SurfaceDescriptorFromWindowsCoreWindow::coreWindow"); - -// SurfaceDescriptorFromWindowsUWPSwapChainPanel implementation -SurfaceDescriptorFromWindowsUWPSwapChainPanel::SurfaceDescriptorFromWindowsUWPSwapChainPanel() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel } {} -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel::Init { - ChainedStruct * const nextInChain; - void * swapChainPanel = nullptr; -}; -SurfaceDescriptorFromWindowsUWPSwapChainPanel::SurfaceDescriptorFromWindowsUWPSwapChainPanel(SurfaceDescriptorFromWindowsUWPSwapChainPanel::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel }, - swapChainPanel(std::move(init.swapChainPanel)) {} - -SurfaceDescriptorFromWindowsUWPSwapChainPanel::operator const WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsUWPSwapChainPanel) == sizeof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel), "sizeof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel"); -static_assert(alignof(SurfaceDescriptorFromWindowsUWPSwapChainPanel) == alignof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel), "alignof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel"); -static_assert(offsetof(SurfaceDescriptorFromWindowsUWPSwapChainPanel, swapChainPanel) == offsetof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel, swapChainPanel), - "offsetof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel::swapChainPanel"); - -// SurfaceDescriptorFromWindowsWinUISwapChainPanel implementation -SurfaceDescriptorFromWindowsWinUISwapChainPanel::SurfaceDescriptorFromWindowsWinUISwapChainPanel() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel } {} -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel::Init { - ChainedStruct * const nextInChain; - void * swapChainPanel = nullptr; -}; -SurfaceDescriptorFromWindowsWinUISwapChainPanel::SurfaceDescriptorFromWindowsWinUISwapChainPanel(SurfaceDescriptorFromWindowsWinUISwapChainPanel::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel }, - swapChainPanel(std::move(init.swapChainPanel)) {} - -SurfaceDescriptorFromWindowsWinUISwapChainPanel::operator const WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsWinUISwapChainPanel) == sizeof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel), "sizeof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel"); -static_assert(alignof(SurfaceDescriptorFromWindowsWinUISwapChainPanel) == alignof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel), "alignof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel"); -static_assert(offsetof(SurfaceDescriptorFromWindowsWinUISwapChainPanel, swapChainPanel) == offsetof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel, swapChainPanel), - "offsetof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel::swapChainPanel"); - -// SurfaceSourceAndroidNativeWindow implementation -SurfaceSourceAndroidNativeWindow::SurfaceSourceAndroidNativeWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceAndroidNativeWindow } {} -struct SurfaceSourceAndroidNativeWindow::Init { - ChainedStruct * const nextInChain; - void * window; -}; -SurfaceSourceAndroidNativeWindow::SurfaceSourceAndroidNativeWindow(SurfaceSourceAndroidNativeWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceAndroidNativeWindow }, - window(std::move(init.window)) {} - -SurfaceSourceAndroidNativeWindow::operator const WGPUSurfaceSourceAndroidNativeWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceAndroidNativeWindow) == sizeof(WGPUSurfaceSourceAndroidNativeWindow), "sizeof mismatch for SurfaceSourceAndroidNativeWindow"); -static_assert(alignof(SurfaceSourceAndroidNativeWindow) == alignof(WGPUSurfaceSourceAndroidNativeWindow), "alignof mismatch for SurfaceSourceAndroidNativeWindow"); -static_assert(offsetof(SurfaceSourceAndroidNativeWindow, window) == offsetof(WGPUSurfaceSourceAndroidNativeWindow, window), - "offsetof mismatch for SurfaceSourceAndroidNativeWindow::window"); - -// SurfaceSourceMetalLayer implementation -SurfaceSourceMetalLayer::SurfaceSourceMetalLayer() -: ChainedStruct { nullptr, SType::SurfaceSourceMetalLayer } {} -struct SurfaceSourceMetalLayer::Init { - ChainedStruct * const nextInChain; - void * layer = nullptr; -}; -SurfaceSourceMetalLayer::SurfaceSourceMetalLayer(SurfaceSourceMetalLayer::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceMetalLayer }, - layer(std::move(init.layer)) {} - -SurfaceSourceMetalLayer::operator const WGPUSurfaceSourceMetalLayer&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceMetalLayer) == sizeof(WGPUSurfaceSourceMetalLayer), "sizeof mismatch for SurfaceSourceMetalLayer"); -static_assert(alignof(SurfaceSourceMetalLayer) == alignof(WGPUSurfaceSourceMetalLayer), "alignof mismatch for SurfaceSourceMetalLayer"); -static_assert(offsetof(SurfaceSourceMetalLayer, layer) == offsetof(WGPUSurfaceSourceMetalLayer, layer), - "offsetof mismatch for SurfaceSourceMetalLayer::layer"); - -// SurfaceSourceWaylandSurface implementation -SurfaceSourceWaylandSurface::SurfaceSourceWaylandSurface() -: ChainedStruct { nullptr, SType::SurfaceSourceWaylandSurface } {} -struct SurfaceSourceWaylandSurface::Init { - ChainedStruct * const nextInChain; - void * display = nullptr; - void * surface = nullptr; -}; -SurfaceSourceWaylandSurface::SurfaceSourceWaylandSurface(SurfaceSourceWaylandSurface::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceWaylandSurface }, - display(std::move(init.display)), - surface(std::move(init.surface)) {} - -SurfaceSourceWaylandSurface::operator const WGPUSurfaceSourceWaylandSurface&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceWaylandSurface) == sizeof(WGPUSurfaceSourceWaylandSurface), "sizeof mismatch for SurfaceSourceWaylandSurface"); -static_assert(alignof(SurfaceSourceWaylandSurface) == alignof(WGPUSurfaceSourceWaylandSurface), "alignof mismatch for SurfaceSourceWaylandSurface"); -static_assert(offsetof(SurfaceSourceWaylandSurface, display) == offsetof(WGPUSurfaceSourceWaylandSurface, display), - "offsetof mismatch for SurfaceSourceWaylandSurface::display"); -static_assert(offsetof(SurfaceSourceWaylandSurface, surface) == offsetof(WGPUSurfaceSourceWaylandSurface, surface), - "offsetof mismatch for SurfaceSourceWaylandSurface::surface"); - -// SurfaceSourceWindowsHWND implementation -SurfaceSourceWindowsHWND::SurfaceSourceWindowsHWND() -: ChainedStruct { nullptr, SType::SurfaceSourceWindowsHWND } {} -struct SurfaceSourceWindowsHWND::Init { - ChainedStruct * const nextInChain; - void * hinstance = nullptr; - void * hwnd = nullptr; -}; -SurfaceSourceWindowsHWND::SurfaceSourceWindowsHWND(SurfaceSourceWindowsHWND::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceWindowsHWND }, - hinstance(std::move(init.hinstance)), - hwnd(std::move(init.hwnd)) {} - -SurfaceSourceWindowsHWND::operator const WGPUSurfaceSourceWindowsHWND&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceWindowsHWND) == sizeof(WGPUSurfaceSourceWindowsHWND), "sizeof mismatch for SurfaceSourceWindowsHWND"); -static_assert(alignof(SurfaceSourceWindowsHWND) == alignof(WGPUSurfaceSourceWindowsHWND), "alignof mismatch for SurfaceSourceWindowsHWND"); -static_assert(offsetof(SurfaceSourceWindowsHWND, hinstance) == offsetof(WGPUSurfaceSourceWindowsHWND, hinstance), - "offsetof mismatch for SurfaceSourceWindowsHWND::hinstance"); -static_assert(offsetof(SurfaceSourceWindowsHWND, hwnd) == offsetof(WGPUSurfaceSourceWindowsHWND, hwnd), - "offsetof mismatch for SurfaceSourceWindowsHWND::hwnd"); - -// SurfaceSourceXCBWindow implementation -SurfaceSourceXCBWindow::SurfaceSourceXCBWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceXCBWindow } {} -struct SurfaceSourceXCBWindow::Init { - ChainedStruct * const nextInChain; - void * connection = nullptr; - uint32_t window; -}; -SurfaceSourceXCBWindow::SurfaceSourceXCBWindow(SurfaceSourceXCBWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceXCBWindow }, - connection(std::move(init.connection)), - window(std::move(init.window)) {} - -SurfaceSourceXCBWindow::operator const WGPUSurfaceSourceXCBWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceXCBWindow) == sizeof(WGPUSurfaceSourceXCBWindow), "sizeof mismatch for SurfaceSourceXCBWindow"); -static_assert(alignof(SurfaceSourceXCBWindow) == alignof(WGPUSurfaceSourceXCBWindow), "alignof mismatch for SurfaceSourceXCBWindow"); -static_assert(offsetof(SurfaceSourceXCBWindow, connection) == offsetof(WGPUSurfaceSourceXCBWindow, connection), - "offsetof mismatch for SurfaceSourceXCBWindow::connection"); -static_assert(offsetof(SurfaceSourceXCBWindow, window) == offsetof(WGPUSurfaceSourceXCBWindow, window), - "offsetof mismatch for SurfaceSourceXCBWindow::window"); - -// SurfaceSourceXlibWindow implementation -SurfaceSourceXlibWindow::SurfaceSourceXlibWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceXlibWindow } {} -struct SurfaceSourceXlibWindow::Init { - ChainedStruct * const nextInChain; - void * display = nullptr; - uint64_t window; -}; -SurfaceSourceXlibWindow::SurfaceSourceXlibWindow(SurfaceSourceXlibWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceXlibWindow }, - display(std::move(init.display)), - window(std::move(init.window)) {} - -SurfaceSourceXlibWindow::operator const WGPUSurfaceSourceXlibWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceXlibWindow) == sizeof(WGPUSurfaceSourceXlibWindow), "sizeof mismatch for SurfaceSourceXlibWindow"); -static_assert(alignof(SurfaceSourceXlibWindow) == alignof(WGPUSurfaceSourceXlibWindow), "alignof mismatch for SurfaceSourceXlibWindow"); -static_assert(offsetof(SurfaceSourceXlibWindow, display) == offsetof(WGPUSurfaceSourceXlibWindow, display), - "offsetof mismatch for SurfaceSourceXlibWindow::display"); -static_assert(offsetof(SurfaceSourceXlibWindow, window) == offsetof(WGPUSurfaceSourceXlibWindow, window), - "offsetof mismatch for SurfaceSourceXlibWindow::window"); - -// SurfaceTexture implementation - -SurfaceTexture::operator const WGPUSurfaceTexture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceTexture) == sizeof(WGPUSurfaceTexture), "sizeof mismatch for SurfaceTexture"); -static_assert(alignof(SurfaceTexture) == alignof(WGPUSurfaceTexture), "alignof mismatch for SurfaceTexture"); -static_assert(offsetof(SurfaceTexture, nextInChain) == offsetof(WGPUSurfaceTexture, nextInChain), - "offsetof mismatch for SurfaceTexture::nextInChain"); -static_assert(offsetof(SurfaceTexture, texture) == offsetof(WGPUSurfaceTexture, texture), - "offsetof mismatch for SurfaceTexture::texture"); -static_assert(offsetof(SurfaceTexture, status) == offsetof(WGPUSurfaceTexture, status), - "offsetof mismatch for SurfaceTexture::status"); - -// TexelBufferBindingEntry implementation -TexelBufferBindingEntry::TexelBufferBindingEntry() -: ChainedStruct { nullptr, SType::TexelBufferBindingEntry } {} -struct TexelBufferBindingEntry::Init { - ChainedStruct * const nextInChain; - TexelBufferView texelBufferView = nullptr; -}; -TexelBufferBindingEntry::TexelBufferBindingEntry(TexelBufferBindingEntry::Init&& init) : - ChainedStruct { init.nextInChain, SType::TexelBufferBindingEntry }, - texelBufferView(std::move(init.texelBufferView)) {} - -TexelBufferBindingEntry::operator const WGPUTexelBufferBindingEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferBindingEntry) == sizeof(WGPUTexelBufferBindingEntry), "sizeof mismatch for TexelBufferBindingEntry"); -static_assert(alignof(TexelBufferBindingEntry) == alignof(WGPUTexelBufferBindingEntry), "alignof mismatch for TexelBufferBindingEntry"); -static_assert(offsetof(TexelBufferBindingEntry, texelBufferView) == offsetof(WGPUTexelBufferBindingEntry, texelBufferView), - "offsetof mismatch for TexelBufferBindingEntry::texelBufferView"); - -// TexelBufferBindingLayout implementation -TexelBufferBindingLayout::TexelBufferBindingLayout() -: ChainedStruct { nullptr, SType::TexelBufferBindingLayout } {} -struct TexelBufferBindingLayout::Init { - ChainedStruct * const nextInChain; - TexelBufferAccess access = TexelBufferAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; -}; -TexelBufferBindingLayout::TexelBufferBindingLayout(TexelBufferBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::TexelBufferBindingLayout }, - access(std::move(init.access)), - format(std::move(init.format)) {} - -TexelBufferBindingLayout::operator const WGPUTexelBufferBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferBindingLayout) == sizeof(WGPUTexelBufferBindingLayout), "sizeof mismatch for TexelBufferBindingLayout"); -static_assert(alignof(TexelBufferBindingLayout) == alignof(WGPUTexelBufferBindingLayout), "alignof mismatch for TexelBufferBindingLayout"); -static_assert(offsetof(TexelBufferBindingLayout, access) == offsetof(WGPUTexelBufferBindingLayout, access), - "offsetof mismatch for TexelBufferBindingLayout::access"); -static_assert(offsetof(TexelBufferBindingLayout, format) == offsetof(WGPUTexelBufferBindingLayout, format), - "offsetof mismatch for TexelBufferBindingLayout::format"); - -// TexelBufferViewDescriptor implementation - -TexelBufferViewDescriptor::operator const WGPUTexelBufferViewDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferViewDescriptor) == sizeof(WGPUTexelBufferViewDescriptor), "sizeof mismatch for TexelBufferViewDescriptor"); -static_assert(alignof(TexelBufferViewDescriptor) == alignof(WGPUTexelBufferViewDescriptor), "alignof mismatch for TexelBufferViewDescriptor"); -static_assert(offsetof(TexelBufferViewDescriptor, nextInChain) == offsetof(WGPUTexelBufferViewDescriptor, nextInChain), - "offsetof mismatch for TexelBufferViewDescriptor::nextInChain"); -static_assert(offsetof(TexelBufferViewDescriptor, label) == offsetof(WGPUTexelBufferViewDescriptor, label), - "offsetof mismatch for TexelBufferViewDescriptor::label"); -static_assert(offsetof(TexelBufferViewDescriptor, format) == offsetof(WGPUTexelBufferViewDescriptor, format), - "offsetof mismatch for TexelBufferViewDescriptor::format"); -static_assert(offsetof(TexelBufferViewDescriptor, offset) == offsetof(WGPUTexelBufferViewDescriptor, offset), - "offsetof mismatch for TexelBufferViewDescriptor::offset"); -static_assert(offsetof(TexelBufferViewDescriptor, size) == offsetof(WGPUTexelBufferViewDescriptor, size), - "offsetof mismatch for TexelBufferViewDescriptor::size"); - -// TexelCopyBufferLayout implementation - -TexelCopyBufferLayout::operator const WGPUTexelCopyBufferLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyBufferLayout) == sizeof(WGPUTexelCopyBufferLayout), "sizeof mismatch for TexelCopyBufferLayout"); -static_assert(alignof(TexelCopyBufferLayout) == alignof(WGPUTexelCopyBufferLayout), "alignof mismatch for TexelCopyBufferLayout"); -static_assert(offsetof(TexelCopyBufferLayout, offset) == offsetof(WGPUTexelCopyBufferLayout, offset), - "offsetof mismatch for TexelCopyBufferLayout::offset"); -static_assert(offsetof(TexelCopyBufferLayout, bytesPerRow) == offsetof(WGPUTexelCopyBufferLayout, bytesPerRow), - "offsetof mismatch for TexelCopyBufferLayout::bytesPerRow"); -static_assert(offsetof(TexelCopyBufferLayout, rowsPerImage) == offsetof(WGPUTexelCopyBufferLayout, rowsPerImage), - "offsetof mismatch for TexelCopyBufferLayout::rowsPerImage"); - -// TextureBindingLayout implementation - -TextureBindingLayout::operator const WGPUTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureBindingLayout) == sizeof(WGPUTextureBindingLayout), "sizeof mismatch for TextureBindingLayout"); -static_assert(alignof(TextureBindingLayout) == alignof(WGPUTextureBindingLayout), "alignof mismatch for TextureBindingLayout"); -static_assert(offsetof(TextureBindingLayout, nextInChain) == offsetof(WGPUTextureBindingLayout, nextInChain), - "offsetof mismatch for TextureBindingLayout::nextInChain"); -static_assert(offsetof(TextureBindingLayout, sampleType) == offsetof(WGPUTextureBindingLayout, sampleType), - "offsetof mismatch for TextureBindingLayout::sampleType"); -static_assert(offsetof(TextureBindingLayout, viewDimension) == offsetof(WGPUTextureBindingLayout, viewDimension), - "offsetof mismatch for TextureBindingLayout::viewDimension"); -static_assert(offsetof(TextureBindingLayout, multisampled) == offsetof(WGPUTextureBindingLayout, multisampled), - "offsetof mismatch for TextureBindingLayout::multisampled"); - -// TextureBindingViewDimension implementation -TextureBindingViewDimension::TextureBindingViewDimension() -: ChainedStruct { nullptr, SType::TextureBindingViewDimension } {} -struct TextureBindingViewDimension::Init { - ChainedStruct * const nextInChain; - TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; -}; -TextureBindingViewDimension::TextureBindingViewDimension(TextureBindingViewDimension::Init&& init) : - ChainedStruct { init.nextInChain, SType::TextureBindingViewDimension }, - textureBindingViewDimension(std::move(init.textureBindingViewDimension)) {} - -TextureBindingViewDimension::operator const WGPUTextureBindingViewDimension&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureBindingViewDimension) == sizeof(WGPUTextureBindingViewDimension), "sizeof mismatch for TextureBindingViewDimension"); -static_assert(alignof(TextureBindingViewDimension) == alignof(WGPUTextureBindingViewDimension), "alignof mismatch for TextureBindingViewDimension"); -static_assert(offsetof(TextureBindingViewDimension, textureBindingViewDimension) == offsetof(WGPUTextureBindingViewDimension, textureBindingViewDimension), - "offsetof mismatch for TextureBindingViewDimension::textureBindingViewDimension"); - -// TextureComponentSwizzle implementation - -TextureComponentSwizzle::operator const WGPUTextureComponentSwizzle&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureComponentSwizzle) == sizeof(WGPUTextureComponentSwizzle), "sizeof mismatch for TextureComponentSwizzle"); -static_assert(alignof(TextureComponentSwizzle) == alignof(WGPUTextureComponentSwizzle), "alignof mismatch for TextureComponentSwizzle"); -static_assert(offsetof(TextureComponentSwizzle, r) == offsetof(WGPUTextureComponentSwizzle, r), - "offsetof mismatch for TextureComponentSwizzle::r"); -static_assert(offsetof(TextureComponentSwizzle, g) == offsetof(WGPUTextureComponentSwizzle, g), - "offsetof mismatch for TextureComponentSwizzle::g"); -static_assert(offsetof(TextureComponentSwizzle, b) == offsetof(WGPUTextureComponentSwizzle, b), - "offsetof mismatch for TextureComponentSwizzle::b"); -static_assert(offsetof(TextureComponentSwizzle, a) == offsetof(WGPUTextureComponentSwizzle, a), - "offsetof mismatch for TextureComponentSwizzle::a"); - -// VertexAttribute implementation - -VertexAttribute::operator const WGPUVertexAttribute&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexAttribute) == sizeof(WGPUVertexAttribute), "sizeof mismatch for VertexAttribute"); -static_assert(alignof(VertexAttribute) == alignof(WGPUVertexAttribute), "alignof mismatch for VertexAttribute"); -static_assert(offsetof(VertexAttribute, nextInChain) == offsetof(WGPUVertexAttribute, nextInChain), - "offsetof mismatch for VertexAttribute::nextInChain"); -static_assert(offsetof(VertexAttribute, format) == offsetof(WGPUVertexAttribute, format), - "offsetof mismatch for VertexAttribute::format"); -static_assert(offsetof(VertexAttribute, offset) == offsetof(WGPUVertexAttribute, offset), - "offsetof mismatch for VertexAttribute::offset"); -static_assert(offsetof(VertexAttribute, shaderLocation) == offsetof(WGPUVertexAttribute, shaderLocation), - "offsetof mismatch for VertexAttribute::shaderLocation"); - -// YCbCrVkDescriptor implementation -YCbCrVkDescriptor::YCbCrVkDescriptor() -: ChainedStruct { nullptr, SType::YCbCrVkDescriptor } {} -struct YCbCrVkDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t vkFormat = 0; - uint32_t vkYCbCrModel = 0; - uint32_t vkYCbCrRange = 0; - uint32_t vkComponentSwizzleRed = 0; - uint32_t vkComponentSwizzleGreen = 0; - uint32_t vkComponentSwizzleBlue = 0; - uint32_t vkComponentSwizzleAlpha = 0; - uint32_t vkXChromaOffset = 0; - uint32_t vkYChromaOffset = 0; - FilterMode vkChromaFilter = FilterMode::Undefined; - Bool forceExplicitReconstruction = false; - uint64_t externalFormat = 0; -}; -YCbCrVkDescriptor::YCbCrVkDescriptor(YCbCrVkDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::YCbCrVkDescriptor }, - vkFormat(std::move(init.vkFormat)), - vkYCbCrModel(std::move(init.vkYCbCrModel)), - vkYCbCrRange(std::move(init.vkYCbCrRange)), - vkComponentSwizzleRed(std::move(init.vkComponentSwizzleRed)), - vkComponentSwizzleGreen(std::move(init.vkComponentSwizzleGreen)), - vkComponentSwizzleBlue(std::move(init.vkComponentSwizzleBlue)), - vkComponentSwizzleAlpha(std::move(init.vkComponentSwizzleAlpha)), - vkXChromaOffset(std::move(init.vkXChromaOffset)), - vkYChromaOffset(std::move(init.vkYChromaOffset)), - vkChromaFilter(std::move(init.vkChromaFilter)), - forceExplicitReconstruction(std::move(init.forceExplicitReconstruction)), - externalFormat(std::move(init.externalFormat)) {} - -YCbCrVkDescriptor::operator const WGPUYCbCrVkDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(YCbCrVkDescriptor) == sizeof(WGPUYCbCrVkDescriptor), "sizeof mismatch for YCbCrVkDescriptor"); -static_assert(alignof(YCbCrVkDescriptor) == alignof(WGPUYCbCrVkDescriptor), "alignof mismatch for YCbCrVkDescriptor"); -static_assert(offsetof(YCbCrVkDescriptor, vkFormat) == offsetof(WGPUYCbCrVkDescriptor, vkFormat), - "offsetof mismatch for YCbCrVkDescriptor::vkFormat"); -static_assert(offsetof(YCbCrVkDescriptor, vkYCbCrModel) == offsetof(WGPUYCbCrVkDescriptor, vkYCbCrModel), - "offsetof mismatch for YCbCrVkDescriptor::vkYCbCrModel"); -static_assert(offsetof(YCbCrVkDescriptor, vkYCbCrRange) == offsetof(WGPUYCbCrVkDescriptor, vkYCbCrRange), - "offsetof mismatch for YCbCrVkDescriptor::vkYCbCrRange"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleRed) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleRed), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleRed"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleGreen) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleGreen), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleGreen"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleBlue) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleBlue), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleBlue"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleAlpha) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleAlpha), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleAlpha"); -static_assert(offsetof(YCbCrVkDescriptor, vkXChromaOffset) == offsetof(WGPUYCbCrVkDescriptor, vkXChromaOffset), - "offsetof mismatch for YCbCrVkDescriptor::vkXChromaOffset"); -static_assert(offsetof(YCbCrVkDescriptor, vkYChromaOffset) == offsetof(WGPUYCbCrVkDescriptor, vkYChromaOffset), - "offsetof mismatch for YCbCrVkDescriptor::vkYChromaOffset"); -static_assert(offsetof(YCbCrVkDescriptor, vkChromaFilter) == offsetof(WGPUYCbCrVkDescriptor, vkChromaFilter), - "offsetof mismatch for YCbCrVkDescriptor::vkChromaFilter"); -static_assert(offsetof(YCbCrVkDescriptor, forceExplicitReconstruction) == offsetof(WGPUYCbCrVkDescriptor, forceExplicitReconstruction), - "offsetof mismatch for YCbCrVkDescriptor::forceExplicitReconstruction"); -static_assert(offsetof(YCbCrVkDescriptor, externalFormat) == offsetof(WGPUYCbCrVkDescriptor, externalFormat), - "offsetof mismatch for YCbCrVkDescriptor::externalFormat"); - -// AdapterPropertiesMemoryHeaps implementation -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps() -: ChainedStructOut { nullptr, SType::AdapterPropertiesMemoryHeaps } {} -struct AdapterPropertiesMemoryHeaps::Init { - ChainedStructOut * nextInChain; - size_t const heapCount = {}; - MemoryHeapInfo const * const heapInfo = nullptr; -}; -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesMemoryHeaps }, - heapCount(std::move(init.heapCount)), - heapInfo(std::move(init.heapInfo)) {} -AdapterPropertiesMemoryHeaps::~AdapterPropertiesMemoryHeaps() { - FreeMembers(); -} - -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&& rhs) - : heapCount(rhs.heapCount), - heapInfo(rhs.heapInfo){ - Reset(rhs); -} - -AdapterPropertiesMemoryHeaps& AdapterPropertiesMemoryHeaps::operator=(AdapterPropertiesMemoryHeaps&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->heapCount) = std::move(rhs.heapCount); - detail::AsNonConstReference(this->heapInfo) = std::move(rhs.heapInfo); - Reset(rhs); - return *this; -} - -void AdapterPropertiesMemoryHeaps::FreeMembers() { - bool needsFreeing = false; if (this->heapInfo != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuAdapterPropertiesMemoryHeapsFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterPropertiesMemoryHeaps::Reset(AdapterPropertiesMemoryHeaps& value) { - AdapterPropertiesMemoryHeaps defaultValue{}; - detail::AsNonConstReference(value.heapCount) = defaultValue.heapCount; - detail::AsNonConstReference(value.heapInfo) = defaultValue.heapInfo; -} - -AdapterPropertiesMemoryHeaps::operator const WGPUAdapterPropertiesMemoryHeaps&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesMemoryHeaps) == sizeof(WGPUAdapterPropertiesMemoryHeaps), "sizeof mismatch for AdapterPropertiesMemoryHeaps"); -static_assert(alignof(AdapterPropertiesMemoryHeaps) == alignof(WGPUAdapterPropertiesMemoryHeaps), "alignof mismatch for AdapterPropertiesMemoryHeaps"); -static_assert(offsetof(AdapterPropertiesMemoryHeaps, heapCount) == offsetof(WGPUAdapterPropertiesMemoryHeaps, heapCount), - "offsetof mismatch for AdapterPropertiesMemoryHeaps::heapCount"); -static_assert(offsetof(AdapterPropertiesMemoryHeaps, heapInfo) == offsetof(WGPUAdapterPropertiesMemoryHeaps, heapInfo), - "offsetof mismatch for AdapterPropertiesMemoryHeaps::heapInfo"); - -// AdapterPropertiesSubgroupMatrixConfigs implementation -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs() -: ChainedStructOut { nullptr, SType::AdapterPropertiesSubgroupMatrixConfigs } {} -struct AdapterPropertiesSubgroupMatrixConfigs::Init { - ChainedStructOut * nextInChain; - size_t const configCount = {}; - SubgroupMatrixConfig const * const configs = nullptr; -}; -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesSubgroupMatrixConfigs }, - configCount(std::move(init.configCount)), - configs(std::move(init.configs)) {} -AdapterPropertiesSubgroupMatrixConfigs::~AdapterPropertiesSubgroupMatrixConfigs() { - FreeMembers(); -} - -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs&& rhs) - : configCount(rhs.configCount), - configs(rhs.configs){ - Reset(rhs); -} - -AdapterPropertiesSubgroupMatrixConfigs& AdapterPropertiesSubgroupMatrixConfigs::operator=(AdapterPropertiesSubgroupMatrixConfigs&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->configCount) = std::move(rhs.configCount); - detail::AsNonConstReference(this->configs) = std::move(rhs.configs); - Reset(rhs); - return *this; -} - -void AdapterPropertiesSubgroupMatrixConfigs::FreeMembers() { - bool needsFreeing = false; if (this->configs != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuAdapterPropertiesSubgroupMatrixConfigsFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterPropertiesSubgroupMatrixConfigs::Reset(AdapterPropertiesSubgroupMatrixConfigs& value) { - AdapterPropertiesSubgroupMatrixConfigs defaultValue{}; - detail::AsNonConstReference(value.configCount) = defaultValue.configCount; - detail::AsNonConstReference(value.configs) = defaultValue.configs; -} - -AdapterPropertiesSubgroupMatrixConfigs::operator const WGPUAdapterPropertiesSubgroupMatrixConfigs&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesSubgroupMatrixConfigs) == sizeof(WGPUAdapterPropertiesSubgroupMatrixConfigs), "sizeof mismatch for AdapterPropertiesSubgroupMatrixConfigs"); -static_assert(alignof(AdapterPropertiesSubgroupMatrixConfigs) == alignof(WGPUAdapterPropertiesSubgroupMatrixConfigs), "alignof mismatch for AdapterPropertiesSubgroupMatrixConfigs"); -static_assert(offsetof(AdapterPropertiesSubgroupMatrixConfigs, configCount) == offsetof(WGPUAdapterPropertiesSubgroupMatrixConfigs, configCount), - "offsetof mismatch for AdapterPropertiesSubgroupMatrixConfigs::configCount"); -static_assert(offsetof(AdapterPropertiesSubgroupMatrixConfigs, configs) == offsetof(WGPUAdapterPropertiesSubgroupMatrixConfigs, configs), - "offsetof mismatch for AdapterPropertiesSubgroupMatrixConfigs::configs"); - -// AHardwareBufferProperties implementation - -AHardwareBufferProperties::operator const WGPUAHardwareBufferProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AHardwareBufferProperties) == sizeof(WGPUAHardwareBufferProperties), "sizeof mismatch for AHardwareBufferProperties"); -static_assert(alignof(AHardwareBufferProperties) == alignof(WGPUAHardwareBufferProperties), "alignof mismatch for AHardwareBufferProperties"); -static_assert(offsetof(AHardwareBufferProperties, yCbCrInfo) == offsetof(WGPUAHardwareBufferProperties, yCbCrInfo), - "offsetof mismatch for AHardwareBufferProperties::yCbCrInfo"); - -// BindGroupEntry implementation - -BindGroupEntry::operator const WGPUBindGroupEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupEntry) == sizeof(WGPUBindGroupEntry), "sizeof mismatch for BindGroupEntry"); -static_assert(alignof(BindGroupEntry) == alignof(WGPUBindGroupEntry), "alignof mismatch for BindGroupEntry"); -static_assert(offsetof(BindGroupEntry, nextInChain) == offsetof(WGPUBindGroupEntry, nextInChain), - "offsetof mismatch for BindGroupEntry::nextInChain"); -static_assert(offsetof(BindGroupEntry, binding) == offsetof(WGPUBindGroupEntry, binding), - "offsetof mismatch for BindGroupEntry::binding"); -static_assert(offsetof(BindGroupEntry, buffer) == offsetof(WGPUBindGroupEntry, buffer), - "offsetof mismatch for BindGroupEntry::buffer"); -static_assert(offsetof(BindGroupEntry, offset) == offsetof(WGPUBindGroupEntry, offset), - "offsetof mismatch for BindGroupEntry::offset"); -static_assert(offsetof(BindGroupEntry, size) == offsetof(WGPUBindGroupEntry, size), - "offsetof mismatch for BindGroupEntry::size"); -static_assert(offsetof(BindGroupEntry, sampler) == offsetof(WGPUBindGroupEntry, sampler), - "offsetof mismatch for BindGroupEntry::sampler"); -static_assert(offsetof(BindGroupEntry, textureView) == offsetof(WGPUBindGroupEntry, textureView), - "offsetof mismatch for BindGroupEntry::textureView"); - -// BindGroupLayoutEntry implementation - -BindGroupLayoutEntry::operator const WGPUBindGroupLayoutEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupLayoutEntry) == sizeof(WGPUBindGroupLayoutEntry), "sizeof mismatch for BindGroupLayoutEntry"); -static_assert(alignof(BindGroupLayoutEntry) == alignof(WGPUBindGroupLayoutEntry), "alignof mismatch for BindGroupLayoutEntry"); -static_assert(offsetof(BindGroupLayoutEntry, nextInChain) == offsetof(WGPUBindGroupLayoutEntry, nextInChain), - "offsetof mismatch for BindGroupLayoutEntry::nextInChain"); -static_assert(offsetof(BindGroupLayoutEntry, binding) == offsetof(WGPUBindGroupLayoutEntry, binding), - "offsetof mismatch for BindGroupLayoutEntry::binding"); -static_assert(offsetof(BindGroupLayoutEntry, visibility) == offsetof(WGPUBindGroupLayoutEntry, visibility), - "offsetof mismatch for BindGroupLayoutEntry::visibility"); -static_assert(offsetof(BindGroupLayoutEntry, bindingArraySize) == offsetof(WGPUBindGroupLayoutEntry, bindingArraySize), - "offsetof mismatch for BindGroupLayoutEntry::bindingArraySize"); -static_assert(offsetof(BindGroupLayoutEntry, buffer) == offsetof(WGPUBindGroupLayoutEntry, buffer), - "offsetof mismatch for BindGroupLayoutEntry::buffer"); -static_assert(offsetof(BindGroupLayoutEntry, sampler) == offsetof(WGPUBindGroupLayoutEntry, sampler), - "offsetof mismatch for BindGroupLayoutEntry::sampler"); -static_assert(offsetof(BindGroupLayoutEntry, texture) == offsetof(WGPUBindGroupLayoutEntry, texture), - "offsetof mismatch for BindGroupLayoutEntry::texture"); -static_assert(offsetof(BindGroupLayoutEntry, storageTexture) == offsetof(WGPUBindGroupLayoutEntry, storageTexture), - "offsetof mismatch for BindGroupLayoutEntry::storageTexture"); - -// BlendState implementation - -BlendState::operator const WGPUBlendState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BlendState) == sizeof(WGPUBlendState), "sizeof mismatch for BlendState"); -static_assert(alignof(BlendState) == alignof(WGPUBlendState), "alignof mismatch for BlendState"); -static_assert(offsetof(BlendState, color) == offsetof(WGPUBlendState, color), - "offsetof mismatch for BlendState::color"); -static_assert(offsetof(BlendState, alpha) == offsetof(WGPUBlendState, alpha), - "offsetof mismatch for BlendState::alpha"); - -// BufferDescriptor implementation - -BufferDescriptor::operator const WGPUBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferDescriptor) == sizeof(WGPUBufferDescriptor), "sizeof mismatch for BufferDescriptor"); -static_assert(alignof(BufferDescriptor) == alignof(WGPUBufferDescriptor), "alignof mismatch for BufferDescriptor"); -static_assert(offsetof(BufferDescriptor, nextInChain) == offsetof(WGPUBufferDescriptor, nextInChain), - "offsetof mismatch for BufferDescriptor::nextInChain"); -static_assert(offsetof(BufferDescriptor, label) == offsetof(WGPUBufferDescriptor, label), - "offsetof mismatch for BufferDescriptor::label"); -static_assert(offsetof(BufferDescriptor, usage) == offsetof(WGPUBufferDescriptor, usage), - "offsetof mismatch for BufferDescriptor::usage"); -static_assert(offsetof(BufferDescriptor, size) == offsetof(WGPUBufferDescriptor, size), - "offsetof mismatch for BufferDescriptor::size"); -static_assert(offsetof(BufferDescriptor, mappedAtCreation) == offsetof(WGPUBufferDescriptor, mappedAtCreation), - "offsetof mismatch for BufferDescriptor::mappedAtCreation"); - -// CommandEncoderDescriptor implementation - -CommandEncoderDescriptor::operator const WGPUCommandEncoderDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CommandEncoderDescriptor) == sizeof(WGPUCommandEncoderDescriptor), "sizeof mismatch for CommandEncoderDescriptor"); -static_assert(alignof(CommandEncoderDescriptor) == alignof(WGPUCommandEncoderDescriptor), "alignof mismatch for CommandEncoderDescriptor"); -static_assert(offsetof(CommandEncoderDescriptor, nextInChain) == offsetof(WGPUCommandEncoderDescriptor, nextInChain), - "offsetof mismatch for CommandEncoderDescriptor::nextInChain"); -static_assert(offsetof(CommandEncoderDescriptor, label) == offsetof(WGPUCommandEncoderDescriptor, label), - "offsetof mismatch for CommandEncoderDescriptor::label"); - -// CompilationMessage implementation - -CompilationMessage::operator const WGPUCompilationMessage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompilationMessage) == sizeof(WGPUCompilationMessage), "sizeof mismatch for CompilationMessage"); -static_assert(alignof(CompilationMessage) == alignof(WGPUCompilationMessage), "alignof mismatch for CompilationMessage"); -static_assert(offsetof(CompilationMessage, nextInChain) == offsetof(WGPUCompilationMessage, nextInChain), - "offsetof mismatch for CompilationMessage::nextInChain"); -static_assert(offsetof(CompilationMessage, message) == offsetof(WGPUCompilationMessage, message), - "offsetof mismatch for CompilationMessage::message"); -static_assert(offsetof(CompilationMessage, type) == offsetof(WGPUCompilationMessage, type), - "offsetof mismatch for CompilationMessage::type"); -static_assert(offsetof(CompilationMessage, lineNum) == offsetof(WGPUCompilationMessage, lineNum), - "offsetof mismatch for CompilationMessage::lineNum"); -static_assert(offsetof(CompilationMessage, linePos) == offsetof(WGPUCompilationMessage, linePos), - "offsetof mismatch for CompilationMessage::linePos"); -static_assert(offsetof(CompilationMessage, offset) == offsetof(WGPUCompilationMessage, offset), - "offsetof mismatch for CompilationMessage::offset"); -static_assert(offsetof(CompilationMessage, length) == offsetof(WGPUCompilationMessage, length), - "offsetof mismatch for CompilationMessage::length"); - -// ComputePassDescriptor implementation - -ComputePassDescriptor::operator const WGPUComputePassDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputePassDescriptor) == sizeof(WGPUComputePassDescriptor), "sizeof mismatch for ComputePassDescriptor"); -static_assert(alignof(ComputePassDescriptor) == alignof(WGPUComputePassDescriptor), "alignof mismatch for ComputePassDescriptor"); -static_assert(offsetof(ComputePassDescriptor, nextInChain) == offsetof(WGPUComputePassDescriptor, nextInChain), - "offsetof mismatch for ComputePassDescriptor::nextInChain"); -static_assert(offsetof(ComputePassDescriptor, label) == offsetof(WGPUComputePassDescriptor, label), - "offsetof mismatch for ComputePassDescriptor::label"); -static_assert(offsetof(ComputePassDescriptor, timestampWrites) == offsetof(WGPUComputePassDescriptor, timestampWrites), - "offsetof mismatch for ComputePassDescriptor::timestampWrites"); - -// ComputeState implementation - -ComputeState::operator const WGPUComputeState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputeState) == sizeof(WGPUComputeState), "sizeof mismatch for ComputeState"); -static_assert(alignof(ComputeState) == alignof(WGPUComputeState), "alignof mismatch for ComputeState"); -static_assert(offsetof(ComputeState, nextInChain) == offsetof(WGPUComputeState, nextInChain), - "offsetof mismatch for ComputeState::nextInChain"); -static_assert(offsetof(ComputeState, module) == offsetof(WGPUComputeState, module), - "offsetof mismatch for ComputeState::module"); -static_assert(offsetof(ComputeState, entryPoint) == offsetof(WGPUComputeState, entryPoint), - "offsetof mismatch for ComputeState::entryPoint"); -static_assert(offsetof(ComputeState, constantCount) == offsetof(WGPUComputeState, constantCount), - "offsetof mismatch for ComputeState::constantCount"); -static_assert(offsetof(ComputeState, constants) == offsetof(WGPUComputeState, constants), - "offsetof mismatch for ComputeState::constants"); - -// DawnDrmFormatCapabilities implementation -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities() -: ChainedStructOut { nullptr, SType::DawnDrmFormatCapabilities } {} -struct DawnDrmFormatCapabilities::Init { - ChainedStructOut * nextInChain; - size_t const propertiesCount = {}; - DawnDrmFormatProperties const * const properties = nullptr; -}; -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities(DawnDrmFormatCapabilities::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnDrmFormatCapabilities }, - propertiesCount(std::move(init.propertiesCount)), - properties(std::move(init.properties)) {} -DawnDrmFormatCapabilities::~DawnDrmFormatCapabilities() { - FreeMembers(); -} - -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities(DawnDrmFormatCapabilities&& rhs) - : propertiesCount(rhs.propertiesCount), - properties(rhs.properties){ - Reset(rhs); -} - -DawnDrmFormatCapabilities& DawnDrmFormatCapabilities::operator=(DawnDrmFormatCapabilities&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->propertiesCount) = std::move(rhs.propertiesCount); - detail::AsNonConstReference(this->properties) = std::move(rhs.properties); - Reset(rhs); - return *this; -} - -void DawnDrmFormatCapabilities::FreeMembers() { - bool needsFreeing = false; if (this->properties != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnDrmFormatCapabilitiesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void DawnDrmFormatCapabilities::Reset(DawnDrmFormatCapabilities& value) { - DawnDrmFormatCapabilities defaultValue{}; - detail::AsNonConstReference(value.propertiesCount) = defaultValue.propertiesCount; - detail::AsNonConstReference(value.properties) = defaultValue.properties; -} - -DawnDrmFormatCapabilities::operator const WGPUDawnDrmFormatCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDrmFormatCapabilities) == sizeof(WGPUDawnDrmFormatCapabilities), "sizeof mismatch for DawnDrmFormatCapabilities"); -static_assert(alignof(DawnDrmFormatCapabilities) == alignof(WGPUDawnDrmFormatCapabilities), "alignof mismatch for DawnDrmFormatCapabilities"); -static_assert(offsetof(DawnDrmFormatCapabilities, propertiesCount) == offsetof(WGPUDawnDrmFormatCapabilities, propertiesCount), - "offsetof mismatch for DawnDrmFormatCapabilities::propertiesCount"); -static_assert(offsetof(DawnDrmFormatCapabilities, properties) == offsetof(WGPUDawnDrmFormatCapabilities, properties), - "offsetof mismatch for DawnDrmFormatCapabilities::properties"); - -// DepthStencilState implementation - -DepthStencilState::operator const WGPUDepthStencilState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DepthStencilState) == sizeof(WGPUDepthStencilState), "sizeof mismatch for DepthStencilState"); -static_assert(alignof(DepthStencilState) == alignof(WGPUDepthStencilState), "alignof mismatch for DepthStencilState"); -static_assert(offsetof(DepthStencilState, nextInChain) == offsetof(WGPUDepthStencilState, nextInChain), - "offsetof mismatch for DepthStencilState::nextInChain"); -static_assert(offsetof(DepthStencilState, format) == offsetof(WGPUDepthStencilState, format), - "offsetof mismatch for DepthStencilState::format"); -static_assert(offsetof(DepthStencilState, depthWriteEnabled) == offsetof(WGPUDepthStencilState, depthWriteEnabled), - "offsetof mismatch for DepthStencilState::depthWriteEnabled"); -static_assert(offsetof(DepthStencilState, depthCompare) == offsetof(WGPUDepthStencilState, depthCompare), - "offsetof mismatch for DepthStencilState::depthCompare"); -static_assert(offsetof(DepthStencilState, stencilFront) == offsetof(WGPUDepthStencilState, stencilFront), - "offsetof mismatch for DepthStencilState::stencilFront"); -static_assert(offsetof(DepthStencilState, stencilBack) == offsetof(WGPUDepthStencilState, stencilBack), - "offsetof mismatch for DepthStencilState::stencilBack"); -static_assert(offsetof(DepthStencilState, stencilReadMask) == offsetof(WGPUDepthStencilState, stencilReadMask), - "offsetof mismatch for DepthStencilState::stencilReadMask"); -static_assert(offsetof(DepthStencilState, stencilWriteMask) == offsetof(WGPUDepthStencilState, stencilWriteMask), - "offsetof mismatch for DepthStencilState::stencilWriteMask"); -static_assert(offsetof(DepthStencilState, depthBias) == offsetof(WGPUDepthStencilState, depthBias), - "offsetof mismatch for DepthStencilState::depthBias"); -static_assert(offsetof(DepthStencilState, depthBiasSlopeScale) == offsetof(WGPUDepthStencilState, depthBiasSlopeScale), - "offsetof mismatch for DepthStencilState::depthBiasSlopeScale"); -static_assert(offsetof(DepthStencilState, depthBiasClamp) == offsetof(WGPUDepthStencilState, depthBiasClamp), - "offsetof mismatch for DepthStencilState::depthBiasClamp"); - -// ExternalTextureDescriptor implementation - -ExternalTextureDescriptor::operator const WGPUExternalTextureDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureDescriptor) == sizeof(WGPUExternalTextureDescriptor), "sizeof mismatch for ExternalTextureDescriptor"); -static_assert(alignof(ExternalTextureDescriptor) == alignof(WGPUExternalTextureDescriptor), "alignof mismatch for ExternalTextureDescriptor"); -static_assert(offsetof(ExternalTextureDescriptor, nextInChain) == offsetof(WGPUExternalTextureDescriptor, nextInChain), - "offsetof mismatch for ExternalTextureDescriptor::nextInChain"); -static_assert(offsetof(ExternalTextureDescriptor, label) == offsetof(WGPUExternalTextureDescriptor, label), - "offsetof mismatch for ExternalTextureDescriptor::label"); -static_assert(offsetof(ExternalTextureDescriptor, plane0) == offsetof(WGPUExternalTextureDescriptor, plane0), - "offsetof mismatch for ExternalTextureDescriptor::plane0"); -static_assert(offsetof(ExternalTextureDescriptor, plane1) == offsetof(WGPUExternalTextureDescriptor, plane1), - "offsetof mismatch for ExternalTextureDescriptor::plane1"); -static_assert(offsetof(ExternalTextureDescriptor, cropOrigin) == offsetof(WGPUExternalTextureDescriptor, cropOrigin), - "offsetof mismatch for ExternalTextureDescriptor::cropOrigin"); -static_assert(offsetof(ExternalTextureDescriptor, cropSize) == offsetof(WGPUExternalTextureDescriptor, cropSize), - "offsetof mismatch for ExternalTextureDescriptor::cropSize"); -static_assert(offsetof(ExternalTextureDescriptor, apparentSize) == offsetof(WGPUExternalTextureDescriptor, apparentSize), - "offsetof mismatch for ExternalTextureDescriptor::apparentSize"); -static_assert(offsetof(ExternalTextureDescriptor, doYuvToRgbConversionOnly) == offsetof(WGPUExternalTextureDescriptor, doYuvToRgbConversionOnly), - "offsetof mismatch for ExternalTextureDescriptor::doYuvToRgbConversionOnly"); -static_assert(offsetof(ExternalTextureDescriptor, yuvToRgbConversionMatrix) == offsetof(WGPUExternalTextureDescriptor, yuvToRgbConversionMatrix), - "offsetof mismatch for ExternalTextureDescriptor::yuvToRgbConversionMatrix"); -static_assert(offsetof(ExternalTextureDescriptor, srcTransferFunctionParameters) == offsetof(WGPUExternalTextureDescriptor, srcTransferFunctionParameters), - "offsetof mismatch for ExternalTextureDescriptor::srcTransferFunctionParameters"); -static_assert(offsetof(ExternalTextureDescriptor, dstTransferFunctionParameters) == offsetof(WGPUExternalTextureDescriptor, dstTransferFunctionParameters), - "offsetof mismatch for ExternalTextureDescriptor::dstTransferFunctionParameters"); -static_assert(offsetof(ExternalTextureDescriptor, gamutConversionMatrix) == offsetof(WGPUExternalTextureDescriptor, gamutConversionMatrix), - "offsetof mismatch for ExternalTextureDescriptor::gamutConversionMatrix"); -static_assert(offsetof(ExternalTextureDescriptor, mirrored) == offsetof(WGPUExternalTextureDescriptor, mirrored), - "offsetof mismatch for ExternalTextureDescriptor::mirrored"); -static_assert(offsetof(ExternalTextureDescriptor, rotation) == offsetof(WGPUExternalTextureDescriptor, rotation), - "offsetof mismatch for ExternalTextureDescriptor::rotation"); - -// FutureWaitInfo implementation - -FutureWaitInfo::operator const WGPUFutureWaitInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(FutureWaitInfo) == sizeof(WGPUFutureWaitInfo), "sizeof mismatch for FutureWaitInfo"); -static_assert(alignof(FutureWaitInfo) == alignof(WGPUFutureWaitInfo), "alignof mismatch for FutureWaitInfo"); -static_assert(offsetof(FutureWaitInfo, future) == offsetof(WGPUFutureWaitInfo, future), - "offsetof mismatch for FutureWaitInfo::future"); -static_assert(offsetof(FutureWaitInfo, completed) == offsetof(WGPUFutureWaitInfo, completed), - "offsetof mismatch for FutureWaitInfo::completed"); - -// ImageCopyExternalTexture implementation - -ImageCopyExternalTexture::operator const WGPUImageCopyExternalTexture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ImageCopyExternalTexture) == sizeof(WGPUImageCopyExternalTexture), "sizeof mismatch for ImageCopyExternalTexture"); -static_assert(alignof(ImageCopyExternalTexture) == alignof(WGPUImageCopyExternalTexture), "alignof mismatch for ImageCopyExternalTexture"); -static_assert(offsetof(ImageCopyExternalTexture, nextInChain) == offsetof(WGPUImageCopyExternalTexture, nextInChain), - "offsetof mismatch for ImageCopyExternalTexture::nextInChain"); -static_assert(offsetof(ImageCopyExternalTexture, externalTexture) == offsetof(WGPUImageCopyExternalTexture, externalTexture), - "offsetof mismatch for ImageCopyExternalTexture::externalTexture"); -static_assert(offsetof(ImageCopyExternalTexture, origin) == offsetof(WGPUImageCopyExternalTexture, origin), - "offsetof mismatch for ImageCopyExternalTexture::origin"); -static_assert(offsetof(ImageCopyExternalTexture, naturalSize) == offsetof(WGPUImageCopyExternalTexture, naturalSize), - "offsetof mismatch for ImageCopyExternalTexture::naturalSize"); - -// InstanceDescriptor implementation - -InstanceDescriptor::operator const WGPUInstanceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(InstanceDescriptor) == sizeof(WGPUInstanceDescriptor), "sizeof mismatch for InstanceDescriptor"); -static_assert(alignof(InstanceDescriptor) == alignof(WGPUInstanceDescriptor), "alignof mismatch for InstanceDescriptor"); -static_assert(offsetof(InstanceDescriptor, nextInChain) == offsetof(WGPUInstanceDescriptor, nextInChain), - "offsetof mismatch for InstanceDescriptor::nextInChain"); -static_assert(offsetof(InstanceDescriptor, requiredFeatureCount) == offsetof(WGPUInstanceDescriptor, requiredFeatureCount), - "offsetof mismatch for InstanceDescriptor::requiredFeatureCount"); -static_assert(offsetof(InstanceDescriptor, requiredFeatures) == offsetof(WGPUInstanceDescriptor, requiredFeatures), - "offsetof mismatch for InstanceDescriptor::requiredFeatures"); -static_assert(offsetof(InstanceDescriptor, requiredLimits) == offsetof(WGPUInstanceDescriptor, requiredLimits), - "offsetof mismatch for InstanceDescriptor::requiredLimits"); - -// Limits implementation - -Limits::operator const WGPULimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Limits) == sizeof(WGPULimits), "sizeof mismatch for Limits"); -static_assert(alignof(Limits) == alignof(WGPULimits), "alignof mismatch for Limits"); -static_assert(offsetof(Limits, nextInChain) == offsetof(WGPULimits, nextInChain), - "offsetof mismatch for Limits::nextInChain"); -static_assert(offsetof(Limits, maxTextureDimension1D) == offsetof(WGPULimits, maxTextureDimension1D), - "offsetof mismatch for Limits::maxTextureDimension1D"); -static_assert(offsetof(Limits, maxTextureDimension2D) == offsetof(WGPULimits, maxTextureDimension2D), - "offsetof mismatch for Limits::maxTextureDimension2D"); -static_assert(offsetof(Limits, maxTextureDimension3D) == offsetof(WGPULimits, maxTextureDimension3D), - "offsetof mismatch for Limits::maxTextureDimension3D"); -static_assert(offsetof(Limits, maxTextureArrayLayers) == offsetof(WGPULimits, maxTextureArrayLayers), - "offsetof mismatch for Limits::maxTextureArrayLayers"); -static_assert(offsetof(Limits, maxBindGroups) == offsetof(WGPULimits, maxBindGroups), - "offsetof mismatch for Limits::maxBindGroups"); -static_assert(offsetof(Limits, maxBindGroupsPlusVertexBuffers) == offsetof(WGPULimits, maxBindGroupsPlusVertexBuffers), - "offsetof mismatch for Limits::maxBindGroupsPlusVertexBuffers"); -static_assert(offsetof(Limits, maxBindingsPerBindGroup) == offsetof(WGPULimits, maxBindingsPerBindGroup), - "offsetof mismatch for Limits::maxBindingsPerBindGroup"); -static_assert(offsetof(Limits, maxDynamicUniformBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicUniformBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicUniformBuffersPerPipelineLayout"); -static_assert(offsetof(Limits, maxDynamicStorageBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicStorageBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicStorageBuffersPerPipelineLayout"); -static_assert(offsetof(Limits, maxSampledTexturesPerShaderStage) == offsetof(WGPULimits, maxSampledTexturesPerShaderStage), - "offsetof mismatch for Limits::maxSampledTexturesPerShaderStage"); -static_assert(offsetof(Limits, maxSamplersPerShaderStage) == offsetof(WGPULimits, maxSamplersPerShaderStage), - "offsetof mismatch for Limits::maxSamplersPerShaderStage"); -static_assert(offsetof(Limits, maxStorageBuffersPerShaderStage) == offsetof(WGPULimits, maxStorageBuffersPerShaderStage), - "offsetof mismatch for Limits::maxStorageBuffersPerShaderStage"); -static_assert(offsetof(Limits, maxStorageTexturesPerShaderStage) == offsetof(WGPULimits, maxStorageTexturesPerShaderStage), - "offsetof mismatch for Limits::maxStorageTexturesPerShaderStage"); -static_assert(offsetof(Limits, maxUniformBuffersPerShaderStage) == offsetof(WGPULimits, maxUniformBuffersPerShaderStage), - "offsetof mismatch for Limits::maxUniformBuffersPerShaderStage"); -static_assert(offsetof(Limits, maxUniformBufferBindingSize) == offsetof(WGPULimits, maxUniformBufferBindingSize), - "offsetof mismatch for Limits::maxUniformBufferBindingSize"); -static_assert(offsetof(Limits, maxStorageBufferBindingSize) == offsetof(WGPULimits, maxStorageBufferBindingSize), - "offsetof mismatch for Limits::maxStorageBufferBindingSize"); -static_assert(offsetof(Limits, minUniformBufferOffsetAlignment) == offsetof(WGPULimits, minUniformBufferOffsetAlignment), - "offsetof mismatch for Limits::minUniformBufferOffsetAlignment"); -static_assert(offsetof(Limits, minStorageBufferOffsetAlignment) == offsetof(WGPULimits, minStorageBufferOffsetAlignment), - "offsetof mismatch for Limits::minStorageBufferOffsetAlignment"); -static_assert(offsetof(Limits, maxVertexBuffers) == offsetof(WGPULimits, maxVertexBuffers), - "offsetof mismatch for Limits::maxVertexBuffers"); -static_assert(offsetof(Limits, maxBufferSize) == offsetof(WGPULimits, maxBufferSize), - "offsetof mismatch for Limits::maxBufferSize"); -static_assert(offsetof(Limits, maxVertexAttributes) == offsetof(WGPULimits, maxVertexAttributes), - "offsetof mismatch for Limits::maxVertexAttributes"); -static_assert(offsetof(Limits, maxVertexBufferArrayStride) == offsetof(WGPULimits, maxVertexBufferArrayStride), - "offsetof mismatch for Limits::maxVertexBufferArrayStride"); -static_assert(offsetof(Limits, maxInterStageShaderVariables) == offsetof(WGPULimits, maxInterStageShaderVariables), - "offsetof mismatch for Limits::maxInterStageShaderVariables"); -static_assert(offsetof(Limits, maxColorAttachments) == offsetof(WGPULimits, maxColorAttachments), - "offsetof mismatch for Limits::maxColorAttachments"); -static_assert(offsetof(Limits, maxColorAttachmentBytesPerSample) == offsetof(WGPULimits, maxColorAttachmentBytesPerSample), - "offsetof mismatch for Limits::maxColorAttachmentBytesPerSample"); -static_assert(offsetof(Limits, maxComputeWorkgroupStorageSize) == offsetof(WGPULimits, maxComputeWorkgroupStorageSize), - "offsetof mismatch for Limits::maxComputeWorkgroupStorageSize"); -static_assert(offsetof(Limits, maxComputeInvocationsPerWorkgroup) == offsetof(WGPULimits, maxComputeInvocationsPerWorkgroup), - "offsetof mismatch for Limits::maxComputeInvocationsPerWorkgroup"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeX) == offsetof(WGPULimits, maxComputeWorkgroupSizeX), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeX"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeY) == offsetof(WGPULimits, maxComputeWorkgroupSizeY), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeY"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeZ) == offsetof(WGPULimits, maxComputeWorkgroupSizeZ), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeZ"); -static_assert(offsetof(Limits, maxComputeWorkgroupsPerDimension) == offsetof(WGPULimits, maxComputeWorkgroupsPerDimension), - "offsetof mismatch for Limits::maxComputeWorkgroupsPerDimension"); -static_assert(offsetof(Limits, maxImmediateSize) == offsetof(WGPULimits, maxImmediateSize), - "offsetof mismatch for Limits::maxImmediateSize"); - -// PipelineLayoutPixelLocalStorage implementation -PipelineLayoutPixelLocalStorage::PipelineLayoutPixelLocalStorage() -: ChainedStruct { nullptr, SType::PipelineLayoutPixelLocalStorage } {} -struct PipelineLayoutPixelLocalStorage::Init { - ChainedStruct * const nextInChain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - PipelineLayoutStorageAttachment const * storageAttachments = nullptr; -}; -PipelineLayoutPixelLocalStorage::PipelineLayoutPixelLocalStorage(PipelineLayoutPixelLocalStorage::Init&& init) : - ChainedStruct { init.nextInChain, SType::PipelineLayoutPixelLocalStorage }, - totalPixelLocalStorageSize(std::move(init.totalPixelLocalStorageSize)), - storageAttachmentCount(std::move(init.storageAttachmentCount)), - storageAttachments(std::move(init.storageAttachments)) {} - -PipelineLayoutPixelLocalStorage::operator const WGPUPipelineLayoutPixelLocalStorage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutPixelLocalStorage) == sizeof(WGPUPipelineLayoutPixelLocalStorage), "sizeof mismatch for PipelineLayoutPixelLocalStorage"); -static_assert(alignof(PipelineLayoutPixelLocalStorage) == alignof(WGPUPipelineLayoutPixelLocalStorage), "alignof mismatch for PipelineLayoutPixelLocalStorage"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, totalPixelLocalStorageSize) == offsetof(WGPUPipelineLayoutPixelLocalStorage, totalPixelLocalStorageSize), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::totalPixelLocalStorageSize"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, storageAttachmentCount) == offsetof(WGPUPipelineLayoutPixelLocalStorage, storageAttachmentCount), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::storageAttachmentCount"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, storageAttachments) == offsetof(WGPUPipelineLayoutPixelLocalStorage, storageAttachments), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::storageAttachments"); - -// RenderPassColorAttachment implementation - -RenderPassColorAttachment::operator const WGPURenderPassColorAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassColorAttachment) == sizeof(WGPURenderPassColorAttachment), "sizeof mismatch for RenderPassColorAttachment"); -static_assert(alignof(RenderPassColorAttachment) == alignof(WGPURenderPassColorAttachment), "alignof mismatch for RenderPassColorAttachment"); -static_assert(offsetof(RenderPassColorAttachment, nextInChain) == offsetof(WGPURenderPassColorAttachment, nextInChain), - "offsetof mismatch for RenderPassColorAttachment::nextInChain"); -static_assert(offsetof(RenderPassColorAttachment, view) == offsetof(WGPURenderPassColorAttachment, view), - "offsetof mismatch for RenderPassColorAttachment::view"); -static_assert(offsetof(RenderPassColorAttachment, depthSlice) == offsetof(WGPURenderPassColorAttachment, depthSlice), - "offsetof mismatch for RenderPassColorAttachment::depthSlice"); -static_assert(offsetof(RenderPassColorAttachment, resolveTarget) == offsetof(WGPURenderPassColorAttachment, resolveTarget), - "offsetof mismatch for RenderPassColorAttachment::resolveTarget"); -static_assert(offsetof(RenderPassColorAttachment, loadOp) == offsetof(WGPURenderPassColorAttachment, loadOp), - "offsetof mismatch for RenderPassColorAttachment::loadOp"); -static_assert(offsetof(RenderPassColorAttachment, storeOp) == offsetof(WGPURenderPassColorAttachment, storeOp), - "offsetof mismatch for RenderPassColorAttachment::storeOp"); -static_assert(offsetof(RenderPassColorAttachment, clearValue) == offsetof(WGPURenderPassColorAttachment, clearValue), - "offsetof mismatch for RenderPassColorAttachment::clearValue"); - -// RenderPassRenderAreaRect implementation -RenderPassRenderAreaRect::RenderPassRenderAreaRect() -: ChainedStruct { nullptr, SType::RenderPassRenderAreaRect } {} -struct RenderPassRenderAreaRect::Init { - ChainedStruct * const nextInChain; - Origin2D origin = {}; - Extent2D size = {}; -}; -RenderPassRenderAreaRect::RenderPassRenderAreaRect(RenderPassRenderAreaRect::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassRenderAreaRect }, - origin(std::move(init.origin)), - size(std::move(init.size)) {} - -RenderPassRenderAreaRect::operator const WGPURenderPassRenderAreaRect&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassRenderAreaRect) == sizeof(WGPURenderPassRenderAreaRect), "sizeof mismatch for RenderPassRenderAreaRect"); -static_assert(alignof(RenderPassRenderAreaRect) == alignof(WGPURenderPassRenderAreaRect), "alignof mismatch for RenderPassRenderAreaRect"); -static_assert(offsetof(RenderPassRenderAreaRect, origin) == offsetof(WGPURenderPassRenderAreaRect, origin), - "offsetof mismatch for RenderPassRenderAreaRect::origin"); -static_assert(offsetof(RenderPassRenderAreaRect, size) == offsetof(WGPURenderPassRenderAreaRect, size), - "offsetof mismatch for RenderPassRenderAreaRect::size"); - -// RenderPassStorageAttachment implementation - -RenderPassStorageAttachment::operator const WGPURenderPassStorageAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassStorageAttachment) == sizeof(WGPURenderPassStorageAttachment), "sizeof mismatch for RenderPassStorageAttachment"); -static_assert(alignof(RenderPassStorageAttachment) == alignof(WGPURenderPassStorageAttachment), "alignof mismatch for RenderPassStorageAttachment"); -static_assert(offsetof(RenderPassStorageAttachment, nextInChain) == offsetof(WGPURenderPassStorageAttachment, nextInChain), - "offsetof mismatch for RenderPassStorageAttachment::nextInChain"); -static_assert(offsetof(RenderPassStorageAttachment, offset) == offsetof(WGPURenderPassStorageAttachment, offset), - "offsetof mismatch for RenderPassStorageAttachment::offset"); -static_assert(offsetof(RenderPassStorageAttachment, storage) == offsetof(WGPURenderPassStorageAttachment, storage), - "offsetof mismatch for RenderPassStorageAttachment::storage"); -static_assert(offsetof(RenderPassStorageAttachment, loadOp) == offsetof(WGPURenderPassStorageAttachment, loadOp), - "offsetof mismatch for RenderPassStorageAttachment::loadOp"); -static_assert(offsetof(RenderPassStorageAttachment, storeOp) == offsetof(WGPURenderPassStorageAttachment, storeOp), - "offsetof mismatch for RenderPassStorageAttachment::storeOp"); -static_assert(offsetof(RenderPassStorageAttachment, clearValue) == offsetof(WGPURenderPassStorageAttachment, clearValue), - "offsetof mismatch for RenderPassStorageAttachment::clearValue"); - -// RequestAdapterOptions implementation - -RequestAdapterOptions::operator const WGPURequestAdapterOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterOptions) == sizeof(WGPURequestAdapterOptions), "sizeof mismatch for RequestAdapterOptions"); -static_assert(alignof(RequestAdapterOptions) == alignof(WGPURequestAdapterOptions), "alignof mismatch for RequestAdapterOptions"); -static_assert(offsetof(RequestAdapterOptions, nextInChain) == offsetof(WGPURequestAdapterOptions, nextInChain), - "offsetof mismatch for RequestAdapterOptions::nextInChain"); -static_assert(offsetof(RequestAdapterOptions, featureLevel) == offsetof(WGPURequestAdapterOptions, featureLevel), - "offsetof mismatch for RequestAdapterOptions::featureLevel"); -static_assert(offsetof(RequestAdapterOptions, powerPreference) == offsetof(WGPURequestAdapterOptions, powerPreference), - "offsetof mismatch for RequestAdapterOptions::powerPreference"); -static_assert(offsetof(RequestAdapterOptions, forceFallbackAdapter) == offsetof(WGPURequestAdapterOptions, forceFallbackAdapter), - "offsetof mismatch for RequestAdapterOptions::forceFallbackAdapter"); -static_assert(offsetof(RequestAdapterOptions, backendType) == offsetof(WGPURequestAdapterOptions, backendType), - "offsetof mismatch for RequestAdapterOptions::backendType"); -static_assert(offsetof(RequestAdapterOptions, compatibleSurface) == offsetof(WGPURequestAdapterOptions, compatibleSurface), - "offsetof mismatch for RequestAdapterOptions::compatibleSurface"); - -// SamplerDescriptor implementation - -SamplerDescriptor::operator const WGPUSamplerDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SamplerDescriptor) == sizeof(WGPUSamplerDescriptor), "sizeof mismatch for SamplerDescriptor"); -static_assert(alignof(SamplerDescriptor) == alignof(WGPUSamplerDescriptor), "alignof mismatch for SamplerDescriptor"); -static_assert(offsetof(SamplerDescriptor, nextInChain) == offsetof(WGPUSamplerDescriptor, nextInChain), - "offsetof mismatch for SamplerDescriptor::nextInChain"); -static_assert(offsetof(SamplerDescriptor, label) == offsetof(WGPUSamplerDescriptor, label), - "offsetof mismatch for SamplerDescriptor::label"); -static_assert(offsetof(SamplerDescriptor, addressModeU) == offsetof(WGPUSamplerDescriptor, addressModeU), - "offsetof mismatch for SamplerDescriptor::addressModeU"); -static_assert(offsetof(SamplerDescriptor, addressModeV) == offsetof(WGPUSamplerDescriptor, addressModeV), - "offsetof mismatch for SamplerDescriptor::addressModeV"); -static_assert(offsetof(SamplerDescriptor, addressModeW) == offsetof(WGPUSamplerDescriptor, addressModeW), - "offsetof mismatch for SamplerDescriptor::addressModeW"); -static_assert(offsetof(SamplerDescriptor, magFilter) == offsetof(WGPUSamplerDescriptor, magFilter), - "offsetof mismatch for SamplerDescriptor::magFilter"); -static_assert(offsetof(SamplerDescriptor, minFilter) == offsetof(WGPUSamplerDescriptor, minFilter), - "offsetof mismatch for SamplerDescriptor::minFilter"); -static_assert(offsetof(SamplerDescriptor, mipmapFilter) == offsetof(WGPUSamplerDescriptor, mipmapFilter), - "offsetof mismatch for SamplerDescriptor::mipmapFilter"); -static_assert(offsetof(SamplerDescriptor, lodMinClamp) == offsetof(WGPUSamplerDescriptor, lodMinClamp), - "offsetof mismatch for SamplerDescriptor::lodMinClamp"); -static_assert(offsetof(SamplerDescriptor, lodMaxClamp) == offsetof(WGPUSamplerDescriptor, lodMaxClamp), - "offsetof mismatch for SamplerDescriptor::lodMaxClamp"); -static_assert(offsetof(SamplerDescriptor, compare) == offsetof(WGPUSamplerDescriptor, compare), - "offsetof mismatch for SamplerDescriptor::compare"); -static_assert(offsetof(SamplerDescriptor, maxAnisotropy) == offsetof(WGPUSamplerDescriptor, maxAnisotropy), - "offsetof mismatch for SamplerDescriptor::maxAnisotropy"); - -// ShaderModuleDescriptor implementation - -ShaderModuleDescriptor::operator const WGPUShaderModuleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderModuleDescriptor) == sizeof(WGPUShaderModuleDescriptor), "sizeof mismatch for ShaderModuleDescriptor"); -static_assert(alignof(ShaderModuleDescriptor) == alignof(WGPUShaderModuleDescriptor), "alignof mismatch for ShaderModuleDescriptor"); -static_assert(offsetof(ShaderModuleDescriptor, nextInChain) == offsetof(WGPUShaderModuleDescriptor, nextInChain), - "offsetof mismatch for ShaderModuleDescriptor::nextInChain"); -static_assert(offsetof(ShaderModuleDescriptor, label) == offsetof(WGPUShaderModuleDescriptor, label), - "offsetof mismatch for ShaderModuleDescriptor::label"); - -// SharedBufferMemoryDescriptor implementation - -SharedBufferMemoryDescriptor::operator const WGPUSharedBufferMemoryDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryDescriptor) == sizeof(WGPUSharedBufferMemoryDescriptor), "sizeof mismatch for SharedBufferMemoryDescriptor"); -static_assert(alignof(SharedBufferMemoryDescriptor) == alignof(WGPUSharedBufferMemoryDescriptor), "alignof mismatch for SharedBufferMemoryDescriptor"); -static_assert(offsetof(SharedBufferMemoryDescriptor, nextInChain) == offsetof(WGPUSharedBufferMemoryDescriptor, nextInChain), - "offsetof mismatch for SharedBufferMemoryDescriptor::nextInChain"); -static_assert(offsetof(SharedBufferMemoryDescriptor, label) == offsetof(WGPUSharedBufferMemoryDescriptor, label), - "offsetof mismatch for SharedBufferMemoryDescriptor::label"); - -// SharedFenceDescriptor implementation - -SharedFenceDescriptor::operator const WGPUSharedFenceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDescriptor) == sizeof(WGPUSharedFenceDescriptor), "sizeof mismatch for SharedFenceDescriptor"); -static_assert(alignof(SharedFenceDescriptor) == alignof(WGPUSharedFenceDescriptor), "alignof mismatch for SharedFenceDescriptor"); -static_assert(offsetof(SharedFenceDescriptor, nextInChain) == offsetof(WGPUSharedFenceDescriptor, nextInChain), - "offsetof mismatch for SharedFenceDescriptor::nextInChain"); -static_assert(offsetof(SharedFenceDescriptor, label) == offsetof(WGPUSharedFenceDescriptor, label), - "offsetof mismatch for SharedFenceDescriptor::label"); - -// SharedFenceExportInfo implementation - -SharedFenceExportInfo::operator const WGPUSharedFenceExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceExportInfo) == sizeof(WGPUSharedFenceExportInfo), "sizeof mismatch for SharedFenceExportInfo"); -static_assert(alignof(SharedFenceExportInfo) == alignof(WGPUSharedFenceExportInfo), "alignof mismatch for SharedFenceExportInfo"); -static_assert(offsetof(SharedFenceExportInfo, nextInChain) == offsetof(WGPUSharedFenceExportInfo, nextInChain), - "offsetof mismatch for SharedFenceExportInfo::nextInChain"); -static_assert(offsetof(SharedFenceExportInfo, type) == offsetof(WGPUSharedFenceExportInfo, type), - "offsetof mismatch for SharedFenceExportInfo::type"); - -// SharedTextureMemoryAHardwareBufferProperties implementation -SharedTextureMemoryAHardwareBufferProperties::SharedTextureMemoryAHardwareBufferProperties() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryAHardwareBufferProperties } {} -struct SharedTextureMemoryAHardwareBufferProperties::Init { - ChainedStructOut * nextInChain; - YCbCrVkDescriptor yCbCrInfo = {}; -}; -SharedTextureMemoryAHardwareBufferProperties::SharedTextureMemoryAHardwareBufferProperties(SharedTextureMemoryAHardwareBufferProperties::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryAHardwareBufferProperties }, - yCbCrInfo(std::move(init.yCbCrInfo)) {} - -SharedTextureMemoryAHardwareBufferProperties::operator const WGPUSharedTextureMemoryAHardwareBufferProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryAHardwareBufferProperties) == sizeof(WGPUSharedTextureMemoryAHardwareBufferProperties), "sizeof mismatch for SharedTextureMemoryAHardwareBufferProperties"); -static_assert(alignof(SharedTextureMemoryAHardwareBufferProperties) == alignof(WGPUSharedTextureMemoryAHardwareBufferProperties), "alignof mismatch for SharedTextureMemoryAHardwareBufferProperties"); -static_assert(offsetof(SharedTextureMemoryAHardwareBufferProperties, yCbCrInfo) == offsetof(WGPUSharedTextureMemoryAHardwareBufferProperties, yCbCrInfo), - "offsetof mismatch for SharedTextureMemoryAHardwareBufferProperties::yCbCrInfo"); - -// SharedTextureMemoryBeginAccessDescriptor implementation - -SharedTextureMemoryBeginAccessDescriptor::operator const WGPUSharedTextureMemoryBeginAccessDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryBeginAccessDescriptor) == sizeof(WGPUSharedTextureMemoryBeginAccessDescriptor), "sizeof mismatch for SharedTextureMemoryBeginAccessDescriptor"); -static_assert(alignof(SharedTextureMemoryBeginAccessDescriptor) == alignof(WGPUSharedTextureMemoryBeginAccessDescriptor), "alignof mismatch for SharedTextureMemoryBeginAccessDescriptor"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, nextInChain) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, nextInChain), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::nextInChain"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, concurrentRead) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, concurrentRead), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::concurrentRead"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, initialized) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, initialized), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::initialized"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, fenceCount) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, fenceCount), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::fenceCount"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, fences) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, fences), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::fences"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, signaledValueCount) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, signaledValueCount), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::signaledValueCount"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, signaledValues) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, signaledValues), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::signaledValues"); - -// SharedTextureMemoryDmaBufDescriptor implementation -SharedTextureMemoryDmaBufDescriptor::SharedTextureMemoryDmaBufDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryDmaBufDescriptor } {} -struct SharedTextureMemoryDmaBufDescriptor::Init { - ChainedStruct * const nextInChain; - Extent3D size = {}; - uint32_t drmFormat; - uint64_t drmModifier; - size_t planeCount; - SharedTextureMemoryDmaBufPlane const * planes = nullptr; -}; -SharedTextureMemoryDmaBufDescriptor::SharedTextureMemoryDmaBufDescriptor(SharedTextureMemoryDmaBufDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryDmaBufDescriptor }, - size(std::move(init.size)), - drmFormat(std::move(init.drmFormat)), - drmModifier(std::move(init.drmModifier)), - planeCount(std::move(init.planeCount)), - planes(std::move(init.planes)) {} - -SharedTextureMemoryDmaBufDescriptor::operator const WGPUSharedTextureMemoryDmaBufDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDmaBufDescriptor) == sizeof(WGPUSharedTextureMemoryDmaBufDescriptor), "sizeof mismatch for SharedTextureMemoryDmaBufDescriptor"); -static_assert(alignof(SharedTextureMemoryDmaBufDescriptor) == alignof(WGPUSharedTextureMemoryDmaBufDescriptor), "alignof mismatch for SharedTextureMemoryDmaBufDescriptor"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, size) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, size), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::size"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, drmFormat) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, drmFormat), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::drmFormat"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, drmModifier) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, drmModifier), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::drmModifier"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planeCount) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, planeCount), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::planeCount"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planes) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, planes), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::planes"); - -// SharedTextureMemoryMetalEndAccessState implementation -SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryMetalEndAccessState } {} -struct SharedTextureMemoryMetalEndAccessState::Init { - ChainedStructOut * nextInChain; - Future commandsScheduledFuture = {}; -}; -SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState(SharedTextureMemoryMetalEndAccessState::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryMetalEndAccessState }, - commandsScheduledFuture(std::move(init.commandsScheduledFuture)) {} - -SharedTextureMemoryMetalEndAccessState::operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryMetalEndAccessState) == sizeof(WGPUSharedTextureMemoryMetalEndAccessState), "sizeof mismatch for SharedTextureMemoryMetalEndAccessState"); -static_assert(alignof(SharedTextureMemoryMetalEndAccessState) == alignof(WGPUSharedTextureMemoryMetalEndAccessState), "alignof mismatch for SharedTextureMemoryMetalEndAccessState"); -static_assert(offsetof(SharedTextureMemoryMetalEndAccessState, commandsScheduledFuture) == offsetof(WGPUSharedTextureMemoryMetalEndAccessState, commandsScheduledFuture), - "offsetof mismatch for SharedTextureMemoryMetalEndAccessState::commandsScheduledFuture"); - -// SurfaceDescriptor implementation - -SurfaceDescriptor::operator const WGPUSurfaceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptor) == sizeof(WGPUSurfaceDescriptor), "sizeof mismatch for SurfaceDescriptor"); -static_assert(alignof(SurfaceDescriptor) == alignof(WGPUSurfaceDescriptor), "alignof mismatch for SurfaceDescriptor"); -static_assert(offsetof(SurfaceDescriptor, nextInChain) == offsetof(WGPUSurfaceDescriptor, nextInChain), - "offsetof mismatch for SurfaceDescriptor::nextInChain"); -static_assert(offsetof(SurfaceDescriptor, label) == offsetof(WGPUSurfaceDescriptor, label), - "offsetof mismatch for SurfaceDescriptor::label"); - -// TexelCopyBufferInfo implementation - -TexelCopyBufferInfo::operator const WGPUTexelCopyBufferInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyBufferInfo) == sizeof(WGPUTexelCopyBufferInfo), "sizeof mismatch for TexelCopyBufferInfo"); -static_assert(alignof(TexelCopyBufferInfo) == alignof(WGPUTexelCopyBufferInfo), "alignof mismatch for TexelCopyBufferInfo"); -static_assert(offsetof(TexelCopyBufferInfo, layout) == offsetof(WGPUTexelCopyBufferInfo, layout), - "offsetof mismatch for TexelCopyBufferInfo::layout"); -static_assert(offsetof(TexelCopyBufferInfo, buffer) == offsetof(WGPUTexelCopyBufferInfo, buffer), - "offsetof mismatch for TexelCopyBufferInfo::buffer"); - -// TexelCopyTextureInfo implementation - -TexelCopyTextureInfo::operator const WGPUTexelCopyTextureInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyTextureInfo) == sizeof(WGPUTexelCopyTextureInfo), "sizeof mismatch for TexelCopyTextureInfo"); -static_assert(alignof(TexelCopyTextureInfo) == alignof(WGPUTexelCopyTextureInfo), "alignof mismatch for TexelCopyTextureInfo"); -static_assert(offsetof(TexelCopyTextureInfo, texture) == offsetof(WGPUTexelCopyTextureInfo, texture), - "offsetof mismatch for TexelCopyTextureInfo::texture"); -static_assert(offsetof(TexelCopyTextureInfo, mipLevel) == offsetof(WGPUTexelCopyTextureInfo, mipLevel), - "offsetof mismatch for TexelCopyTextureInfo::mipLevel"); -static_assert(offsetof(TexelCopyTextureInfo, origin) == offsetof(WGPUTexelCopyTextureInfo, origin), - "offsetof mismatch for TexelCopyTextureInfo::origin"); -static_assert(offsetof(TexelCopyTextureInfo, aspect) == offsetof(WGPUTexelCopyTextureInfo, aspect), - "offsetof mismatch for TexelCopyTextureInfo::aspect"); - -// TextureComponentSwizzleDescriptor implementation -TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor() -: ChainedStruct { nullptr, SType::TextureComponentSwizzleDescriptor } {} -struct TextureComponentSwizzleDescriptor::Init { - ChainedStruct * const nextInChain; - TextureComponentSwizzle swizzle = {}; -}; -TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor(TextureComponentSwizzleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::TextureComponentSwizzleDescriptor }, - swizzle(std::move(init.swizzle)) {} - -TextureComponentSwizzleDescriptor::operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureComponentSwizzleDescriptor) == sizeof(WGPUTextureComponentSwizzleDescriptor), "sizeof mismatch for TextureComponentSwizzleDescriptor"); -static_assert(alignof(TextureComponentSwizzleDescriptor) == alignof(WGPUTextureComponentSwizzleDescriptor), "alignof mismatch for TextureComponentSwizzleDescriptor"); -static_assert(offsetof(TextureComponentSwizzleDescriptor, swizzle) == offsetof(WGPUTextureComponentSwizzleDescriptor, swizzle), - "offsetof mismatch for TextureComponentSwizzleDescriptor::swizzle"); - -// TextureDescriptor implementation - -TextureDescriptor::operator const WGPUTextureDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureDescriptor) == sizeof(WGPUTextureDescriptor), "sizeof mismatch for TextureDescriptor"); -static_assert(alignof(TextureDescriptor) == alignof(WGPUTextureDescriptor), "alignof mismatch for TextureDescriptor"); -static_assert(offsetof(TextureDescriptor, nextInChain) == offsetof(WGPUTextureDescriptor, nextInChain), - "offsetof mismatch for TextureDescriptor::nextInChain"); -static_assert(offsetof(TextureDescriptor, label) == offsetof(WGPUTextureDescriptor, label), - "offsetof mismatch for TextureDescriptor::label"); -static_assert(offsetof(TextureDescriptor, usage) == offsetof(WGPUTextureDescriptor, usage), - "offsetof mismatch for TextureDescriptor::usage"); -static_assert(offsetof(TextureDescriptor, dimension) == offsetof(WGPUTextureDescriptor, dimension), - "offsetof mismatch for TextureDescriptor::dimension"); -static_assert(offsetof(TextureDescriptor, size) == offsetof(WGPUTextureDescriptor, size), - "offsetof mismatch for TextureDescriptor::size"); -static_assert(offsetof(TextureDescriptor, format) == offsetof(WGPUTextureDescriptor, format), - "offsetof mismatch for TextureDescriptor::format"); -static_assert(offsetof(TextureDescriptor, mipLevelCount) == offsetof(WGPUTextureDescriptor, mipLevelCount), - "offsetof mismatch for TextureDescriptor::mipLevelCount"); -static_assert(offsetof(TextureDescriptor, sampleCount) == offsetof(WGPUTextureDescriptor, sampleCount), - "offsetof mismatch for TextureDescriptor::sampleCount"); -static_assert(offsetof(TextureDescriptor, viewFormatCount) == offsetof(WGPUTextureDescriptor, viewFormatCount), - "offsetof mismatch for TextureDescriptor::viewFormatCount"); -static_assert(offsetof(TextureDescriptor, viewFormats) == offsetof(WGPUTextureDescriptor, viewFormats), - "offsetof mismatch for TextureDescriptor::viewFormats"); - -// VertexBufferLayout implementation - -VertexBufferLayout::operator const WGPUVertexBufferLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexBufferLayout) == sizeof(WGPUVertexBufferLayout), "sizeof mismatch for VertexBufferLayout"); -static_assert(alignof(VertexBufferLayout) == alignof(WGPUVertexBufferLayout), "alignof mismatch for VertexBufferLayout"); -static_assert(offsetof(VertexBufferLayout, nextInChain) == offsetof(WGPUVertexBufferLayout, nextInChain), - "offsetof mismatch for VertexBufferLayout::nextInChain"); -static_assert(offsetof(VertexBufferLayout, stepMode) == offsetof(WGPUVertexBufferLayout, stepMode), - "offsetof mismatch for VertexBufferLayout::stepMode"); -static_assert(offsetof(VertexBufferLayout, arrayStride) == offsetof(WGPUVertexBufferLayout, arrayStride), - "offsetof mismatch for VertexBufferLayout::arrayStride"); -static_assert(offsetof(VertexBufferLayout, attributeCount) == offsetof(WGPUVertexBufferLayout, attributeCount), - "offsetof mismatch for VertexBufferLayout::attributeCount"); -static_assert(offsetof(VertexBufferLayout, attributes) == offsetof(WGPUVertexBufferLayout, attributes), - "offsetof mismatch for VertexBufferLayout::attributes"); - -// AdapterInfo implementation -AdapterInfo::AdapterInfo() = default; -AdapterInfo::~AdapterInfo() { - FreeMembers(); -} - -AdapterInfo::AdapterInfo(AdapterInfo&& rhs) - : vendor(rhs.vendor), - architecture(rhs.architecture), - device(rhs.device), - description(rhs.description), - backendType(rhs.backendType), - adapterType(rhs.adapterType), - vendorID(rhs.vendorID), - deviceID(rhs.deviceID), - subgroupMinSize(rhs.subgroupMinSize), - subgroupMaxSize(rhs.subgroupMaxSize){ - Reset(rhs); -} - -AdapterInfo& AdapterInfo::operator=(AdapterInfo&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->vendor) = std::move(rhs.vendor); - detail::AsNonConstReference(this->architecture) = std::move(rhs.architecture); - detail::AsNonConstReference(this->device) = std::move(rhs.device); - detail::AsNonConstReference(this->description) = std::move(rhs.description); - detail::AsNonConstReference(this->backendType) = std::move(rhs.backendType); - detail::AsNonConstReference(this->adapterType) = std::move(rhs.adapterType); - detail::AsNonConstReference(this->vendorID) = std::move(rhs.vendorID); - detail::AsNonConstReference(this->deviceID) = std::move(rhs.deviceID); - detail::AsNonConstReference(this->subgroupMinSize) = std::move(rhs.subgroupMinSize); - detail::AsNonConstReference(this->subgroupMaxSize) = std::move(rhs.subgroupMaxSize); - Reset(rhs); - return *this; -} - -void AdapterInfo::FreeMembers() { - bool needsFreeing = false; if (this->vendor.data != nullptr) { needsFreeing = true; } if (this->architecture.data != nullptr) { needsFreeing = true; } if (this->device.data != nullptr) { needsFreeing = true; } if (this->description.data != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuAdapterInfoFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterInfo::Reset(AdapterInfo& value) { - AdapterInfo defaultValue{}; - detail::AsNonConstReference(value.vendor) = defaultValue.vendor; - detail::AsNonConstReference(value.architecture) = defaultValue.architecture; - detail::AsNonConstReference(value.device) = defaultValue.device; - detail::AsNonConstReference(value.description) = defaultValue.description; - detail::AsNonConstReference(value.backendType) = defaultValue.backendType; - detail::AsNonConstReference(value.adapterType) = defaultValue.adapterType; - detail::AsNonConstReference(value.vendorID) = defaultValue.vendorID; - detail::AsNonConstReference(value.deviceID) = defaultValue.deviceID; - detail::AsNonConstReference(value.subgroupMinSize) = defaultValue.subgroupMinSize; - detail::AsNonConstReference(value.subgroupMaxSize) = defaultValue.subgroupMaxSize; -} - -AdapterInfo::operator const WGPUAdapterInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterInfo) == sizeof(WGPUAdapterInfo), "sizeof mismatch for AdapterInfo"); -static_assert(alignof(AdapterInfo) == alignof(WGPUAdapterInfo), "alignof mismatch for AdapterInfo"); -static_assert(offsetof(AdapterInfo, nextInChain) == offsetof(WGPUAdapterInfo, nextInChain), - "offsetof mismatch for AdapterInfo::nextInChain"); -static_assert(offsetof(AdapterInfo, vendor) == offsetof(WGPUAdapterInfo, vendor), - "offsetof mismatch for AdapterInfo::vendor"); -static_assert(offsetof(AdapterInfo, architecture) == offsetof(WGPUAdapterInfo, architecture), - "offsetof mismatch for AdapterInfo::architecture"); -static_assert(offsetof(AdapterInfo, device) == offsetof(WGPUAdapterInfo, device), - "offsetof mismatch for AdapterInfo::device"); -static_assert(offsetof(AdapterInfo, description) == offsetof(WGPUAdapterInfo, description), - "offsetof mismatch for AdapterInfo::description"); -static_assert(offsetof(AdapterInfo, backendType) == offsetof(WGPUAdapterInfo, backendType), - "offsetof mismatch for AdapterInfo::backendType"); -static_assert(offsetof(AdapterInfo, adapterType) == offsetof(WGPUAdapterInfo, adapterType), - "offsetof mismatch for AdapterInfo::adapterType"); -static_assert(offsetof(AdapterInfo, vendorID) == offsetof(WGPUAdapterInfo, vendorID), - "offsetof mismatch for AdapterInfo::vendorID"); -static_assert(offsetof(AdapterInfo, deviceID) == offsetof(WGPUAdapterInfo, deviceID), - "offsetof mismatch for AdapterInfo::deviceID"); -static_assert(offsetof(AdapterInfo, subgroupMinSize) == offsetof(WGPUAdapterInfo, subgroupMinSize), - "offsetof mismatch for AdapterInfo::subgroupMinSize"); -static_assert(offsetof(AdapterInfo, subgroupMaxSize) == offsetof(WGPUAdapterInfo, subgroupMaxSize), - "offsetof mismatch for AdapterInfo::subgroupMaxSize"); - -// BindGroupDescriptor implementation - -BindGroupDescriptor::operator const WGPUBindGroupDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupDescriptor) == sizeof(WGPUBindGroupDescriptor), "sizeof mismatch for BindGroupDescriptor"); -static_assert(alignof(BindGroupDescriptor) == alignof(WGPUBindGroupDescriptor), "alignof mismatch for BindGroupDescriptor"); -static_assert(offsetof(BindGroupDescriptor, nextInChain) == offsetof(WGPUBindGroupDescriptor, nextInChain), - "offsetof mismatch for BindGroupDescriptor::nextInChain"); -static_assert(offsetof(BindGroupDescriptor, label) == offsetof(WGPUBindGroupDescriptor, label), - "offsetof mismatch for BindGroupDescriptor::label"); -static_assert(offsetof(BindGroupDescriptor, layout) == offsetof(WGPUBindGroupDescriptor, layout), - "offsetof mismatch for BindGroupDescriptor::layout"); -static_assert(offsetof(BindGroupDescriptor, entryCount) == offsetof(WGPUBindGroupDescriptor, entryCount), - "offsetof mismatch for BindGroupDescriptor::entryCount"); -static_assert(offsetof(BindGroupDescriptor, entries) == offsetof(WGPUBindGroupDescriptor, entries), - "offsetof mismatch for BindGroupDescriptor::entries"); - -// BindGroupLayoutDescriptor implementation - -BindGroupLayoutDescriptor::operator const WGPUBindGroupLayoutDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupLayoutDescriptor) == sizeof(WGPUBindGroupLayoutDescriptor), "sizeof mismatch for BindGroupLayoutDescriptor"); -static_assert(alignof(BindGroupLayoutDescriptor) == alignof(WGPUBindGroupLayoutDescriptor), "alignof mismatch for BindGroupLayoutDescriptor"); -static_assert(offsetof(BindGroupLayoutDescriptor, nextInChain) == offsetof(WGPUBindGroupLayoutDescriptor, nextInChain), - "offsetof mismatch for BindGroupLayoutDescriptor::nextInChain"); -static_assert(offsetof(BindGroupLayoutDescriptor, label) == offsetof(WGPUBindGroupLayoutDescriptor, label), - "offsetof mismatch for BindGroupLayoutDescriptor::label"); -static_assert(offsetof(BindGroupLayoutDescriptor, entryCount) == offsetof(WGPUBindGroupLayoutDescriptor, entryCount), - "offsetof mismatch for BindGroupLayoutDescriptor::entryCount"); -static_assert(offsetof(BindGroupLayoutDescriptor, entries) == offsetof(WGPUBindGroupLayoutDescriptor, entries), - "offsetof mismatch for BindGroupLayoutDescriptor::entries"); - -// ColorTargetState implementation - -ColorTargetState::operator const WGPUColorTargetState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorTargetState) == sizeof(WGPUColorTargetState), "sizeof mismatch for ColorTargetState"); -static_assert(alignof(ColorTargetState) == alignof(WGPUColorTargetState), "alignof mismatch for ColorTargetState"); -static_assert(offsetof(ColorTargetState, nextInChain) == offsetof(WGPUColorTargetState, nextInChain), - "offsetof mismatch for ColorTargetState::nextInChain"); -static_assert(offsetof(ColorTargetState, format) == offsetof(WGPUColorTargetState, format), - "offsetof mismatch for ColorTargetState::format"); -static_assert(offsetof(ColorTargetState, blend) == offsetof(WGPUColorTargetState, blend), - "offsetof mismatch for ColorTargetState::blend"); -static_assert(offsetof(ColorTargetState, writeMask) == offsetof(WGPUColorTargetState, writeMask), - "offsetof mismatch for ColorTargetState::writeMask"); - -// CompilationInfo implementation - -CompilationInfo::operator const WGPUCompilationInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompilationInfo) == sizeof(WGPUCompilationInfo), "sizeof mismatch for CompilationInfo"); -static_assert(alignof(CompilationInfo) == alignof(WGPUCompilationInfo), "alignof mismatch for CompilationInfo"); -static_assert(offsetof(CompilationInfo, nextInChain) == offsetof(WGPUCompilationInfo, nextInChain), - "offsetof mismatch for CompilationInfo::nextInChain"); -static_assert(offsetof(CompilationInfo, messageCount) == offsetof(WGPUCompilationInfo, messageCount), - "offsetof mismatch for CompilationInfo::messageCount"); -static_assert(offsetof(CompilationInfo, messages) == offsetof(WGPUCompilationInfo, messages), - "offsetof mismatch for CompilationInfo::messages"); - -// ComputePipelineDescriptor implementation - -ComputePipelineDescriptor::operator const WGPUComputePipelineDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputePipelineDescriptor) == sizeof(WGPUComputePipelineDescriptor), "sizeof mismatch for ComputePipelineDescriptor"); -static_assert(alignof(ComputePipelineDescriptor) == alignof(WGPUComputePipelineDescriptor), "alignof mismatch for ComputePipelineDescriptor"); -static_assert(offsetof(ComputePipelineDescriptor, nextInChain) == offsetof(WGPUComputePipelineDescriptor, nextInChain), - "offsetof mismatch for ComputePipelineDescriptor::nextInChain"); -static_assert(offsetof(ComputePipelineDescriptor, label) == offsetof(WGPUComputePipelineDescriptor, label), - "offsetof mismatch for ComputePipelineDescriptor::label"); -static_assert(offsetof(ComputePipelineDescriptor, layout) == offsetof(WGPUComputePipelineDescriptor, layout), - "offsetof mismatch for ComputePipelineDescriptor::layout"); -static_assert(offsetof(ComputePipelineDescriptor, compute) == offsetof(WGPUComputePipelineDescriptor, compute), - "offsetof mismatch for ComputePipelineDescriptor::compute"); - -// DawnFormatCapabilities implementation - -DawnFormatCapabilities::operator const WGPUDawnFormatCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFormatCapabilities) == sizeof(WGPUDawnFormatCapabilities), "sizeof mismatch for DawnFormatCapabilities"); -static_assert(alignof(DawnFormatCapabilities) == alignof(WGPUDawnFormatCapabilities), "alignof mismatch for DawnFormatCapabilities"); -static_assert(offsetof(DawnFormatCapabilities, nextInChain) == offsetof(WGPUDawnFormatCapabilities, nextInChain), - "offsetof mismatch for DawnFormatCapabilities::nextInChain"); - -// DeviceDescriptor implementation -DeviceDescriptor::DeviceDescriptor() = default; -struct DeviceDescriptor::Init { - ChainedStruct * const nextInChain; - StringView label = {}; - size_t requiredFeatureCount = 0; - FeatureName const * requiredFeatures = nullptr; - Limits const * requiredLimits = nullptr; - QueueDescriptor defaultQueue = {}; -}; -DeviceDescriptor::DeviceDescriptor(DeviceDescriptor::Init&& init) : - detail::DeviceDescriptor { - init.nextInChain, - std::move(init.label), - std::move(init.requiredFeatureCount), - std::move(init.requiredFeatures), - std::move(init.requiredLimits), - std::move(init.defaultQueue), - } {} -template -void DeviceDescriptor::SetDeviceLostCallback(CallbackMode callbackMode, F callback, T userdata) { - static_assert(offsetof(DeviceDescriptor, deviceLostCallbackInfo) == offsetof(WGPUDeviceDescriptor, deviceLostCallbackInfo), - "offsetof mismatch for DeviceDescriptor::deviceLostCallbackInfo"); - - assert(deviceLostCallbackInfo.callback == nullptr); - deviceLostCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - deviceLostCallbackInfo.mode = static_cast(callbackMode); -} -template -void DeviceDescriptor::SetDeviceLostCallback(CallbackMode callbackMode, F callback) { - assert(deviceLostCallbackInfo.callback == nullptr); - deviceLostCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - deviceLostCallbackInfo.mode = static_cast(callbackMode); -} -template -void DeviceDescriptor::SetUncapturedErrorCallback(F callback, T userdata) { - static_assert(offsetof(DeviceDescriptor, uncapturedErrorCallbackInfo) == offsetof(WGPUDeviceDescriptor, uncapturedErrorCallbackInfo), - "offsetof mismatch for DeviceDescriptor::uncapturedErrorCallbackInfo"); - - assert(uncapturedErrorCallbackInfo.callback == nullptr); - uncapturedErrorCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DeviceDescriptor::SetUncapturedErrorCallback(F callback) { - assert(uncapturedErrorCallbackInfo.callback == nullptr); - uncapturedErrorCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} - -DeviceDescriptor::operator const WGPUDeviceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DeviceDescriptor) == sizeof(WGPUDeviceDescriptor), "sizeof mismatch for DeviceDescriptor"); -static_assert(alignof(DeviceDescriptor) == alignof(WGPUDeviceDescriptor), "alignof mismatch for DeviceDescriptor"); -static_assert(offsetof(DeviceDescriptor, nextInChain) == offsetof(WGPUDeviceDescriptor, nextInChain), - "offsetof mismatch for DeviceDescriptor::nextInChain"); -static_assert(offsetof(DeviceDescriptor, label) == offsetof(WGPUDeviceDescriptor, label), - "offsetof mismatch for DeviceDescriptor::label"); -static_assert(offsetof(DeviceDescriptor, requiredFeatureCount) == offsetof(WGPUDeviceDescriptor, requiredFeatureCount), - "offsetof mismatch for DeviceDescriptor::requiredFeatureCount"); -static_assert(offsetof(DeviceDescriptor, requiredFeatures) == offsetof(WGPUDeviceDescriptor, requiredFeatures), - "offsetof mismatch for DeviceDescriptor::requiredFeatures"); -static_assert(offsetof(DeviceDescriptor, requiredLimits) == offsetof(WGPUDeviceDescriptor, requiredLimits), - "offsetof mismatch for DeviceDescriptor::requiredLimits"); -static_assert(offsetof(DeviceDescriptor, defaultQueue) == offsetof(WGPUDeviceDescriptor, defaultQueue), - "offsetof mismatch for DeviceDescriptor::defaultQueue"); - -// PipelineLayoutDescriptor implementation - -PipelineLayoutDescriptor::operator const WGPUPipelineLayoutDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutDescriptor) == sizeof(WGPUPipelineLayoutDescriptor), "sizeof mismatch for PipelineLayoutDescriptor"); -static_assert(alignof(PipelineLayoutDescriptor) == alignof(WGPUPipelineLayoutDescriptor), "alignof mismatch for PipelineLayoutDescriptor"); -static_assert(offsetof(PipelineLayoutDescriptor, nextInChain) == offsetof(WGPUPipelineLayoutDescriptor, nextInChain), - "offsetof mismatch for PipelineLayoutDescriptor::nextInChain"); -static_assert(offsetof(PipelineLayoutDescriptor, label) == offsetof(WGPUPipelineLayoutDescriptor, label), - "offsetof mismatch for PipelineLayoutDescriptor::label"); -static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayoutCount) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayoutCount), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayoutCount"); -static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayouts) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayouts), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayouts"); -static_assert(offsetof(PipelineLayoutDescriptor, immediateSize) == offsetof(WGPUPipelineLayoutDescriptor, immediateSize), - "offsetof mismatch for PipelineLayoutDescriptor::immediateSize"); - -// RenderPassPixelLocalStorage implementation -RenderPassPixelLocalStorage::RenderPassPixelLocalStorage() -: ChainedStruct { nullptr, SType::RenderPassPixelLocalStorage } {} -struct RenderPassPixelLocalStorage::Init { - ChainedStruct * const nextInChain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - RenderPassStorageAttachment const * storageAttachments = nullptr; -}; -RenderPassPixelLocalStorage::RenderPassPixelLocalStorage(RenderPassPixelLocalStorage::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassPixelLocalStorage }, - totalPixelLocalStorageSize(std::move(init.totalPixelLocalStorageSize)), - storageAttachmentCount(std::move(init.storageAttachmentCount)), - storageAttachments(std::move(init.storageAttachments)) {} - -RenderPassPixelLocalStorage::operator const WGPURenderPassPixelLocalStorage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassPixelLocalStorage) == sizeof(WGPURenderPassPixelLocalStorage), "sizeof mismatch for RenderPassPixelLocalStorage"); -static_assert(alignof(RenderPassPixelLocalStorage) == alignof(WGPURenderPassPixelLocalStorage), "alignof mismatch for RenderPassPixelLocalStorage"); -static_assert(offsetof(RenderPassPixelLocalStorage, totalPixelLocalStorageSize) == offsetof(WGPURenderPassPixelLocalStorage, totalPixelLocalStorageSize), - "offsetof mismatch for RenderPassPixelLocalStorage::totalPixelLocalStorageSize"); -static_assert(offsetof(RenderPassPixelLocalStorage, storageAttachmentCount) == offsetof(WGPURenderPassPixelLocalStorage, storageAttachmentCount), - "offsetof mismatch for RenderPassPixelLocalStorage::storageAttachmentCount"); -static_assert(offsetof(RenderPassPixelLocalStorage, storageAttachments) == offsetof(WGPURenderPassPixelLocalStorage, storageAttachments), - "offsetof mismatch for RenderPassPixelLocalStorage::storageAttachments"); - -// SharedTextureMemoryDescriptor implementation - -SharedTextureMemoryDescriptor::operator const WGPUSharedTextureMemoryDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDescriptor) == sizeof(WGPUSharedTextureMemoryDescriptor), "sizeof mismatch for SharedTextureMemoryDescriptor"); -static_assert(alignof(SharedTextureMemoryDescriptor) == alignof(WGPUSharedTextureMemoryDescriptor), "alignof mismatch for SharedTextureMemoryDescriptor"); -static_assert(offsetof(SharedTextureMemoryDescriptor, nextInChain) == offsetof(WGPUSharedTextureMemoryDescriptor, nextInChain), - "offsetof mismatch for SharedTextureMemoryDescriptor::nextInChain"); -static_assert(offsetof(SharedTextureMemoryDescriptor, label) == offsetof(WGPUSharedTextureMemoryDescriptor, label), - "offsetof mismatch for SharedTextureMemoryDescriptor::label"); - -// SharedTextureMemoryEndAccessState implementation -SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState() = default; -SharedTextureMemoryEndAccessState::~SharedTextureMemoryEndAccessState() { - FreeMembers(); -} - -SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&& rhs) - : initialized(rhs.initialized), - fenceCount(rhs.fenceCount), - fences(rhs.fences), - signaledValueCount(rhs.signaledValueCount), - signaledValues(rhs.signaledValues){ - Reset(rhs); -} - -SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(SharedTextureMemoryEndAccessState&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized); - detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount); - detail::AsNonConstReference(this->fences) = std::move(rhs.fences); - detail::AsNonConstReference(this->signaledValueCount) = std::move(rhs.signaledValueCount); - detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues); - Reset(rhs); - return *this; -} - -void SharedTextureMemoryEndAccessState::FreeMembers() { - bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuSharedTextureMemoryEndAccessStateFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SharedTextureMemoryEndAccessState::Reset(SharedTextureMemoryEndAccessState& value) { - SharedTextureMemoryEndAccessState defaultValue{}; - detail::AsNonConstReference(value.initialized) = defaultValue.initialized; - detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount; - detail::AsNonConstReference(value.fences) = defaultValue.fences; - detail::AsNonConstReference(value.signaledValueCount) = defaultValue.signaledValueCount; - detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues; -} - -SharedTextureMemoryEndAccessState::operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryEndAccessState) == sizeof(WGPUSharedTextureMemoryEndAccessState), "sizeof mismatch for SharedTextureMemoryEndAccessState"); -static_assert(alignof(SharedTextureMemoryEndAccessState) == alignof(WGPUSharedTextureMemoryEndAccessState), "alignof mismatch for SharedTextureMemoryEndAccessState"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedTextureMemoryEndAccessState, nextInChain), - "offsetof mismatch for SharedTextureMemoryEndAccessState::nextInChain"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, initialized) == offsetof(WGPUSharedTextureMemoryEndAccessState, initialized), - "offsetof mismatch for SharedTextureMemoryEndAccessState::initialized"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, fenceCount), - "offsetof mismatch for SharedTextureMemoryEndAccessState::fenceCount"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, fences) == offsetof(WGPUSharedTextureMemoryEndAccessState, fences), - "offsetof mismatch for SharedTextureMemoryEndAccessState::fences"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValueCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValueCount), - "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValueCount"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValues), - "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValues"); - -// SharedTextureMemoryProperties implementation - -SharedTextureMemoryProperties::operator const WGPUSharedTextureMemoryProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryProperties) == sizeof(WGPUSharedTextureMemoryProperties), "sizeof mismatch for SharedTextureMemoryProperties"); -static_assert(alignof(SharedTextureMemoryProperties) == alignof(WGPUSharedTextureMemoryProperties), "alignof mismatch for SharedTextureMemoryProperties"); -static_assert(offsetof(SharedTextureMemoryProperties, nextInChain) == offsetof(WGPUSharedTextureMemoryProperties, nextInChain), - "offsetof mismatch for SharedTextureMemoryProperties::nextInChain"); -static_assert(offsetof(SharedTextureMemoryProperties, usage) == offsetof(WGPUSharedTextureMemoryProperties, usage), - "offsetof mismatch for SharedTextureMemoryProperties::usage"); -static_assert(offsetof(SharedTextureMemoryProperties, size) == offsetof(WGPUSharedTextureMemoryProperties, size), - "offsetof mismatch for SharedTextureMemoryProperties::size"); -static_assert(offsetof(SharedTextureMemoryProperties, format) == offsetof(WGPUSharedTextureMemoryProperties, format), - "offsetof mismatch for SharedTextureMemoryProperties::format"); - -// TextureViewDescriptor implementation - -TextureViewDescriptor::operator const WGPUTextureViewDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureViewDescriptor) == sizeof(WGPUTextureViewDescriptor), "sizeof mismatch for TextureViewDescriptor"); -static_assert(alignof(TextureViewDescriptor) == alignof(WGPUTextureViewDescriptor), "alignof mismatch for TextureViewDescriptor"); -static_assert(offsetof(TextureViewDescriptor, nextInChain) == offsetof(WGPUTextureViewDescriptor, nextInChain), - "offsetof mismatch for TextureViewDescriptor::nextInChain"); -static_assert(offsetof(TextureViewDescriptor, label) == offsetof(WGPUTextureViewDescriptor, label), - "offsetof mismatch for TextureViewDescriptor::label"); -static_assert(offsetof(TextureViewDescriptor, format) == offsetof(WGPUTextureViewDescriptor, format), - "offsetof mismatch for TextureViewDescriptor::format"); -static_assert(offsetof(TextureViewDescriptor, dimension) == offsetof(WGPUTextureViewDescriptor, dimension), - "offsetof mismatch for TextureViewDescriptor::dimension"); -static_assert(offsetof(TextureViewDescriptor, baseMipLevel) == offsetof(WGPUTextureViewDescriptor, baseMipLevel), - "offsetof mismatch for TextureViewDescriptor::baseMipLevel"); -static_assert(offsetof(TextureViewDescriptor, mipLevelCount) == offsetof(WGPUTextureViewDescriptor, mipLevelCount), - "offsetof mismatch for TextureViewDescriptor::mipLevelCount"); -static_assert(offsetof(TextureViewDescriptor, baseArrayLayer) == offsetof(WGPUTextureViewDescriptor, baseArrayLayer), - "offsetof mismatch for TextureViewDescriptor::baseArrayLayer"); -static_assert(offsetof(TextureViewDescriptor, arrayLayerCount) == offsetof(WGPUTextureViewDescriptor, arrayLayerCount), - "offsetof mismatch for TextureViewDescriptor::arrayLayerCount"); -static_assert(offsetof(TextureViewDescriptor, aspect) == offsetof(WGPUTextureViewDescriptor, aspect), - "offsetof mismatch for TextureViewDescriptor::aspect"); -static_assert(offsetof(TextureViewDescriptor, usage) == offsetof(WGPUTextureViewDescriptor, usage), - "offsetof mismatch for TextureViewDescriptor::usage"); - -// VertexState implementation - -VertexState::operator const WGPUVertexState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexState) == sizeof(WGPUVertexState), "sizeof mismatch for VertexState"); -static_assert(alignof(VertexState) == alignof(WGPUVertexState), "alignof mismatch for VertexState"); -static_assert(offsetof(VertexState, nextInChain) == offsetof(WGPUVertexState, nextInChain), - "offsetof mismatch for VertexState::nextInChain"); -static_assert(offsetof(VertexState, module) == offsetof(WGPUVertexState, module), - "offsetof mismatch for VertexState::module"); -static_assert(offsetof(VertexState, entryPoint) == offsetof(WGPUVertexState, entryPoint), - "offsetof mismatch for VertexState::entryPoint"); -static_assert(offsetof(VertexState, constantCount) == offsetof(WGPUVertexState, constantCount), - "offsetof mismatch for VertexState::constantCount"); -static_assert(offsetof(VertexState, constants) == offsetof(WGPUVertexState, constants), - "offsetof mismatch for VertexState::constants"); -static_assert(offsetof(VertexState, bufferCount) == offsetof(WGPUVertexState, bufferCount), - "offsetof mismatch for VertexState::bufferCount"); -static_assert(offsetof(VertexState, buffers) == offsetof(WGPUVertexState, buffers), - "offsetof mismatch for VertexState::buffers"); - -// FragmentState implementation - -FragmentState::operator const WGPUFragmentState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(FragmentState) == sizeof(WGPUFragmentState), "sizeof mismatch for FragmentState"); -static_assert(alignof(FragmentState) == alignof(WGPUFragmentState), "alignof mismatch for FragmentState"); -static_assert(offsetof(FragmentState, nextInChain) == offsetof(WGPUFragmentState, nextInChain), - "offsetof mismatch for FragmentState::nextInChain"); -static_assert(offsetof(FragmentState, module) == offsetof(WGPUFragmentState, module), - "offsetof mismatch for FragmentState::module"); -static_assert(offsetof(FragmentState, entryPoint) == offsetof(WGPUFragmentState, entryPoint), - "offsetof mismatch for FragmentState::entryPoint"); -static_assert(offsetof(FragmentState, constantCount) == offsetof(WGPUFragmentState, constantCount), - "offsetof mismatch for FragmentState::constantCount"); -static_assert(offsetof(FragmentState, constants) == offsetof(WGPUFragmentState, constants), - "offsetof mismatch for FragmentState::constants"); -static_assert(offsetof(FragmentState, targetCount) == offsetof(WGPUFragmentState, targetCount), - "offsetof mismatch for FragmentState::targetCount"); -static_assert(offsetof(FragmentState, targets) == offsetof(WGPUFragmentState, targets), - "offsetof mismatch for FragmentState::targets"); - -// RenderPassDescriptor implementation - -RenderPassDescriptor::operator const WGPURenderPassDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDescriptor) == sizeof(WGPURenderPassDescriptor), "sizeof mismatch for RenderPassDescriptor"); -static_assert(alignof(RenderPassDescriptor) == alignof(WGPURenderPassDescriptor), "alignof mismatch for RenderPassDescriptor"); -static_assert(offsetof(RenderPassDescriptor, nextInChain) == offsetof(WGPURenderPassDescriptor, nextInChain), - "offsetof mismatch for RenderPassDescriptor::nextInChain"); -static_assert(offsetof(RenderPassDescriptor, label) == offsetof(WGPURenderPassDescriptor, label), - "offsetof mismatch for RenderPassDescriptor::label"); -static_assert(offsetof(RenderPassDescriptor, colorAttachmentCount) == offsetof(WGPURenderPassDescriptor, colorAttachmentCount), - "offsetof mismatch for RenderPassDescriptor::colorAttachmentCount"); -static_assert(offsetof(RenderPassDescriptor, colorAttachments) == offsetof(WGPURenderPassDescriptor, colorAttachments), - "offsetof mismatch for RenderPassDescriptor::colorAttachments"); -static_assert(offsetof(RenderPassDescriptor, depthStencilAttachment) == offsetof(WGPURenderPassDescriptor, depthStencilAttachment), - "offsetof mismatch for RenderPassDescriptor::depthStencilAttachment"); -static_assert(offsetof(RenderPassDescriptor, occlusionQuerySet) == offsetof(WGPURenderPassDescriptor, occlusionQuerySet), - "offsetof mismatch for RenderPassDescriptor::occlusionQuerySet"); -static_assert(offsetof(RenderPassDescriptor, timestampWrites) == offsetof(WGPURenderPassDescriptor, timestampWrites), - "offsetof mismatch for RenderPassDescriptor::timestampWrites"); - -// RenderPipelineDescriptor implementation - -RenderPipelineDescriptor::operator const WGPURenderPipelineDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPipelineDescriptor) == sizeof(WGPURenderPipelineDescriptor), "sizeof mismatch for RenderPipelineDescriptor"); -static_assert(alignof(RenderPipelineDescriptor) == alignof(WGPURenderPipelineDescriptor), "alignof mismatch for RenderPipelineDescriptor"); -static_assert(offsetof(RenderPipelineDescriptor, nextInChain) == offsetof(WGPURenderPipelineDescriptor, nextInChain), - "offsetof mismatch for RenderPipelineDescriptor::nextInChain"); -static_assert(offsetof(RenderPipelineDescriptor, label) == offsetof(WGPURenderPipelineDescriptor, label), - "offsetof mismatch for RenderPipelineDescriptor::label"); -static_assert(offsetof(RenderPipelineDescriptor, layout) == offsetof(WGPURenderPipelineDescriptor, layout), - "offsetof mismatch for RenderPipelineDescriptor::layout"); -static_assert(offsetof(RenderPipelineDescriptor, vertex) == offsetof(WGPURenderPipelineDescriptor, vertex), - "offsetof mismatch for RenderPipelineDescriptor::vertex"); -static_assert(offsetof(RenderPipelineDescriptor, primitive) == offsetof(WGPURenderPipelineDescriptor, primitive), - "offsetof mismatch for RenderPipelineDescriptor::primitive"); -static_assert(offsetof(RenderPipelineDescriptor, depthStencil) == offsetof(WGPURenderPipelineDescriptor, depthStencil), - "offsetof mismatch for RenderPipelineDescriptor::depthStencil"); -static_assert(offsetof(RenderPipelineDescriptor, multisample) == offsetof(WGPURenderPipelineDescriptor, multisample), - "offsetof mismatch for RenderPipelineDescriptor::multisample"); -static_assert(offsetof(RenderPipelineDescriptor, fragment) == offsetof(WGPURenderPipelineDescriptor, fragment), - "offsetof mismatch for RenderPipelineDescriptor::fragment"); - - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -// Adapter implementation - -Device Adapter::CreateDevice(DeviceDescriptor const * descriptor) const { - auto result = wgpuAdapterCreateDevice(Get(), reinterpret_cast(descriptor)); - return Device::Acquire(result); -} -void Adapter::GetFeatures(SupportedFeatures * features) const { - *features = SupportedFeatures(); - wgpuAdapterGetFeatures(Get(), reinterpret_cast(features)); -} -ConvertibleStatus Adapter::GetFormatCapabilities(TextureFormat format, DawnFormatCapabilities * capabilities) const { - auto result = wgpuAdapterGetFormatCapabilities(Get(), static_cast(format), reinterpret_cast(capabilities)); - return static_cast(result); -} -ConvertibleStatus Adapter::GetInfo(AdapterInfo * info) const { - *info = AdapterInfo(); - auto result = wgpuAdapterGetInfo(Get(), reinterpret_cast(info)); - return static_cast(result); -} -Instance Adapter::GetInstance() const { - auto result = wgpuAdapterGetInstance(Get()); - return Instance::Acquire(result); -} -ConvertibleStatus Adapter::GetLimits(Limits * limits) const { - auto result = wgpuAdapterGetLimits(Get(), reinterpret_cast(limits)); - return static_cast(result); -} -Bool Adapter::HasFeature(FeatureName feature) const { - auto result = wgpuAdapterHasFeature(Get(), static_cast(feature)); - return result; -} -template -Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} - - -void Adapter::WGPUAddRef(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuAdapterAddRef(handle); - } -} -void Adapter::WGPURelease(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuAdapterRelease(handle); - } -} -static_assert(sizeof(Adapter) == sizeof(WGPUAdapter), "sizeof mismatch for Adapter"); -static_assert(alignof(Adapter) == alignof(WGPUAdapter), "alignof mismatch for Adapter"); - -// BindGroup implementation - -void BindGroup::SetLabel(StringView label) const { - wgpuBindGroupSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void BindGroup::WGPUAddRef(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupAddRef(handle); - } -} -void BindGroup::WGPURelease(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupRelease(handle); - } -} -static_assert(sizeof(BindGroup) == sizeof(WGPUBindGroup), "sizeof mismatch for BindGroup"); -static_assert(alignof(BindGroup) == alignof(WGPUBindGroup), "alignof mismatch for BindGroup"); - -// BindGroupLayout implementation - -void BindGroupLayout::SetLabel(StringView label) const { - wgpuBindGroupLayoutSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void BindGroupLayout::WGPUAddRef(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutAddRef(handle); - } -} -void BindGroupLayout::WGPURelease(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutRelease(handle); - } -} -static_assert(sizeof(BindGroupLayout) == sizeof(WGPUBindGroupLayout), "sizeof mismatch for BindGroupLayout"); -static_assert(alignof(BindGroupLayout) == alignof(WGPUBindGroupLayout), "alignof mismatch for BindGroupLayout"); - -// Buffer implementation - -TexelBufferView Buffer::CreateTexelView(TexelBufferViewDescriptor const * descriptor) const { - auto result = wgpuBufferCreateTexelView(Get(), reinterpret_cast(descriptor)); - return TexelBufferView::Acquire(result); -} -void Buffer::Destroy() const { - wgpuBufferDestroy(Get()); -} -void const * Buffer::GetConstMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetConstMappedRange(Get(), offset, size); - return result; -} -void * Buffer::GetMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetMappedRange(Get(), offset, size); - return result; -} -BufferMapState Buffer::GetMapState() const { - auto result = wgpuBufferGetMapState(Get()); - return static_cast(result); -} -uint64_t Buffer::GetSize() const { - auto result = wgpuBufferGetSize(Get()); - return result; -} -BufferUsage Buffer::GetUsage() const { - auto result = wgpuBufferGetUsage(Get()); - return static_cast(result); -} -template -Future Buffer::MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuBufferMapAsync(Get(), static_cast(mode), offset, size, callbackInfo); - return Future { - result.id - }; -} -template -Future Buffer::MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuBufferMapAsync(Get(), static_cast(mode), offset, size, callbackInfo); - return Future { - result.id - }; -} -ConvertibleStatus Buffer::ReadMappedRange(size_t offset, void * data, size_t size) const { - auto result = wgpuBufferReadMappedRange(Get(), offset, reinterpret_cast(data), size); - return static_cast(result); -} -void Buffer::SetLabel(StringView label) const { - wgpuBufferSetLabel(Get(), *reinterpret_cast(&label)); -} -void Buffer::Unmap() const { - wgpuBufferUnmap(Get()); -} -ConvertibleStatus Buffer::WriteMappedRange(size_t offset, void const * data, size_t size) const { - auto result = wgpuBufferWriteMappedRange(Get(), offset, reinterpret_cast(data), size); - return static_cast(result); -} - - -void Buffer::WGPUAddRef(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferAddRef(handle); - } -} -void Buffer::WGPURelease(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferRelease(handle); - } -} -static_assert(sizeof(Buffer) == sizeof(WGPUBuffer), "sizeof mismatch for Buffer"); -static_assert(alignof(Buffer) == alignof(WGPUBuffer), "alignof mismatch for Buffer"); - -// CommandBuffer implementation - -void CommandBuffer::SetLabel(StringView label) const { - wgpuCommandBufferSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void CommandBuffer::WGPUAddRef(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferAddRef(handle); - } -} -void CommandBuffer::WGPURelease(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferRelease(handle); - } -} -static_assert(sizeof(CommandBuffer) == sizeof(WGPUCommandBuffer), "sizeof mismatch for CommandBuffer"); -static_assert(alignof(CommandBuffer) == alignof(WGPUCommandBuffer), "alignof mismatch for CommandBuffer"); - -// CommandEncoder implementation - -ComputePassEncoder CommandEncoder::BeginComputePass(ComputePassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast(descriptor)); - return ComputePassEncoder::Acquire(result); -} -RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast(descriptor)); - return RenderPassEncoder::Acquire(result); -} -void CommandEncoder::ClearBuffer(Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuCommandEncoderClearBuffer(Get(), buffer.Get(), offset, size); -} -void CommandEncoder::CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const { - wgpuCommandEncoderCopyBufferToBuffer(Get(), source.Get(), sourceOffset, destination.Get(), destinationOffset, size); -} -void CommandEncoder::CopyBufferToTexture(TexelCopyBufferInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -void CommandEncoder::CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -void CommandEncoder::CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast(descriptor)); - return CommandBuffer::Acquire(result); -} -void CommandEncoder::InjectValidationError(StringView message) const { - wgpuCommandEncoderInjectValidationError(Get(), *reinterpret_cast(&message)); -} -void CommandEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuCommandEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void CommandEncoder::PopDebugGroup() const { - wgpuCommandEncoderPopDebugGroup(Get()); -} -void CommandEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuCommandEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void CommandEncoder::ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const { - wgpuCommandEncoderResolveQuerySet(Get(), querySet.Get(), firstQuery, queryCount, destination.Get(), destinationOffset); -} -void CommandEncoder::SetLabel(StringView label) const { - wgpuCommandEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void CommandEncoder::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) const { - wgpuCommandEncoderWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); -} -void CommandEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuCommandEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void CommandEncoder::WGPUAddRef(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderAddRef(handle); - } -} -void CommandEncoder::WGPURelease(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderRelease(handle); - } -} -static_assert(sizeof(CommandEncoder) == sizeof(WGPUCommandEncoder), "sizeof mismatch for CommandEncoder"); -static_assert(alignof(CommandEncoder) == alignof(WGPUCommandEncoder), "alignof mismatch for CommandEncoder"); - -// ComputePipeline implementation - -BindGroupLayout ComputePipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuComputePipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); -} -void ComputePipeline::SetLabel(StringView label) const { - wgpuComputePipelineSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ComputePipeline::WGPUAddRef(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineAddRef(handle); - } -} -void ComputePipeline::WGPURelease(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineRelease(handle); - } -} -static_assert(sizeof(ComputePipeline) == sizeof(WGPUComputePipeline), "sizeof mismatch for ComputePipeline"); -static_assert(alignof(ComputePipeline) == alignof(WGPUComputePipeline), "alignof mismatch for ComputePipeline"); - -// Device implementation - -BindGroup Device::CreateBindGroup(BindGroupDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast(descriptor)); - return BindGroup::Acquire(result); -} -BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); - return BindGroupLayout::Acquire(result); -} -Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); - return CommandEncoder::Acquire(result); -} -ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); - return ComputePipeline::Acquire(result); -} -template -Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -Buffer Device::CreateErrorBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateErrorBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -ExternalTexture Device::CreateErrorExternalTexture() const { - auto result = wgpuDeviceCreateErrorExternalTexture(Get()); - return ExternalTexture::Acquire(result); -} -ShaderModule Device::CreateErrorShaderModule(ShaderModuleDescriptor const * descriptor, StringView errorMessage) const { - auto result = wgpuDeviceCreateErrorShaderModule(Get(), reinterpret_cast(descriptor), *reinterpret_cast(&errorMessage)); - return ShaderModule::Acquire(result); -} -Texture Device::CreateErrorTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateErrorTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -ExternalTexture Device::CreateExternalTexture(ExternalTextureDescriptor const * externalTextureDescriptor) const { - auto result = wgpuDeviceCreateExternalTexture(Get(), reinterpret_cast(externalTextureDescriptor)); - return ExternalTexture::Acquire(result); -} -PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); - return PipelineLayout::Acquire(result); -} -QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); - return QuerySet::Acquire(result); -} -RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); - return RenderBundleEncoder::Acquire(result); -} -RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); - return RenderPipeline::Acquire(result); -} -template -Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -ResourceTable Device::CreateResourceTable(ResourceTableDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateResourceTable(Get(), reinterpret_cast(descriptor)); - return ResourceTable::Acquire(result); -} -Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); - return Sampler::Acquire(result); -} -ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); - return ShaderModule::Acquire(result); -} -Texture Device::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -void Device::Destroy() const { - wgpuDeviceDestroy(Get()); -} -void Device::ForceLoss(DeviceLostReason type, StringView message) const { - wgpuDeviceForceLoss(Get(), static_cast(type), *reinterpret_cast(&message)); -} -Adapter Device::GetAdapter() const { - auto result = wgpuDeviceGetAdapter(Get()); - return Adapter::Acquire(result); -} -ConvertibleStatus Device::GetAdapterInfo(AdapterInfo * adapterInfo) const { - *adapterInfo = AdapterInfo(); - auto result = wgpuDeviceGetAdapterInfo(Get(), reinterpret_cast(adapterInfo)); - return static_cast(result); -} -ConvertibleStatus Device::GetAHardwareBufferProperties(void * handle, AHardwareBufferProperties * properties) const { - auto result = wgpuDeviceGetAHardwareBufferProperties(Get(), handle, reinterpret_cast(properties)); - return static_cast(result); -} -void Device::GetFeatures(SupportedFeatures * features) const { - *features = SupportedFeatures(); - wgpuDeviceGetFeatures(Get(), reinterpret_cast(features)); -} -ConvertibleStatus Device::GetLimits(Limits * limits) const { - auto result = wgpuDeviceGetLimits(Get(), reinterpret_cast(limits)); - return static_cast(result); -} -Future Device::GetLostFuture() const { - auto result = wgpuDeviceGetLostFuture(Get()); - return Future { - result.id - }; -} -Queue Device::GetQueue() const { - auto result = wgpuDeviceGetQueue(Get()); - return Queue::Acquire(result); -} -Bool Device::HasFeature(FeatureName feature) const { - auto result = wgpuDeviceHasFeature(Get(), static_cast(feature)); - return result; -} -SharedBufferMemory Device::ImportSharedBufferMemory(SharedBufferMemoryDescriptor const * descriptor) const { - auto result = wgpuDeviceImportSharedBufferMemory(Get(), reinterpret_cast(descriptor)); - return SharedBufferMemory::Acquire(result); -} -SharedFence Device::ImportSharedFence(SharedFenceDescriptor const * descriptor) const { - auto result = wgpuDeviceImportSharedFence(Get(), reinterpret_cast(descriptor)); - return SharedFence::Acquire(result); -} -SharedTextureMemory Device::ImportSharedTextureMemory(SharedTextureMemoryDescriptor const * descriptor) const { - auto result = wgpuDeviceImportSharedTextureMemory(Get(), reinterpret_cast(descriptor)); - return SharedTextureMemory::Acquire(result); -} -void Device::InjectError(ErrorType type, StringView message) const { - wgpuDeviceInjectError(Get(), static_cast(type), *reinterpret_cast(&message)); -} -template -Future Device::PopErrorScope(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDevicePopErrorScope(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::PopErrorScope(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDevicePopErrorScope(Get(), callbackInfo); - return Future { - result.id - }; -} -void Device::PushErrorScope(ErrorFilter filter) const { - wgpuDevicePushErrorScope(Get(), static_cast(filter)); -} -void Device::SetLabel(StringView label) const { - wgpuDeviceSetLabel(Get(), *reinterpret_cast(&label)); -} -template -void Device::SetLoggingCallback(F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - return wgpuDeviceSetLoggingCallback(Get(), callbackInfo); -} -template -void Device::SetLoggingCallback(F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - return wgpuDeviceSetLoggingCallback(Get(), callbackInfo); -} -void Device::Tick() const { - wgpuDeviceTick(Get()); -} -void Device::ValidateTextureDescriptor(TextureDescriptor const * descriptor) const { - wgpuDeviceValidateTextureDescriptor(Get(), reinterpret_cast(descriptor)); -} - - -void Device::WGPUAddRef(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceAddRef(handle); - } -} -void Device::WGPURelease(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceRelease(handle); - } -} -static_assert(sizeof(Device) == sizeof(WGPUDevice), "sizeof mismatch for Device"); -static_assert(alignof(Device) == alignof(WGPUDevice), "alignof mismatch for Device"); - -// ExternalTexture implementation - -void ExternalTexture::Destroy() const { - wgpuExternalTextureDestroy(Get()); -} -void ExternalTexture::Expire() const { - wgpuExternalTextureExpire(Get()); -} -void ExternalTexture::Refresh() const { - wgpuExternalTextureRefresh(Get()); -} -void ExternalTexture::SetLabel(StringView label) const { - wgpuExternalTextureSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ExternalTexture::WGPUAddRef(WGPUExternalTexture handle) { - if (handle != nullptr) { - wgpuExternalTextureAddRef(handle); - } -} -void ExternalTexture::WGPURelease(WGPUExternalTexture handle) { - if (handle != nullptr) { - wgpuExternalTextureRelease(handle); - } -} -static_assert(sizeof(ExternalTexture) == sizeof(WGPUExternalTexture), "sizeof mismatch for ExternalTexture"); -static_assert(alignof(ExternalTexture) == alignof(WGPUExternalTexture), "alignof mismatch for ExternalTexture"); - -// Instance implementation - -Surface Instance::CreateSurface(SurfaceDescriptor const * descriptor) const { - auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast(descriptor)); - return Surface::Acquire(result); -} -void Instance::GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const { - *features = SupportedWGSLLanguageFeatures(); - wgpuInstanceGetWGSLLanguageFeatures(Get(), reinterpret_cast(features)); -} -Bool Instance::HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const { - auto result = wgpuInstanceHasWGSLLanguageFeature(Get(), static_cast(feature)); - return result; -} -void Instance::ProcessEvents() const { - wgpuInstanceProcessEvents(Get()); -} -template -Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); - return Future { - result.id - }; -} -template -Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); - return Future { - result.id - }; -} -WaitStatus Instance::WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const { - auto result = wgpuInstanceWaitAny(Get(), futureCount, reinterpret_cast(futures), timeoutNS); - return static_cast(result); -} - -WaitStatus Instance::WaitAny(Future f, uint64_t timeout) const { - FutureWaitInfo waitInfo { f }; - return WaitAny(1, &waitInfo, timeout); -} - -void Instance::WGPUAddRef(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceAddRef(handle); - } -} -void Instance::WGPURelease(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceRelease(handle); - } -} -static_assert(sizeof(Instance) == sizeof(WGPUInstance), "sizeof mismatch for Instance"); -static_assert(alignof(Instance) == alignof(WGPUInstance), "alignof mismatch for Instance"); - -// PipelineLayout implementation - -void PipelineLayout::SetLabel(StringView label) const { - wgpuPipelineLayoutSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void PipelineLayout::WGPUAddRef(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutAddRef(handle); - } -} -void PipelineLayout::WGPURelease(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutRelease(handle); - } -} -static_assert(sizeof(PipelineLayout) == sizeof(WGPUPipelineLayout), "sizeof mismatch for PipelineLayout"); -static_assert(alignof(PipelineLayout) == alignof(WGPUPipelineLayout), "alignof mismatch for PipelineLayout"); - -// QuerySet implementation - -void QuerySet::Destroy() const { - wgpuQuerySetDestroy(Get()); -} -uint32_t QuerySet::GetCount() const { - auto result = wgpuQuerySetGetCount(Get()); - return result; -} -QueryType QuerySet::GetType() const { - auto result = wgpuQuerySetGetType(Get()); - return static_cast(result); -} -void QuerySet::SetLabel(StringView label) const { - wgpuQuerySetSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void QuerySet::WGPUAddRef(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetAddRef(handle); - } -} -void QuerySet::WGPURelease(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetRelease(handle); - } -} -static_assert(sizeof(QuerySet) == sizeof(WGPUQuerySet), "sizeof mismatch for QuerySet"); -static_assert(alignof(QuerySet) == alignof(WGPUQuerySet), "alignof mismatch for QuerySet"); - -// Queue implementation - -void Queue::CopyExternalTextureForBrowser(ImageCopyExternalTexture const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const { - wgpuQueueCopyExternalTextureForBrowser(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize), reinterpret_cast(options)); -} -void Queue::CopyTextureForBrowser(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const { - wgpuQueueCopyTextureForBrowser(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize), reinterpret_cast(options)); -} -template -Future Queue::OnSubmittedWorkDone(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuQueueOnSubmittedWorkDone(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future Queue::OnSubmittedWorkDone(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuQueueOnSubmittedWorkDone(Get(), callbackInfo); - return Future { - result.id - }; -} -void Queue::SetLabel(StringView label) const { - wgpuQueueSetLabel(Get(), *reinterpret_cast(&label)); -} -void Queue::Submit(size_t commandCount, CommandBuffer const * commands) const { - wgpuQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); -} -void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const { - wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); -} -void Queue::WriteTexture(TexelCopyTextureInfo const * destination, void const * data, size_t dataSize, TexelCopyBufferLayout const * dataLayout, Extent3D const * writeSize) const { - wgpuQueueWriteTexture(Get(), reinterpret_cast(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(writeSize)); -} - - -void Queue::WGPUAddRef(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueAddRef(handle); - } -} -void Queue::WGPURelease(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueRelease(handle); - } -} -static_assert(sizeof(Queue) == sizeof(WGPUQueue), "sizeof mismatch for Queue"); -static_assert(alignof(Queue) == alignof(WGPUQueue), "alignof mismatch for Queue"); - -// RenderBundle implementation - -void RenderBundle::SetLabel(StringView label) const { - wgpuRenderBundleSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void RenderBundle::WGPUAddRef(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleAddRef(handle); - } -} -void RenderBundle::WGPURelease(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleRelease(handle); - } -} -static_assert(sizeof(RenderBundle) == sizeof(WGPURenderBundle), "sizeof mismatch for RenderBundle"); -static_assert(alignof(RenderBundle) == alignof(WGPURenderBundle), "alignof mismatch for RenderBundle"); - -// RenderPipeline implementation - -BindGroupLayout RenderPipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuRenderPipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); -} -void RenderPipeline::SetLabel(StringView label) const { - wgpuRenderPipelineSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void RenderPipeline::WGPUAddRef(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineAddRef(handle); - } -} -void RenderPipeline::WGPURelease(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineRelease(handle); - } -} -static_assert(sizeof(RenderPipeline) == sizeof(WGPURenderPipeline), "sizeof mismatch for RenderPipeline"); -static_assert(alignof(RenderPipeline) == alignof(WGPURenderPipeline), "alignof mismatch for RenderPipeline"); - -// ResourceTable implementation - -void ResourceTable::Destroy() const { - wgpuResourceTableDestroy(Get()); -} -uint32_t ResourceTable::GetSize() const { - auto result = wgpuResourceTableGetSize(Get()); - return result; -} -uint32_t ResourceTable::InsertBinding(BindingResource const * resource) const { - auto result = wgpuResourceTableInsertBinding(Get(), reinterpret_cast(resource)); - return result; -} -ConvertibleStatus ResourceTable::RemoveBinding(uint32_t slot) const { - auto result = wgpuResourceTableRemoveBinding(Get(), slot); - return static_cast(result); -} -void ResourceTable::SetLabel(StringView label) const { - wgpuResourceTableSetLabel(Get(), *reinterpret_cast(&label)); -} -ConvertibleStatus ResourceTable::Update(uint32_t slot, BindingResource const * resource) const { - auto result = wgpuResourceTableUpdate(Get(), slot, reinterpret_cast(resource)); - return static_cast(result); -} - - -void ResourceTable::WGPUAddRef(WGPUResourceTable handle) { - if (handle != nullptr) { - wgpuResourceTableAddRef(handle); - } -} -void ResourceTable::WGPURelease(WGPUResourceTable handle) { - if (handle != nullptr) { - wgpuResourceTableRelease(handle); - } -} -static_assert(sizeof(ResourceTable) == sizeof(WGPUResourceTable), "sizeof mismatch for ResourceTable"); -static_assert(alignof(ResourceTable) == alignof(WGPUResourceTable), "alignof mismatch for ResourceTable"); - -// Sampler implementation - -void Sampler::SetLabel(StringView label) const { - wgpuSamplerSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void Sampler::WGPUAddRef(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerAddRef(handle); - } -} -void Sampler::WGPURelease(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerRelease(handle); - } -} -static_assert(sizeof(Sampler) == sizeof(WGPUSampler), "sizeof mismatch for Sampler"); -static_assert(alignof(Sampler) == alignof(WGPUSampler), "alignof mismatch for Sampler"); - -// ShaderModule implementation - -template -Future ShaderModule::GetCompilationInfo(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuShaderModuleGetCompilationInfo(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future ShaderModule::GetCompilationInfo(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuShaderModuleGetCompilationInfo(Get(), callbackInfo); - return Future { - result.id - }; -} -void ShaderModule::SetLabel(StringView label) const { - wgpuShaderModuleSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ShaderModule::WGPUAddRef(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleAddRef(handle); - } -} -void ShaderModule::WGPURelease(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleRelease(handle); - } -} -static_assert(sizeof(ShaderModule) == sizeof(WGPUShaderModule), "sizeof mismatch for ShaderModule"); -static_assert(alignof(ShaderModule) == alignof(WGPUShaderModule), "alignof mismatch for ShaderModule"); - -// SharedBufferMemory implementation - -ConvertibleStatus SharedBufferMemory::BeginAccess(Buffer const& buffer, SharedBufferMemoryBeginAccessDescriptor const * descriptor) const { - auto result = wgpuSharedBufferMemoryBeginAccess(Get(), buffer.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -Buffer SharedBufferMemory::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuSharedBufferMemoryCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -ConvertibleStatus SharedBufferMemory::EndAccess(Buffer const& buffer, SharedBufferMemoryEndAccessState * descriptor) const { - *descriptor = SharedBufferMemoryEndAccessState(); - auto result = wgpuSharedBufferMemoryEndAccess(Get(), buffer.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -ConvertibleStatus SharedBufferMemory::GetProperties(SharedBufferMemoryProperties * properties) const { - auto result = wgpuSharedBufferMemoryGetProperties(Get(), reinterpret_cast(properties)); - return static_cast(result); -} -Bool SharedBufferMemory::IsDeviceLost() const { - auto result = wgpuSharedBufferMemoryIsDeviceLost(Get()); - return result; -} -void SharedBufferMemory::SetLabel(StringView label) const { - wgpuSharedBufferMemorySetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedBufferMemory::WGPUAddRef(WGPUSharedBufferMemory handle) { - if (handle != nullptr) { - wgpuSharedBufferMemoryAddRef(handle); - } -} -void SharedBufferMemory::WGPURelease(WGPUSharedBufferMemory handle) { - if (handle != nullptr) { - wgpuSharedBufferMemoryRelease(handle); - } -} -static_assert(sizeof(SharedBufferMemory) == sizeof(WGPUSharedBufferMemory), "sizeof mismatch for SharedBufferMemory"); -static_assert(alignof(SharedBufferMemory) == alignof(WGPUSharedBufferMemory), "alignof mismatch for SharedBufferMemory"); - -// SharedFence implementation - -void SharedFence::ExportInfo(SharedFenceExportInfo * info) const { - wgpuSharedFenceExportInfo(Get(), reinterpret_cast(info)); -} -void SharedFence::SetLabel(StringView label) const { - wgpuSharedFenceSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedFence::WGPUAddRef(WGPUSharedFence handle) { - if (handle != nullptr) { - wgpuSharedFenceAddRef(handle); - } -} -void SharedFence::WGPURelease(WGPUSharedFence handle) { - if (handle != nullptr) { - wgpuSharedFenceRelease(handle); - } -} -static_assert(sizeof(SharedFence) == sizeof(WGPUSharedFence), "sizeof mismatch for SharedFence"); -static_assert(alignof(SharedFence) == alignof(WGPUSharedFence), "alignof mismatch for SharedFence"); - -// SharedTextureMemory implementation - -ConvertibleStatus SharedTextureMemory::BeginAccess(Texture const& texture, SharedTextureMemoryBeginAccessDescriptor const * descriptor) const { - auto result = wgpuSharedTextureMemoryBeginAccess(Get(), texture.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -Texture SharedTextureMemory::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuSharedTextureMemoryCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -ConvertibleStatus SharedTextureMemory::EndAccess(Texture const& texture, SharedTextureMemoryEndAccessState * descriptor) const { - *descriptor = SharedTextureMemoryEndAccessState(); - auto result = wgpuSharedTextureMemoryEndAccess(Get(), texture.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -ConvertibleStatus SharedTextureMemory::GetProperties(SharedTextureMemoryProperties * properties) const { - auto result = wgpuSharedTextureMemoryGetProperties(Get(), reinterpret_cast(properties)); - return static_cast(result); -} -Bool SharedTextureMemory::IsDeviceLost() const { - auto result = wgpuSharedTextureMemoryIsDeviceLost(Get()); - return result; -} -void SharedTextureMemory::SetLabel(StringView label) const { - wgpuSharedTextureMemorySetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedTextureMemory::WGPUAddRef(WGPUSharedTextureMemory handle) { - if (handle != nullptr) { - wgpuSharedTextureMemoryAddRef(handle); - } -} -void SharedTextureMemory::WGPURelease(WGPUSharedTextureMemory handle) { - if (handle != nullptr) { - wgpuSharedTextureMemoryRelease(handle); - } -} -static_assert(sizeof(SharedTextureMemory) == sizeof(WGPUSharedTextureMemory), "sizeof mismatch for SharedTextureMemory"); -static_assert(alignof(SharedTextureMemory) == alignof(WGPUSharedTextureMemory), "alignof mismatch for SharedTextureMemory"); - -// Surface implementation - -void Surface::Configure(SurfaceConfiguration const * config) const { - wgpuSurfaceConfigure(Get(), reinterpret_cast(config)); -} -ConvertibleStatus Surface::GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const { - *capabilities = SurfaceCapabilities(); - auto result = wgpuSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast(capabilities)); - return static_cast(result); -} -void Surface::GetCurrentTexture(SurfaceTexture * surfaceTexture) const { - wgpuSurfaceGetCurrentTexture(Get(), reinterpret_cast(surfaceTexture)); -} -ConvertibleStatus Surface::Present() const { - auto result = wgpuSurfacePresent(Get()); - return static_cast(result); -} -void Surface::SetLabel(StringView label) const { - wgpuSurfaceSetLabel(Get(), *reinterpret_cast(&label)); -} -void Surface::Unconfigure() const { - wgpuSurfaceUnconfigure(Get()); -} - - -void Surface::WGPUAddRef(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceAddRef(handle); - } -} -void Surface::WGPURelease(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceRelease(handle); - } -} -static_assert(sizeof(Surface) == sizeof(WGPUSurface), "sizeof mismatch for Surface"); -static_assert(alignof(Surface) == alignof(WGPUSurface), "alignof mismatch for Surface"); - -// TexelBufferView implementation - -void TexelBufferView::SetLabel(StringView label) const { - wgpuTexelBufferViewSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void TexelBufferView::WGPUAddRef(WGPUTexelBufferView handle) { - if (handle != nullptr) { - wgpuTexelBufferViewAddRef(handle); - } -} -void TexelBufferView::WGPURelease(WGPUTexelBufferView handle) { - if (handle != nullptr) { - wgpuTexelBufferViewRelease(handle); - } -} -static_assert(sizeof(TexelBufferView) == sizeof(WGPUTexelBufferView), "sizeof mismatch for TexelBufferView"); -static_assert(alignof(TexelBufferView) == alignof(WGPUTexelBufferView), "alignof mismatch for TexelBufferView"); - -// Texture implementation - -TextureView Texture::CreateErrorView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuTextureCreateErrorView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); -} -TextureView Texture::CreateView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuTextureCreateView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); -} -void Texture::Destroy() const { - wgpuTextureDestroy(Get()); -} -uint32_t Texture::GetDepthOrArrayLayers() const { - auto result = wgpuTextureGetDepthOrArrayLayers(Get()); - return result; -} -TextureDimension Texture::GetDimension() const { - auto result = wgpuTextureGetDimension(Get()); - return static_cast(result); -} -TextureFormat Texture::GetFormat() const { - auto result = wgpuTextureGetFormat(Get()); - return static_cast(result); -} -uint32_t Texture::GetHeight() const { - auto result = wgpuTextureGetHeight(Get()); - return result; -} -uint32_t Texture::GetMipLevelCount() const { - auto result = wgpuTextureGetMipLevelCount(Get()); - return result; -} -uint32_t Texture::GetSampleCount() const { - auto result = wgpuTextureGetSampleCount(Get()); - return result; -} -TextureViewDimension Texture::GetTextureBindingViewDimension() const { - auto result = wgpuTextureGetTextureBindingViewDimension(Get()); - return static_cast(result); -} -TextureUsage Texture::GetUsage() const { - auto result = wgpuTextureGetUsage(Get()); - return static_cast(result); -} -uint32_t Texture::GetWidth() const { - auto result = wgpuTextureGetWidth(Get()); - return result; -} -void Texture::Pin(TextureUsage usage) const { - wgpuTexturePin(Get(), static_cast(usage)); -} -void Texture::SetLabel(StringView label) const { - wgpuTextureSetLabel(Get(), *reinterpret_cast(&label)); -} -void Texture::SetOwnershipForMemoryDump(uint64_t ownerGuid) const { - wgpuTextureSetOwnershipForMemoryDump(Get(), ownerGuid); -} -void Texture::Unpin() const { - wgpuTextureUnpin(Get()); -} - - -void Texture::WGPUAddRef(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureAddRef(handle); - } -} -void Texture::WGPURelease(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureRelease(handle); - } -} -static_assert(sizeof(Texture) == sizeof(WGPUTexture), "sizeof mismatch for Texture"); -static_assert(alignof(Texture) == alignof(WGPUTexture), "alignof mismatch for Texture"); - -// TextureView implementation - -void TextureView::SetLabel(StringView label) const { - wgpuTextureViewSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void TextureView::WGPUAddRef(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewAddRef(handle); - } -} -void TextureView::WGPURelease(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewRelease(handle); - } -} -static_assert(sizeof(TextureView) == sizeof(WGPUTextureView), "sizeof mismatch for TextureView"); -static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatch for TextureView"); - -// ComputePassEncoder implementation - -void ComputePassEncoder::DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) const { - wgpuComputePassEncoderDispatchWorkgroups(Get(), workgroupCountX, workgroupCountY, workgroupCountZ); -} -void ComputePassEncoder::DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuComputePassEncoderDispatchWorkgroupsIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void ComputePassEncoder::End() const { - wgpuComputePassEncoderEnd(Get()); -} -void ComputePassEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuComputePassEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void ComputePassEncoder::PopDebugGroup() const { - wgpuComputePassEncoderPopDebugGroup(Get()); -} -void ComputePassEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuComputePassEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void ComputePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void ComputePassEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuComputePassEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void ComputePassEncoder::SetLabel(StringView label) const { - wgpuComputePassEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void ComputePassEncoder::SetPipeline(ComputePipeline const& pipeline) const { - wgpuComputePassEncoderSetPipeline(Get(), pipeline.Get()); -} -void ComputePassEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuComputePassEncoderSetResourceTable(Get(), table.Get()); -} -void ComputePassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuComputePassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void ComputePassEncoder::WGPUAddRef(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderAddRef(handle); - } -} -void ComputePassEncoder::WGPURelease(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderRelease(handle); - } -} -static_assert(sizeof(ComputePassEncoder) == sizeof(WGPUComputePassEncoder), "sizeof mismatch for ComputePassEncoder"); -static_assert(alignof(ComputePassEncoder) == alignof(WGPUComputePassEncoder), "alignof mismatch for ComputePassEncoder"); - -// RenderBundleEncoder implementation - -void RenderBundleEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderBundleEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderBundleEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderBundleEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -RenderBundle RenderBundleEncoder::Finish(RenderBundleDescriptor const * descriptor) const { - auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast(descriptor)); - return RenderBundle::Acquire(result); -} -void RenderBundleEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuRenderBundleEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void RenderBundleEncoder::PopDebugGroup() const { - wgpuRenderBundleEncoderPopDebugGroup(Get()); -} -void RenderBundleEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuRenderBundleEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void RenderBundleEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void RenderBundleEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuRenderBundleEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); -} -void RenderBundleEncoder::SetLabel(StringView label) const { - wgpuRenderBundleEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void RenderBundleEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderBundleEncoderSetPipeline(Get(), pipeline.Get()); -} -void RenderBundleEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuRenderBundleEncoderSetResourceTable(Get(), table.Get()); -} -void RenderBundleEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); -} - - -void RenderBundleEncoder::WGPUAddRef(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderAddRef(handle); - } -} -void RenderBundleEncoder::WGPURelease(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderRelease(handle); - } -} -static_assert(sizeof(RenderBundleEncoder) == sizeof(WGPURenderBundleEncoder), "sizeof mismatch for RenderBundleEncoder"); -static_assert(alignof(RenderBundleEncoder) == alignof(WGPURenderBundleEncoder), "alignof mismatch for RenderBundleEncoder"); - -// RenderPassEncoder implementation - -void RenderPassEncoder::BeginOcclusionQuery(uint32_t queryIndex) const { - wgpuRenderPassEncoderBeginOcclusionQuery(Get(), queryIndex); -} -void RenderPassEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderPassEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderPassEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderPassEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderPassEncoder::End() const { - wgpuRenderPassEncoderEnd(Get()); -} -void RenderPassEncoder::EndOcclusionQuery() const { - wgpuRenderPassEncoderEndOcclusionQuery(Get()); -} -void RenderPassEncoder::ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const { - wgpuRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast(bundles)); -} -void RenderPassEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuRenderPassEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void RenderPassEncoder::MultiDrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer, uint64_t drawCountBufferOffset) const { - wgpuRenderPassEncoderMultiDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset, maxDrawCount, drawCountBuffer.Get(), drawCountBufferOffset); -} -void RenderPassEncoder::MultiDrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer, uint64_t drawCountBufferOffset) const { - wgpuRenderPassEncoderMultiDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset, maxDrawCount, drawCountBuffer.Get(), drawCountBufferOffset); -} -void RenderPassEncoder::PixelLocalStorageBarrier() const { - wgpuRenderPassEncoderPixelLocalStorageBarrier(Get()); -} -void RenderPassEncoder::PopDebugGroup() const { - wgpuRenderPassEncoderPopDebugGroup(Get()); -} -void RenderPassEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuRenderPassEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void RenderPassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void RenderPassEncoder::SetBlendConstant(Color const * color) const { - wgpuRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast(color)); -} -void RenderPassEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuRenderPassEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); -} -void RenderPassEncoder::SetLabel(StringView label) const { - wgpuRenderPassEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void RenderPassEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderPassEncoderSetPipeline(Get(), pipeline.Get()); -} -void RenderPassEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuRenderPassEncoderSetResourceTable(Get(), table.Get()); -} -void RenderPassEncoder::SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { - wgpuRenderPassEncoderSetScissorRect(Get(), x, y, width, height); -} -void RenderPassEncoder::SetStencilReference(uint32_t reference) const { - wgpuRenderPassEncoderSetStencilReference(Get(), reference); -} -void RenderPassEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); -} -void RenderPassEncoder::SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const { - wgpuRenderPassEncoderSetViewport(Get(), x, y, width, height, minDepth, maxDepth); -} -void RenderPassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuRenderPassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void RenderPassEncoder::WGPUAddRef(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderAddRef(handle); - } -} -void RenderPassEncoder::WGPURelease(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderRelease(handle); - } -} -static_assert(sizeof(RenderPassEncoder) == sizeof(WGPURenderPassEncoder), "sizeof mismatch for RenderPassEncoder"); -static_assert(alignof(RenderPassEncoder) == alignof(WGPURenderPassEncoder), "alignof mismatch for RenderPassEncoder"); - - - - -// Free Functions -static inline Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr) { - auto result = wgpuCreateInstance(reinterpret_cast(descriptor)); - return Instance::Acquire(result); -} -static inline void GetInstanceFeatures(SupportedInstanceFeatures * features) { - wgpuGetInstanceFeatures(reinterpret_cast(features)); -} -static inline Status GetInstanceLimits(InstanceLimits * limits) { - auto result = wgpuGetInstanceLimits(reinterpret_cast(limits)); - return static_cast(result); -} -static inline Bool HasInstanceFeature(InstanceFeatureName feature) { - auto result = wgpuHasInstanceFeature(static_cast(feature)); - return result; -} -static inline Proc GetProcAddress(StringView procName) { - auto result = wgpuGetProcAddress(*reinterpret_cast(&procName)); - return reinterpret_cast(result); -} - -} // namespace wgpu - -namespace wgpu { - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - - -inline bool operator==(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) { - return s1.r == s2.r && s1.g == s2.g && s1.b == s2.b && s1.a == s2.a; -} -inline bool operator!=(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) { - return !(s1 == s2); -} - -} // namespace wgpu - -namespace std { -// 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); - } -}; -template <> -struct hash { - public: - size_t operator()(const wgpu::OptionalBool &v) const { - return hash()(v.mValue); - } -}; -} // namespace std - -#endif // WEBGPU_CPP_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp_print.h b/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp_print.h deleted file mode 100644 index fb4a284..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/webgpu_cpp_print.h +++ /dev/null @@ -1,2844 +0,0 @@ -// Copyright 2021 The Dawn & Tint Authors -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef WEBGPU_CPP_PRINT_H_ -#define WEBGPU_CPP_PRINT_H_ - -#include "webgpu/webgpu_cpp.h" - -#include -#include -#include -#include - -namespace wgpu { - - template - std::basic_ostream& operator<<(std::basic_ostream& o, AdapterType value) { - switch (value) { - case AdapterType::DiscreteGPU: - o << "AdapterType::DiscreteGPU"; - break; - case AdapterType::IntegratedGPU: - o << "AdapterType::IntegratedGPU"; - break; - case AdapterType::CPU: - o << "AdapterType::CPU"; - break; - case AdapterType::Unknown: - o << "AdapterType::Unknown"; - break; - default: - o << "AdapterType::" << 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, 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; - default: - o << "AddressMode::" << 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, 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; - default: - o << "AlphaMode::" << 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, BackendType value) { - switch (value) { - case BackendType::Undefined: - o << "BackendType::Undefined"; - break; - case BackendType::Null: - o << "BackendType::Null"; - break; - case BackendType::WebGPU: - o << "BackendType::WebGPU"; - break; - case BackendType::D3D11: - o << "BackendType::D3D11"; - break; - case BackendType::D3D12: - o << "BackendType::D3D12"; - break; - case BackendType::Metal: - o << "BackendType::Metal"; - break; - case BackendType::Vulkan: - o << "BackendType::Vulkan"; - break; - case BackendType::OpenGL: - o << "BackendType::OpenGL"; - break; - case BackendType::OpenGLES: - o << "BackendType::OpenGLES"; - break; - default: - o << "BackendType::" << 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, BlendFactor value) { - switch (value) { - case BlendFactor::Undefined: - o << "BlendFactor::Undefined"; - break; - case BlendFactor::Zero: - o << "BlendFactor::Zero"; - break; - case BlendFactor::One: - o << "BlendFactor::One"; - break; - case BlendFactor::Src: - o << "BlendFactor::Src"; - break; - case BlendFactor::OneMinusSrc: - o << "BlendFactor::OneMinusSrc"; - break; - case BlendFactor::SrcAlpha: - o << "BlendFactor::SrcAlpha"; - break; - case BlendFactor::OneMinusSrcAlpha: - o << "BlendFactor::OneMinusSrcAlpha"; - break; - case BlendFactor::Dst: - o << "BlendFactor::Dst"; - break; - case BlendFactor::OneMinusDst: - o << "BlendFactor::OneMinusDst"; - break; - case BlendFactor::DstAlpha: - o << "BlendFactor::DstAlpha"; - break; - case BlendFactor::OneMinusDstAlpha: - o << "BlendFactor::OneMinusDstAlpha"; - break; - case BlendFactor::SrcAlphaSaturated: - o << "BlendFactor::SrcAlphaSaturated"; - break; - case BlendFactor::Constant: - o << "BlendFactor::Constant"; - 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); - } - return o; - } - 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; - case BlendOperation::Subtract: - o << "BlendOperation::Subtract"; - break; - case BlendOperation::ReverseSubtract: - o << "BlendOperation::ReverseSubtract"; - break; - case BlendOperation::Min: - o << "BlendOperation::Min"; - break; - case BlendOperation::Max: - o << "BlendOperation::Max"; - break; - default: - o << "BlendOperation::" << 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, BufferBindingType value) { - switch (value) { - case BufferBindingType::BindingNotUsed: - o << "BufferBindingType::BindingNotUsed"; - break; - case BufferBindingType::Undefined: - o << "BufferBindingType::Undefined"; - break; - case BufferBindingType::Uniform: - o << "BufferBindingType::Uniform"; - break; - case BufferBindingType::Storage: - o << "BufferBindingType::Storage"; - break; - case BufferBindingType::ReadOnlyStorage: - o << "BufferBindingType::ReadOnlyStorage"; - break; - default: - o << "BufferBindingType::" << 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, 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, ColorSpacePrimariesDawn value) { - switch (value) { - case ColorSpacePrimariesDawn::SRGB: - o << "ColorSpacePrimariesDawn::SRGB"; - break; - case ColorSpacePrimariesDawn::Rec601: - o << "ColorSpacePrimariesDawn::Rec601"; - break; - case ColorSpacePrimariesDawn::Rec2020: - o << "ColorSpacePrimariesDawn::Rec2020"; - break; - case ColorSpacePrimariesDawn::DisplayP3: - o << "ColorSpacePrimariesDawn::DisplayP3"; - break; - default: - o << "ColorSpacePrimariesDawn::" << 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, ColorSpaceTransferDawn value) { - switch (value) { - case ColorSpaceTransferDawn::Identity: - o << "ColorSpaceTransferDawn::Identity"; - break; - case ColorSpaceTransferDawn::SRGB: - o << "ColorSpaceTransferDawn::SRGB"; - break; - case ColorSpaceTransferDawn::DisplayP3: - o << "ColorSpaceTransferDawn::DisplayP3"; - break; - case ColorSpaceTransferDawn::SMPTE_170M: - o << "ColorSpaceTransferDawn::SMPTE_170M"; - break; - case ColorSpaceTransferDawn::HLG: - o << "ColorSpaceTransferDawn::HLG"; - break; - case ColorSpaceTransferDawn::PQ: - o << "ColorSpaceTransferDawn::PQ"; - break; - default: - o << "ColorSpaceTransferDawn::" << 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, ColorSpaceYCbCrMatrixDawn value) { - switch (value) { - case ColorSpaceYCbCrMatrixDawn::Identity: - o << "ColorSpaceYCbCrMatrixDawn::Identity"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec601: - o << "ColorSpaceYCbCrMatrixDawn::Rec601"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec709: - o << "ColorSpaceYCbCrMatrixDawn::Rec709"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec2020: - o << "ColorSpaceYCbCrMatrixDawn::Rec2020"; - break; - default: - o << "ColorSpaceYCbCrMatrixDawn::" << 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, ColorSpaceYCbCrRangeDawn value) { - switch (value) { - case ColorSpaceYCbCrRangeDawn::Identity: - o << "ColorSpaceYCbCrRangeDawn::Identity"; - break; - case ColorSpaceYCbCrRangeDawn::Narrow: - o << "ColorSpaceYCbCrRangeDawn::Narrow"; - break; - case ColorSpaceYCbCrRangeDawn::Full: - o << "ColorSpaceYCbCrRangeDawn::Full"; - break; - default: - o << "ColorSpaceYCbCrRangeDawn::" << 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: - o << "CompareFunction::Undefined"; - break; - case CompareFunction::Never: - o << "CompareFunction::Never"; - break; - 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::NotEqual: - o << "CompareFunction::NotEqual"; - break; - case CompareFunction::GreaterEqual: - o << "CompareFunction::GreaterEqual"; - break; - case CompareFunction::Always: - o << "CompareFunction::Always"; - break; - default: - o << "CompareFunction::" << 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, CompilationInfoRequestStatus value) { - switch (value) { - case CompilationInfoRequestStatus::Success: - o << "CompilationInfoRequestStatus::Success"; - break; - case CompilationInfoRequestStatus::CallbackCancelled: - o << "CompilationInfoRequestStatus::CallbackCancelled"; - break; - default: - o << "CompilationInfoRequestStatus::" << 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, CompilationMessageType value) { - switch (value) { - case CompilationMessageType::Error: - o << "CompilationMessageType::Error"; - break; - case CompilationMessageType::Warning: - o << "CompilationMessageType::Warning"; - break; - case CompilationMessageType::Info: - o << "CompilationMessageType::Info"; - break; - default: - o << "CompilationMessageType::" << 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, ComponentSwizzle value) { - switch (value) { - case ComponentSwizzle::Undefined: - o << "ComponentSwizzle::Undefined"; - break; - case ComponentSwizzle::Zero: - o << "ComponentSwizzle::Zero"; - break; - case ComponentSwizzle::One: - o << "ComponentSwizzle::One"; - break; - case ComponentSwizzle::R: - o << "ComponentSwizzle::R"; - break; - case ComponentSwizzle::G: - o << "ComponentSwizzle::G"; - break; - case ComponentSwizzle::B: - o << "ComponentSwizzle::B"; - break; - case ComponentSwizzle::A: - o << "ComponentSwizzle::A"; - break; - default: - o << "ComponentSwizzle::" << 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, CompositeAlphaMode value) { - switch (value) { - case CompositeAlphaMode::Auto: - o << "CompositeAlphaMode::Auto"; - break; - case CompositeAlphaMode::Opaque: - o << "CompositeAlphaMode::Opaque"; - break; - case CompositeAlphaMode::Premultiplied: - o << "CompositeAlphaMode::Premultiplied"; - break; - case CompositeAlphaMode::Unpremultiplied: - o << "CompositeAlphaMode::Unpremultiplied"; - break; - case CompositeAlphaMode::Inherit: - o << "CompositeAlphaMode::Inherit"; - break; - default: - o << "CompositeAlphaMode::" << 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::CallbackCancelled: - o << "CreatePipelineAsyncStatus::CallbackCancelled"; - break; - case CreatePipelineAsyncStatus::ValidationError: - o << "CreatePipelineAsyncStatus::ValidationError"; - break; - case CreatePipelineAsyncStatus::InternalError: - o << "CreatePipelineAsyncStatus::InternalError"; - break; - default: - o << "CreatePipelineAsyncStatus::" << 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, CullMode value) { - switch (value) { - case CullMode::Undefined: - o << "CullMode::Undefined"; - break; - case CullMode::None: - o << "CullMode::None"; - break; - case CullMode::Front: - o << "CullMode::Front"; - break; - case CullMode::Back: - o << "CullMode::Back"; - break; - default: - o << "CullMode::" << 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, DeviceLostReason value) { - switch (value) { - case DeviceLostReason::Unknown: - o << "DeviceLostReason::Unknown"; - break; - case DeviceLostReason::Destroyed: - o << "DeviceLostReason::Destroyed"; - break; - case DeviceLostReason::CallbackCancelled: - o << "DeviceLostReason::CallbackCancelled"; - break; - case DeviceLostReason::FailedCreation: - o << "DeviceLostReason::FailedCreation"; - break; - default: - o << "DeviceLostReason::" << 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, ErrorFilter value) { - switch (value) { - case ErrorFilter::Validation: - o << "ErrorFilter::Validation"; - break; - case ErrorFilter::OutOfMemory: - o << "ErrorFilter::OutOfMemory"; - break; - case ErrorFilter::Internal: - o << "ErrorFilter::Internal"; - break; - default: - o << "ErrorFilter::" << 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, ErrorType value) { - switch (value) { - case ErrorType::NoError: - o << "ErrorType::NoError"; - break; - case ErrorType::Validation: - o << "ErrorType::Validation"; - break; - case ErrorType::OutOfMemory: - o << "ErrorType::OutOfMemory"; - break; - case ErrorType::Internal: - o << "ErrorType::Internal"; - break; - case ErrorType::Unknown: - o << "ErrorType::Unknown"; - break; - default: - o << "ErrorType::" << 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, 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, FeatureLevel value) { - switch (value) { - case FeatureLevel::Undefined: - o << "FeatureLevel::Undefined"; - break; - case FeatureLevel::Compatibility: - o << "FeatureLevel::Compatibility"; - break; - case FeatureLevel::Core: - o << "FeatureLevel::Core"; - break; - default: - o << "FeatureLevel::" << 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::CoreFeaturesAndLimits: - o << "FeatureName::CoreFeaturesAndLimits"; - break; - case FeatureName::DepthClipControl: - o << "FeatureName::DepthClipControl"; - break; - case FeatureName::Depth32FloatStencil8: - o << "FeatureName::Depth32FloatStencil8"; - break; - case FeatureName::TextureCompressionBC: - o << "FeatureName::TextureCompressionBC"; - break; - case FeatureName::TextureCompressionBCSliced3D: - o << "FeatureName::TextureCompressionBCSliced3D"; - break; - case FeatureName::TextureCompressionETC2: - o << "FeatureName::TextureCompressionETC2"; - break; - case FeatureName::TextureCompressionASTC: - o << "FeatureName::TextureCompressionASTC"; - break; - case FeatureName::TextureCompressionASTCSliced3D: - o << "FeatureName::TextureCompressionASTCSliced3D"; - break; - case FeatureName::TimestampQuery: - o << "FeatureName::TimestampQuery"; - break; - case FeatureName::IndirectFirstInstance: - o << "FeatureName::IndirectFirstInstance"; - break; - case FeatureName::ShaderF16: - o << "FeatureName::ShaderF16"; - break; - case FeatureName::RG11B10UfloatRenderable: - o << "FeatureName::RG11B10UfloatRenderable"; - break; - case FeatureName::BGRA8UnormStorage: - o << "FeatureName::BGRA8UnormStorage"; - break; - case FeatureName::Float32Filterable: - o << "FeatureName::Float32Filterable"; - break; - case FeatureName::Float32Blendable: - o << "FeatureName::Float32Blendable"; - break; - case FeatureName::ClipDistances: - o << "FeatureName::ClipDistances"; - break; - case FeatureName::DualSourceBlending: - o << "FeatureName::DualSourceBlending"; - break; - case FeatureName::Subgroups: - o << "FeatureName::Subgroups"; - break; - case FeatureName::TextureFormatsTier1: - o << "FeatureName::TextureFormatsTier1"; - break; - case FeatureName::TextureFormatsTier2: - o << "FeatureName::TextureFormatsTier2"; - break; - case FeatureName::PrimitiveIndex: - o << "FeatureName::PrimitiveIndex"; - break; - case FeatureName::TextureComponentSwizzle: - o << "FeatureName::TextureComponentSwizzle"; - break; - case FeatureName::DawnInternalUsages: - o << "FeatureName::DawnInternalUsages"; - break; - case FeatureName::DawnMultiPlanarFormats: - o << "FeatureName::DawnMultiPlanarFormats"; - break; - case FeatureName::DawnNative: - o << "FeatureName::DawnNative"; - break; - case FeatureName::ChromiumExperimentalTimestampQueryInsidePasses: - o << "FeatureName::ChromiumExperimentalTimestampQueryInsidePasses"; - break; - case FeatureName::ImplicitDeviceSynchronization: - o << "FeatureName::ImplicitDeviceSynchronization"; - break; - case FeatureName::TransientAttachments: - o << "FeatureName::TransientAttachments"; - break; - case FeatureName::MSAARenderToSingleSampled: - o << "FeatureName::MSAARenderToSingleSampled"; - break; - case FeatureName::D3D11MultithreadProtected: - o << "FeatureName::D3D11MultithreadProtected"; - break; - case FeatureName::ANGLETextureSharing: - o << "FeatureName::ANGLETextureSharing"; - break; - case FeatureName::PixelLocalStorageCoherent: - o << "FeatureName::PixelLocalStorageCoherent"; - break; - case FeatureName::PixelLocalStorageNonCoherent: - o << "FeatureName::PixelLocalStorageNonCoherent"; - break; - case FeatureName::Unorm16TextureFormats: - o << "FeatureName::Unorm16TextureFormats"; - 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::AdapterPropertiesVk: - o << "FeatureName::AdapterPropertiesVk"; - break; - case FeatureName::DawnFormatCapabilities: - o << "FeatureName::DawnFormatCapabilities"; - break; - case FeatureName::DawnDrmFormatCapabilities: - o << "FeatureName::DawnDrmFormatCapabilities"; - break; - case FeatureName::MultiPlanarFormatNv16: - o << "FeatureName::MultiPlanarFormatNv16"; - break; - case FeatureName::MultiPlanarFormatNv24: - o << "FeatureName::MultiPlanarFormatNv24"; - break; - case FeatureName::MultiPlanarFormatP210: - o << "FeatureName::MultiPlanarFormatP210"; - break; - case FeatureName::MultiPlanarFormatP410: - o << "FeatureName::MultiPlanarFormatP410"; - break; - case FeatureName::SharedTextureMemoryVkDedicatedAllocation: - o << "FeatureName::SharedTextureMemoryVkDedicatedAllocation"; - break; - case FeatureName::SharedTextureMemoryAHardwareBuffer: - o << "FeatureName::SharedTextureMemoryAHardwareBuffer"; - break; - 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::SharedFenceSyncFD: - o << "FeatureName::SharedFenceSyncFD"; - 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; - case FeatureName::StaticSamplers: - o << "FeatureName::StaticSamplers"; - break; - case FeatureName::YCbCrVulkanSamplers: - o << "FeatureName::YCbCrVulkanSamplers"; - break; - case FeatureName::ShaderModuleCompilationOptions: - o << "FeatureName::ShaderModuleCompilationOptions"; - break; - case FeatureName::DawnLoadResolveTexture: - o << "FeatureName::DawnLoadResolveTexture"; - break; - case FeatureName::DawnPartialLoadResolveTexture: - o << "FeatureName::DawnPartialLoadResolveTexture"; - break; - case FeatureName::MultiDrawIndirect: - o << "FeatureName::MultiDrawIndirect"; - break; - case FeatureName::DawnTexelCopyBufferRowAlignment: - o << "FeatureName::DawnTexelCopyBufferRowAlignment"; - break; - case FeatureName::FlexibleTextureViews: - o << "FeatureName::FlexibleTextureViews"; - break; - case FeatureName::ChromiumExperimentalSubgroupMatrix: - o << "FeatureName::ChromiumExperimentalSubgroupMatrix"; - break; - case FeatureName::SharedFenceEGLSync: - o << "FeatureName::SharedFenceEGLSync"; - break; - case FeatureName::DawnDeviceAllocatorControl: - o << "FeatureName::DawnDeviceAllocatorControl"; - break; - case FeatureName::AdapterPropertiesWGPU: - o << "FeatureName::AdapterPropertiesWGPU"; - break; - case FeatureName::SharedBufferMemoryD3D12SharedMemoryFileMappingHandle: - o << "FeatureName::SharedBufferMemoryD3D12SharedMemoryFileMappingHandle"; - break; - case FeatureName::SharedTextureMemoryD3D12Resource: - o << "FeatureName::SharedTextureMemoryD3D12Resource"; - break; - case FeatureName::ChromiumExperimentalSamplingResourceTable: - o << "FeatureName::ChromiumExperimentalSamplingResourceTable"; - break; - case FeatureName::SubgroupSizeControl: - o << "FeatureName::SubgroupSizeControl"; - break; - case FeatureName::AtomicVec2uMinMax: - o << "FeatureName::AtomicVec2uMinMax"; - break; - case FeatureName::Unorm16FormatsForExternalTexture: - o << "FeatureName::Unorm16FormatsForExternalTexture"; - break; - case FeatureName::OpaqueYCbCrAndroidForExternalTexture: - o << "FeatureName::OpaqueYCbCrAndroidForExternalTexture"; - break; - case FeatureName::Unorm16Filterable: - o << "FeatureName::Unorm16Filterable"; - break; - case FeatureName::RenderPassRenderArea: - o << "FeatureName::RenderPassRenderArea"; - break; - case FeatureName::AdapterPropertiesDrm: - o << "FeatureName::AdapterPropertiesDrm"; - break; - default: - o << "FeatureName::" << 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, FilterMode value) { - switch (value) { - case FilterMode::Undefined: - o << "FilterMode::Undefined"; - break; - case FilterMode::Nearest: - o << "FilterMode::Nearest"; - break; - case FilterMode::Linear: - o << "FilterMode::Linear"; - break; - default: - o << "FilterMode::" << 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, FrontFace value) { - switch (value) { - case FrontFace::Undefined: - o << "FrontFace::Undefined"; - break; - case FrontFace::CCW: - o << "FrontFace::CCW"; - break; - case FrontFace::CW: - o << "FrontFace::CW"; - break; - default: - o << "FrontFace::" << 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, IndexFormat value) { - switch (value) { - case IndexFormat::Undefined: - o << "IndexFormat::Undefined"; - break; - case IndexFormat::Uint16: - o << "IndexFormat::Uint16"; - break; - case IndexFormat::Uint32: - o << "IndexFormat::Uint32"; - break; - default: - o << "IndexFormat::" << 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, InstanceFeatureName value) { - switch (value) { - case InstanceFeatureName::TimedWaitAny: - o << "InstanceFeatureName::TimedWaitAny"; - break; - case InstanceFeatureName::ShaderSourceSPIRV: - o << "InstanceFeatureName::ShaderSourceSPIRV"; - break; - case InstanceFeatureName::MultipleDevicesPerAdapter: - o << "InstanceFeatureName::MultipleDevicesPerAdapter"; - break; - default: - o << "InstanceFeatureName::" << 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, LoadOp value) { - switch (value) { - case LoadOp::Undefined: - o << "LoadOp::Undefined"; - break; - case LoadOp::Load: - o << "LoadOp::Load"; - break; - case LoadOp::Clear: - o << "LoadOp::Clear"; - break; - case LoadOp::ExpandResolveTexture: - o << "LoadOp::ExpandResolveTexture"; - break; - default: - o << "LoadOp::" << 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, LoggingType value) { - switch (value) { - case LoggingType::Verbose: - o << "LoggingType::Verbose"; - break; - case LoggingType::Info: - o << "LoggingType::Info"; - break; - case LoggingType::Warning: - o << "LoggingType::Warning"; - break; - case LoggingType::Error: - o << "LoggingType::Error"; - break; - default: - o << "LoggingType::" << 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, MapAsyncStatus value) { - switch (value) { - case MapAsyncStatus::Success: - o << "MapAsyncStatus::Success"; - break; - case MapAsyncStatus::CallbackCancelled: - o << "MapAsyncStatus::CallbackCancelled"; - break; - case MapAsyncStatus::Error: - o << "MapAsyncStatus::Error"; - break; - case MapAsyncStatus::Aborted: - o << "MapAsyncStatus::Aborted"; - break; - default: - o << "MapAsyncStatus::" << 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, MipmapFilterMode value) { - switch (value) { - case MipmapFilterMode::Undefined: - o << "MipmapFilterMode::Undefined"; - break; - case MipmapFilterMode::Nearest: - o << "MipmapFilterMode::Nearest"; - break; - case MipmapFilterMode::Linear: - o << "MipmapFilterMode::Linear"; - break; - 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 PopErrorScopeStatus::CallbackCancelled: - o << "PopErrorScopeStatus::CallbackCancelled"; - break; - case PopErrorScopeStatus::Error: - o << "PopErrorScopeStatus::Error"; - break; - default: - o << "PopErrorScopeStatus::" << 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, PowerPreference value) { - switch (value) { - case PowerPreference::Undefined: - o << "PowerPreference::Undefined"; - break; - case PowerPreference::LowPower: - o << "PowerPreference::LowPower"; - break; - case PowerPreference::HighPerformance: - o << "PowerPreference::HighPerformance"; - break; - default: - o << "PowerPreference::" << 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, PredefinedColorSpace value) { - switch (value) { - case PredefinedColorSpace::SRGB: - o << "PredefinedColorSpace::SRGB"; - break; - case PredefinedColorSpace::DisplayP3: - o << "PredefinedColorSpace::DisplayP3"; - break; - case PredefinedColorSpace::SRGBLinear: - o << "PredefinedColorSpace::SRGBLinear"; - break; - case PredefinedColorSpace::DisplayP3Linear: - o << "PredefinedColorSpace::DisplayP3Linear"; - break; - default: - o << "PredefinedColorSpace::" << 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, PresentMode value) { - switch (value) { - case PresentMode::Undefined: - o << "PresentMode::Undefined"; - break; - case PresentMode::Fifo: - o << "PresentMode::Fifo"; - break; - case PresentMode::FifoRelaxed: - o << "PresentMode::FifoRelaxed"; - break; - case PresentMode::Immediate: - o << "PresentMode::Immediate"; - break; - case PresentMode::Mailbox: - o << "PresentMode::Mailbox"; - break; - default: - o << "PresentMode::" << 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, PrimitiveTopology value) { - switch (value) { - case PrimitiveTopology::Undefined: - o << "PrimitiveTopology::Undefined"; - break; - case PrimitiveTopology::PointList: - o << "PrimitiveTopology::PointList"; - break; - case PrimitiveTopology::LineList: - o << "PrimitiveTopology::LineList"; - break; - case PrimitiveTopology::LineStrip: - o << "PrimitiveTopology::LineStrip"; - break; - case PrimitiveTopology::TriangleList: - o << "PrimitiveTopology::TriangleList"; - break; - case PrimitiveTopology::TriangleStrip: - o << "PrimitiveTopology::TriangleStrip"; - break; - default: - o << "PrimitiveTopology::" << 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, QueryType value) { - switch (value) { - case QueryType::Occlusion: - o << "QueryType::Occlusion"; - break; - case QueryType::Timestamp: - o << "QueryType::Timestamp"; - break; - default: - o << "QueryType::" << 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, QueueWorkDoneStatus value) { - switch (value) { - case QueueWorkDoneStatus::Success: - o << "QueueWorkDoneStatus::Success"; - break; - case QueueWorkDoneStatus::CallbackCancelled: - o << "QueueWorkDoneStatus::CallbackCancelled"; - break; - case QueueWorkDoneStatus::Error: - o << "QueueWorkDoneStatus::Error"; - break; - default: - o << "QueueWorkDoneStatus::" << 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::CallbackCancelled: - o << "RequestAdapterStatus::CallbackCancelled"; - break; - case RequestAdapterStatus::Unavailable: - o << "RequestAdapterStatus::Unavailable"; - break; - case RequestAdapterStatus::Error: - o << "RequestAdapterStatus::Error"; - break; - default: - o << "RequestAdapterStatus::" << 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, RequestDeviceStatus value) { - switch (value) { - case RequestDeviceStatus::Success: - o << "RequestDeviceStatus::Success"; - break; - case RequestDeviceStatus::CallbackCancelled: - o << "RequestDeviceStatus::CallbackCancelled"; - break; - case RequestDeviceStatus::Error: - o << "RequestDeviceStatus::Error"; - break; - default: - o << "RequestDeviceStatus::" << 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, SamplerBindingType value) { - switch (value) { - case SamplerBindingType::BindingNotUsed: - o << "SamplerBindingType::BindingNotUsed"; - break; - case SamplerBindingType::Undefined: - o << "SamplerBindingType::Undefined"; - break; - case SamplerBindingType::Filtering: - o << "SamplerBindingType::Filtering"; - break; - case SamplerBindingType::NonFiltering: - o << "SamplerBindingType::NonFiltering"; - break; - case SamplerBindingType::Comparison: - o << "SamplerBindingType::Comparison"; - break; - default: - o << "SamplerBindingType::" << 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, SharedFenceType value) { - switch (value) { - case SharedFenceType::VkSemaphoreOpaqueFD: - o << "SharedFenceType::VkSemaphoreOpaqueFD"; - break; - case SharedFenceType::SyncFD: - o << "SharedFenceType::SyncFD"; - break; - case SharedFenceType::VkSemaphoreZirconHandle: - o << "SharedFenceType::VkSemaphoreZirconHandle"; - break; - case SharedFenceType::DXGISharedHandle: - o << "SharedFenceType::DXGISharedHandle"; - break; - case SharedFenceType::MTLSharedEvent: - o << "SharedFenceType::MTLSharedEvent"; - break; - case SharedFenceType::EGLSync: - o << "SharedFenceType::EGLSync"; - 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, Status value) { - switch (value) { - case Status::Success: - o << "Status::Success"; - break; - case Status::Error: - o << "Status::Error"; - break; - default: - o << "Status::" << 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; - case StencilOperation::Zero: - o << "StencilOperation::Zero"; - break; - case StencilOperation::Replace: - o << "StencilOperation::Replace"; - break; - case StencilOperation::Invert: - o << "StencilOperation::Invert"; - break; - case StencilOperation::IncrementClamp: - o << "StencilOperation::IncrementClamp"; - break; - case StencilOperation::DecrementClamp: - o << "StencilOperation::DecrementClamp"; - break; - case StencilOperation::IncrementWrap: - o << "StencilOperation::IncrementWrap"; - break; - case StencilOperation::DecrementWrap: - o << "StencilOperation::DecrementWrap"; - break; - default: - o << "StencilOperation::" << 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, StorageTextureAccess value) { - switch (value) { - case StorageTextureAccess::BindingNotUsed: - o << "StorageTextureAccess::BindingNotUsed"; - break; - case StorageTextureAccess::Undefined: - o << "StorageTextureAccess::Undefined"; - 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); - } - return o; - } - template - std::basic_ostream& operator<<(std::basic_ostream& o, StoreOp value) { - switch (value) { - case StoreOp::Undefined: - o << "StoreOp::Undefined"; - break; - case StoreOp::Store: - o << "StoreOp::Store"; - break; - case StoreOp::Discard: - o << "StoreOp::Discard"; - break; - default: - o << "StoreOp::" << 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, SType value) { - switch (value) { - case SType::ShaderSourceSPIRV: - o << "SType::ShaderSourceSPIRV"; - break; - case SType::ShaderSourceWGSL: - o << "SType::ShaderSourceWGSL"; - break; - case SType::RenderPassMaxDrawCount: - o << "SType::RenderPassMaxDrawCount"; - break; - case SType::SurfaceSourceMetalLayer: - o << "SType::SurfaceSourceMetalLayer"; - break; - case SType::SurfaceSourceWindowsHWND: - o << "SType::SurfaceSourceWindowsHWND"; - break; - case SType::SurfaceSourceXlibWindow: - o << "SType::SurfaceSourceXlibWindow"; - break; - case SType::SurfaceSourceWaylandSurface: - o << "SType::SurfaceSourceWaylandSurface"; - break; - case SType::SurfaceSourceAndroidNativeWindow: - o << "SType::SurfaceSourceAndroidNativeWindow"; - break; - case SType::SurfaceSourceXCBWindow: - o << "SType::SurfaceSourceXCBWindow"; - break; - case SType::SurfaceColorManagement: - o << "SType::SurfaceColorManagement"; - break; - case SType::RequestAdapterWebXROptions: - o << "SType::RequestAdapterWebXROptions"; - break; - case SType::TextureComponentSwizzleDescriptor: - o << "SType::TextureComponentSwizzleDescriptor"; - break; - case SType::ExternalTextureBindingLayout: - o << "SType::ExternalTextureBindingLayout"; - break; - case SType::ExternalTextureBindingEntry: - o << "SType::ExternalTextureBindingEntry"; - break; - case SType::CompatibilityModeLimits: - o << "SType::CompatibilityModeLimits"; - break; - case SType::TextureBindingViewDimension: - o << "SType::TextureBindingViewDimension"; - break; - case SType::SurfaceDescriptorFromWindowsCoreWindow: - o << "SType::SurfaceDescriptorFromWindowsCoreWindow"; - break; - case SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel: - o << "SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel"; - break; - case SType::DawnTextureInternalUsageDescriptor: - o << "SType::DawnTextureInternalUsageDescriptor"; - break; - case SType::DawnEncoderInternalUsageDescriptor: - o << "SType::DawnEncoderInternalUsageDescriptor"; - break; - case SType::DawnInstanceDescriptor: - o << "SType::DawnInstanceDescriptor"; - break; - case SType::DawnCacheDeviceDescriptor: - o << "SType::DawnCacheDeviceDescriptor"; - 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::DawnRenderPassSampleCount: - o << "SType::DawnRenderPassSampleCount"; - break; - case SType::RenderPassPixelLocalStorage: - o << "SType::RenderPassPixelLocalStorage"; - break; - case SType::PipelineLayoutPixelLocalStorage: - o << "SType::PipelineLayoutPixelLocalStorage"; - break; - case SType::BufferHostMappedPointer: - o << "SType::BufferHostMappedPointer"; - break; - case SType::AdapterPropertiesMemoryHeaps: - o << "SType::AdapterPropertiesMemoryHeaps"; - break; - case SType::AdapterPropertiesD3D: - o << "SType::AdapterPropertiesD3D"; - break; - case SType::AdapterPropertiesVk: - o << "SType::AdapterPropertiesVk"; - break; - case SType::DawnWireWGSLControl: - o << "SType::DawnWireWGSLControl"; - break; - case SType::DawnWGSLBlocklist: - o << "SType::DawnWGSLBlocklist"; - break; - case SType::DawnDrmFormatCapabilities: - o << "SType::DawnDrmFormatCapabilities"; - break; - case SType::ShaderModuleCompilationOptions: - o << "SType::ShaderModuleCompilationOptions"; - break; - case SType::ColorTargetStateExpandResolveTextureDawn: - o << "SType::ColorTargetStateExpandResolveTextureDawn"; - break; - case SType::RenderPassRenderAreaRect: - o << "SType::RenderPassRenderAreaRect"; - 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::SharedTextureMemoryD3DSwapchainBeginState: - o << "SType::SharedTextureMemoryD3DSwapchainBeginState"; - break; - case SType::SharedFenceVkSemaphoreOpaqueFDDescriptor: - o << "SType::SharedFenceVkSemaphoreOpaqueFDDescriptor"; - break; - case SType::SharedFenceVkSemaphoreOpaqueFDExportInfo: - o << "SType::SharedFenceVkSemaphoreOpaqueFDExportInfo"; - break; - case SType::SharedFenceSyncFDDescriptor: - o << "SType::SharedFenceSyncFDDescriptor"; - break; - case SType::SharedFenceSyncFDExportInfo: - o << "SType::SharedFenceSyncFDExportInfo"; - 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; - case SType::StaticSamplerBindingLayout: - o << "SType::StaticSamplerBindingLayout"; - break; - case SType::YCbCrVkDescriptor: - o << "SType::YCbCrVkDescriptor"; - break; - case SType::SharedTextureMemoryAHardwareBufferProperties: - o << "SType::SharedTextureMemoryAHardwareBufferProperties"; - break; - case SType::AHardwareBufferProperties: - o << "SType::AHardwareBufferProperties"; - break; - case SType::DawnTexelCopyBufferRowAlignmentLimits: - o << "SType::DawnTexelCopyBufferRowAlignmentLimits"; - break; - case SType::AdapterPropertiesSubgroupMatrixConfigs: - o << "SType::AdapterPropertiesSubgroupMatrixConfigs"; - break; - case SType::SharedFenceEGLSyncDescriptor: - o << "SType::SharedFenceEGLSyncDescriptor"; - break; - case SType::SharedFenceEGLSyncExportInfo: - o << "SType::SharedFenceEGLSyncExportInfo"; - break; - case SType::DawnInjectedInvalidSType: - o << "SType::DawnInjectedInvalidSType"; - break; - case SType::DawnCompilationMessageUtf16: - o << "SType::DawnCompilationMessageUtf16"; - break; - case SType::DawnFakeBufferOOMForTesting: - o << "SType::DawnFakeBufferOOMForTesting"; - break; - case SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel: - o << "SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel"; - break; - case SType::DawnDeviceAllocatorControl: - o << "SType::DawnDeviceAllocatorControl"; - break; - case SType::DawnHostMappedPointerLimits: - o << "SType::DawnHostMappedPointerLimits"; - break; - case SType::RenderPassDescriptorResolveRect: - o << "SType::RenderPassDescriptorResolveRect"; - break; - case SType::RequestAdapterWebGPUBackendOptions: - o << "SType::RequestAdapterWebGPUBackendOptions"; - break; - case SType::DawnFakeDeviceInitializeErrorForTesting: - o << "SType::DawnFakeDeviceInitializeErrorForTesting"; - break; - case SType::SharedTextureMemoryD3D11BeginState: - o << "SType::SharedTextureMemoryD3D11BeginState"; - break; - case SType::DawnConsumeAdapterDescriptor: - o << "SType::DawnConsumeAdapterDescriptor"; - break; - case SType::TexelBufferBindingEntry: - o << "SType::TexelBufferBindingEntry"; - break; - case SType::TexelBufferBindingLayout: - o << "SType::TexelBufferBindingLayout"; - break; - case SType::SharedTextureMemoryMetalEndAccessState: - o << "SType::SharedTextureMemoryMetalEndAccessState"; - break; - case SType::AdapterPropertiesWGPU: - o << "SType::AdapterPropertiesWGPU"; - break; - case SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor: - o << "SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"; - break; - case SType::SharedTextureMemoryD3D12ResourceDescriptor: - o << "SType::SharedTextureMemoryD3D12ResourceDescriptor"; - break; - case SType::RequestAdapterOptionsAngleVirtualizationGroup: - o << "SType::RequestAdapterOptionsAngleVirtualizationGroup"; - break; - case SType::PipelineLayoutResourceTable: - o << "SType::PipelineLayoutResourceTable"; - break; - case SType::AdapterPropertiesDrm: - o << "SType::AdapterPropertiesDrm"; - break; - default: - o << "SType::" << 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, SubgroupMatrixComponentType value) { - switch (value) { - case SubgroupMatrixComponentType::F32: - o << "SubgroupMatrixComponentType::F32"; - break; - case SubgroupMatrixComponentType::F16: - o << "SubgroupMatrixComponentType::F16"; - break; - case SubgroupMatrixComponentType::U32: - o << "SubgroupMatrixComponentType::U32"; - break; - case SubgroupMatrixComponentType::I32: - o << "SubgroupMatrixComponentType::I32"; - break; - case SubgroupMatrixComponentType::U8: - o << "SubgroupMatrixComponentType::U8"; - break; - case SubgroupMatrixComponentType::I8: - o << "SubgroupMatrixComponentType::I8"; - break; - default: - o << "SubgroupMatrixComponentType::" << 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, SurfaceGetCurrentTextureStatus value) { - switch (value) { - case SurfaceGetCurrentTextureStatus::SuccessOptimal: - o << "SurfaceGetCurrentTextureStatus::SuccessOptimal"; - break; - case SurfaceGetCurrentTextureStatus::SuccessSuboptimal: - o << "SurfaceGetCurrentTextureStatus::SuccessSuboptimal"; - break; - case SurfaceGetCurrentTextureStatus::Timeout: - o << "SurfaceGetCurrentTextureStatus::Timeout"; - break; - case SurfaceGetCurrentTextureStatus::Outdated: - o << "SurfaceGetCurrentTextureStatus::Outdated"; - break; - case SurfaceGetCurrentTextureStatus::Lost: - o << "SurfaceGetCurrentTextureStatus::Lost"; - break; - case SurfaceGetCurrentTextureStatus::Error: - o << "SurfaceGetCurrentTextureStatus::Error"; - break; - default: - o << "SurfaceGetCurrentTextureStatus::" << 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, TexelBufferAccess value) { - switch (value) { - case TexelBufferAccess::Undefined: - o << "TexelBufferAccess::Undefined"; - break; - case TexelBufferAccess::ReadOnly: - o << "TexelBufferAccess::ReadOnly"; - break; - case TexelBufferAccess::ReadWrite: - o << "TexelBufferAccess::ReadWrite"; - break; - default: - o << "TexelBufferAccess::" << 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, TextureAspect value) { - switch (value) { - case TextureAspect::Undefined: - o << "TextureAspect::Undefined"; - break; - case TextureAspect::All: - o << "TextureAspect::All"; - break; - case TextureAspect::StencilOnly: - o << "TextureAspect::StencilOnly"; - break; - case TextureAspect::DepthOnly: - o << "TextureAspect::DepthOnly"; - break; - case TextureAspect::Plane0Only: - o << "TextureAspect::Plane0Only"; - break; - case TextureAspect::Plane1Only: - o << "TextureAspect::Plane1Only"; - break; - case TextureAspect::Plane2Only: - o << "TextureAspect::Plane2Only"; - 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, TextureDimension value) { - switch (value) { - case TextureDimension::Undefined: - o << "TextureDimension::Undefined"; - break; - case TextureDimension::e1D: - o << "TextureDimension::e1D"; - break; - case TextureDimension::e2D: - o << "TextureDimension::e2D"; - break; - case TextureDimension::e3D: - o << "TextureDimension::e3D"; - break; - default: - o << "TextureDimension::" << 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, TextureFormat value) { - switch (value) { - case TextureFormat::Undefined: - o << "TextureFormat::Undefined"; - break; - case TextureFormat::R8Unorm: - o << "TextureFormat::R8Unorm"; - break; - case TextureFormat::R8Snorm: - o << "TextureFormat::R8Snorm"; - break; - case TextureFormat::R8Uint: - o << "TextureFormat::R8Uint"; - break; - case TextureFormat::R8Sint: - o << "TextureFormat::R8Sint"; - break; - case TextureFormat::R16Unorm: - o << "TextureFormat::R16Unorm"; - break; - case TextureFormat::R16Snorm: - o << "TextureFormat::R16Snorm"; - break; - case TextureFormat::R16Uint: - o << "TextureFormat::R16Uint"; - break; - case TextureFormat::R16Sint: - o << "TextureFormat::R16Sint"; - break; - case TextureFormat::R16Float: - o << "TextureFormat::R16Float"; - break; - case TextureFormat::RG8Unorm: - o << "TextureFormat::RG8Unorm"; - break; - case TextureFormat::RG8Snorm: - o << "TextureFormat::RG8Snorm"; - break; - case TextureFormat::RG8Uint: - o << "TextureFormat::RG8Uint"; - break; - case TextureFormat::RG8Sint: - o << "TextureFormat::RG8Sint"; - break; - case TextureFormat::R32Float: - o << "TextureFormat::R32Float"; - break; - case TextureFormat::R32Uint: - o << "TextureFormat::R32Uint"; - break; - case TextureFormat::R32Sint: - o << "TextureFormat::R32Sint"; - break; - case TextureFormat::RG16Unorm: - o << "TextureFormat::RG16Unorm"; - break; - case TextureFormat::RG16Snorm: - o << "TextureFormat::RG16Snorm"; - break; - case TextureFormat::RG16Uint: - o << "TextureFormat::RG16Uint"; - break; - case TextureFormat::RG16Sint: - o << "TextureFormat::RG16Sint"; - break; - case TextureFormat::RG16Float: - o << "TextureFormat::RG16Float"; - break; - case TextureFormat::RGBA8Unorm: - o << "TextureFormat::RGBA8Unorm"; - break; - case TextureFormat::RGBA8UnormSrgb: - o << "TextureFormat::RGBA8UnormSrgb"; - break; - case TextureFormat::RGBA8Snorm: - o << "TextureFormat::RGBA8Snorm"; - break; - case TextureFormat::RGBA8Uint: - o << "TextureFormat::RGBA8Uint"; - break; - case TextureFormat::RGBA8Sint: - o << "TextureFormat::RGBA8Sint"; - break; - case TextureFormat::BGRA8Unorm: - o << "TextureFormat::BGRA8Unorm"; - break; - case TextureFormat::BGRA8UnormSrgb: - o << "TextureFormat::BGRA8UnormSrgb"; - break; - case TextureFormat::RGB10A2Uint: - o << "TextureFormat::RGB10A2Uint"; - break; - case TextureFormat::RGB10A2Unorm: - o << "TextureFormat::RGB10A2Unorm"; - break; - case TextureFormat::RG11B10Ufloat: - o << "TextureFormat::RG11B10Ufloat"; - break; - case TextureFormat::RGB9E5Ufloat: - o << "TextureFormat::RGB9E5Ufloat"; - break; - case TextureFormat::RG32Float: - o << "TextureFormat::RG32Float"; - break; - case TextureFormat::RG32Uint: - o << "TextureFormat::RG32Uint"; - break; - case TextureFormat::RG32Sint: - o << "TextureFormat::RG32Sint"; - break; - case TextureFormat::RGBA16Unorm: - o << "TextureFormat::RGBA16Unorm"; - break; - case TextureFormat::RGBA16Snorm: - o << "TextureFormat::RGBA16Snorm"; - break; - case TextureFormat::RGBA16Uint: - o << "TextureFormat::RGBA16Uint"; - break; - case TextureFormat::RGBA16Sint: - o << "TextureFormat::RGBA16Sint"; - break; - case TextureFormat::RGBA16Float: - o << "TextureFormat::RGBA16Float"; - break; - case TextureFormat::RGBA32Float: - o << "TextureFormat::RGBA32Float"; - break; - case TextureFormat::RGBA32Uint: - o << "TextureFormat::RGBA32Uint"; - break; - case TextureFormat::RGBA32Sint: - o << "TextureFormat::RGBA32Sint"; - break; - case TextureFormat::Stencil8: - o << "TextureFormat::Stencil8"; - break; - case TextureFormat::Depth16Unorm: - o << "TextureFormat::Depth16Unorm"; - break; - case TextureFormat::Depth24Plus: - o << "TextureFormat::Depth24Plus"; - break; - case TextureFormat::Depth24PlusStencil8: - o << "TextureFormat::Depth24PlusStencil8"; - break; - case TextureFormat::Depth32Float: - o << "TextureFormat::Depth32Float"; - break; - case TextureFormat::Depth32FloatStencil8: - o << "TextureFormat::Depth32FloatStencil8"; - break; - case TextureFormat::BC1RGBAUnorm: - o << "TextureFormat::BC1RGBAUnorm"; - break; - case TextureFormat::BC1RGBAUnormSrgb: - o << "TextureFormat::BC1RGBAUnormSrgb"; - break; - case TextureFormat::BC2RGBAUnorm: - o << "TextureFormat::BC2RGBAUnorm"; - break; - case TextureFormat::BC2RGBAUnormSrgb: - o << "TextureFormat::BC2RGBAUnormSrgb"; - break; - case TextureFormat::BC3RGBAUnorm: - o << "TextureFormat::BC3RGBAUnorm"; - break; - case TextureFormat::BC3RGBAUnormSrgb: - o << "TextureFormat::BC3RGBAUnormSrgb"; - break; - case TextureFormat::BC4RUnorm: - o << "TextureFormat::BC4RUnorm"; - break; - case TextureFormat::BC4RSnorm: - o << "TextureFormat::BC4RSnorm"; - break; - case TextureFormat::BC5RGUnorm: - o << "TextureFormat::BC5RGUnorm"; - break; - case TextureFormat::BC5RGSnorm: - o << "TextureFormat::BC5RGSnorm"; - break; - case TextureFormat::BC6HRGBUfloat: - o << "TextureFormat::BC6HRGBUfloat"; - break; - case TextureFormat::BC6HRGBFloat: - o << "TextureFormat::BC6HRGBFloat"; - break; - case TextureFormat::BC7RGBAUnorm: - o << "TextureFormat::BC7RGBAUnorm"; - break; - case TextureFormat::BC7RGBAUnormSrgb: - o << "TextureFormat::BC7RGBAUnormSrgb"; - break; - case TextureFormat::ETC2RGB8Unorm: - o << "TextureFormat::ETC2RGB8Unorm"; - break; - case TextureFormat::ETC2RGB8UnormSrgb: - o << "TextureFormat::ETC2RGB8UnormSrgb"; - break; - case TextureFormat::ETC2RGB8A1Unorm: - o << "TextureFormat::ETC2RGB8A1Unorm"; - break; - case TextureFormat::ETC2RGB8A1UnormSrgb: - o << "TextureFormat::ETC2RGB8A1UnormSrgb"; - break; - case TextureFormat::ETC2RGBA8Unorm: - o << "TextureFormat::ETC2RGBA8Unorm"; - break; - case TextureFormat::ETC2RGBA8UnormSrgb: - o << "TextureFormat::ETC2RGBA8UnormSrgb"; - break; - case TextureFormat::EACR11Unorm: - o << "TextureFormat::EACR11Unorm"; - break; - case TextureFormat::EACR11Snorm: - o << "TextureFormat::EACR11Snorm"; - break; - case TextureFormat::EACRG11Unorm: - o << "TextureFormat::EACRG11Unorm"; - break; - case TextureFormat::EACRG11Snorm: - o << "TextureFormat::EACRG11Snorm"; - break; - case TextureFormat::ASTC4x4Unorm: - o << "TextureFormat::ASTC4x4Unorm"; - break; - case TextureFormat::ASTC4x4UnormSrgb: - o << "TextureFormat::ASTC4x4UnormSrgb"; - break; - case TextureFormat::ASTC5x4Unorm: - o << "TextureFormat::ASTC5x4Unorm"; - break; - case TextureFormat::ASTC5x4UnormSrgb: - o << "TextureFormat::ASTC5x4UnormSrgb"; - break; - case TextureFormat::ASTC5x5Unorm: - o << "TextureFormat::ASTC5x5Unorm"; - break; - case TextureFormat::ASTC5x5UnormSrgb: - o << "TextureFormat::ASTC5x5UnormSrgb"; - break; - case TextureFormat::ASTC6x5Unorm: - o << "TextureFormat::ASTC6x5Unorm"; - break; - case TextureFormat::ASTC6x5UnormSrgb: - o << "TextureFormat::ASTC6x5UnormSrgb"; - break; - case TextureFormat::ASTC6x6Unorm: - o << "TextureFormat::ASTC6x6Unorm"; - break; - case TextureFormat::ASTC6x6UnormSrgb: - o << "TextureFormat::ASTC6x6UnormSrgb"; - break; - case TextureFormat::ASTC8x5Unorm: - o << "TextureFormat::ASTC8x5Unorm"; - break; - case TextureFormat::ASTC8x5UnormSrgb: - o << "TextureFormat::ASTC8x5UnormSrgb"; - break; - case TextureFormat::ASTC8x6Unorm: - o << "TextureFormat::ASTC8x6Unorm"; - break; - case TextureFormat::ASTC8x6UnormSrgb: - o << "TextureFormat::ASTC8x6UnormSrgb"; - break; - case TextureFormat::ASTC8x8Unorm: - o << "TextureFormat::ASTC8x8Unorm"; - break; - case TextureFormat::ASTC8x8UnormSrgb: - o << "TextureFormat::ASTC8x8UnormSrgb"; - break; - case TextureFormat::ASTC10x5Unorm: - o << "TextureFormat::ASTC10x5Unorm"; - break; - case TextureFormat::ASTC10x5UnormSrgb: - o << "TextureFormat::ASTC10x5UnormSrgb"; - break; - case TextureFormat::ASTC10x6Unorm: - o << "TextureFormat::ASTC10x6Unorm"; - break; - case TextureFormat::ASTC10x6UnormSrgb: - o << "TextureFormat::ASTC10x6UnormSrgb"; - break; - case TextureFormat::ASTC10x8Unorm: - o << "TextureFormat::ASTC10x8Unorm"; - break; - case TextureFormat::ASTC10x8UnormSrgb: - o << "TextureFormat::ASTC10x8UnormSrgb"; - break; - case TextureFormat::ASTC10x10Unorm: - o << "TextureFormat::ASTC10x10Unorm"; - break; - case TextureFormat::ASTC10x10UnormSrgb: - o << "TextureFormat::ASTC10x10UnormSrgb"; - break; - case TextureFormat::ASTC12x10Unorm: - o << "TextureFormat::ASTC12x10Unorm"; - break; - case TextureFormat::ASTC12x10UnormSrgb: - o << "TextureFormat::ASTC12x10UnormSrgb"; - break; - case TextureFormat::ASTC12x12Unorm: - o << "TextureFormat::ASTC12x12Unorm"; - break; - case TextureFormat::ASTC12x12UnormSrgb: - o << "TextureFormat::ASTC12x12UnormSrgb"; - break; - case TextureFormat::R8BG8Biplanar420Unorm: - o << "TextureFormat::R8BG8Biplanar420Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar420Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar420Unorm"; - break; - case TextureFormat::R8BG8A8Triplanar420Unorm: - o << "TextureFormat::R8BG8A8Triplanar420Unorm"; - break; - case TextureFormat::R8BG8Biplanar422Unorm: - o << "TextureFormat::R8BG8Biplanar422Unorm"; - break; - case TextureFormat::R8BG8Biplanar444Unorm: - o << "TextureFormat::R8BG8Biplanar444Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar422Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar422Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar444Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar444Unorm"; - break; - case TextureFormat::OpaqueYCbCrAndroid: - o << "TextureFormat::OpaqueYCbCrAndroid"; - break; - default: - o << "TextureFormat::" << 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, TextureSampleType value) { - switch (value) { - case TextureSampleType::BindingNotUsed: - o << "TextureSampleType::BindingNotUsed"; - break; - case TextureSampleType::Undefined: - o << "TextureSampleType::Undefined"; - break; - case TextureSampleType::Float: - o << "TextureSampleType::Float"; - break; - case TextureSampleType::UnfilterableFloat: - o << "TextureSampleType::UnfilterableFloat"; - break; - case TextureSampleType::Depth: - o << "TextureSampleType::Depth"; - break; - case TextureSampleType::Sint: - o << "TextureSampleType::Sint"; - break; - case TextureSampleType::Uint: - o << "TextureSampleType::Uint"; - break; - default: - o << "TextureSampleType::" << 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, TextureViewDimension value) { - switch (value) { - case TextureViewDimension::Undefined: - o << "TextureViewDimension::Undefined"; - break; - case TextureViewDimension::e1D: - o << "TextureViewDimension::e1D"; - break; - case TextureViewDimension::e2D: - o << "TextureViewDimension::e2D"; - break; - case TextureViewDimension::e2DArray: - o << "TextureViewDimension::e2DArray"; - break; - case TextureViewDimension::Cube: - o << "TextureViewDimension::Cube"; - break; - case TextureViewDimension::CubeArray: - o << "TextureViewDimension::CubeArray"; - break; - case TextureViewDimension::e3D: - o << "TextureViewDimension::e3D"; - break; - default: - o << "TextureViewDimension::" << 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, ToneMappingMode value) { - switch (value) { - case ToneMappingMode::Standard: - o << "ToneMappingMode::Standard"; - break; - case ToneMappingMode::Extended: - o << "ToneMappingMode::Extended"; - break; - default: - o << "ToneMappingMode::" << 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, VertexFormat value) { - switch (value) { - case VertexFormat::Uint8: - o << "VertexFormat::Uint8"; - break; - case VertexFormat::Uint8x2: - o << "VertexFormat::Uint8x2"; - break; - case VertexFormat::Uint8x4: - o << "VertexFormat::Uint8x4"; - break; - case VertexFormat::Sint8: - o << "VertexFormat::Sint8"; - break; - case VertexFormat::Sint8x2: - o << "VertexFormat::Sint8x2"; - break; - case VertexFormat::Sint8x4: - o << "VertexFormat::Sint8x4"; - break; - case VertexFormat::Unorm8: - o << "VertexFormat::Unorm8"; - break; - case VertexFormat::Unorm8x2: - o << "VertexFormat::Unorm8x2"; - break; - case VertexFormat::Unorm8x4: - o << "VertexFormat::Unorm8x4"; - break; - case VertexFormat::Snorm8: - o << "VertexFormat::Snorm8"; - break; - case VertexFormat::Snorm8x2: - o << "VertexFormat::Snorm8x2"; - break; - case VertexFormat::Snorm8x4: - o << "VertexFormat::Snorm8x4"; - break; - case VertexFormat::Uint16: - o << "VertexFormat::Uint16"; - break; - case VertexFormat::Uint16x2: - o << "VertexFormat::Uint16x2"; - break; - case VertexFormat::Uint16x4: - o << "VertexFormat::Uint16x4"; - break; - case VertexFormat::Sint16: - o << "VertexFormat::Sint16"; - break; - case VertexFormat::Sint16x2: - o << "VertexFormat::Sint16x2"; - break; - case VertexFormat::Sint16x4: - o << "VertexFormat::Sint16x4"; - break; - case VertexFormat::Unorm16: - o << "VertexFormat::Unorm16"; - break; - case VertexFormat::Unorm16x2: - o << "VertexFormat::Unorm16x2"; - break; - case VertexFormat::Unorm16x4: - o << "VertexFormat::Unorm16x4"; - break; - case VertexFormat::Snorm16: - o << "VertexFormat::Snorm16"; - break; - case VertexFormat::Snorm16x2: - o << "VertexFormat::Snorm16x2"; - break; - case VertexFormat::Snorm16x4: - o << "VertexFormat::Snorm16x4"; - break; - case VertexFormat::Float16: - o << "VertexFormat::Float16"; - break; - case VertexFormat::Float16x2: - o << "VertexFormat::Float16x2"; - break; - case VertexFormat::Float16x4: - o << "VertexFormat::Float16x4"; - break; - case VertexFormat::Float32: - o << "VertexFormat::Float32"; - break; - case VertexFormat::Float32x2: - o << "VertexFormat::Float32x2"; - break; - case VertexFormat::Float32x3: - o << "VertexFormat::Float32x3"; - break; - case VertexFormat::Float32x4: - o << "VertexFormat::Float32x4"; - break; - case VertexFormat::Uint32: - o << "VertexFormat::Uint32"; - break; - case VertexFormat::Uint32x2: - o << "VertexFormat::Uint32x2"; - break; - case VertexFormat::Uint32x3: - o << "VertexFormat::Uint32x3"; - break; - case VertexFormat::Uint32x4: - o << "VertexFormat::Uint32x4"; - break; - case VertexFormat::Sint32: - o << "VertexFormat::Sint32"; - break; - case VertexFormat::Sint32x2: - o << "VertexFormat::Sint32x2"; - break; - case VertexFormat::Sint32x3: - o << "VertexFormat::Sint32x3"; - break; - case VertexFormat::Sint32x4: - o << "VertexFormat::Sint32x4"; - break; - case VertexFormat::Unorm10_10_10_2: - o << "VertexFormat::Unorm10_10_10_2"; - break; - case VertexFormat::Unorm8x4BGRA: - o << "VertexFormat::Unorm8x4BGRA"; - break; - default: - o << "VertexFormat::" << 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, VertexStepMode value) { - switch (value) { - case VertexStepMode::Undefined: - o << "VertexStepMode::Undefined"; - break; - case VertexStepMode::Vertex: - o << "VertexStepMode::Vertex"; - break; - case VertexStepMode::Instance: - o << "VertexStepMode::Instance"; - 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::Error: - o << "WaitStatus::Error"; - 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, WGSLLanguageFeatureName value) { - switch (value) { - case WGSLLanguageFeatureName::ReadonlyAndReadwriteStorageTextures: - o << "WGSLLanguageFeatureName::ReadonlyAndReadwriteStorageTextures"; - break; - case WGSLLanguageFeatureName::Packed4x8IntegerDotProduct: - o << "WGSLLanguageFeatureName::Packed4x8IntegerDotProduct"; - break; - case WGSLLanguageFeatureName::UnrestrictedPointerParameters: - o << "WGSLLanguageFeatureName::UnrestrictedPointerParameters"; - break; - case WGSLLanguageFeatureName::PointerCompositeAccess: - o << "WGSLLanguageFeatureName::PointerCompositeAccess"; - break; - case WGSLLanguageFeatureName::UniformBufferStandardLayout: - o << "WGSLLanguageFeatureName::UniformBufferStandardLayout"; - break; - case WGSLLanguageFeatureName::SubgroupId: - o << "WGSLLanguageFeatureName::SubgroupId"; - break; - case WGSLLanguageFeatureName::TextureAndSamplerLet: - o << "WGSLLanguageFeatureName::TextureAndSamplerLet"; - break; - case WGSLLanguageFeatureName::SubgroupUniformity: - o << "WGSLLanguageFeatureName::SubgroupUniformity"; - break; - case WGSLLanguageFeatureName::TextureFormatsTier1: - o << "WGSLLanguageFeatureName::TextureFormatsTier1"; - break; - case WGSLLanguageFeatureName::LinearIndexing: - o << "WGSLLanguageFeatureName::LinearIndexing"; - break; - case WGSLLanguageFeatureName::ImmediateAddressSpace: - o << "WGSLLanguageFeatureName::ImmediateAddressSpace"; - break; - case WGSLLanguageFeatureName::ChromiumTestingUnimplemented: - o << "WGSLLanguageFeatureName::ChromiumTestingUnimplemented"; - break; - case WGSLLanguageFeatureName::ChromiumTestingUnsafeExperimental: - o << "WGSLLanguageFeatureName::ChromiumTestingUnsafeExperimental"; - break; - case WGSLLanguageFeatureName::ChromiumTestingExperimental: - o << "WGSLLanguageFeatureName::ChromiumTestingExperimental"; - break; - case WGSLLanguageFeatureName::ChromiumTestingShippedWithKillswitch: - o << "WGSLLanguageFeatureName::ChromiumTestingShippedWithKillswitch"; - break; - case WGSLLanguageFeatureName::ChromiumTestingShipped: - o << "WGSLLanguageFeatureName::ChromiumTestingShipped"; - break; - case WGSLLanguageFeatureName::SizedBindingArray: - o << "WGSLLanguageFeatureName::SizedBindingArray"; - break; - case WGSLLanguageFeatureName::TexelBuffers: - o << "WGSLLanguageFeatureName::TexelBuffers"; - break; - case WGSLLanguageFeatureName::ChromiumPrint: - o << "WGSLLanguageFeatureName::ChromiumPrint"; - break; - case WGSLLanguageFeatureName::FragmentDepth: - o << "WGSLLanguageFeatureName::FragmentDepth"; - break; - case WGSLLanguageFeatureName::BufferView: - o << "WGSLLanguageFeatureName::BufferView"; - break; - case WGSLLanguageFeatureName::SwizzleAssignment: - o << "WGSLLanguageFeatureName::SwizzleAssignment"; - break; - default: - o << "WGSLLanguageFeatureName::" << 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) { - o << "BufferUsage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & BufferUsage::MapRead) { - if (!first) { - o << "|"; - } - first = false; - o << "MapRead"; - value &= ~BufferUsage::MapRead; - } - if (value & BufferUsage::MapWrite) { - if (!first) { - o << "|"; - } - first = false; - o << "MapWrite"; - value &= ~BufferUsage::MapWrite; - } - if (value & BufferUsage::CopySrc) { - if (!first) { - o << "|"; - } - first = false; - o << "CopySrc"; - value &= ~BufferUsage::CopySrc; - } - if (value & BufferUsage::CopyDst) { - if (!first) { - o << "|"; - } - first = false; - o << "CopyDst"; - value &= ~BufferUsage::CopyDst; - } - if (value & BufferUsage::Index) { - if (!first) { - o << "|"; - } - first = false; - o << "Index"; - value &= ~BufferUsage::Index; - } - if (value & BufferUsage::Vertex) { - if (!first) { - o << "|"; - } - first = false; - o << "Vertex"; - value &= ~BufferUsage::Vertex; - } - if (value & BufferUsage::Uniform) { - if (!first) { - o << "|"; - } - first = false; - o << "Uniform"; - value &= ~BufferUsage::Uniform; - } - if (value & BufferUsage::Storage) { - if (!first) { - o << "|"; - } - first = false; - o << "Storage"; - value &= ~BufferUsage::Storage; - } - if (value & BufferUsage::Indirect) { - if (!first) { - o << "|"; - } - first = false; - o << "Indirect"; - value &= ~BufferUsage::Indirect; - } - if (value & BufferUsage::QueryResolve) { - if (!first) { - o << "|"; - } - first = false; - o << "QueryResolve"; - value &= ~BufferUsage::QueryResolve; - } - if (value & BufferUsage::TexelBuffer) { - if (!first) { - o << "|"; - } - first = false; - o << "TexelBuffer"; - value &= ~BufferUsage::TexelBuffer; - } - - 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, ColorWriteMask value) { - o << "ColorWriteMask::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & ColorWriteMask::Red) { - if (!first) { - o << "|"; - } - first = false; - o << "Red"; - value &= ~ColorWriteMask::Red; - } - if (value & ColorWriteMask::Green) { - if (!first) { - o << "|"; - } - first = false; - o << "Green"; - value &= ~ColorWriteMask::Green; - } - if (value & ColorWriteMask::Blue) { - if (!first) { - o << "|"; - } - first = false; - o << "Blue"; - value &= ~ColorWriteMask::Blue; - } - if (value & ColorWriteMask::Alpha) { - if (!first) { - o << "|"; - } - first = false; - o << "Alpha"; - value &= ~ColorWriteMask::Alpha; - } - if (value & ColorWriteMask::All) { - if (!first) { - o << "|"; - } - first = false; - o << "All"; - value &= ~ColorWriteMask::All; - } - - 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, HeapProperty value) { - o << "HeapProperty::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - 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)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & MapMode::Read) { - if (!first) { - o << "|"; - } - first = false; - o << "Read"; - value &= ~MapMode::Read; - } - if (value & MapMode::Write) { - if (!first) { - o << "|"; - } - first = false; - o << "Write"; - value &= ~MapMode::Write; - } - - 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, ShaderStage value) { - o << "ShaderStage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & ShaderStage::Vertex) { - if (!first) { - o << "|"; - } - first = false; - o << "Vertex"; - value &= ~ShaderStage::Vertex; - } - if (value & ShaderStage::Fragment) { - if (!first) { - o << "|"; - } - first = false; - o << "Fragment"; - value &= ~ShaderStage::Fragment; - } - if (value & ShaderStage::Compute) { - if (!first) { - o << "|"; - } - first = false; - o << "Compute"; - value &= ~ShaderStage::Compute; - } - - 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, TextureUsage value) { - o << "TextureUsage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & TextureUsage::CopySrc) { - if (!first) { - o << "|"; - } - first = false; - o << "CopySrc"; - value &= ~TextureUsage::CopySrc; - } - if (value & TextureUsage::CopyDst) { - if (!first) { - o << "|"; - } - first = false; - o << "CopyDst"; - value &= ~TextureUsage::CopyDst; - } - if (value & TextureUsage::TextureBinding) { - if (!first) { - o << "|"; - } - first = false; - o << "TextureBinding"; - value &= ~TextureUsage::TextureBinding; - } - if (value & TextureUsage::StorageBinding) { - if (!first) { - o << "|"; - } - first = false; - o << "StorageBinding"; - value &= ~TextureUsage::StorageBinding; - } - if (value & TextureUsage::RenderAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "RenderAttachment"; - value &= ~TextureUsage::RenderAttachment; - } - if (value & TextureUsage::TransientAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "TransientAttachment"; - value &= ~TextureUsage::TransientAttachment; - } - if (value & TextureUsage::StorageAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "StorageAttachment"; - value &= ~TextureUsage::StorageAttachment; - } - - 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; - } - -} // namespace wgpu - -namespace wgpu { - - template - std::basic_ostream& operator<<(std::basic_ostream& o, StringView value) { - o << std::string_view(value); - return o; - } - -} // namespace wgpu - -#endif // WEBGPU_CPP_PRINT_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu.h b/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu.h deleted file mode 100644 index 7f8e310..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu.h +++ /dev/null @@ -1,370 +0,0 @@ -#ifndef DAWN_WIRE_CLIENT_WEBGPU_H_ -#define DAWN_WIRE_CLIENT_WEBGPU_H_ - -#include "webgpu/webgpu.h" -#include "dawn/wire/dawn_wire_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -DAWN_WIRE_EXPORT WGPUInstance wgpuDawnWireClientCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientGetInstanceFeatures(WGPUSupportedInstanceFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientGetInstanceLimits(WGPUInstanceLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientHasInstanceFeature(WGPUInstanceFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUProc wgpuDawnWireClientGetProcAddress(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Adapter -DAWN_WIRE_EXPORT WGPUDevice wgpuDawnWireClientAdapterCreateDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterGetFeatures(WGPUAdapter adapter, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientAdapterGetFormatCapabilities(WGPUAdapter adapter, WGPUTextureFormat format, WGPUDawnFormatCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientAdapterGetInfo(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUInstance wgpuDawnWireClientAdapterGetInstance(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientAdapterGetLimits(WGPUAdapter adapter, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterAddRef(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterInfo -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterInfoFreeMembers(WGPUAdapterInfo adapterInfo) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterPropertiesMemoryHeaps -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterPropertiesMemoryHeapsFreeMembers(WGPUAdapterPropertiesMemoryHeaps adapterPropertiesMemoryHeaps) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of AdapterPropertiesSubgroupMatrixConfigs -DAWN_WIRE_EXPORT void wgpuDawnWireClientAdapterPropertiesSubgroupMatrixConfigsFreeMembers(WGPUAdapterPropertiesSubgroupMatrixConfigs adapterPropertiesSubgroupMatrixConfigs) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroup -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupSetLabel(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupAddRef(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of BindGroupLayout -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupLayoutAddRef(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Buffer -DAWN_WIRE_EXPORT WGPUTexelBufferView wgpuDawnWireClientBufferCreateTexelView(WGPUBuffer buffer, WGPUTexelBufferViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBufferDestroy(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void const * wgpuDawnWireClientBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void * wgpuDawnWireClientBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBufferMapState wgpuDawnWireClientBufferGetMapState(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint64_t wgpuDawnWireClientBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBufferUsage wgpuDawnWireClientBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientBufferMapAsync(WGPUBuffer buffer, WGPUMapMode mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientBufferReadMappedRange(WGPUBuffer buffer, size_t offset, void * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBufferSetLabel(WGPUBuffer buffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBufferUnmap(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientBufferWriteMappedRange(WGPUBuffer buffer, size_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBufferAddRef(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientBufferRelease(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandBuffer -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandBufferAddRef(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandBufferRelease(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of CommandEncoder -DAWN_WIRE_EXPORT WGPUComputePassEncoder wgpuDawnWireClientCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPURenderPassEncoder wgpuDawnWireClientCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUTexelCopyBufferInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyBufferInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUCommandBuffer wgpuDawnWireClientCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, WGPUStringView groupLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderWriteBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderAddRef(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientCommandEncoderRelease(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePassEncoder -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, WGPUStringView groupLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderSetImmediates(WGPUComputePassEncoder computePassEncoder, uint32_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderSetResourceTable(WGPUComputePassEncoder computePassEncoder, WGPU_NULLABLE WGPUResourceTable table) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderAddRef(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ComputePipeline -DAWN_WIRE_EXPORT WGPUBindGroupLayout wgpuDawnWireClientComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePipelineSetLabel(WGPUComputePipeline computePipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePipelineAddRef(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of DawnDrmFormatCapabilities -DAWN_WIRE_EXPORT void wgpuDawnWireClientDawnDrmFormatCapabilitiesFreeMembers(WGPUDawnDrmFormatCapabilities dawnDrmFormatCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Device -DAWN_WIRE_EXPORT WGPUBindGroup wgpuDawnWireClientDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBindGroupLayout wgpuDawnWireClientDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPU_NULLABLE WGPUBuffer wgpuDawnWireClientDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUCommandEncoder wgpuDawnWireClientDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUComputePipeline wgpuDawnWireClientDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBuffer wgpuDawnWireClientDeviceCreateErrorBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUExternalTexture wgpuDawnWireClientDeviceCreateErrorExternalTexture(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUShaderModule wgpuDawnWireClientDeviceCreateErrorShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor, WGPUStringView errorMessage) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTexture wgpuDawnWireClientDeviceCreateErrorTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUExternalTexture wgpuDawnWireClientDeviceCreateExternalTexture(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUPipelineLayout wgpuDawnWireClientDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUQuerySet wgpuDawnWireClientDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPURenderBundleEncoder wgpuDawnWireClientDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPURenderPipeline wgpuDawnWireClientDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUResourceTable wgpuDawnWireClientDeviceCreateResourceTable(WGPUDevice device, WGPUResourceTableDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUSampler wgpuDawnWireClientDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUShaderModule wgpuDawnWireClientDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTexture wgpuDawnWireClientDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceForceLoss(WGPUDevice device, WGPUDeviceLostReason type, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUAdapter wgpuDawnWireClientDeviceGetAdapter(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientDeviceGetAdapterInfo(WGPUDevice device, WGPUAdapterInfo * adapterInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientDeviceGetAHardwareBufferProperties(WGPUDevice device, void * handle, WGPUAHardwareBufferProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceGetFeatures(WGPUDevice device, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientDeviceGetLimits(WGPUDevice device, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientDeviceGetLostFuture(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUQueue wgpuDawnWireClientDeviceGetQueue(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUSharedBufferMemory wgpuDawnWireClientDeviceImportSharedBufferMemory(WGPUDevice device, WGPUSharedBufferMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUSharedFence wgpuDawnWireClientDeviceImportSharedFence(WGPUDevice device, WGPUSharedFenceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUSharedTextureMemory wgpuDawnWireClientDeviceImportSharedTextureMemory(WGPUDevice device, WGPUSharedTextureMemoryDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceInjectError(WGPUDevice device, WGPUErrorType type, WGPUStringView message) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientDevicePopErrorScope(WGPUDevice device, WGPUPopErrorScopeCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceSetLabel(WGPUDevice device, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceSetLoggingCallback(WGPUDevice device, WGPULoggingCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceTick(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceValidateTextureDescriptor(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceAddRef(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ExternalTexture -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureDestroy(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureExpire(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureRefresh(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureSetLabel(WGPUExternalTexture externalTexture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureAddRef(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientExternalTextureRelease(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Instance -DAWN_WIRE_EXPORT WGPUSurface wgpuDawnWireClientInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientInstanceGetWGSLLanguageFeatures(WGPUInstance instance, WGPUSupportedWGSLLanguageFeatures * features) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLLanguageFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUWaitStatus wgpuDawnWireClientInstanceWaitAny(WGPUInstance instance, size_t futureCount, WGPU_NULLABLE WGPUFutureWaitInfo * futures, uint64_t timeoutNS) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientInstanceAddRef(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of PipelineLayout -DAWN_WIRE_EXPORT void wgpuDawnWireClientPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientPipelineLayoutAddRef(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of QuerySet -DAWN_WIRE_EXPORT void wgpuDawnWireClientQuerySetDestroy(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientQuerySetGetCount(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUQueryType wgpuDawnWireClientQuerySetGetType(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQuerySetSetLabel(WGPUQuerySet querySet, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQuerySetAddRef(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Queue -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueCopyExternalTextureForBrowser(WGPUQueue queue, WGPUImageCopyExternalTexture const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueCopyTextureForBrowser(WGPUQueue queue, WGPUTexelCopyTextureInfo const * source, WGPUTexelCopyTextureInfo const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueSetLabel(WGPUQueue queue, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueWriteTexture(WGPUQueue queue, WGPUTexelCopyTextureInfo const * destination, void const * data, size_t dataSize, WGPUTexelCopyBufferLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueAddRef(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientQueueRelease(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundle -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleSetLabel(WGPURenderBundle renderBundle, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleAddRef(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleRelease(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderBundleEncoder -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPURenderBundle wgpuDawnWireClientRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView groupLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetImmediates(WGPURenderBundleEncoder renderBundleEncoder, uint32_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetResourceTable(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPUResourceTable table) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderAddRef(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPassEncoder -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, WGPUStringView markerLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderMultiDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderMultiDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, WGPU_NULLABLE WGPUBuffer drawCountBuffer, uint64_t drawCountBufferOffset) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderPixelLocalStorageBarrier(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, WGPUStringView groupLabel) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetImmediates(WGPURenderPassEncoder renderPassEncoder, uint32_t offset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetResourceTable(WGPURenderPassEncoder renderPassEncoder, WGPU_NULLABLE WGPUResourceTable table) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderAddRef(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of RenderPipeline -DAWN_WIRE_EXPORT WGPUBindGroupLayout wgpuDawnWireClientRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPipelineAddRef(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientRenderPipelineRelease(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ResourceTable -DAWN_WIRE_EXPORT void wgpuDawnWireClientResourceTableDestroy(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientResourceTableGetSize(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientResourceTableInsertBinding(WGPUResourceTable resourceTable, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientResourceTableRemoveBinding(WGPUResourceTable resourceTable, uint32_t slot) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientResourceTableSetLabel(WGPUResourceTable resourceTable, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientResourceTableUpdate(WGPUResourceTable resourceTable, uint32_t slot, WGPUBindingResource const * resource) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientResourceTableAddRef(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientResourceTableRelease(WGPUResourceTable resourceTable) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Sampler -DAWN_WIRE_EXPORT void wgpuDawnWireClientSamplerSetLabel(WGPUSampler sampler, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSamplerAddRef(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSamplerRelease(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of ShaderModule -DAWN_WIRE_EXPORT WGPUFuture wgpuDawnWireClientShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallbackInfo callbackInfo) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientShaderModuleSetLabel(WGPUShaderModule shaderModule, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientShaderModuleAddRef(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedBufferMemory -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedBufferMemoryBeginAccess(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBuffer wgpuDawnWireClientSharedBufferMemoryCreateBuffer(WGPUSharedBufferMemory sharedBufferMemory, WGPU_NULLABLE WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedBufferMemoryEndAccess(WGPUSharedBufferMemory sharedBufferMemory, WGPUBuffer buffer, WGPUSharedBufferMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedBufferMemoryGetProperties(WGPUSharedBufferMemory sharedBufferMemory, WGPUSharedBufferMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientSharedBufferMemoryIsDeviceLost(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedBufferMemorySetLabel(WGPUSharedBufferMemory sharedBufferMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedBufferMemoryAddRef(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedBufferMemoryRelease(WGPUSharedBufferMemory sharedBufferMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedBufferMemoryEndAccessState -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedBufferMemoryEndAccessStateFreeMembers(WGPUSharedBufferMemoryEndAccessState sharedBufferMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedFence -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedFenceExportInfo(WGPUSharedFence sharedFence, WGPUSharedFenceExportInfo * info) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedFenceSetLabel(WGPUSharedFence sharedFence, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedFenceAddRef(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedFenceRelease(WGPUSharedFence sharedFence) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedTextureMemory -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedTextureMemoryBeginAccess(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryBeginAccessDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTexture wgpuDawnWireClientSharedTextureMemoryCreateTexture(WGPUSharedTextureMemory sharedTextureMemory, WGPU_NULLABLE WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedTextureMemoryEndAccess(WGPUSharedTextureMemory sharedTextureMemory, WGPUTexture texture, WGPUSharedTextureMemoryEndAccessState * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSharedTextureMemoryGetProperties(WGPUSharedTextureMemory sharedTextureMemory, WGPUSharedTextureMemoryProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUBool wgpuDawnWireClientSharedTextureMemoryIsDeviceLost(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedTextureMemorySetLabel(WGPUSharedTextureMemory sharedTextureMemory, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedTextureMemoryAddRef(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedTextureMemoryRelease(WGPUSharedTextureMemory sharedTextureMemory) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SharedTextureMemoryEndAccessState -DAWN_WIRE_EXPORT void wgpuDawnWireClientSharedTextureMemoryEndAccessStateFreeMembers(WGPUSharedTextureMemoryEndAccessState sharedTextureMemoryEndAccessState) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedFeatures -DAWN_WIRE_EXPORT void wgpuDawnWireClientSupportedFeaturesFreeMembers(WGPUSupportedFeatures supportedFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedInstanceFeatures -DAWN_WIRE_EXPORT void wgpuDawnWireClientSupportedInstanceFeaturesFreeMembers(WGPUSupportedInstanceFeatures supportedInstanceFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SupportedWGSLLanguageFeatures -DAWN_WIRE_EXPORT void wgpuDawnWireClientSupportedWGSLLanguageFeaturesFreeMembers(WGPUSupportedWGSLLanguageFeatures supportedWGSLLanguageFeatures) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Surface -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUStatus wgpuDawnWireClientSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceSetLabel(WGPUSurface surface, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceUnconfigure(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceAddRef(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceRelease(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of SurfaceCapabilities -DAWN_WIRE_EXPORT void wgpuDawnWireClientSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of TexelBufferView -DAWN_WIRE_EXPORT void wgpuDawnWireClientTexelBufferViewSetLabel(WGPUTexelBufferView texelBufferView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTexelBufferViewAddRef(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTexelBufferViewRelease(WGPUTexelBufferView texelBufferView) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of Texture -DAWN_WIRE_EXPORT WGPUTextureView wgpuDawnWireClientTextureCreateErrorView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTextureView wgpuDawnWireClientTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureDestroy(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientTextureGetDepthOrArrayLayers(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTextureDimension wgpuDawnWireClientTextureGetDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTextureFormat wgpuDawnWireClientTextureGetFormat(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientTextureGetHeight(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientTextureGetMipLevelCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientTextureGetSampleCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTextureViewDimension wgpuDawnWireClientTextureGetTextureBindingViewDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT WGPUTextureUsage wgpuDawnWireClientTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT uint32_t wgpuDawnWireClientTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTexturePin(WGPUTexture texture, WGPUTextureUsage usage) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureSetLabel(WGPUTexture texture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureSetOwnershipForMemoryDump(WGPUTexture texture, uint64_t ownerGuid) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureUnpin(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureAddRef(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; - -// Methods of TextureView -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureViewSetLabel(WGPUTextureView textureView, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureViewAddRef(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; -DAWN_WIRE_EXPORT void wgpuDawnWireClientTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // DAWN_WIRE_CLIENT_WEBGPU_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp.h b/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp.h deleted file mode 100644 index 26bccdb..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp.h +++ /dev/null @@ -1,10363 +0,0 @@ -// Copyright 2017 The Dawn & Tint Authors -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#ifdef __EMSCRIPTEN__ -#error "Do not include this header. Emscripten already provides headers needed for WebGPU." -#endif - -#ifndef DAWN_WIRE_CLIENT_WEBGPU_CPP_H_ -#define DAWN_WIRE_CLIENT_WEBGPU_CPP_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dawn/wire/client/webgpu.h" -#include "webgpu/webgpu_cpp_chained_struct.h" -#include "webgpu/webgpu_enum_class_bitmasks.h" // IWYU pragma: export - -namespace wgpu { - -static constexpr uint32_t kArrayLayerCountUndefined = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; -static constexpr uint32_t kCopyStrideUndefined = WGPU_COPY_STRIDE_UNDEFINED; -static constexpr float kDepthClearValueUndefined = std::numeric_limits::quiet_NaN(); -static constexpr uint32_t kDepthSliceUndefined = WGPU_DEPTH_SLICE_UNDEFINED; -static constexpr uint32_t kInvalidBinding = WGPU_INVALID_BINDING; -static constexpr uint32_t kLimitU32Undefined = WGPU_LIMIT_U32_UNDEFINED; -static constexpr uint64_t kLimitU64Undefined = WGPU_LIMIT_U64_UNDEFINED; -static constexpr uint32_t kMipLevelCountUndefined = WGPU_MIP_LEVEL_COUNT_UNDEFINED; -static constexpr uint32_t kQuerySetIndexUndefined = WGPU_QUERY_SET_INDEX_UNDEFINED; -static constexpr size_t kStrlen = WGPU_STRLEN; -static constexpr size_t kWholeMapSize = WGPU_WHOLE_MAP_SIZE; -static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE; - -enum class AdapterType : uint32_t { - DiscreteGPU = WGPUAdapterType_DiscreteGPU, - IntegratedGPU = WGPUAdapterType_IntegratedGPU, - CPU = WGPUAdapterType_CPU, - Unknown = WGPUAdapterType_Unknown, -}; -static_assert(sizeof(AdapterType) == sizeof(WGPUAdapterType), "sizeof mismatch for AdapterType"); -static_assert(alignof(AdapterType) == alignof(WGPUAdapterType), "alignof mismatch for AdapterType"); - -enum class AddressMode : uint32_t { - Undefined = WGPUAddressMode_Undefined, - ClampToEdge = WGPUAddressMode_ClampToEdge, - Repeat = WGPUAddressMode_Repeat, - MirrorRepeat = WGPUAddressMode_MirrorRepeat, -}; -static_assert(sizeof(AddressMode) == sizeof(WGPUAddressMode), "sizeof mismatch for AddressMode"); -static_assert(alignof(AddressMode) == alignof(WGPUAddressMode), "alignof mismatch for AddressMode"); - -enum class AlphaMode : uint32_t { - Opaque = WGPUAlphaMode_Opaque, - Premultiplied = WGPUAlphaMode_Premultiplied, - Unpremultiplied = WGPUAlphaMode_Unpremultiplied, -}; -static_assert(sizeof(AlphaMode) == sizeof(WGPUAlphaMode), "sizeof mismatch for AlphaMode"); -static_assert(alignof(AlphaMode) == alignof(WGPUAlphaMode), "alignof mismatch for AlphaMode"); - -enum class BackendType : uint32_t { - Undefined = WGPUBackendType_Undefined, - Null = WGPUBackendType_Null, - WebGPU = WGPUBackendType_WebGPU, - D3D11 = WGPUBackendType_D3D11, - D3D12 = WGPUBackendType_D3D12, - Metal = WGPUBackendType_Metal, - Vulkan = WGPUBackendType_Vulkan, - OpenGL = WGPUBackendType_OpenGL, - OpenGLES = WGPUBackendType_OpenGLES, -}; -static_assert(sizeof(BackendType) == sizeof(WGPUBackendType), "sizeof mismatch for BackendType"); -static_assert(alignof(BackendType) == alignof(WGPUBackendType), "alignof mismatch for BackendType"); - -enum class BlendFactor : uint32_t { - Undefined = WGPUBlendFactor_Undefined, - Zero = WGPUBlendFactor_Zero, - One = WGPUBlendFactor_One, - Src = WGPUBlendFactor_Src, - OneMinusSrc = WGPUBlendFactor_OneMinusSrc, - SrcAlpha = WGPUBlendFactor_SrcAlpha, - OneMinusSrcAlpha = WGPUBlendFactor_OneMinusSrcAlpha, - Dst = WGPUBlendFactor_Dst, - OneMinusDst = WGPUBlendFactor_OneMinusDst, - DstAlpha = WGPUBlendFactor_DstAlpha, - OneMinusDstAlpha = WGPUBlendFactor_OneMinusDstAlpha, - SrcAlphaSaturated = WGPUBlendFactor_SrcAlphaSaturated, - Constant = WGPUBlendFactor_Constant, - OneMinusConstant = WGPUBlendFactor_OneMinusConstant, - Src1 = WGPUBlendFactor_Src1, - OneMinusSrc1 = WGPUBlendFactor_OneMinusSrc1, - Src1Alpha = WGPUBlendFactor_Src1Alpha, - OneMinusSrc1Alpha = WGPUBlendFactor_OneMinusSrc1Alpha, -}; -static_assert(sizeof(BlendFactor) == sizeof(WGPUBlendFactor), "sizeof mismatch for BlendFactor"); -static_assert(alignof(BlendFactor) == alignof(WGPUBlendFactor), "alignof mismatch for BlendFactor"); - -enum class BlendOperation : uint32_t { - Undefined = WGPUBlendOperation_Undefined, - Add = WGPUBlendOperation_Add, - Subtract = WGPUBlendOperation_Subtract, - ReverseSubtract = WGPUBlendOperation_ReverseSubtract, - Min = WGPUBlendOperation_Min, - Max = WGPUBlendOperation_Max, -}; -static_assert(sizeof(BlendOperation) == sizeof(WGPUBlendOperation), "sizeof mismatch for BlendOperation"); -static_assert(alignof(BlendOperation) == alignof(WGPUBlendOperation), "alignof mismatch for BlendOperation"); - -enum class BufferBindingType : uint32_t { - BindingNotUsed = WGPUBufferBindingType_BindingNotUsed, - Undefined = WGPUBufferBindingType_Undefined, - Uniform = WGPUBufferBindingType_Uniform, - Storage = WGPUBufferBindingType_Storage, - ReadOnlyStorage = WGPUBufferBindingType_ReadOnlyStorage, -}; -static_assert(sizeof(BufferBindingType) == sizeof(WGPUBufferBindingType), "sizeof mismatch for BufferBindingType"); -static_assert(alignof(BufferBindingType) == alignof(WGPUBufferBindingType), "alignof mismatch for BufferBindingType"); - -enum class BufferMapState : uint32_t { - Unmapped = WGPUBufferMapState_Unmapped, - Pending = WGPUBufferMapState_Pending, - Mapped = WGPUBufferMapState_Mapped, -}; -static_assert(sizeof(BufferMapState) == sizeof(WGPUBufferMapState), "sizeof mismatch for BufferMapState"); -static_assert(alignof(BufferMapState) == alignof(WGPUBufferMapState), "alignof mismatch for BufferMapState"); - -enum class CallbackMode : uint32_t { - WaitAnyOnly = WGPUCallbackMode_WaitAnyOnly, - AllowProcessEvents = WGPUCallbackMode_AllowProcessEvents, - AllowSpontaneous = WGPUCallbackMode_AllowSpontaneous, -}; -static_assert(sizeof(CallbackMode) == sizeof(WGPUCallbackMode), "sizeof mismatch for CallbackMode"); -static_assert(alignof(CallbackMode) == alignof(WGPUCallbackMode), "alignof mismatch for CallbackMode"); - -enum class ColorSpacePrimariesDawn : uint32_t { - SRGB = WGPUColorSpacePrimariesDawn_SRGB, - Rec709 = WGPUColorSpacePrimariesDawn_Rec709, - Rec601 = WGPUColorSpacePrimariesDawn_Rec601, - Rec2020 = WGPUColorSpacePrimariesDawn_Rec2020, - DisplayP3 = WGPUColorSpacePrimariesDawn_DisplayP3, -}; -static_assert(sizeof(ColorSpacePrimariesDawn) == sizeof(WGPUColorSpacePrimariesDawn), "sizeof mismatch for ColorSpacePrimariesDawn"); -static_assert(alignof(ColorSpacePrimariesDawn) == alignof(WGPUColorSpacePrimariesDawn), "alignof mismatch for ColorSpacePrimariesDawn"); - -enum class ColorSpaceTransferDawn : uint32_t { - Identity = WGPUColorSpaceTransferDawn_Identity, - SRGB = WGPUColorSpaceTransferDawn_SRGB, - DisplayP3 = WGPUColorSpaceTransferDawn_DisplayP3, - SMPTE_170M = WGPUColorSpaceTransferDawn_SMPTE_170M, - HLG = WGPUColorSpaceTransferDawn_HLG, - PQ = WGPUColorSpaceTransferDawn_PQ, -}; -static_assert(sizeof(ColorSpaceTransferDawn) == sizeof(WGPUColorSpaceTransferDawn), "sizeof mismatch for ColorSpaceTransferDawn"); -static_assert(alignof(ColorSpaceTransferDawn) == alignof(WGPUColorSpaceTransferDawn), "alignof mismatch for ColorSpaceTransferDawn"); - -enum class ColorSpaceYCbCrMatrixDawn : uint32_t { - Identity = WGPUColorSpaceYCbCrMatrixDawn_Identity, - Rec601 = WGPUColorSpaceYCbCrMatrixDawn_Rec601, - Rec709 = WGPUColorSpaceYCbCrMatrixDawn_Rec709, - Rec2020 = WGPUColorSpaceYCbCrMatrixDawn_Rec2020, -}; -static_assert(sizeof(ColorSpaceYCbCrMatrixDawn) == sizeof(WGPUColorSpaceYCbCrMatrixDawn), "sizeof mismatch for ColorSpaceYCbCrMatrixDawn"); -static_assert(alignof(ColorSpaceYCbCrMatrixDawn) == alignof(WGPUColorSpaceYCbCrMatrixDawn), "alignof mismatch for ColorSpaceYCbCrMatrixDawn"); - -enum class ColorSpaceYCbCrRangeDawn : uint32_t { - Identity = WGPUColorSpaceYCbCrRangeDawn_Identity, - Narrow = WGPUColorSpaceYCbCrRangeDawn_Narrow, - Full = WGPUColorSpaceYCbCrRangeDawn_Full, -}; -static_assert(sizeof(ColorSpaceYCbCrRangeDawn) == sizeof(WGPUColorSpaceYCbCrRangeDawn), "sizeof mismatch for ColorSpaceYCbCrRangeDawn"); -static_assert(alignof(ColorSpaceYCbCrRangeDawn) == alignof(WGPUColorSpaceYCbCrRangeDawn), "alignof mismatch for ColorSpaceYCbCrRangeDawn"); - -enum class CompareFunction : uint32_t { - Undefined = WGPUCompareFunction_Undefined, - Never = WGPUCompareFunction_Never, - Less = WGPUCompareFunction_Less, - Equal = WGPUCompareFunction_Equal, - LessEqual = WGPUCompareFunction_LessEqual, - Greater = WGPUCompareFunction_Greater, - NotEqual = WGPUCompareFunction_NotEqual, - GreaterEqual = WGPUCompareFunction_GreaterEqual, - Always = WGPUCompareFunction_Always, -}; -static_assert(sizeof(CompareFunction) == sizeof(WGPUCompareFunction), "sizeof mismatch for CompareFunction"); -static_assert(alignof(CompareFunction) == alignof(WGPUCompareFunction), "alignof mismatch for CompareFunction"); - -enum class CompilationInfoRequestStatus : uint32_t { - Success = WGPUCompilationInfoRequestStatus_Success, - CallbackCancelled = WGPUCompilationInfoRequestStatus_CallbackCancelled, -}; -static_assert(sizeof(CompilationInfoRequestStatus) == sizeof(WGPUCompilationInfoRequestStatus), "sizeof mismatch for CompilationInfoRequestStatus"); -static_assert(alignof(CompilationInfoRequestStatus) == alignof(WGPUCompilationInfoRequestStatus), "alignof mismatch for CompilationInfoRequestStatus"); - -enum class CompilationMessageType : uint32_t { - Error = WGPUCompilationMessageType_Error, - Warning = WGPUCompilationMessageType_Warning, - Info = WGPUCompilationMessageType_Info, -}; -static_assert(sizeof(CompilationMessageType) == sizeof(WGPUCompilationMessageType), "sizeof mismatch for CompilationMessageType"); -static_assert(alignof(CompilationMessageType) == alignof(WGPUCompilationMessageType), "alignof mismatch for CompilationMessageType"); - -enum class ComponentSwizzle : uint32_t { - Undefined = WGPUComponentSwizzle_Undefined, - Zero = WGPUComponentSwizzle_Zero, - One = WGPUComponentSwizzle_One, - R = WGPUComponentSwizzle_R, - G = WGPUComponentSwizzle_G, - B = WGPUComponentSwizzle_B, - A = WGPUComponentSwizzle_A, -}; -static_assert(sizeof(ComponentSwizzle) == sizeof(WGPUComponentSwizzle), "sizeof mismatch for ComponentSwizzle"); -static_assert(alignof(ComponentSwizzle) == alignof(WGPUComponentSwizzle), "alignof mismatch for ComponentSwizzle"); - -enum class CompositeAlphaMode : uint32_t { - Auto = WGPUCompositeAlphaMode_Auto, - Opaque = WGPUCompositeAlphaMode_Opaque, - Premultiplied = WGPUCompositeAlphaMode_Premultiplied, - Unpremultiplied = WGPUCompositeAlphaMode_Unpremultiplied, - Inherit = WGPUCompositeAlphaMode_Inherit, -}; -static_assert(sizeof(CompositeAlphaMode) == sizeof(WGPUCompositeAlphaMode), "sizeof mismatch for CompositeAlphaMode"); -static_assert(alignof(CompositeAlphaMode) == alignof(WGPUCompositeAlphaMode), "alignof mismatch for CompositeAlphaMode"); - -enum class CreatePipelineAsyncStatus : uint32_t { - Success = WGPUCreatePipelineAsyncStatus_Success, - CallbackCancelled = WGPUCreatePipelineAsyncStatus_CallbackCancelled, - ValidationError = WGPUCreatePipelineAsyncStatus_ValidationError, - InternalError = WGPUCreatePipelineAsyncStatus_InternalError, -}; -static_assert(sizeof(CreatePipelineAsyncStatus) == sizeof(WGPUCreatePipelineAsyncStatus), "sizeof mismatch for CreatePipelineAsyncStatus"); -static_assert(alignof(CreatePipelineAsyncStatus) == alignof(WGPUCreatePipelineAsyncStatus), "alignof mismatch for CreatePipelineAsyncStatus"); - -enum class CullMode : uint32_t { - Undefined = WGPUCullMode_Undefined, - None = WGPUCullMode_None, - Front = WGPUCullMode_Front, - Back = WGPUCullMode_Back, -}; -static_assert(sizeof(CullMode) == sizeof(WGPUCullMode), "sizeof mismatch for CullMode"); -static_assert(alignof(CullMode) == alignof(WGPUCullMode), "alignof mismatch for CullMode"); - -enum class DeviceLostReason : uint32_t { - Unknown = WGPUDeviceLostReason_Unknown, - Destroyed = WGPUDeviceLostReason_Destroyed, - CallbackCancelled = WGPUDeviceLostReason_CallbackCancelled, - FailedCreation = WGPUDeviceLostReason_FailedCreation, -}; -static_assert(sizeof(DeviceLostReason) == sizeof(WGPUDeviceLostReason), "sizeof mismatch for DeviceLostReason"); -static_assert(alignof(DeviceLostReason) == alignof(WGPUDeviceLostReason), "alignof mismatch for DeviceLostReason"); - -enum class ErrorFilter : uint32_t { - Validation = WGPUErrorFilter_Validation, - OutOfMemory = WGPUErrorFilter_OutOfMemory, - Internal = WGPUErrorFilter_Internal, -}; -static_assert(sizeof(ErrorFilter) == sizeof(WGPUErrorFilter), "sizeof mismatch for ErrorFilter"); -static_assert(alignof(ErrorFilter) == alignof(WGPUErrorFilter), "alignof mismatch for ErrorFilter"); - -enum class ErrorType : uint32_t { - NoError = WGPUErrorType_NoError, - Validation = WGPUErrorType_Validation, - OutOfMemory = WGPUErrorType_OutOfMemory, - Internal = WGPUErrorType_Internal, - Unknown = WGPUErrorType_Unknown, -}; -static_assert(sizeof(ErrorType) == sizeof(WGPUErrorType), "sizeof mismatch for ErrorType"); -static_assert(alignof(ErrorType) == alignof(WGPUErrorType), "alignof mismatch for ErrorType"); - -enum class ExternalTextureRotation : uint32_t { - Rotate0Degrees = WGPUExternalTextureRotation_Rotate0Degrees, - Rotate90Degrees = WGPUExternalTextureRotation_Rotate90Degrees, - Rotate180Degrees = WGPUExternalTextureRotation_Rotate180Degrees, - Rotate270Degrees = WGPUExternalTextureRotation_Rotate270Degrees, -}; -static_assert(sizeof(ExternalTextureRotation) == sizeof(WGPUExternalTextureRotation), "sizeof mismatch for ExternalTextureRotation"); -static_assert(alignof(ExternalTextureRotation) == alignof(WGPUExternalTextureRotation), "alignof mismatch for ExternalTextureRotation"); - -enum class FeatureLevel : uint32_t { - Undefined = WGPUFeatureLevel_Undefined, - Compatibility = WGPUFeatureLevel_Compatibility, - Core = WGPUFeatureLevel_Core, -}; -static_assert(sizeof(FeatureLevel) == sizeof(WGPUFeatureLevel), "sizeof mismatch for FeatureLevel"); -static_assert(alignof(FeatureLevel) == alignof(WGPUFeatureLevel), "alignof mismatch for FeatureLevel"); - -enum class FeatureName : uint32_t { - CoreFeaturesAndLimits = WGPUFeatureName_CoreFeaturesAndLimits, - DepthClipControl = WGPUFeatureName_DepthClipControl, - Depth32FloatStencil8 = WGPUFeatureName_Depth32FloatStencil8, - TextureCompressionBC = WGPUFeatureName_TextureCompressionBC, - TextureCompressionBCSliced3D = WGPUFeatureName_TextureCompressionBCSliced3D, - TextureCompressionETC2 = WGPUFeatureName_TextureCompressionETC2, - TextureCompressionASTC = WGPUFeatureName_TextureCompressionASTC, - TextureCompressionASTCSliced3D = WGPUFeatureName_TextureCompressionASTCSliced3D, - TimestampQuery = WGPUFeatureName_TimestampQuery, - IndirectFirstInstance = WGPUFeatureName_IndirectFirstInstance, - ShaderF16 = WGPUFeatureName_ShaderF16, - RG11B10UfloatRenderable = WGPUFeatureName_RG11B10UfloatRenderable, - BGRA8UnormStorage = WGPUFeatureName_BGRA8UnormStorage, - Float32Filterable = WGPUFeatureName_Float32Filterable, - Float32Blendable = WGPUFeatureName_Float32Blendable, - ClipDistances = WGPUFeatureName_ClipDistances, - DualSourceBlending = WGPUFeatureName_DualSourceBlending, - Subgroups = WGPUFeatureName_Subgroups, - TextureFormatsTier1 = WGPUFeatureName_TextureFormatsTier1, - TextureFormatsTier2 = WGPUFeatureName_TextureFormatsTier2, - PrimitiveIndex = WGPUFeatureName_PrimitiveIndex, - TextureComponentSwizzle = WGPUFeatureName_TextureComponentSwizzle, - DawnInternalUsages = WGPUFeatureName_DawnInternalUsages, - DawnMultiPlanarFormats = WGPUFeatureName_DawnMultiPlanarFormats, - DawnNative = WGPUFeatureName_DawnNative, - ChromiumExperimentalTimestampQueryInsidePasses = WGPUFeatureName_ChromiumExperimentalTimestampQueryInsidePasses, - ImplicitDeviceSynchronization = WGPUFeatureName_ImplicitDeviceSynchronization, - TransientAttachments = WGPUFeatureName_TransientAttachments, - MSAARenderToSingleSampled = WGPUFeatureName_MSAARenderToSingleSampled, - D3D11MultithreadProtected = WGPUFeatureName_D3D11MultithreadProtected, - ANGLETextureSharing = WGPUFeatureName_ANGLETextureSharing, - PixelLocalStorageCoherent = WGPUFeatureName_PixelLocalStorageCoherent, - PixelLocalStorageNonCoherent = WGPUFeatureName_PixelLocalStorageNonCoherent, - Unorm16TextureFormats = WGPUFeatureName_Unorm16TextureFormats, - MultiPlanarFormatExtendedUsages = WGPUFeatureName_MultiPlanarFormatExtendedUsages, - MultiPlanarFormatP010 = WGPUFeatureName_MultiPlanarFormatP010, - HostMappedPointer = WGPUFeatureName_HostMappedPointer, - MultiPlanarRenderTargets = WGPUFeatureName_MultiPlanarRenderTargets, - MultiPlanarFormatNv12a = WGPUFeatureName_MultiPlanarFormatNv12a, - FramebufferFetch = WGPUFeatureName_FramebufferFetch, - BufferMapExtendedUsages = WGPUFeatureName_BufferMapExtendedUsages, - AdapterPropertiesMemoryHeaps = WGPUFeatureName_AdapterPropertiesMemoryHeaps, - AdapterPropertiesD3D = WGPUFeatureName_AdapterPropertiesD3D, - AdapterPropertiesVk = WGPUFeatureName_AdapterPropertiesVk, - DawnFormatCapabilities = WGPUFeatureName_DawnFormatCapabilities, - DawnDrmFormatCapabilities = WGPUFeatureName_DawnDrmFormatCapabilities, - MultiPlanarFormatNv16 = WGPUFeatureName_MultiPlanarFormatNv16, - MultiPlanarFormatNv24 = WGPUFeatureName_MultiPlanarFormatNv24, - MultiPlanarFormatP210 = WGPUFeatureName_MultiPlanarFormatP210, - MultiPlanarFormatP410 = WGPUFeatureName_MultiPlanarFormatP410, - SharedTextureMemoryVkDedicatedAllocation = WGPUFeatureName_SharedTextureMemoryVkDedicatedAllocation, - SharedTextureMemoryAHardwareBuffer = WGPUFeatureName_SharedTextureMemoryAHardwareBuffer, - SharedTextureMemoryDmaBuf = WGPUFeatureName_SharedTextureMemoryDmaBuf, - SharedTextureMemoryOpaqueFD = WGPUFeatureName_SharedTextureMemoryOpaqueFD, - SharedTextureMemoryZirconHandle = WGPUFeatureName_SharedTextureMemoryZirconHandle, - SharedTextureMemoryDXGISharedHandle = WGPUFeatureName_SharedTextureMemoryDXGISharedHandle, - SharedTextureMemoryD3D11Texture2D = WGPUFeatureName_SharedTextureMemoryD3D11Texture2D, - SharedTextureMemoryIOSurface = WGPUFeatureName_SharedTextureMemoryIOSurface, - SharedTextureMemoryEGLImage = WGPUFeatureName_SharedTextureMemoryEGLImage, - SharedFenceVkSemaphoreOpaqueFD = WGPUFeatureName_SharedFenceVkSemaphoreOpaqueFD, - SharedFenceSyncFD = WGPUFeatureName_SharedFenceSyncFD, - SharedFenceVkSemaphoreZirconHandle = WGPUFeatureName_SharedFenceVkSemaphoreZirconHandle, - SharedFenceDXGISharedHandle = WGPUFeatureName_SharedFenceDXGISharedHandle, - SharedFenceMTLSharedEvent = WGPUFeatureName_SharedFenceMTLSharedEvent, - SharedBufferMemoryD3D12Resource = WGPUFeatureName_SharedBufferMemoryD3D12Resource, - StaticSamplers = WGPUFeatureName_StaticSamplers, - YCbCrVulkanSamplers = WGPUFeatureName_YCbCrVulkanSamplers, - ShaderModuleCompilationOptions = WGPUFeatureName_ShaderModuleCompilationOptions, - DawnLoadResolveTexture = WGPUFeatureName_DawnLoadResolveTexture, - DawnPartialLoadResolveTexture = WGPUFeatureName_DawnPartialLoadResolveTexture, - MultiDrawIndirect = WGPUFeatureName_MultiDrawIndirect, - DawnTexelCopyBufferRowAlignment = WGPUFeatureName_DawnTexelCopyBufferRowAlignment, - FlexibleTextureViews = WGPUFeatureName_FlexibleTextureViews, - ChromiumExperimentalSubgroupMatrix = WGPUFeatureName_ChromiumExperimentalSubgroupMatrix, - SharedFenceEGLSync = WGPUFeatureName_SharedFenceEGLSync, - DawnDeviceAllocatorControl = WGPUFeatureName_DawnDeviceAllocatorControl, - AdapterPropertiesWGPU = WGPUFeatureName_AdapterPropertiesWGPU, - SharedBufferMemoryD3D12SharedMemoryFileMappingHandle = WGPUFeatureName_SharedBufferMemoryD3D12SharedMemoryFileMappingHandle, - SharedTextureMemoryD3D12Resource = WGPUFeatureName_SharedTextureMemoryD3D12Resource, - ChromiumExperimentalSamplingResourceTable = WGPUFeatureName_ChromiumExperimentalSamplingResourceTable, - SubgroupSizeControl = WGPUFeatureName_SubgroupSizeControl, - AtomicVec2uMinMax = WGPUFeatureName_AtomicVec2uMinMax, - Unorm16FormatsForExternalTexture = WGPUFeatureName_Unorm16FormatsForExternalTexture, - OpaqueYCbCrAndroidForExternalTexture = WGPUFeatureName_OpaqueYCbCrAndroidForExternalTexture, - Unorm16Filterable = WGPUFeatureName_Unorm16Filterable, - RenderPassRenderArea = WGPUFeatureName_RenderPassRenderArea, - AdapterPropertiesDrm = WGPUFeatureName_AdapterPropertiesDrm, -}; -static_assert(sizeof(FeatureName) == sizeof(WGPUFeatureName), "sizeof mismatch for FeatureName"); -static_assert(alignof(FeatureName) == alignof(WGPUFeatureName), "alignof mismatch for FeatureName"); - -enum class FilterMode : uint32_t { - Undefined = WGPUFilterMode_Undefined, - Nearest = WGPUFilterMode_Nearest, - Linear = WGPUFilterMode_Linear, -}; -static_assert(sizeof(FilterMode) == sizeof(WGPUFilterMode), "sizeof mismatch for FilterMode"); -static_assert(alignof(FilterMode) == alignof(WGPUFilterMode), "alignof mismatch for FilterMode"); - -enum class FrontFace : uint32_t { - Undefined = WGPUFrontFace_Undefined, - CCW = WGPUFrontFace_CCW, - CW = WGPUFrontFace_CW, -}; -static_assert(sizeof(FrontFace) == sizeof(WGPUFrontFace), "sizeof mismatch for FrontFace"); -static_assert(alignof(FrontFace) == alignof(WGPUFrontFace), "alignof mismatch for FrontFace"); - -enum class IndexFormat : uint32_t { - Undefined = WGPUIndexFormat_Undefined, - Uint16 = WGPUIndexFormat_Uint16, - Uint32 = WGPUIndexFormat_Uint32, -}; -static_assert(sizeof(IndexFormat) == sizeof(WGPUIndexFormat), "sizeof mismatch for IndexFormat"); -static_assert(alignof(IndexFormat) == alignof(WGPUIndexFormat), "alignof mismatch for IndexFormat"); - -enum class InstanceFeatureName : uint32_t { - TimedWaitAny = WGPUInstanceFeatureName_TimedWaitAny, - ShaderSourceSPIRV = WGPUInstanceFeatureName_ShaderSourceSPIRV, - MultipleDevicesPerAdapter = WGPUInstanceFeatureName_MultipleDevicesPerAdapter, -}; -static_assert(sizeof(InstanceFeatureName) == sizeof(WGPUInstanceFeatureName), "sizeof mismatch for InstanceFeatureName"); -static_assert(alignof(InstanceFeatureName) == alignof(WGPUInstanceFeatureName), "alignof mismatch for InstanceFeatureName"); - -enum class LoadOp : uint32_t { - Undefined = WGPULoadOp_Undefined, - Load = WGPULoadOp_Load, - Clear = WGPULoadOp_Clear, - ExpandResolveTexture = WGPULoadOp_ExpandResolveTexture, -}; -static_assert(sizeof(LoadOp) == sizeof(WGPULoadOp), "sizeof mismatch for LoadOp"); -static_assert(alignof(LoadOp) == alignof(WGPULoadOp), "alignof mismatch for LoadOp"); - -enum class LoggingType : uint32_t { - Verbose = WGPULoggingType_Verbose, - Info = WGPULoggingType_Info, - Warning = WGPULoggingType_Warning, - Error = WGPULoggingType_Error, -}; -static_assert(sizeof(LoggingType) == sizeof(WGPULoggingType), "sizeof mismatch for LoggingType"); -static_assert(alignof(LoggingType) == alignof(WGPULoggingType), "alignof mismatch for LoggingType"); - -enum class MapAsyncStatus : uint32_t { - Success = WGPUMapAsyncStatus_Success, - CallbackCancelled = WGPUMapAsyncStatus_CallbackCancelled, - Error = WGPUMapAsyncStatus_Error, - Aborted = WGPUMapAsyncStatus_Aborted, -}; -static_assert(sizeof(MapAsyncStatus) == sizeof(WGPUMapAsyncStatus), "sizeof mismatch for MapAsyncStatus"); -static_assert(alignof(MapAsyncStatus) == alignof(WGPUMapAsyncStatus), "alignof mismatch for MapAsyncStatus"); - -enum class MipmapFilterMode : uint32_t { - Undefined = WGPUMipmapFilterMode_Undefined, - Nearest = WGPUMipmapFilterMode_Nearest, - Linear = WGPUMipmapFilterMode_Linear, -}; -static_assert(sizeof(MipmapFilterMode) == sizeof(WGPUMipmapFilterMode), "sizeof mismatch for MipmapFilterMode"); -static_assert(alignof(MipmapFilterMode) == alignof(WGPUMipmapFilterMode), "alignof mismatch for MipmapFilterMode"); - -enum class PopErrorScopeStatus : uint32_t { - Success = WGPUPopErrorScopeStatus_Success, - CallbackCancelled = WGPUPopErrorScopeStatus_CallbackCancelled, - Error = WGPUPopErrorScopeStatus_Error, -}; -static_assert(sizeof(PopErrorScopeStatus) == sizeof(WGPUPopErrorScopeStatus), "sizeof mismatch for PopErrorScopeStatus"); -static_assert(alignof(PopErrorScopeStatus) == alignof(WGPUPopErrorScopeStatus), "alignof mismatch for PopErrorScopeStatus"); - -enum class PowerPreference : uint32_t { - Undefined = WGPUPowerPreference_Undefined, - LowPower = WGPUPowerPreference_LowPower, - HighPerformance = WGPUPowerPreference_HighPerformance, -}; -static_assert(sizeof(PowerPreference) == sizeof(WGPUPowerPreference), "sizeof mismatch for PowerPreference"); -static_assert(alignof(PowerPreference) == alignof(WGPUPowerPreference), "alignof mismatch for PowerPreference"); - -enum class PredefinedColorSpace : uint32_t { - SRGB = WGPUPredefinedColorSpace_SRGB, - DisplayP3 = WGPUPredefinedColorSpace_DisplayP3, - SRGBLinear = WGPUPredefinedColorSpace_SRGBLinear, - DisplayP3Linear = WGPUPredefinedColorSpace_DisplayP3Linear, -}; -static_assert(sizeof(PredefinedColorSpace) == sizeof(WGPUPredefinedColorSpace), "sizeof mismatch for PredefinedColorSpace"); -static_assert(alignof(PredefinedColorSpace) == alignof(WGPUPredefinedColorSpace), "alignof mismatch for PredefinedColorSpace"); - -enum class PresentMode : uint32_t { - Undefined = WGPUPresentMode_Undefined, - Fifo = WGPUPresentMode_Fifo, - FifoRelaxed = WGPUPresentMode_FifoRelaxed, - Immediate = WGPUPresentMode_Immediate, - Mailbox = WGPUPresentMode_Mailbox, -}; -static_assert(sizeof(PresentMode) == sizeof(WGPUPresentMode), "sizeof mismatch for PresentMode"); -static_assert(alignof(PresentMode) == alignof(WGPUPresentMode), "alignof mismatch for PresentMode"); - -enum class PrimitiveTopology : uint32_t { - Undefined = WGPUPrimitiveTopology_Undefined, - PointList = WGPUPrimitiveTopology_PointList, - LineList = WGPUPrimitiveTopology_LineList, - LineStrip = WGPUPrimitiveTopology_LineStrip, - TriangleList = WGPUPrimitiveTopology_TriangleList, - TriangleStrip = WGPUPrimitiveTopology_TriangleStrip, -}; -static_assert(sizeof(PrimitiveTopology) == sizeof(WGPUPrimitiveTopology), "sizeof mismatch for PrimitiveTopology"); -static_assert(alignof(PrimitiveTopology) == alignof(WGPUPrimitiveTopology), "alignof mismatch for PrimitiveTopology"); - -enum class QueryType : uint32_t { - Occlusion = WGPUQueryType_Occlusion, - Timestamp = WGPUQueryType_Timestamp, -}; -static_assert(sizeof(QueryType) == sizeof(WGPUQueryType), "sizeof mismatch for QueryType"); -static_assert(alignof(QueryType) == alignof(WGPUQueryType), "alignof mismatch for QueryType"); - -enum class QueueWorkDoneStatus : uint32_t { - Success = WGPUQueueWorkDoneStatus_Success, - CallbackCancelled = WGPUQueueWorkDoneStatus_CallbackCancelled, - Error = WGPUQueueWorkDoneStatus_Error, -}; -static_assert(sizeof(QueueWorkDoneStatus) == sizeof(WGPUQueueWorkDoneStatus), "sizeof mismatch for QueueWorkDoneStatus"); -static_assert(alignof(QueueWorkDoneStatus) == alignof(WGPUQueueWorkDoneStatus), "alignof mismatch for QueueWorkDoneStatus"); - -enum class RequestAdapterStatus : uint32_t { - Success = WGPURequestAdapterStatus_Success, - CallbackCancelled = WGPURequestAdapterStatus_CallbackCancelled, - Unavailable = WGPURequestAdapterStatus_Unavailable, - Error = WGPURequestAdapterStatus_Error, -}; -static_assert(sizeof(RequestAdapterStatus) == sizeof(WGPURequestAdapterStatus), "sizeof mismatch for RequestAdapterStatus"); -static_assert(alignof(RequestAdapterStatus) == alignof(WGPURequestAdapterStatus), "alignof mismatch for RequestAdapterStatus"); - -enum class RequestDeviceStatus : uint32_t { - Success = WGPURequestDeviceStatus_Success, - CallbackCancelled = WGPURequestDeviceStatus_CallbackCancelled, - Error = WGPURequestDeviceStatus_Error, -}; -static_assert(sizeof(RequestDeviceStatus) == sizeof(WGPURequestDeviceStatus), "sizeof mismatch for RequestDeviceStatus"); -static_assert(alignof(RequestDeviceStatus) == alignof(WGPURequestDeviceStatus), "alignof mismatch for RequestDeviceStatus"); - -enum class SamplerBindingType : uint32_t { - BindingNotUsed = WGPUSamplerBindingType_BindingNotUsed, - Undefined = WGPUSamplerBindingType_Undefined, - Filtering = WGPUSamplerBindingType_Filtering, - NonFiltering = WGPUSamplerBindingType_NonFiltering, - Comparison = WGPUSamplerBindingType_Comparison, -}; -static_assert(sizeof(SamplerBindingType) == sizeof(WGPUSamplerBindingType), "sizeof mismatch for SamplerBindingType"); -static_assert(alignof(SamplerBindingType) == alignof(WGPUSamplerBindingType), "alignof mismatch for SamplerBindingType"); - -enum class SharedFenceType : uint32_t { - VkSemaphoreOpaqueFD = WGPUSharedFenceType_VkSemaphoreOpaqueFD, - SyncFD = WGPUSharedFenceType_SyncFD, - VkSemaphoreZirconHandle = WGPUSharedFenceType_VkSemaphoreZirconHandle, - DXGISharedHandle = WGPUSharedFenceType_DXGISharedHandle, - MTLSharedEvent = WGPUSharedFenceType_MTLSharedEvent, - EGLSync = WGPUSharedFenceType_EGLSync, -}; -static_assert(sizeof(SharedFenceType) == sizeof(WGPUSharedFenceType), "sizeof mismatch for SharedFenceType"); -static_assert(alignof(SharedFenceType) == alignof(WGPUSharedFenceType), "alignof mismatch for SharedFenceType"); - -enum class Status : uint32_t { - Success = WGPUStatus_Success, - Error = WGPUStatus_Error, -}; -static_assert(sizeof(Status) == sizeof(WGPUStatus), "sizeof mismatch for Status"); -static_assert(alignof(Status) == alignof(WGPUStatus), "alignof mismatch for Status"); - -enum class StencilOperation : uint32_t { - Undefined = WGPUStencilOperation_Undefined, - Keep = WGPUStencilOperation_Keep, - Zero = WGPUStencilOperation_Zero, - Replace = WGPUStencilOperation_Replace, - Invert = WGPUStencilOperation_Invert, - IncrementClamp = WGPUStencilOperation_IncrementClamp, - DecrementClamp = WGPUStencilOperation_DecrementClamp, - IncrementWrap = WGPUStencilOperation_IncrementWrap, - DecrementWrap = WGPUStencilOperation_DecrementWrap, -}; -static_assert(sizeof(StencilOperation) == sizeof(WGPUStencilOperation), "sizeof mismatch for StencilOperation"); -static_assert(alignof(StencilOperation) == alignof(WGPUStencilOperation), "alignof mismatch for StencilOperation"); - -enum class StorageTextureAccess : uint32_t { - BindingNotUsed = WGPUStorageTextureAccess_BindingNotUsed, - Undefined = WGPUStorageTextureAccess_Undefined, - WriteOnly = WGPUStorageTextureAccess_WriteOnly, - ReadOnly = WGPUStorageTextureAccess_ReadOnly, - ReadWrite = WGPUStorageTextureAccess_ReadWrite, -}; -static_assert(sizeof(StorageTextureAccess) == sizeof(WGPUStorageTextureAccess), "sizeof mismatch for StorageTextureAccess"); -static_assert(alignof(StorageTextureAccess) == alignof(WGPUStorageTextureAccess), "alignof mismatch for StorageTextureAccess"); - -enum class StoreOp : uint32_t { - Undefined = WGPUStoreOp_Undefined, - Store = WGPUStoreOp_Store, - Discard = WGPUStoreOp_Discard, -}; -static_assert(sizeof(StoreOp) == sizeof(WGPUStoreOp), "sizeof mismatch for StoreOp"); -static_assert(alignof(StoreOp) == alignof(WGPUStoreOp), "alignof mismatch for StoreOp"); - -enum class SType : uint32_t { - ShaderSourceSPIRV = WGPUSType_ShaderSourceSPIRV, - ShaderSourceWGSL = WGPUSType_ShaderSourceWGSL, - RenderPassMaxDrawCount = WGPUSType_RenderPassMaxDrawCount, - SurfaceSourceMetalLayer = WGPUSType_SurfaceSourceMetalLayer, - SurfaceSourceWindowsHWND = WGPUSType_SurfaceSourceWindowsHWND, - SurfaceSourceXlibWindow = WGPUSType_SurfaceSourceXlibWindow, - SurfaceSourceWaylandSurface = WGPUSType_SurfaceSourceWaylandSurface, - SurfaceSourceAndroidNativeWindow = WGPUSType_SurfaceSourceAndroidNativeWindow, - SurfaceSourceXCBWindow = WGPUSType_SurfaceSourceXCBWindow, - SurfaceColorManagement = WGPUSType_SurfaceColorManagement, - RequestAdapterWebXROptions = WGPUSType_RequestAdapterWebXROptions, - TextureComponentSwizzleDescriptor = WGPUSType_TextureComponentSwizzleDescriptor, - ExternalTextureBindingLayout = WGPUSType_ExternalTextureBindingLayout, - ExternalTextureBindingEntry = WGPUSType_ExternalTextureBindingEntry, - CompatibilityModeLimits = WGPUSType_CompatibilityModeLimits, - TextureBindingViewDimension = WGPUSType_TextureBindingViewDimension, - SurfaceDescriptorFromWindowsCoreWindow = WGPUSType_SurfaceDescriptorFromWindowsCoreWindow, - SurfaceDescriptorFromWindowsUWPSwapChainPanel = WGPUSType_SurfaceDescriptorFromWindowsUWPSwapChainPanel, - DawnTextureInternalUsageDescriptor = WGPUSType_DawnTextureInternalUsageDescriptor, - DawnEncoderInternalUsageDescriptor = WGPUSType_DawnEncoderInternalUsageDescriptor, - DawnInstanceDescriptor = WGPUSType_DawnInstanceDescriptor, - DawnCacheDeviceDescriptor = WGPUSType_DawnCacheDeviceDescriptor, - DawnAdapterPropertiesPowerPreference = WGPUSType_DawnAdapterPropertiesPowerPreference, - DawnBufferDescriptorErrorInfoFromWireClient = WGPUSType_DawnBufferDescriptorErrorInfoFromWireClient, - DawnTogglesDescriptor = WGPUSType_DawnTogglesDescriptor, - DawnShaderModuleSPIRVOptionsDescriptor = WGPUSType_DawnShaderModuleSPIRVOptionsDescriptor, - RequestAdapterOptionsLUID = WGPUSType_RequestAdapterOptionsLUID, - RequestAdapterOptionsGetGLProc = WGPUSType_RequestAdapterOptionsGetGLProc, - RequestAdapterOptionsD3D11Device = WGPUSType_RequestAdapterOptionsD3D11Device, - DawnRenderPassSampleCount = WGPUSType_DawnRenderPassSampleCount, - RenderPassPixelLocalStorage = WGPUSType_RenderPassPixelLocalStorage, - PipelineLayoutPixelLocalStorage = WGPUSType_PipelineLayoutPixelLocalStorage, - BufferHostMappedPointer = WGPUSType_BufferHostMappedPointer, - AdapterPropertiesMemoryHeaps = WGPUSType_AdapterPropertiesMemoryHeaps, - AdapterPropertiesD3D = WGPUSType_AdapterPropertiesD3D, - AdapterPropertiesVk = WGPUSType_AdapterPropertiesVk, - DawnWireWGSLControl = WGPUSType_DawnWireWGSLControl, - DawnWGSLBlocklist = WGPUSType_DawnWGSLBlocklist, - DawnDrmFormatCapabilities = WGPUSType_DawnDrmFormatCapabilities, - ShaderModuleCompilationOptions = WGPUSType_ShaderModuleCompilationOptions, - ColorTargetStateExpandResolveTextureDawn = WGPUSType_ColorTargetStateExpandResolveTextureDawn, - RenderPassRenderAreaRect = WGPUSType_RenderPassRenderAreaRect, - SharedTextureMemoryVkDedicatedAllocationDescriptor = WGPUSType_SharedTextureMemoryVkDedicatedAllocationDescriptor, - SharedTextureMemoryAHardwareBufferDescriptor = WGPUSType_SharedTextureMemoryAHardwareBufferDescriptor, - SharedTextureMemoryDmaBufDescriptor = WGPUSType_SharedTextureMemoryDmaBufDescriptor, - SharedTextureMemoryOpaqueFDDescriptor = WGPUSType_SharedTextureMemoryOpaqueFDDescriptor, - SharedTextureMemoryZirconHandleDescriptor = WGPUSType_SharedTextureMemoryZirconHandleDescriptor, - SharedTextureMemoryDXGISharedHandleDescriptor = WGPUSType_SharedTextureMemoryDXGISharedHandleDescriptor, - SharedTextureMemoryD3D11Texture2DDescriptor = WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor, - SharedTextureMemoryIOSurfaceDescriptor = WGPUSType_SharedTextureMemoryIOSurfaceDescriptor, - SharedTextureMemoryEGLImageDescriptor = WGPUSType_SharedTextureMemoryEGLImageDescriptor, - SharedTextureMemoryInitializedBeginState = WGPUSType_SharedTextureMemoryInitializedBeginState, - SharedTextureMemoryInitializedEndState = WGPUSType_SharedTextureMemoryInitializedEndState, - SharedTextureMemoryVkImageLayoutBeginState = WGPUSType_SharedTextureMemoryVkImageLayoutBeginState, - SharedTextureMemoryVkImageLayoutEndState = WGPUSType_SharedTextureMemoryVkImageLayoutEndState, - SharedTextureMemoryD3DSwapchainBeginState = WGPUSType_SharedTextureMemoryD3DSwapchainBeginState, - SharedFenceVkSemaphoreOpaqueFDDescriptor = WGPUSType_SharedFenceVkSemaphoreOpaqueFDDescriptor, - SharedFenceVkSemaphoreOpaqueFDExportInfo = WGPUSType_SharedFenceVkSemaphoreOpaqueFDExportInfo, - SharedFenceSyncFDDescriptor = WGPUSType_SharedFenceSyncFDDescriptor, - SharedFenceSyncFDExportInfo = WGPUSType_SharedFenceSyncFDExportInfo, - SharedFenceVkSemaphoreZirconHandleDescriptor = WGPUSType_SharedFenceVkSemaphoreZirconHandleDescriptor, - SharedFenceVkSemaphoreZirconHandleExportInfo = WGPUSType_SharedFenceVkSemaphoreZirconHandleExportInfo, - SharedFenceDXGISharedHandleDescriptor = WGPUSType_SharedFenceDXGISharedHandleDescriptor, - SharedFenceDXGISharedHandleExportInfo = WGPUSType_SharedFenceDXGISharedHandleExportInfo, - SharedFenceMTLSharedEventDescriptor = WGPUSType_SharedFenceMTLSharedEventDescriptor, - SharedFenceMTLSharedEventExportInfo = WGPUSType_SharedFenceMTLSharedEventExportInfo, - SharedBufferMemoryD3D12ResourceDescriptor = WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor, - StaticSamplerBindingLayout = WGPUSType_StaticSamplerBindingLayout, - YCbCrVkDescriptor = WGPUSType_YCbCrVkDescriptor, - SharedTextureMemoryAHardwareBufferProperties = WGPUSType_SharedTextureMemoryAHardwareBufferProperties, - AHardwareBufferProperties = WGPUSType_AHardwareBufferProperties, - DawnTexelCopyBufferRowAlignmentLimits = WGPUSType_DawnTexelCopyBufferRowAlignmentLimits, - AdapterPropertiesSubgroupMatrixConfigs = WGPUSType_AdapterPropertiesSubgroupMatrixConfigs, - SharedFenceEGLSyncDescriptor = WGPUSType_SharedFenceEGLSyncDescriptor, - SharedFenceEGLSyncExportInfo = WGPUSType_SharedFenceEGLSyncExportInfo, - DawnInjectedInvalidSType = WGPUSType_DawnInjectedInvalidSType, - DawnCompilationMessageUtf16 = WGPUSType_DawnCompilationMessageUtf16, - DawnFakeBufferOOMForTesting = WGPUSType_DawnFakeBufferOOMForTesting, - SurfaceDescriptorFromWindowsWinUISwapChainPanel = WGPUSType_SurfaceDescriptorFromWindowsWinUISwapChainPanel, - DawnDeviceAllocatorControl = WGPUSType_DawnDeviceAllocatorControl, - DawnHostMappedPointerLimits = WGPUSType_DawnHostMappedPointerLimits, - RenderPassDescriptorResolveRect = WGPUSType_RenderPassDescriptorResolveRect, - RequestAdapterWebGPUBackendOptions = WGPUSType_RequestAdapterWebGPUBackendOptions, - DawnFakeDeviceInitializeErrorForTesting = WGPUSType_DawnFakeDeviceInitializeErrorForTesting, - SharedTextureMemoryD3D11BeginState = WGPUSType_SharedTextureMemoryD3D11BeginState, - DawnConsumeAdapterDescriptor = WGPUSType_DawnConsumeAdapterDescriptor, - TexelBufferBindingEntry = WGPUSType_TexelBufferBindingEntry, - TexelBufferBindingLayout = WGPUSType_TexelBufferBindingLayout, - SharedTextureMemoryMetalEndAccessState = WGPUSType_SharedTextureMemoryMetalEndAccessState, - AdapterPropertiesWGPU = WGPUSType_AdapterPropertiesWGPU, - SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor = WGPUSType_SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, - SharedTextureMemoryD3D12ResourceDescriptor = WGPUSType_SharedTextureMemoryD3D12ResourceDescriptor, - RequestAdapterOptionsAngleVirtualizationGroup = WGPUSType_RequestAdapterOptionsAngleVirtualizationGroup, - PipelineLayoutResourceTable = WGPUSType_PipelineLayoutResourceTable, - AdapterPropertiesDrm = WGPUSType_AdapterPropertiesDrm, -}; -static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType"); -static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType"); - -enum class SubgroupMatrixComponentType : uint32_t { - F32 = WGPUSubgroupMatrixComponentType_F32, - F16 = WGPUSubgroupMatrixComponentType_F16, - U32 = WGPUSubgroupMatrixComponentType_U32, - I32 = WGPUSubgroupMatrixComponentType_I32, - U8 = WGPUSubgroupMatrixComponentType_U8, - I8 = WGPUSubgroupMatrixComponentType_I8, -}; -static_assert(sizeof(SubgroupMatrixComponentType) == sizeof(WGPUSubgroupMatrixComponentType), "sizeof mismatch for SubgroupMatrixComponentType"); -static_assert(alignof(SubgroupMatrixComponentType) == alignof(WGPUSubgroupMatrixComponentType), "alignof mismatch for SubgroupMatrixComponentType"); - -enum class SurfaceGetCurrentTextureStatus : uint32_t { - SuccessOptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal, - SuccessSuboptimal = WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal, - Timeout = WGPUSurfaceGetCurrentTextureStatus_Timeout, - Outdated = WGPUSurfaceGetCurrentTextureStatus_Outdated, - Lost = WGPUSurfaceGetCurrentTextureStatus_Lost, - Error = WGPUSurfaceGetCurrentTextureStatus_Error, -}; -static_assert(sizeof(SurfaceGetCurrentTextureStatus) == sizeof(WGPUSurfaceGetCurrentTextureStatus), "sizeof mismatch for SurfaceGetCurrentTextureStatus"); -static_assert(alignof(SurfaceGetCurrentTextureStatus) == alignof(WGPUSurfaceGetCurrentTextureStatus), "alignof mismatch for SurfaceGetCurrentTextureStatus"); - -enum class TexelBufferAccess : uint32_t { - Undefined = WGPUTexelBufferAccess_Undefined, - ReadOnly = WGPUTexelBufferAccess_ReadOnly, - ReadWrite = WGPUTexelBufferAccess_ReadWrite, -}; -static_assert(sizeof(TexelBufferAccess) == sizeof(WGPUTexelBufferAccess), "sizeof mismatch for TexelBufferAccess"); -static_assert(alignof(TexelBufferAccess) == alignof(WGPUTexelBufferAccess), "alignof mismatch for TexelBufferAccess"); - -enum class TextureAspect : uint32_t { - Undefined = WGPUTextureAspect_Undefined, - All = WGPUTextureAspect_All, - StencilOnly = WGPUTextureAspect_StencilOnly, - DepthOnly = WGPUTextureAspect_DepthOnly, - Plane0Only = WGPUTextureAspect_Plane0Only, - Plane1Only = WGPUTextureAspect_Plane1Only, - Plane2Only = WGPUTextureAspect_Plane2Only, -}; -static_assert(sizeof(TextureAspect) == sizeof(WGPUTextureAspect), "sizeof mismatch for TextureAspect"); -static_assert(alignof(TextureAspect) == alignof(WGPUTextureAspect), "alignof mismatch for TextureAspect"); - -enum class TextureDimension : uint32_t { - Undefined = WGPUTextureDimension_Undefined, - e1D = WGPUTextureDimension_1D, - e2D = WGPUTextureDimension_2D, - e3D = WGPUTextureDimension_3D, -}; -static_assert(sizeof(TextureDimension) == sizeof(WGPUTextureDimension), "sizeof mismatch for TextureDimension"); -static_assert(alignof(TextureDimension) == alignof(WGPUTextureDimension), "alignof mismatch for TextureDimension"); - -enum class TextureFormat : uint32_t { - Undefined = WGPUTextureFormat_Undefined, - R8Unorm = WGPUTextureFormat_R8Unorm, - R8Snorm = WGPUTextureFormat_R8Snorm, - R8Uint = WGPUTextureFormat_R8Uint, - R8Sint = WGPUTextureFormat_R8Sint, - R16Unorm = WGPUTextureFormat_R16Unorm, - R16Snorm = WGPUTextureFormat_R16Snorm, - R16Uint = WGPUTextureFormat_R16Uint, - R16Sint = WGPUTextureFormat_R16Sint, - R16Float = WGPUTextureFormat_R16Float, - RG8Unorm = WGPUTextureFormat_RG8Unorm, - RG8Snorm = WGPUTextureFormat_RG8Snorm, - RG8Uint = WGPUTextureFormat_RG8Uint, - RG8Sint = WGPUTextureFormat_RG8Sint, - R32Float = WGPUTextureFormat_R32Float, - R32Uint = WGPUTextureFormat_R32Uint, - R32Sint = WGPUTextureFormat_R32Sint, - RG16Unorm = WGPUTextureFormat_RG16Unorm, - RG16Snorm = WGPUTextureFormat_RG16Snorm, - RG16Uint = WGPUTextureFormat_RG16Uint, - RG16Sint = WGPUTextureFormat_RG16Sint, - RG16Float = WGPUTextureFormat_RG16Float, - RGBA8Unorm = WGPUTextureFormat_RGBA8Unorm, - RGBA8UnormSrgb = WGPUTextureFormat_RGBA8UnormSrgb, - RGBA8Snorm = WGPUTextureFormat_RGBA8Snorm, - RGBA8Uint = WGPUTextureFormat_RGBA8Uint, - RGBA8Sint = WGPUTextureFormat_RGBA8Sint, - BGRA8Unorm = WGPUTextureFormat_BGRA8Unorm, - BGRA8UnormSrgb = WGPUTextureFormat_BGRA8UnormSrgb, - RGB10A2Uint = WGPUTextureFormat_RGB10A2Uint, - RGB10A2Unorm = WGPUTextureFormat_RGB10A2Unorm, - RG11B10Ufloat = WGPUTextureFormat_RG11B10Ufloat, - RGB9E5Ufloat = WGPUTextureFormat_RGB9E5Ufloat, - RG32Float = WGPUTextureFormat_RG32Float, - RG32Uint = WGPUTextureFormat_RG32Uint, - RG32Sint = WGPUTextureFormat_RG32Sint, - RGBA16Unorm = WGPUTextureFormat_RGBA16Unorm, - RGBA16Snorm = WGPUTextureFormat_RGBA16Snorm, - RGBA16Uint = WGPUTextureFormat_RGBA16Uint, - RGBA16Sint = WGPUTextureFormat_RGBA16Sint, - RGBA16Float = WGPUTextureFormat_RGBA16Float, - RGBA32Float = WGPUTextureFormat_RGBA32Float, - RGBA32Uint = WGPUTextureFormat_RGBA32Uint, - RGBA32Sint = WGPUTextureFormat_RGBA32Sint, - Stencil8 = WGPUTextureFormat_Stencil8, - Depth16Unorm = WGPUTextureFormat_Depth16Unorm, - Depth24Plus = WGPUTextureFormat_Depth24Plus, - Depth24PlusStencil8 = WGPUTextureFormat_Depth24PlusStencil8, - Depth32Float = WGPUTextureFormat_Depth32Float, - Depth32FloatStencil8 = WGPUTextureFormat_Depth32FloatStencil8, - BC1RGBAUnorm = WGPUTextureFormat_BC1RGBAUnorm, - BC1RGBAUnormSrgb = WGPUTextureFormat_BC1RGBAUnormSrgb, - BC2RGBAUnorm = WGPUTextureFormat_BC2RGBAUnorm, - BC2RGBAUnormSrgb = WGPUTextureFormat_BC2RGBAUnormSrgb, - BC3RGBAUnorm = WGPUTextureFormat_BC3RGBAUnorm, - BC3RGBAUnormSrgb = WGPUTextureFormat_BC3RGBAUnormSrgb, - BC4RUnorm = WGPUTextureFormat_BC4RUnorm, - BC4RSnorm = WGPUTextureFormat_BC4RSnorm, - BC5RGUnorm = WGPUTextureFormat_BC5RGUnorm, - BC5RGSnorm = WGPUTextureFormat_BC5RGSnorm, - BC6HRGBUfloat = WGPUTextureFormat_BC6HRGBUfloat, - BC6HRGBFloat = WGPUTextureFormat_BC6HRGBFloat, - BC7RGBAUnorm = WGPUTextureFormat_BC7RGBAUnorm, - BC7RGBAUnormSrgb = WGPUTextureFormat_BC7RGBAUnormSrgb, - ETC2RGB8Unorm = WGPUTextureFormat_ETC2RGB8Unorm, - ETC2RGB8UnormSrgb = WGPUTextureFormat_ETC2RGB8UnormSrgb, - ETC2RGB8A1Unorm = WGPUTextureFormat_ETC2RGB8A1Unorm, - ETC2RGB8A1UnormSrgb = WGPUTextureFormat_ETC2RGB8A1UnormSrgb, - ETC2RGBA8Unorm = WGPUTextureFormat_ETC2RGBA8Unorm, - ETC2RGBA8UnormSrgb = WGPUTextureFormat_ETC2RGBA8UnormSrgb, - EACR11Unorm = WGPUTextureFormat_EACR11Unorm, - EACR11Snorm = WGPUTextureFormat_EACR11Snorm, - EACRG11Unorm = WGPUTextureFormat_EACRG11Unorm, - EACRG11Snorm = WGPUTextureFormat_EACRG11Snorm, - ASTC4x4Unorm = WGPUTextureFormat_ASTC4x4Unorm, - ASTC4x4UnormSrgb = WGPUTextureFormat_ASTC4x4UnormSrgb, - ASTC5x4Unorm = WGPUTextureFormat_ASTC5x4Unorm, - ASTC5x4UnormSrgb = WGPUTextureFormat_ASTC5x4UnormSrgb, - ASTC5x5Unorm = WGPUTextureFormat_ASTC5x5Unorm, - ASTC5x5UnormSrgb = WGPUTextureFormat_ASTC5x5UnormSrgb, - ASTC6x5Unorm = WGPUTextureFormat_ASTC6x5Unorm, - ASTC6x5UnormSrgb = WGPUTextureFormat_ASTC6x5UnormSrgb, - ASTC6x6Unorm = WGPUTextureFormat_ASTC6x6Unorm, - ASTC6x6UnormSrgb = WGPUTextureFormat_ASTC6x6UnormSrgb, - ASTC8x5Unorm = WGPUTextureFormat_ASTC8x5Unorm, - ASTC8x5UnormSrgb = WGPUTextureFormat_ASTC8x5UnormSrgb, - ASTC8x6Unorm = WGPUTextureFormat_ASTC8x6Unorm, - ASTC8x6UnormSrgb = WGPUTextureFormat_ASTC8x6UnormSrgb, - ASTC8x8Unorm = WGPUTextureFormat_ASTC8x8Unorm, - ASTC8x8UnormSrgb = WGPUTextureFormat_ASTC8x8UnormSrgb, - ASTC10x5Unorm = WGPUTextureFormat_ASTC10x5Unorm, - ASTC10x5UnormSrgb = WGPUTextureFormat_ASTC10x5UnormSrgb, - ASTC10x6Unorm = WGPUTextureFormat_ASTC10x6Unorm, - ASTC10x6UnormSrgb = WGPUTextureFormat_ASTC10x6UnormSrgb, - ASTC10x8Unorm = WGPUTextureFormat_ASTC10x8Unorm, - ASTC10x8UnormSrgb = WGPUTextureFormat_ASTC10x8UnormSrgb, - ASTC10x10Unorm = WGPUTextureFormat_ASTC10x10Unorm, - ASTC10x10UnormSrgb = WGPUTextureFormat_ASTC10x10UnormSrgb, - ASTC12x10Unorm = WGPUTextureFormat_ASTC12x10Unorm, - ASTC12x10UnormSrgb = WGPUTextureFormat_ASTC12x10UnormSrgb, - ASTC12x12Unorm = WGPUTextureFormat_ASTC12x12Unorm, - ASTC12x12UnormSrgb = WGPUTextureFormat_ASTC12x12UnormSrgb, - R8BG8Biplanar420Unorm = WGPUTextureFormat_R8BG8Biplanar420Unorm, - R10X6BG10X6Biplanar420Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar420Unorm, - R8BG8A8Triplanar420Unorm = WGPUTextureFormat_R8BG8A8Triplanar420Unorm, - R8BG8Biplanar422Unorm = WGPUTextureFormat_R8BG8Biplanar422Unorm, - R8BG8Biplanar444Unorm = WGPUTextureFormat_R8BG8Biplanar444Unorm, - R10X6BG10X6Biplanar422Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar422Unorm, - R10X6BG10X6Biplanar444Unorm = WGPUTextureFormat_R10X6BG10X6Biplanar444Unorm, - OpaqueYCbCrAndroid = WGPUTextureFormat_OpaqueYCbCrAndroid, -}; -static_assert(sizeof(TextureFormat) == sizeof(WGPUTextureFormat), "sizeof mismatch for TextureFormat"); -static_assert(alignof(TextureFormat) == alignof(WGPUTextureFormat), "alignof mismatch for TextureFormat"); - -enum class TextureSampleType : uint32_t { - BindingNotUsed = WGPUTextureSampleType_BindingNotUsed, - Undefined = WGPUTextureSampleType_Undefined, - Float = WGPUTextureSampleType_Float, - UnfilterableFloat = WGPUTextureSampleType_UnfilterableFloat, - Depth = WGPUTextureSampleType_Depth, - Sint = WGPUTextureSampleType_Sint, - Uint = WGPUTextureSampleType_Uint, -}; -static_assert(sizeof(TextureSampleType) == sizeof(WGPUTextureSampleType), "sizeof mismatch for TextureSampleType"); -static_assert(alignof(TextureSampleType) == alignof(WGPUTextureSampleType), "alignof mismatch for TextureSampleType"); - -enum class TextureViewDimension : uint32_t { - Undefined = WGPUTextureViewDimension_Undefined, - e1D = WGPUTextureViewDimension_1D, - e2D = WGPUTextureViewDimension_2D, - e2DArray = WGPUTextureViewDimension_2DArray, - Cube = WGPUTextureViewDimension_Cube, - CubeArray = WGPUTextureViewDimension_CubeArray, - e3D = WGPUTextureViewDimension_3D, -}; -static_assert(sizeof(TextureViewDimension) == sizeof(WGPUTextureViewDimension), "sizeof mismatch for TextureViewDimension"); -static_assert(alignof(TextureViewDimension) == alignof(WGPUTextureViewDimension), "alignof mismatch for TextureViewDimension"); - -enum class ToneMappingMode : uint32_t { - Standard = WGPUToneMappingMode_Standard, - Extended = WGPUToneMappingMode_Extended, -}; -static_assert(sizeof(ToneMappingMode) == sizeof(WGPUToneMappingMode), "sizeof mismatch for ToneMappingMode"); -static_assert(alignof(ToneMappingMode) == alignof(WGPUToneMappingMode), "alignof mismatch for ToneMappingMode"); - -enum class VertexFormat : uint32_t { - Uint8 = WGPUVertexFormat_Uint8, - Uint8x2 = WGPUVertexFormat_Uint8x2, - Uint8x4 = WGPUVertexFormat_Uint8x4, - Sint8 = WGPUVertexFormat_Sint8, - Sint8x2 = WGPUVertexFormat_Sint8x2, - Sint8x4 = WGPUVertexFormat_Sint8x4, - Unorm8 = WGPUVertexFormat_Unorm8, - Unorm8x2 = WGPUVertexFormat_Unorm8x2, - Unorm8x4 = WGPUVertexFormat_Unorm8x4, - Snorm8 = WGPUVertexFormat_Snorm8, - Snorm8x2 = WGPUVertexFormat_Snorm8x2, - Snorm8x4 = WGPUVertexFormat_Snorm8x4, - Uint16 = WGPUVertexFormat_Uint16, - Uint16x2 = WGPUVertexFormat_Uint16x2, - Uint16x4 = WGPUVertexFormat_Uint16x4, - Sint16 = WGPUVertexFormat_Sint16, - Sint16x2 = WGPUVertexFormat_Sint16x2, - Sint16x4 = WGPUVertexFormat_Sint16x4, - Unorm16 = WGPUVertexFormat_Unorm16, - Unorm16x2 = WGPUVertexFormat_Unorm16x2, - Unorm16x4 = WGPUVertexFormat_Unorm16x4, - Snorm16 = WGPUVertexFormat_Snorm16, - Snorm16x2 = WGPUVertexFormat_Snorm16x2, - Snorm16x4 = WGPUVertexFormat_Snorm16x4, - Float16 = WGPUVertexFormat_Float16, - Float16x2 = WGPUVertexFormat_Float16x2, - Float16x4 = WGPUVertexFormat_Float16x4, - Float32 = WGPUVertexFormat_Float32, - Float32x2 = WGPUVertexFormat_Float32x2, - Float32x3 = WGPUVertexFormat_Float32x3, - Float32x4 = WGPUVertexFormat_Float32x4, - Uint32 = WGPUVertexFormat_Uint32, - Uint32x2 = WGPUVertexFormat_Uint32x2, - Uint32x3 = WGPUVertexFormat_Uint32x3, - Uint32x4 = WGPUVertexFormat_Uint32x4, - Sint32 = WGPUVertexFormat_Sint32, - Sint32x2 = WGPUVertexFormat_Sint32x2, - Sint32x3 = WGPUVertexFormat_Sint32x3, - Sint32x4 = WGPUVertexFormat_Sint32x4, - Unorm10_10_10_2 = WGPUVertexFormat_Unorm10_10_10_2, - Unorm8x4BGRA = WGPUVertexFormat_Unorm8x4BGRA, -}; -static_assert(sizeof(VertexFormat) == sizeof(WGPUVertexFormat), "sizeof mismatch for VertexFormat"); -static_assert(alignof(VertexFormat) == alignof(WGPUVertexFormat), "alignof mismatch for VertexFormat"); - -enum class VertexStepMode : uint32_t { - Undefined = WGPUVertexStepMode_Undefined, - Vertex = WGPUVertexStepMode_Vertex, - Instance = WGPUVertexStepMode_Instance, -}; -static_assert(sizeof(VertexStepMode) == sizeof(WGPUVertexStepMode), "sizeof mismatch for VertexStepMode"); -static_assert(alignof(VertexStepMode) == alignof(WGPUVertexStepMode), "alignof mismatch for VertexStepMode"); - -enum class WaitStatus : uint32_t { - Success = WGPUWaitStatus_Success, - TimedOut = WGPUWaitStatus_TimedOut, - Error = WGPUWaitStatus_Error, -}; -static_assert(sizeof(WaitStatus) == sizeof(WGPUWaitStatus), "sizeof mismatch for WaitStatus"); -static_assert(alignof(WaitStatus) == alignof(WGPUWaitStatus), "alignof mismatch for WaitStatus"); - -enum class WGSLLanguageFeatureName : uint32_t { - ReadonlyAndReadwriteStorageTextures = WGPUWGSLLanguageFeatureName_ReadonlyAndReadwriteStorageTextures, - Packed4x8IntegerDotProduct = WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct, - UnrestrictedPointerParameters = WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters, - PointerCompositeAccess = WGPUWGSLLanguageFeatureName_PointerCompositeAccess, - UniformBufferStandardLayout = WGPUWGSLLanguageFeatureName_UniformBufferStandardLayout, - SubgroupId = WGPUWGSLLanguageFeatureName_SubgroupId, - TextureAndSamplerLet = WGPUWGSLLanguageFeatureName_TextureAndSamplerLet, - SubgroupUniformity = WGPUWGSLLanguageFeatureName_SubgroupUniformity, - TextureFormatsTier1 = WGPUWGSLLanguageFeatureName_TextureFormatsTier1, - LinearIndexing = WGPUWGSLLanguageFeatureName_LinearIndexing, - ImmediateAddressSpace = WGPUWGSLLanguageFeatureName_ImmediateAddressSpace, - ChromiumTestingUnimplemented = WGPUWGSLLanguageFeatureName_ChromiumTestingUnimplemented, - ChromiumTestingUnsafeExperimental = WGPUWGSLLanguageFeatureName_ChromiumTestingUnsafeExperimental, - ChromiumTestingExperimental = WGPUWGSLLanguageFeatureName_ChromiumTestingExperimental, - ChromiumTestingShippedWithKillswitch = WGPUWGSLLanguageFeatureName_ChromiumTestingShippedWithKillswitch, - ChromiumTestingShipped = WGPUWGSLLanguageFeatureName_ChromiumTestingShipped, - SizedBindingArray = WGPUWGSLLanguageFeatureName_SizedBindingArray, - TexelBuffers = WGPUWGSLLanguageFeatureName_TexelBuffers, - ChromiumPrint = WGPUWGSLLanguageFeatureName_ChromiumPrint, - FragmentDepth = WGPUWGSLLanguageFeatureName_FragmentDepth, - BufferView = WGPUWGSLLanguageFeatureName_BufferView, - SwizzleAssignment = WGPUWGSLLanguageFeatureName_SwizzleAssignment, -}; -static_assert(sizeof(WGSLLanguageFeatureName) == sizeof(WGPUWGSLLanguageFeatureName), "sizeof mismatch for WGSLLanguageFeatureName"); -static_assert(alignof(WGSLLanguageFeatureName) == alignof(WGPUWGSLLanguageFeatureName), "alignof mismatch for WGSLLanguageFeatureName"); - - -enum class BufferUsage : uint64_t { - None = WGPUBufferUsage_None, - MapRead = WGPUBufferUsage_MapRead, - MapWrite = WGPUBufferUsage_MapWrite, - CopySrc = WGPUBufferUsage_CopySrc, - CopyDst = WGPUBufferUsage_CopyDst, - Index = WGPUBufferUsage_Index, - Vertex = WGPUBufferUsage_Vertex, - Uniform = WGPUBufferUsage_Uniform, - Storage = WGPUBufferUsage_Storage, - Indirect = WGPUBufferUsage_Indirect, - QueryResolve = WGPUBufferUsage_QueryResolve, - TexelBuffer = WGPUBufferUsage_TexelBuffer, -}; -static_assert(sizeof(BufferUsage) == sizeof(WGPUBufferUsage), "sizeof mismatch for BufferUsage"); -static_assert(alignof(BufferUsage) == alignof(WGPUBufferUsage), "alignof mismatch for BufferUsage"); - -enum class ColorWriteMask : uint64_t { - None = WGPUColorWriteMask_None, - Red = WGPUColorWriteMask_Red, - Green = WGPUColorWriteMask_Green, - Blue = WGPUColorWriteMask_Blue, - Alpha = WGPUColorWriteMask_Alpha, - All = WGPUColorWriteMask_All, -}; -static_assert(sizeof(ColorWriteMask) == sizeof(WGPUColorWriteMask), "sizeof mismatch for ColorWriteMask"); -static_assert(alignof(ColorWriteMask) == alignof(WGPUColorWriteMask), "alignof mismatch for ColorWriteMask"); - -enum class HeapProperty : uint64_t { - None = WGPUHeapProperty_None, - DeviceLocal = WGPUHeapProperty_DeviceLocal, - HostVisible = WGPUHeapProperty_HostVisible, - HostCoherent = WGPUHeapProperty_HostCoherent, - HostUncached = WGPUHeapProperty_HostUncached, - HostCached = WGPUHeapProperty_HostCached, -}; -static_assert(sizeof(HeapProperty) == sizeof(WGPUHeapProperty), "sizeof mismatch for HeapProperty"); -static_assert(alignof(HeapProperty) == alignof(WGPUHeapProperty), "alignof mismatch for HeapProperty"); - -enum class MapMode : uint64_t { - None = WGPUMapMode_None, - Read = WGPUMapMode_Read, - Write = WGPUMapMode_Write, -}; -static_assert(sizeof(MapMode) == sizeof(WGPUMapMode), "sizeof mismatch for MapMode"); -static_assert(alignof(MapMode) == alignof(WGPUMapMode), "alignof mismatch for MapMode"); - -enum class ShaderStage : uint64_t { - None = WGPUShaderStage_None, - Vertex = WGPUShaderStage_Vertex, - Fragment = WGPUShaderStage_Fragment, - Compute = WGPUShaderStage_Compute, -}; -static_assert(sizeof(ShaderStage) == sizeof(WGPUShaderStage), "sizeof mismatch for ShaderStage"); -static_assert(alignof(ShaderStage) == alignof(WGPUShaderStage), "alignof mismatch for ShaderStage"); - -enum class TextureUsage : uint64_t { - None = WGPUTextureUsage_None, - CopySrc = WGPUTextureUsage_CopySrc, - CopyDst = WGPUTextureUsage_CopyDst, - TextureBinding = WGPUTextureUsage_TextureBinding, - StorageBinding = WGPUTextureUsage_StorageBinding, - RenderAttachment = WGPUTextureUsage_RenderAttachment, - TransientAttachment = WGPUTextureUsage_TransientAttachment, - StorageAttachment = WGPUTextureUsage_StorageAttachment, -}; -static_assert(sizeof(TextureUsage) == sizeof(WGPUTextureUsage), "sizeof mismatch for TextureUsage"); -static_assert(alignof(TextureUsage) == alignof(WGPUTextureUsage), "alignof mismatch for TextureUsage"); - - -// TODO(crbug.com/42241461): Update these to not be using the C callback types, and instead be -// defined using C++ types instead. Note that when we remove these, the C++ callback info types -// should also all be removed as they will no longer be necessary given the C++ templated -// functions calls and setter utilities. -using Callback = WGPUCallback; -using DawnLoadCacheDataFunction = WGPUDawnLoadCacheDataFunction; -using DawnStoreCacheDataFunction = WGPUDawnStoreCacheDataFunction; -using Proc = WGPUProc; - -// 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); -}; - -// Special class for optional booleans in order to allow conversions. -class OptionalBool { - public: - constexpr OptionalBool() = default; - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(bool value) : mValue(static_cast(value)) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(std::optional value) : - mValue(value ? static_cast(*value) : WGPUOptionalBool_Undefined) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr OptionalBool(WGPUOptionalBool value): mValue(value) {} - - // Define the values that are equivalent to the enums. - static const OptionalBool False; - static const OptionalBool True; - static const OptionalBool Undefined; - - // Assignment operators. - OptionalBool& operator=(const bool& value) { - mValue = static_cast(value); - return *this; - } - OptionalBool& operator=(const std::optional& value) { - mValue = value ? static_cast(*value) : WGPUOptionalBool_Undefined; - return *this; - } - OptionalBool& operator=(const WGPUOptionalBool& value) { - mValue = value; - return *this; - } - - // Conversion functions. - operator WGPUOptionalBool() const { return mValue; } - operator std::optional() const { - if (mValue == WGPUOptionalBool_Undefined) { - return std::nullopt; - } - return static_cast(mValue); - } - - // Comparison functions. - friend bool operator==(const OptionalBool& lhs, const OptionalBool& rhs) { - return lhs.mValue == rhs.mValue; - } - friend bool operator!=(const OptionalBool& lhs, const OptionalBool& rhs) { - return lhs.mValue != rhs.mValue; - } - - private: - friend struct std::hash; - // Default to undefined. - WGPUOptionalBool mValue = WGPUOptionalBool_Undefined; -}; -inline const OptionalBool OptionalBool::False = OptionalBool(WGPUOptionalBool_False); -inline const OptionalBool OptionalBool::True = OptionalBool(WGPUOptionalBool_True); -inline const OptionalBool OptionalBool::Undefined = OptionalBool(WGPUOptionalBool_Undefined); - -// Helper class to wrap Status which allows implicit conversion to bool. -// Used while callers switch to checking the Status enum instead of booleans. -// TODO(crbug.com/42241199): Remove when all callers check the enum. -struct ConvertibleStatus { - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - constexpr ConvertibleStatus(Status status) : status(status) {} - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - constexpr operator bool() const { - return status == Status::Success; - } - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - constexpr operator Status() const { - return status; - } - Status status; -}; - -template -class ObjectBase { - public: - ObjectBase() = default; - ObjectBase(CType handle): mHandle(handle) { - if (mHandle) Derived::WGPUAddRef(mHandle); - } - ~ObjectBase() { - if (mHandle) Derived::WGPURelease(mHandle); - } - - ObjectBase(ObjectBase const& other) - : ObjectBase(other.Get()) { - } - Derived& operator=(ObjectBase const& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - if (mHandle) Derived::WGPUAddRef(mHandle); - } - - return static_cast(*this); - } - - ObjectBase(ObjectBase&& other) { - mHandle = other.mHandle; - other.mHandle = 0; - } - Derived& operator=(ObjectBase&& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - other.mHandle = 0; - } - - return static_cast(*this); - } - - ObjectBase(std::nullptr_t) {} - Derived& operator=(std::nullptr_t) { - if (mHandle != nullptr) { - Derived::WGPURelease(mHandle); - mHandle = nullptr; - } - return static_cast(*this); - } - - bool operator==(std::nullptr_t) const { - return mHandle == nullptr; - } - bool operator!=(std::nullptr_t) const { - return mHandle != nullptr; - } - - explicit operator bool() const { - return mHandle != nullptr; - } - CType Get() const { - return mHandle; - } - CType MoveToCHandle() { - CType result = mHandle; - mHandle = 0; - return result; - } - static Derived Acquire(CType handle) { - Derived result; - result.mHandle = handle; - return result; - } - - protected: - CType mHandle = nullptr; -}; -namespace dawn::wire::client { - -class Adapter; -class BindGroup; -class BindGroupLayout; -class Buffer; -class CommandBuffer; -class CommandEncoder; -class ComputePipeline; -class Device; -class ExternalTexture; -class Instance; -class PipelineLayout; -class QuerySet; -class Queue; -class RenderBundle; -class RenderPipeline; -class ResourceTable; -class Sampler; -class ShaderModule; -class SharedBufferMemory; -class SharedFence; -class SharedTextureMemory; -class Surface; -class TexelBufferView; -class Texture; -class TextureView; -class ComputePassEncoder; -class RenderBundleEncoder; -class RenderPassEncoder; - -struct StringView; -struct AdapterPropertiesD3D; -struct AdapterPropertiesDrm; -struct AdapterPropertiesVk; -struct AdapterPropertiesWGPU; -struct BindingResource; -struct BlendComponent; -struct BufferBindingLayout; -struct BufferHostMappedPointer; -struct Color; -struct ColorSpaceDawn; -struct ColorTargetStateExpandResolveTextureDawn; -struct CommandBufferDescriptor; -struct CompatibilityModeLimits; -struct ConstantEntry; -struct CopyTextureForBrowserOptions; -struct DawnAdapterPropertiesPowerPreference; -struct DawnBufferDescriptorErrorInfoFromWireClient; -struct DawnCacheDeviceDescriptor; -struct DawnCompilationMessageUtf16; -struct DawnConsumeAdapterDescriptor; -struct DawnDeviceAllocatorControl; -struct DawnDrmFormatProperties; -struct DawnEncoderInternalUsageDescriptor; -struct DawnFakeBufferOOMForTesting; -struct DawnFakeDeviceInitializeErrorForTesting; -struct DawnHostMappedPointerLimits; -struct DawnInjectedInvalidSType; -struct DawnRenderPassSampleCount; -struct DawnShaderModuleSPIRVOptionsDescriptor; -struct DawnTexelCopyBufferRowAlignmentLimits; -struct DawnTextureInternalUsageDescriptor; -struct DawnTogglesDescriptor; -struct DawnWGSLBlocklist; -struct DawnWireWGSLControl; -struct Extent2D; -struct Extent3D; -struct ExternalTextureBindingEntry; -struct ExternalTextureBindingLayout; -struct Future; -struct InstanceLimits; -struct MemoryHeapInfo; -struct MultisampleState; -struct Origin2D; -struct Origin3D; -struct PassTimestampWrites; -struct PipelineLayoutResourceTable; -struct PipelineLayoutStorageAttachment; -struct PrimitiveState; -struct QuerySetDescriptor; -struct QueueDescriptor; -struct RenderBundleDescriptor; -struct RenderBundleEncoderDescriptor; -struct RenderPassDepthStencilAttachment; -struct RenderPassDescriptorResolveRect; -struct RenderPassMaxDrawCount; -struct RequestAdapterWebGPUBackendOptions; -struct RequestAdapterWebXROptions; -struct ResourceTableDescriptor; -struct SamplerBindingLayout; -struct ShaderModuleCompilationOptions; -struct ShaderSourceSPIRV; -struct ShaderSourceWGSL; -struct SharedBufferMemoryBeginAccessDescriptor; -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor; -struct SharedBufferMemoryEndAccessState; -struct SharedBufferMemoryProperties; -struct SharedFenceDXGISharedHandleDescriptor; -struct SharedFenceDXGISharedHandleExportInfo; -struct SharedFenceEGLSyncDescriptor; -struct SharedFenceEGLSyncExportInfo; -struct SharedFenceMTLSharedEventDescriptor; -struct SharedFenceMTLSharedEventExportInfo; -struct SharedFenceSyncFDDescriptor; -struct SharedFenceSyncFDExportInfo; -struct SharedFenceVkSemaphoreOpaqueFDDescriptor; -struct SharedFenceVkSemaphoreOpaqueFDExportInfo; -struct SharedFenceVkSemaphoreZirconHandleDescriptor; -struct SharedFenceVkSemaphoreZirconHandleExportInfo; -struct SharedTextureMemoryAHardwareBufferDescriptor; -struct SharedTextureMemoryD3D11BeginState; -struct SharedTextureMemoryD3DSwapchainBeginState; -struct SharedTextureMemoryDmaBufPlane; -struct SharedTextureMemoryDXGISharedHandleDescriptor; -struct SharedTextureMemoryEGLImageDescriptor; -struct SharedTextureMemoryIOSurfaceDescriptor; -struct SharedTextureMemoryOpaqueFDDescriptor; -struct SharedTextureMemoryVkDedicatedAllocationDescriptor; -struct SharedTextureMemoryVkImageLayoutBeginState; -struct SharedTextureMemoryVkImageLayoutEndState; -struct SharedTextureMemoryZirconHandleDescriptor; -struct StaticSamplerBindingLayout; -struct StencilFaceState; -struct StorageTextureBindingLayout; -struct SubgroupMatrixConfig; -struct SupportedFeatures; -struct SupportedInstanceFeatures; -struct SupportedWGSLLanguageFeatures; -struct SurfaceCapabilities; -struct SurfaceColorManagement; -struct SurfaceConfiguration; -struct SurfaceDescriptorFromWindowsCoreWindow; -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel; -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel; -struct SurfaceSourceAndroidNativeWindow; -struct SurfaceSourceMetalLayer; -struct SurfaceSourceWaylandSurface; -struct SurfaceSourceWindowsHWND; -struct SurfaceSourceXCBWindow; -struct SurfaceSourceXlibWindow; -struct SurfaceTexture; -struct TexelBufferBindingEntry; -struct TexelBufferBindingLayout; -struct TexelBufferViewDescriptor; -struct TexelCopyBufferLayout; -struct TextureBindingLayout; -struct TextureBindingViewDimension; -struct TextureComponentSwizzle; -struct VertexAttribute; -struct YCbCrVkDescriptor; -struct AdapterPropertiesMemoryHeaps; -struct AdapterPropertiesSubgroupMatrixConfigs; -struct AHardwareBufferProperties; -struct BindGroupEntry; -struct BindGroupLayoutEntry; -struct BlendState; -struct BufferDescriptor; -struct CommandEncoderDescriptor; -struct CompilationMessage; -struct ComputePassDescriptor; -struct ComputeState; -struct DawnDrmFormatCapabilities; -struct DepthStencilState; -struct ExternalTextureDescriptor; -struct FutureWaitInfo; -struct ImageCopyExternalTexture; -struct InstanceDescriptor; -struct Limits; -struct PipelineLayoutPixelLocalStorage; -struct RenderPassColorAttachment; -struct RenderPassRenderAreaRect; -struct RenderPassStorageAttachment; -struct RequestAdapterOptions; -struct SamplerDescriptor; -struct ShaderModuleDescriptor; -struct SharedBufferMemoryDescriptor; -struct SharedFenceDescriptor; -struct SharedFenceExportInfo; -struct SharedTextureMemoryAHardwareBufferProperties; -struct SharedTextureMemoryBeginAccessDescriptor; -struct SharedTextureMemoryDmaBufDescriptor; -struct SharedTextureMemoryMetalEndAccessState; -struct SurfaceDescriptor; -struct TexelCopyBufferInfo; -struct TexelCopyTextureInfo; -struct TextureComponentSwizzleDescriptor; -struct TextureDescriptor; -struct VertexBufferLayout; -struct AdapterInfo; -struct BindGroupDescriptor; -struct BindGroupLayoutDescriptor; -struct ColorTargetState; -struct CompilationInfo; -struct ComputePipelineDescriptor; -struct DawnFormatCapabilities; -struct DeviceDescriptor; -struct PipelineLayoutDescriptor; -struct RenderPassPixelLocalStorage; -struct SharedTextureMemoryDescriptor; -struct SharedTextureMemoryEndAccessState; -struct SharedTextureMemoryProperties; -struct TextureViewDescriptor; -struct VertexState; -struct FragmentState; -struct RenderPassDescriptor; -struct RenderPipelineDescriptor; - -// TODO(42241188): Remove once all clients use StringView versions of the callbacks. -// To make MSVC happy we need a StringView constructor from the adapter, so we first need to -// forward declare StringViewAdapter here. Otherwise MSVC complains about an ambiguous conversion. -namespace detail { - struct StringViewAdapter; -} // namespace detail - -struct StringView { - char const * data = nullptr; - size_t length = WGPU_STRLEN; - - inline constexpr StringView() noexcept = default; - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(const std::string_view& sv) noexcept { - this->data = sv.data(); - this->length = sv.length(); - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(const char* s) { - this->data = s; - this->length = WGPU_STRLEN; // use strlen - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(WGPUStringView s) { - this->data = s.data; - this->length = s.length; - } - - inline constexpr StringView(const char* data, size_t length) { - this->data = data; - this->length = length; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(std::nullptr_t) { - this->data = nullptr; - this->length = WGPU_STRLEN; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit construction - inline constexpr StringView(std::nullopt_t) { - this->data = nullptr; - this->length = WGPU_STRLEN; - } - - bool IsUndefined() const { - return this->data == nullptr && this->length == wgpu::kStrlen; - } - - // NOLINTNEXTLINE(runtime/explicit) allow implicit conversion - operator std::string_view() const { - if (this->length == wgpu::kStrlen) { - if (IsUndefined()) { - return {}; - } - return {this->data}; - } - return {this->data, this->length}; - } - - template >> - explicit operator View() const { - if (this->length == wgpu::kStrlen) { - if (IsUndefined()) { - return {}; - } - return {this->data}; - } - return {this->data, this->length}; - } - - - StringView(const detail::StringViewAdapter& s); -}; - -namespace detail { -constexpr size_t ConstexprMax(size_t a, size_t b) { - return a > b ? a : b; -} - -template -static T& AsNonConstReference(const T& value) { - return const_cast(value); -} - -// A wrapper around StringView that can be implicitly converted to const char* with temporary -// storage that adds the \0 for output strings that are all explicitly-sized. -// TODO(42241188): Remove once all clients use StringView versions of the callbacks. -struct StringViewAdapter { - WGPUStringView sv; - char* nullTerminated = nullptr; - - StringViewAdapter(WGPUStringView sv) : sv(sv) {} - ~StringViewAdapter() { delete[] nullTerminated; } - operator ::WGPUStringView() { return sv; } - operator StringView() { return {sv.data, sv.length}; } - operator const char*() { - assert(sv.length != WGPU_STRLEN); - assert(nullTerminated == nullptr); - nullTerminated = new char[sv.length + 1]; - for (size_t i = 0; i < sv.length; i++) { - nullTerminated[i] = sv.data[i]; - } - nullTerminated[sv.length] = 0; - return nullTerminated; - } -}; -} // namespace detail - -inline StringView::StringView(const detail::StringViewAdapter& s): data(s.sv.data), length(s.sv.length) {} - -namespace detail { -// For callbacks, we support two modes: -// 1) No userdata where we allow a std::function type that can include argument captures. -// 2) Explicit typed userdata where we only allow non-capturing lambdas or function pointers. -template -struct CallbackTypeBase; -template -struct CallbackTypeBase> { - using Callback = std::function; -}; -template -struct CallbackTypeBase, void> { - using Callback = R (Args...); -}; -template -struct CallbackTypeBase, T> { - using Callback = R (Args..., T); -}; -} // namespace detail -template -using BufferMapCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CompilationInfoCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CreateComputePipelineAsyncCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using CreateRenderPipelineAsyncCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using DawnLoadCacheDataCallback = typename detail::CallbackTypeBase< - size_t, - std::tuple, T...>::Callback; -template -using DawnStoreCacheDataCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using LoggingCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using PopErrorScopeCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using QueueWorkDoneCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using RequestAdapterCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using RequestDeviceCallback = typename detail::CallbackTypeBase< - void, - std::tuple, T...>::Callback; -template -using DeviceLostCallback = typename detail::CallbackTypeBase, T...>::Callback; -template -using UncapturedErrorCallback = typename detail::CallbackTypeBase, T...>::Callback; - -class Adapter : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline Device CreateDevice(DeviceDescriptor const * descriptor = nullptr) const; - inline void GetFeatures(SupportedFeatures * features) const; - inline ConvertibleStatus GetFormatCapabilities(TextureFormat format, DawnFormatCapabilities * capabilities) const; - inline ConvertibleStatus GetInfo(AdapterInfo * info) const; - inline Instance GetInstance() const; - inline ConvertibleStatus GetLimits(Limits * limits) const; - inline Bool HasFeature(FeatureName feature) const; - template - Future RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUAdapter handle); - static inline void WGPURelease(WGPUAdapter handle); -}; - -class BindGroup : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBindGroup handle); - static inline void WGPURelease(WGPUBindGroup handle); -}; - -class BindGroupLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBindGroupLayout handle); - static inline void WGPURelease(WGPUBindGroupLayout handle); -}; - -class Buffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline TexelBufferView CreateTexelView(TexelBufferViewDescriptor const * descriptor) const; - inline void Destroy() const; - inline void const * GetConstMappedRange(size_t offset = 0, size_t size = kWholeMapSize) const; - inline void * GetMappedRange(size_t offset = 0, size_t size = kWholeMapSize) const; - inline BufferMapState GetMapState() const; - inline uint64_t GetSize() const; - inline BufferUsage GetUsage() const; - template - Future MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback, T userdata) const; - template - Future MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback) const; - inline ConvertibleStatus ReadMappedRange(size_t offset, void * data, size_t size) const; - inline void SetLabel(StringView label) const; - inline void Unmap() const; - inline ConvertibleStatus WriteMappedRange(size_t offset, void const * data, size_t size) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUBuffer handle); - static inline void WGPURelease(WGPUBuffer handle); -}; - -class CommandBuffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUCommandBuffer handle); - static inline void WGPURelease(WGPUCommandBuffer handle); -}; - -class CommandEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ComputePassEncoder BeginComputePass(ComputePassDescriptor const * descriptor = nullptr) const; - inline RenderPassEncoder BeginRenderPass(RenderPassDescriptor const * descriptor) const; - inline void ClearBuffer(Buffer const& buffer, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const; - inline void CopyBufferToTexture(TexelCopyBufferInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const; - inline void CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const; - inline void CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const; - inline CommandBuffer Finish(CommandBufferDescriptor const * descriptor = nullptr) const; - inline void InjectValidationError(StringView message) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const; - inline void SetLabel(StringView label) const; - inline void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUCommandEncoder handle); - static inline void WGPURelease(WGPUCommandEncoder handle); -}; - -class ComputePipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUComputePipeline handle); - static inline void WGPURelease(WGPUComputePipeline handle); -}; - -class Device : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroup CreateBindGroup(BindGroupDescriptor const * descriptor) const; - inline BindGroupLayout CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const; - inline Buffer CreateBuffer(BufferDescriptor const * descriptor) const; - inline CommandEncoder CreateCommandEncoder(CommandEncoderDescriptor const * descriptor = nullptr) const; - inline ComputePipeline CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const; - template - Future CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - inline Buffer CreateErrorBuffer(BufferDescriptor const * descriptor) const; - inline ExternalTexture CreateErrorExternalTexture() const; - inline ShaderModule CreateErrorShaderModule(ShaderModuleDescriptor const * descriptor, StringView errorMessage) const; - inline Texture CreateErrorTexture(TextureDescriptor const * descriptor) const; - inline ExternalTexture CreateExternalTexture(ExternalTextureDescriptor const * externalTextureDescriptor) const; - inline PipelineLayout CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const; - inline QuerySet CreateQuerySet(QuerySetDescriptor const * descriptor) const; - inline RenderBundleEncoder CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const; - inline RenderPipeline CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const; - template - Future CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const; - template - Future CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const; - inline ResourceTable CreateResourceTable(ResourceTableDescriptor const * descriptor) const; - inline Sampler CreateSampler(SamplerDescriptor const * descriptor = nullptr) const; - inline ShaderModule CreateShaderModule(ShaderModuleDescriptor const * descriptor) const; - inline Texture CreateTexture(TextureDescriptor const * descriptor) const; - inline void Destroy() const; - inline void ForceLoss(DeviceLostReason type, StringView message) const; - inline Adapter GetAdapter() const; - inline ConvertibleStatus GetAdapterInfo(AdapterInfo * adapterInfo) const; - inline ConvertibleStatus GetAHardwareBufferProperties(void * handle, AHardwareBufferProperties * properties) const; - inline void GetFeatures(SupportedFeatures * features) const; - inline ConvertibleStatus GetLimits(Limits * limits) const; - inline Future GetLostFuture() const; - inline Queue GetQueue() const; - inline Bool HasFeature(FeatureName feature) const; - inline SharedBufferMemory ImportSharedBufferMemory(SharedBufferMemoryDescriptor const * descriptor) const; - inline SharedFence ImportSharedFence(SharedFenceDescriptor const * descriptor) const; - inline SharedTextureMemory ImportSharedTextureMemory(SharedTextureMemoryDescriptor const * descriptor) const; - inline void InjectError(ErrorType type, StringView message) const; - template - Future PopErrorScope(CallbackMode callbackMode, F callback, T userdata) const; - template - Future PopErrorScope(CallbackMode callbackMode, F callback) const; - inline void PushErrorScope(ErrorFilter filter) const; - inline void SetLabel(StringView label) const; - template - void SetLoggingCallback(F callback, T userdata) const; - template - void SetLoggingCallback(F callback) const; - inline void Tick() const; - inline void ValidateTextureDescriptor(TextureDescriptor const * descriptor) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUDevice handle); - static inline void WGPURelease(WGPUDevice handle); -}; - -class ExternalTexture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline void Expire() const; - inline void Refresh() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUExternalTexture handle); - static inline void WGPURelease(WGPUExternalTexture handle); -}; - -class Instance : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline Surface CreateSurface(SurfaceDescriptor const * descriptor) const; - inline void GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const; - inline Bool HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const; - inline void ProcessEvents() const; - template - Future RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback, T userdata) const; - template - Future RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback) const; - inline WaitStatus WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const; - - inline WaitStatus WaitAny(Future f, uint64_t timeout) const; - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUInstance handle); - static inline void WGPURelease(WGPUInstance handle); -}; - -class PipelineLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUPipelineLayout handle); - static inline void WGPURelease(WGPUPipelineLayout handle); -}; - -class QuerySet : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline uint32_t GetCount() const; - inline QueryType GetType() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUQuerySet handle); - static inline void WGPURelease(WGPUQuerySet handle); -}; - -class Queue : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void CopyExternalTextureForBrowser(ImageCopyExternalTexture const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - inline void CopyTextureForBrowser(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - template - Future OnSubmittedWorkDone(CallbackMode callbackMode, F callback, T userdata) const; - template - Future OnSubmittedWorkDone(CallbackMode callbackMode, F callback) const; - inline void SetLabel(StringView label) const; - inline void Submit(size_t commandCount, CommandBuffer const * commands) const; - inline void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const; - inline void WriteTexture(TexelCopyTextureInfo const * destination, void const * data, size_t dataSize, TexelCopyBufferLayout const * dataLayout, Extent3D const * writeSize) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUQueue handle); - static inline void WGPURelease(WGPUQueue handle); -}; - -class RenderBundle : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderBundle handle); - static inline void WGPURelease(WGPURenderBundle handle); -}; - -class RenderPipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderPipeline handle); - static inline void WGPURelease(WGPURenderPipeline handle); -}; - -class ResourceTable : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Destroy() const; - inline uint32_t GetSize() const; - inline uint32_t InsertBinding(BindingResource const * resource) const; - inline ConvertibleStatus RemoveBinding(uint32_t slot) const; - inline void SetLabel(StringView label) const; - inline ConvertibleStatus Update(uint32_t slot, BindingResource const * resource) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUResourceTable handle); - static inline void WGPURelease(WGPUResourceTable handle); -}; - -class Sampler : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSampler handle); - static inline void WGPURelease(WGPUSampler handle); -}; - -class ShaderModule : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - template - Future GetCompilationInfo(CallbackMode callbackMode, F callback, T userdata) const; - template - Future GetCompilationInfo(CallbackMode callbackMode, F callback) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUShaderModule handle); - static inline void WGPURelease(WGPUShaderModule handle); -}; - -class SharedBufferMemory : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ConvertibleStatus BeginAccess(Buffer const& buffer, SharedBufferMemoryBeginAccessDescriptor const * descriptor) const; - inline Buffer CreateBuffer(BufferDescriptor const * descriptor = nullptr) const; - inline ConvertibleStatus EndAccess(Buffer const& buffer, SharedBufferMemoryEndAccessState * descriptor) const; - inline ConvertibleStatus GetProperties(SharedBufferMemoryProperties * properties) const; - inline Bool IsDeviceLost() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedBufferMemory handle); - static inline void WGPURelease(WGPUSharedBufferMemory handle); -}; - -class SharedFence : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void ExportInfo(SharedFenceExportInfo * info) const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedFence handle); - static inline void WGPURelease(WGPUSharedFence handle); -}; - -class SharedTextureMemory : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline ConvertibleStatus BeginAccess(Texture const& texture, SharedTextureMemoryBeginAccessDescriptor const * descriptor) const; - inline Texture CreateTexture(TextureDescriptor const * descriptor = nullptr) const; - inline ConvertibleStatus EndAccess(Texture const& texture, SharedTextureMemoryEndAccessState * descriptor) const; - inline ConvertibleStatus GetProperties(SharedTextureMemoryProperties * properties) const; - inline Bool IsDeviceLost() const; - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSharedTextureMemory handle); - static inline void WGPURelease(WGPUSharedTextureMemory handle); -}; - -class Surface : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Configure(SurfaceConfiguration const * config) const; - inline ConvertibleStatus GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const; - inline void GetCurrentTexture(SurfaceTexture * surfaceTexture) const; - inline ConvertibleStatus Present() const; - inline void SetLabel(StringView label) const; - inline void Unconfigure() const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUSurface handle); - static inline void WGPURelease(WGPUSurface handle); -}; - -class TexelBufferView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTexelBufferView handle); - static inline void WGPURelease(WGPUTexelBufferView handle); -}; - -class Texture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline TextureView CreateErrorView(TextureViewDescriptor const * descriptor = nullptr) const; - inline TextureView CreateView(TextureViewDescriptor const * descriptor = nullptr) const; - inline void Destroy() const; - inline uint32_t GetDepthOrArrayLayers() const; - inline TextureDimension GetDimension() const; - inline TextureFormat GetFormat() const; - inline uint32_t GetHeight() const; - inline uint32_t GetMipLevelCount() const; - inline uint32_t GetSampleCount() const; - inline TextureViewDimension GetTextureBindingViewDimension() const; - inline TextureUsage GetUsage() const; - inline uint32_t GetWidth() const; - inline void Pin(TextureUsage usage) const; - inline void SetLabel(StringView label) const; - inline void SetOwnershipForMemoryDump(uint64_t ownerGuid = 0) const; - inline void Unpin() const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTexture handle); - static inline void WGPURelease(WGPUTexture handle); -}; - -class TextureView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void SetLabel(StringView label) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUTextureView handle); - static inline void WGPURelease(WGPUTextureView handle); -}; - -class ComputePassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const; - inline void DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void End() const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(ComputePipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPUComputePassEncoder handle); - static inline void WGPURelease(WGPUComputePassEncoder handle); -}; - -class RenderBundleEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline RenderBundle Finish(RenderBundleDescriptor const * descriptor = nullptr) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(RenderPipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void SetVertexBuffer(uint32_t slot, Buffer const& buffer = nullptr, uint64_t offset = 0, uint64_t size = kWholeSize) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderBundleEncoder handle); - static inline void WGPURelease(WGPURenderBundleEncoder handle); -}; - -class RenderPassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - inline void BeginOcclusionQuery(uint32_t queryIndex) const; - inline void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - inline void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - inline void End() const; - inline void EndOcclusionQuery() const; - inline void ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const; - inline void InsertDebugMarker(StringView markerLabel) const; - inline void MultiDrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer = nullptr, uint64_t drawCountBufferOffset = 0) const; - inline void MultiDrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer = nullptr, uint64_t drawCountBufferOffset = 0) const; - inline void PixelLocalStorageBarrier() const; - inline void PopDebugGroup() const; - inline void PushDebugGroup(StringView groupLabel) const; - inline void SetBindGroup(uint32_t groupIndex, BindGroup const& group = nullptr, size_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - inline void SetBlendConstant(Color const * color) const; - inline void SetImmediates(uint32_t offset, void const * data, size_t size) const; - inline void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetLabel(StringView label) const; - inline void SetPipeline(RenderPipeline const& pipeline) const; - inline void SetResourceTable(ResourceTable const& table = nullptr) const; - inline void SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; - inline void SetStencilReference(uint32_t reference) const; - inline void SetVertexBuffer(uint32_t slot, Buffer const& buffer = nullptr, uint64_t offset = 0, uint64_t size = kWholeSize) const; - inline void SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const; - inline void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - - private: - friend ObjectBase; - static inline void WGPUAddRef(WGPURenderPassEncoder handle); - static inline void WGPURelease(WGPURenderPassEncoder handle); -}; - - -// ChainedStruct -static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct), - "sizeof mismatch for ChainedStruct"); -static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), - "alignof mismatch for ChainedStruct"); -static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next), - "offsetof mismatch for ChainedStruct::nextInChain"); -static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), - "offsetof mismatch for ChainedStruct::sType"); - -// Can be chained in AdapterInfo -struct AdapterPropertiesD3D : ChainedStructOut { - inline AdapterPropertiesD3D(); - struct Init; - inline AdapterPropertiesD3D(Init&& init); - inline operator const WGPUAdapterPropertiesD3D&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t shaderModel; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesDrm : ChainedStructOut { - inline AdapterPropertiesDrm(); - struct Init; - inline AdapterPropertiesDrm(Init&& init); - inline operator const WGPUAdapterPropertiesDrm&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool hasPrimary = false; - Bool hasRender = false; - uint64_t primaryMajor = 0; - uint64_t primaryMinor = 0; - uint64_t renderMajor = 0; - uint64_t renderMinor = 0; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesVk : ChainedStructOut { - inline AdapterPropertiesVk(); - struct Init; - inline AdapterPropertiesVk(Init&& init); - inline operator const WGPUAdapterPropertiesVk&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t driverVersion; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesWGPU : ChainedStructOut { - inline AdapterPropertiesWGPU(); - struct Init; - inline AdapterPropertiesWGPU(Init&& init); - inline operator const WGPUAdapterPropertiesWGPU&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(BackendType)); - alignas(kFirstMemberAlignment) BackendType backendType = BackendType::Undefined; -}; - -struct BindingResource { - inline operator const WGPUBindingResource&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size = kWholeSize; - Sampler sampler = nullptr; - TextureView textureView = nullptr; -}; - -struct BlendComponent { - inline operator const WGPUBlendComponent&() const noexcept; - - BlendOperation operation = BlendOperation::Undefined; - BlendFactor srcFactor = BlendFactor::Undefined; - BlendFactor dstFactor = BlendFactor::Undefined; -}; - -struct BufferBindingLayout { - inline operator const WGPUBufferBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - BufferBindingType type = BufferBindingType::Undefined; - Bool hasDynamicOffset = false; - uint64_t minBindingSize = 0; -}; - -// Can be chained in BufferDescriptor -struct BufferHostMappedPointer : ChainedStruct { - inline BufferHostMappedPointer(); - struct Init; - inline BufferHostMappedPointer(Init&& init); - inline operator const WGPUBufferHostMappedPointer&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * pointer; - Callback disposeCallback; - void * userdata; -}; - -struct Color { - inline operator const WGPUColor&() const noexcept; - - double r; - double g; - double b; - double a; -}; - -struct ColorSpaceDawn { - inline operator const WGPUColorSpaceDawn&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ColorSpacePrimariesDawn primaries = {}; - ColorSpaceTransferDawn transfer = ColorSpaceTransferDawn::Identity; - ColorSpaceYCbCrRangeDawn yCbCrRange = ColorSpaceYCbCrRangeDawn::Identity; - ColorSpaceYCbCrMatrixDawn yCbCrMatrix = ColorSpaceYCbCrMatrixDawn::Identity; -}; - -// Can be chained in ColorTargetState -struct ColorTargetStateExpandResolveTextureDawn : ChainedStruct { - inline ColorTargetStateExpandResolveTextureDawn(); - struct Init; - inline ColorTargetStateExpandResolveTextureDawn(Init&& init); - inline operator const WGPUColorTargetStateExpandResolveTextureDawn&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool enabled = false; -}; - -struct CommandBufferDescriptor { - inline operator const WGPUCommandBufferDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -// Can be chained in Limits -struct CompatibilityModeLimits : ChainedStructOut { - inline CompatibilityModeLimits(); - struct Init; - inline CompatibilityModeLimits(Init&& init); - inline operator const WGPUCompatibilityModeLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t maxStorageBuffersInVertexStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInVertexStage = kLimitU32Undefined; - uint32_t maxStorageBuffersInFragmentStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInFragmentStage = kLimitU32Undefined; -}; - -struct ConstantEntry { - inline operator const WGPUConstantEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView key = {}; - double value; -}; - -struct CopyTextureForBrowserOptions { - inline operator const WGPUCopyTextureForBrowserOptions&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - 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; -}; - -// Can be chained in AdapterInfo -struct DawnAdapterPropertiesPowerPreference : ChainedStructOut { - inline DawnAdapterPropertiesPowerPreference(); - struct Init; - inline DawnAdapterPropertiesPowerPreference(Init&& init); - inline operator const WGPUDawnAdapterPropertiesPowerPreference&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(PowerPreference)); - alignas(kFirstMemberAlignment) PowerPreference powerPreference = PowerPreference::Undefined; -}; - -// Can be chained in BufferDescriptor -struct DawnBufferDescriptorErrorInfoFromWireClient : ChainedStruct { - inline DawnBufferDescriptorErrorInfoFromWireClient(); - struct Init; - inline DawnBufferDescriptorErrorInfoFromWireClient(Init&& init); - inline operator const WGPUDawnBufferDescriptorErrorInfoFromWireClient&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool outOfMemory = false; -}; - -namespace detail { -struct DawnCacheDeviceDescriptor { - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView)); - alignas(kFirstMemberAlignment) StringView isolationKey = {}; - DawnLoadCacheDataFunction loadDataFunction = nullptr; - DawnStoreCacheDataFunction storeDataFunction = nullptr; - void * functionUserdata = nullptr; - WGPUDawnLoadCacheDataCallbackInfo dawnLoadCacheDataCallbackInfo = WGPU_DAWN_LOAD_CACHE_DATA_CALLBACK_INFO_INIT; - WGPUDawnStoreCacheDataCallbackInfo dawnStoreCacheDataCallbackInfo = WGPU_DAWN_STORE_CACHE_DATA_CALLBACK_INFO_INIT; -}; -} // namespace detail -// Can be chained in DeviceDescriptor -struct DawnCacheDeviceDescriptor : ChainedStruct, protected detail::DawnCacheDeviceDescriptor { - inline DawnCacheDeviceDescriptor(); - struct Init; - inline DawnCacheDeviceDescriptor(Init&& init); - inline operator const WGPUDawnCacheDeviceDescriptor&() const noexcept; - - using detail::DawnCacheDeviceDescriptor::kFirstMemberAlignment; - using detail::DawnCacheDeviceDescriptor::isolationKey; - using detail::DawnCacheDeviceDescriptor::loadDataFunction; - using detail::DawnCacheDeviceDescriptor::storeDataFunction; - using detail::DawnCacheDeviceDescriptor::functionUserdata; - - template - void SetDawnLoadCacheDataCallback(F callback, T userdata); - template - void SetDawnLoadCacheDataCallback(F callback); - template - void SetDawnStoreCacheDataCallback(F callback, T userdata); - template - void SetDawnStoreCacheDataCallback(F callback); -}; - -// Can be chained in CompilationMessage -struct DawnCompilationMessageUtf16 : ChainedStruct { - inline DawnCompilationMessageUtf16(); - struct Init; - inline DawnCompilationMessageUtf16(Init&& init); - inline operator const WGPUDawnCompilationMessageUtf16&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t linePos; - uint64_t offset; - uint64_t length; -}; - -// Can be chained in DeviceDescriptor -struct DawnConsumeAdapterDescriptor : ChainedStruct { - inline DawnConsumeAdapterDescriptor(); - struct Init; - inline DawnConsumeAdapterDescriptor(Init&& init); - inline operator const WGPUDawnConsumeAdapterDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool consumeAdapter = false; -}; - -// Can be chained in DeviceDescriptor -struct DawnDeviceAllocatorControl : ChainedStruct { - inline DawnDeviceAllocatorControl(); - struct Init; - inline DawnDeviceAllocatorControl(Init&& init); - inline operator const WGPUDawnDeviceAllocatorControl&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t allocatorHeapBlockSize = 0; -}; - -struct DawnDrmFormatProperties { - inline operator const WGPUDawnDrmFormatProperties&() const noexcept; - - uint64_t modifier; - uint32_t modifierPlaneCount; -}; - -// Can be chained in CommandEncoderDescriptor -struct DawnEncoderInternalUsageDescriptor : ChainedStruct { - inline DawnEncoderInternalUsageDescriptor(); - struct Init; - inline DawnEncoderInternalUsageDescriptor(Init&& init); - inline operator const WGPUDawnEncoderInternalUsageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool useInternalUsages = false; -}; - -// Can be chained in BufferDescriptor -struct DawnFakeBufferOOMForTesting : ChainedStruct { - inline DawnFakeBufferOOMForTesting(); - struct Init; - inline DawnFakeBufferOOMForTesting(Init&& init); - inline operator const WGPUDawnFakeBufferOOMForTesting&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool fakeOOMAtWireClientMap; - Bool fakeOOMAtNativeMap; - Bool fakeOOMAtDevice; -}; - -// Can be chained in DeviceDescriptor -struct DawnFakeDeviceInitializeErrorForTesting : ChainedStruct { - inline DawnFakeDeviceInitializeErrorForTesting(); - struct Init; - inline DawnFakeDeviceInitializeErrorForTesting(Init&& init); - inline operator const WGPUDawnFakeDeviceInitializeErrorForTesting&() const noexcept; - - }; - -// Can be chained in Limits -struct DawnHostMappedPointerLimits : ChainedStructOut { - inline DawnHostMappedPointerLimits(); - struct Init; - inline DawnHostMappedPointerLimits(Init&& init); - inline operator const WGPUDawnHostMappedPointerLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t hostMappedPointerAlignment = kLimitU32Undefined; -}; - -struct DawnInjectedInvalidSType : ChainedStruct { - inline DawnInjectedInvalidSType(); - struct Init; - inline DawnInjectedInvalidSType(Init&& init); - inline operator const WGPUDawnInjectedInvalidSType&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(SType)); - alignas(kFirstMemberAlignment) SType invalidSType = {}; -}; - -// Can be chained in RenderPassDescriptor -struct DawnRenderPassSampleCount : ChainedStruct { - inline DawnRenderPassSampleCount(); - struct Init; - inline DawnRenderPassSampleCount(Init&& init); - inline operator const WGPUDawnRenderPassSampleCount&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t sampleCount = 1; -}; - -// Can be chained in ShaderModuleDescriptor -struct DawnShaderModuleSPIRVOptionsDescriptor : ChainedStruct { - inline DawnShaderModuleSPIRVOptionsDescriptor(); - struct Init; - inline DawnShaderModuleSPIRVOptionsDescriptor(Init&& init); - inline operator const WGPUDawnShaderModuleSPIRVOptionsDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool allowNonUniformDerivatives = false; -}; - -// Can be chained in Limits -struct DawnTexelCopyBufferRowAlignmentLimits : ChainedStructOut { - inline DawnTexelCopyBufferRowAlignmentLimits(); - struct Init; - inline DawnTexelCopyBufferRowAlignmentLimits(Init&& init); - inline operator const WGPUDawnTexelCopyBufferRowAlignmentLimits&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t minTexelCopyBufferRowAlignment = kLimitU32Undefined; -}; - -// Can be chained in TextureDescriptor -struct DawnTextureInternalUsageDescriptor : ChainedStruct { - inline DawnTextureInternalUsageDescriptor(); - struct Init; - inline DawnTextureInternalUsageDescriptor(Init&& init); - inline operator const WGPUDawnTextureInternalUsageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureUsage)); - alignas(kFirstMemberAlignment) TextureUsage internalUsage = TextureUsage::None; -}; - -// Can be chained in InstanceDescriptor -// Can be chained in RequestAdapterOptions -// Can be chained in DeviceDescriptor -struct DawnTogglesDescriptor : ChainedStruct { - inline DawnTogglesDescriptor(); - struct Init; - inline DawnTogglesDescriptor(Init&& init); - inline operator const WGPUDawnTogglesDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t enabledToggleCount = 0; - const char* const * enabledToggles = nullptr; - size_t disabledToggleCount = 0; - const char* const * disabledToggles = nullptr; -}; - -// Can be chained in InstanceDescriptor -struct DawnWGSLBlocklist : ChainedStruct { - inline DawnWGSLBlocklist(); - struct Init; - inline DawnWGSLBlocklist(Init&& init); - inline operator const WGPUDawnWGSLBlocklist&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t blocklistedFeatureCount = 0; - const char* const * blocklistedFeatures = nullptr; -}; - -// Can be chained in InstanceDescriptor -struct DawnWireWGSLControl : ChainedStruct { - inline DawnWireWGSLControl(); - struct Init; - inline DawnWireWGSLControl(Init&& init); - inline operator const WGPUDawnWireWGSLControl&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool enableExperimental = false; - Bool enableUnsafe = false; - Bool enableTesting = false; -}; - -struct Extent2D { - inline operator const WGPUExtent2D&() const noexcept; - - uint32_t width; - uint32_t height; -}; - -struct Extent3D { - inline operator const WGPUExtent3D&() const noexcept; - - uint32_t width; - uint32_t height = 1; - uint32_t depthOrArrayLayers = 1; -}; - -// Can be chained in BindGroupEntry -struct ExternalTextureBindingEntry : ChainedStruct { - inline ExternalTextureBindingEntry(); - struct Init; - inline ExternalTextureBindingEntry(Init&& init); - inline operator const WGPUExternalTextureBindingEntry&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(ExternalTexture)); - alignas(kFirstMemberAlignment) ExternalTexture externalTexture = nullptr; -}; - -// Can be chained in BindGroupLayoutEntry -struct ExternalTextureBindingLayout : ChainedStruct { - inline ExternalTextureBindingLayout(); - struct Init; - inline ExternalTextureBindingLayout(Init&& init); - inline operator const WGPUExternalTextureBindingLayout&() const noexcept; - - }; - -struct Future { - inline operator const WGPUFuture&() const noexcept; - - uint64_t id; -}; - -struct InstanceLimits { - inline operator const WGPUInstanceLimits&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - size_t timedWaitAnyMaxCount = 0; -}; - -struct MemoryHeapInfo { - inline operator const WGPUMemoryHeapInfo&() const noexcept; - - HeapProperty properties = HeapProperty::None; - uint64_t size; -}; - -struct MultisampleState { - inline operator const WGPUMultisampleState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t count = 1; - uint32_t mask = 0xFFFFFFFF; - Bool alphaToCoverageEnabled = false; -}; - -struct Origin2D { - inline operator const WGPUOrigin2D&() const noexcept; - - uint32_t x = 0; - uint32_t y = 0; -}; - -struct Origin3D { - inline operator const WGPUOrigin3D&() const noexcept; - - uint32_t x = 0; - uint32_t y = 0; - uint32_t z = 0; -}; - -struct PassTimestampWrites { - inline operator const WGPUPassTimestampWrites&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - QuerySet querySet = nullptr; - uint32_t beginningOfPassWriteIndex = kQuerySetIndexUndefined; - uint32_t endOfPassWriteIndex = kQuerySetIndexUndefined; -}; - -// Can be chained in PipelineLayoutDescriptor -struct PipelineLayoutResourceTable : ChainedStruct { - inline PipelineLayoutResourceTable(); - struct Init; - inline PipelineLayoutResourceTable(Init&& init); - inline operator const WGPUPipelineLayoutResourceTable&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool usesResourceTable = false; -}; - -struct PipelineLayoutStorageAttachment { - inline operator const WGPUPipelineLayoutStorageAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - TextureFormat format = TextureFormat::Undefined; -}; - -struct PrimitiveState { - inline operator const WGPUPrimitiveState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - PrimitiveTopology topology = PrimitiveTopology::Undefined; - IndexFormat stripIndexFormat = IndexFormat::Undefined; - FrontFace frontFace = FrontFace::Undefined; - CullMode cullMode = CullMode::Undefined; - Bool unclippedDepth = false; -}; - -struct QuerySetDescriptor { - inline operator const WGPUQuerySetDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - QueryType type = {}; - uint32_t count; -}; - -struct QueueDescriptor { - inline operator const WGPUQueueDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct RenderBundleDescriptor { - inline operator const WGPURenderBundleDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct RenderBundleEncoderDescriptor { - inline operator const WGPURenderBundleEncoderDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t colorFormatCount; - TextureFormat const * colorFormats = nullptr; - TextureFormat depthStencilFormat = TextureFormat::Undefined; - uint32_t sampleCount = 1; - Bool depthReadOnly = false; - Bool stencilReadOnly = false; -}; - -struct RenderPassDepthStencilAttachment { - inline operator const WGPURenderPassDepthStencilAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureView view = nullptr; - LoadOp depthLoadOp = LoadOp::Undefined; - StoreOp depthStoreOp = StoreOp::Undefined; - float depthClearValue = kDepthClearValueUndefined; - Bool depthReadOnly = false; - LoadOp stencilLoadOp = LoadOp::Undefined; - StoreOp stencilStoreOp = StoreOp::Undefined; - uint32_t stencilClearValue = 0; - Bool stencilReadOnly = false; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassDescriptorResolveRect : ChainedStruct { - inline RenderPassDescriptorResolveRect(); - struct Init; - inline RenderPassDescriptorResolveRect(Init&& init); - inline operator const WGPURenderPassDescriptorResolveRect&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t colorOffsetX; - uint32_t colorOffsetY; - uint32_t resolveOffsetX; - uint32_t resolveOffsetY; - uint32_t width; - uint32_t height; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassMaxDrawCount : ChainedStruct { - inline RenderPassMaxDrawCount(); - struct Init; - inline RenderPassMaxDrawCount(Init&& init); - inline operator const WGPURenderPassMaxDrawCount&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t maxDrawCount = 50000000; -}; - -// Can be chained in RequestAdapterOptions -struct RequestAdapterWebGPUBackendOptions : ChainedStruct { - inline RequestAdapterWebGPUBackendOptions(); - struct Init; - inline RequestAdapterWebGPUBackendOptions(Init&& init); - inline operator const WGPURequestAdapterWebGPUBackendOptions&() const noexcept; - - }; - -// Can be chained in RequestAdapterOptions -struct RequestAdapterWebXROptions : ChainedStruct { - inline RequestAdapterWebXROptions(); - struct Init; - inline RequestAdapterWebXROptions(Init&& init); - inline operator const WGPURequestAdapterWebXROptions&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool xrCompatible; -}; - -struct ResourceTableDescriptor { - inline operator const WGPUResourceTableDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - uint32_t size; -}; - -struct SamplerBindingLayout { - inline operator const WGPUSamplerBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - SamplerBindingType type = SamplerBindingType::Undefined; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderModuleCompilationOptions : ChainedStruct { - inline ShaderModuleCompilationOptions(); - struct Init; - inline ShaderModuleCompilationOptions(Init&& init); - inline operator const WGPUShaderModuleCompilationOptions&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool strictMath; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderSourceSPIRV : ChainedStruct { - inline ShaderSourceSPIRV(); - struct Init; - inline ShaderSourceSPIRV(Init&& init); - inline operator const WGPUShaderSourceSPIRV&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t codeSize; - uint32_t const * code = nullptr; -}; - -// Can be chained in ShaderModuleDescriptor -struct ShaderSourceWGSL : ChainedStruct { - inline ShaderSourceWGSL(); - struct Init; - inline ShaderSourceWGSL(Init&& init); - inline operator const WGPUShaderSourceWGSL&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(StringView)); - alignas(kFirstMemberAlignment) StringView code = {}; -}; - -struct SharedBufferMemoryBeginAccessDescriptor { - inline operator const WGPUSharedBufferMemoryBeginAccessDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Bool initialized; - size_t fenceCount = 0; - SharedFence const * fences = nullptr; - size_t signaledValueCount = 0; - uint64_t const * signaledValues = nullptr; -}; - -// Can be chained in SharedBufferMemoryDescriptor -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor : ChainedStruct { - inline SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(); - struct Init; - inline SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(Init&& init); - inline operator const WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; - uint64_t size; -}; - -struct SharedBufferMemoryEndAccessState { - inline SharedBufferMemoryEndAccessState(); - inline ~SharedBufferMemoryEndAccessState(); - SharedBufferMemoryEndAccessState(const SharedBufferMemoryEndAccessState&) = delete; - SharedBufferMemoryEndAccessState& operator=(const SharedBufferMemoryEndAccessState&) = delete; - inline SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&&); - inline SharedBufferMemoryEndAccessState& operator=(SharedBufferMemoryEndAccessState&&); - inline operator const WGPUSharedBufferMemoryEndAccessState&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Bool const initialized = {}; - size_t const fenceCount = 0; - SharedFence const * const fences = nullptr; - size_t const signaledValueCount = 0; - uint64_t const * const signaledValues = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SharedBufferMemoryEndAccessState& value); -}; - -struct SharedBufferMemoryProperties { - inline operator const WGPUSharedBufferMemoryProperties&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - BufferUsage usage = BufferUsage::None; - uint64_t size; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceDXGISharedHandleDescriptor : ChainedStruct { - inline SharedFenceDXGISharedHandleDescriptor(); - struct Init; - inline SharedFenceDXGISharedHandleDescriptor(Init&& init); - inline operator const WGPUSharedFenceDXGISharedHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceDXGISharedHandleExportInfo : ChainedStructOut { - inline SharedFenceDXGISharedHandleExportInfo(); - struct Init; - inline SharedFenceDXGISharedHandleExportInfo(Init&& init); - inline operator const WGPUSharedFenceDXGISharedHandleExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceEGLSyncDescriptor : ChainedStruct { - inline SharedFenceEGLSyncDescriptor(); - struct Init; - inline SharedFenceEGLSyncDescriptor(Init&& init); - inline operator const WGPUSharedFenceEGLSyncDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * sync; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceEGLSyncExportInfo : ChainedStructOut { - inline SharedFenceEGLSyncExportInfo(); - struct Init; - inline SharedFenceEGLSyncExportInfo(Init&& init); - inline operator const WGPUSharedFenceEGLSyncExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * sync; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceMTLSharedEventDescriptor : ChainedStruct { - inline SharedFenceMTLSharedEventDescriptor(); - struct Init; - inline SharedFenceMTLSharedEventDescriptor(Init&& init); - inline operator const WGPUSharedFenceMTLSharedEventDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * sharedEvent; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceMTLSharedEventExportInfo : ChainedStructOut { - inline SharedFenceMTLSharedEventExportInfo(); - struct Init; - inline SharedFenceMTLSharedEventExportInfo(Init&& init); - inline operator const WGPUSharedFenceMTLSharedEventExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(void *)); - alignas(kFirstMemberAlignment) void * sharedEvent; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceSyncFDDescriptor : ChainedStruct { - inline SharedFenceSyncFDDescriptor(); - struct Init; - inline SharedFenceSyncFDDescriptor(Init&& init); - inline operator const WGPUSharedFenceSyncFDDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceSyncFDExportInfo : ChainedStructOut { - inline SharedFenceSyncFDExportInfo(); - struct Init; - inline SharedFenceSyncFDExportInfo(Init&& init); - inline operator const WGPUSharedFenceSyncFDExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceVkSemaphoreOpaqueFDDescriptor : ChainedStruct { - inline SharedFenceVkSemaphoreOpaqueFDDescriptor(); - struct Init; - inline SharedFenceVkSemaphoreOpaqueFDDescriptor(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceExportInfo -struct SharedFenceVkSemaphoreOpaqueFDExportInfo : ChainedStructOut { - inline SharedFenceVkSemaphoreOpaqueFDExportInfo(); - struct Init; - inline SharedFenceVkSemaphoreOpaqueFDExportInfo(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int)); - alignas(kFirstMemberAlignment) int handle; -}; - -// Can be chained in SharedFenceDescriptor -struct SharedFenceVkSemaphoreZirconHandleDescriptor : ChainedStruct { - inline SharedFenceVkSemaphoreZirconHandleDescriptor(); - struct Init; - inline SharedFenceVkSemaphoreZirconHandleDescriptor(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreZirconHandleDescriptor&() const noexcept; - - 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 { - inline SharedFenceVkSemaphoreZirconHandleExportInfo(); - struct Init; - inline SharedFenceVkSemaphoreZirconHandleExportInfo(Init&& init); - inline operator const WGPUSharedFenceVkSemaphoreZirconHandleExportInfo&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t handle; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryAHardwareBufferDescriptor : ChainedStruct { - inline SharedTextureMemoryAHardwareBufferDescriptor(); - struct Init; - inline SharedTextureMemoryAHardwareBufferDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryAHardwareBufferDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * handle; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryD3D11BeginState : ChainedStruct { - inline SharedTextureMemoryD3D11BeginState(); - struct Init; - inline SharedTextureMemoryD3D11BeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryD3D11BeginState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool requiresEndAccessFence = true; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryD3DSwapchainBeginState : ChainedStruct { - inline SharedTextureMemoryD3DSwapchainBeginState(); - struct Init; - inline SharedTextureMemoryD3DSwapchainBeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryD3DSwapchainBeginState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool isSwapchain = false; -}; - -struct SharedTextureMemoryDmaBufPlane { - inline operator const WGPUSharedTextureMemoryDmaBufPlane&() const noexcept; - - int fd; - uint64_t offset; - uint32_t stride; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryDXGISharedHandleDescriptor : ChainedStruct { - inline SharedTextureMemoryDXGISharedHandleDescriptor(); - struct Init; - inline SharedTextureMemoryDXGISharedHandleDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryDXGISharedHandleDescriptor&() const noexcept; - - 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 { - inline SharedTextureMemoryEGLImageDescriptor(); - struct Init; - inline SharedTextureMemoryEGLImageDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryEGLImageDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * image; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryIOSurfaceDescriptor : ChainedStruct { - inline SharedTextureMemoryIOSurfaceDescriptor(); - struct Init; - inline SharedTextureMemoryIOSurfaceDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryIOSurfaceDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * ioSurface; - Bool allowStorageBinding = true; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryOpaqueFDDescriptor : ChainedStruct { - inline SharedTextureMemoryOpaqueFDDescriptor(); - struct Init; - inline SharedTextureMemoryOpaqueFDDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryOpaqueFDDescriptor&() const noexcept; - - 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 { - inline SharedTextureMemoryVkDedicatedAllocationDescriptor(); - struct Init; - inline SharedTextureMemoryVkDedicatedAllocationDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Bool)); - alignas(kFirstMemberAlignment) Bool dedicatedAllocation; -}; - -// Can be chained in SharedTextureMemoryBeginAccessDescriptor -struct SharedTextureMemoryVkImageLayoutBeginState : ChainedStruct { - inline SharedTextureMemoryVkImageLayoutBeginState(); - struct Init; - inline SharedTextureMemoryVkImageLayoutBeginState(Init&& init); - inline operator const WGPUSharedTextureMemoryVkImageLayoutBeginState&() const noexcept; - - 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 { - inline SharedTextureMemoryVkImageLayoutEndState(); - struct Init; - inline SharedTextureMemoryVkImageLayoutEndState(Init&& init); - inline operator const WGPUSharedTextureMemoryVkImageLayoutEndState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(int32_t)); - alignas(kFirstMemberAlignment) int32_t oldLayout; - int32_t newLayout; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryZirconHandleDescriptor : ChainedStruct { - inline SharedTextureMemoryZirconHandleDescriptor(); - struct Init; - inline SharedTextureMemoryZirconHandleDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryZirconHandleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t memoryFD; - uint64_t allocationSize; -}; - -// Can be chained in BindGroupLayoutEntry -struct StaticSamplerBindingLayout : ChainedStruct { - inline StaticSamplerBindingLayout(); - struct Init; - inline StaticSamplerBindingLayout(Init&& init); - inline operator const WGPUStaticSamplerBindingLayout&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Sampler)); - alignas(kFirstMemberAlignment) Sampler sampler = nullptr; - uint32_t sampledTextureBinding = kLimitU32Undefined; -}; - -struct StencilFaceState { - inline operator const WGPUStencilFaceState&() const noexcept; - - CompareFunction compare = CompareFunction::Undefined; - StencilOperation failOp = StencilOperation::Undefined; - StencilOperation depthFailOp = StencilOperation::Undefined; - StencilOperation passOp = StencilOperation::Undefined; -}; - -struct StorageTextureBindingLayout { - inline operator const WGPUStorageTextureBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StorageTextureAccess access = StorageTextureAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; -}; - -struct SubgroupMatrixConfig { - inline operator const WGPUSubgroupMatrixConfig&() const noexcept; - - SubgroupMatrixComponentType componentType = {}; - SubgroupMatrixComponentType resultComponentType = {}; - uint32_t M; - uint32_t N; - uint32_t K; -}; - -struct SupportedFeatures { - inline SupportedFeatures(); - inline ~SupportedFeatures(); - SupportedFeatures(const SupportedFeatures&) = delete; - SupportedFeatures& operator=(const SupportedFeatures&) = delete; - inline SupportedFeatures(SupportedFeatures&&); - inline SupportedFeatures& operator=(SupportedFeatures&&); - inline operator const WGPUSupportedFeatures&() const noexcept; - - size_t const featureCount = {}; - FeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedFeatures& value); -}; - -struct SupportedInstanceFeatures { - inline SupportedInstanceFeatures(); - inline ~SupportedInstanceFeatures(); - SupportedInstanceFeatures(const SupportedInstanceFeatures&) = delete; - SupportedInstanceFeatures& operator=(const SupportedInstanceFeatures&) = delete; - inline SupportedInstanceFeatures(SupportedInstanceFeatures&&); - inline SupportedInstanceFeatures& operator=(SupportedInstanceFeatures&&); - inline operator const WGPUSupportedInstanceFeatures&() const noexcept; - - size_t const featureCount = {}; - InstanceFeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedInstanceFeatures& value); -}; - -struct SupportedWGSLLanguageFeatures { - inline SupportedWGSLLanguageFeatures(); - inline ~SupportedWGSLLanguageFeatures(); - SupportedWGSLLanguageFeatures(const SupportedWGSLLanguageFeatures&) = delete; - SupportedWGSLLanguageFeatures& operator=(const SupportedWGSLLanguageFeatures&) = delete; - inline SupportedWGSLLanguageFeatures(SupportedWGSLLanguageFeatures&&); - inline SupportedWGSLLanguageFeatures& operator=(SupportedWGSLLanguageFeatures&&); - inline operator const WGPUSupportedWGSLLanguageFeatures&() const noexcept; - - size_t const featureCount = {}; - WGSLLanguageFeatureName const * const features = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SupportedWGSLLanguageFeatures& value); -}; - -struct SurfaceCapabilities { - inline SurfaceCapabilities(); - inline ~SurfaceCapabilities(); - SurfaceCapabilities(const SurfaceCapabilities&) = delete; - SurfaceCapabilities& operator=(const SurfaceCapabilities&) = delete; - inline SurfaceCapabilities(SurfaceCapabilities&&); - inline SurfaceCapabilities& operator=(SurfaceCapabilities&&); - inline operator const WGPUSurfaceCapabilities&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - TextureUsage const usages = TextureUsage::None; - size_t const formatCount = {}; - TextureFormat const * const formats = nullptr; - size_t const presentModeCount = {}; - PresentMode const * const presentModes = nullptr; - size_t const alphaModeCount = {}; - CompositeAlphaMode const * const alphaModes = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SurfaceCapabilities& value); -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceColorManagement : ChainedStruct { - inline SurfaceColorManagement(); - struct Init; - inline SurfaceColorManagement(Init&& init); - inline operator const WGPUSurfaceColorManagement&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(PredefinedColorSpace)); - alignas(kFirstMemberAlignment) PredefinedColorSpace colorSpace = {}; - ToneMappingMode toneMappingMode = {}; -}; - -struct SurfaceConfiguration { - inline operator const WGPUSurfaceConfiguration&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Device device = nullptr; - TextureFormat format = TextureFormat::Undefined; - TextureUsage usage = TextureUsage::RenderAttachment; - uint32_t width; - uint32_t height; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats = nullptr; - CompositeAlphaMode alphaMode = CompositeAlphaMode::Auto; - PresentMode presentMode = PresentMode::Undefined; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsCoreWindow : ChainedStruct { - inline SurfaceDescriptorFromWindowsCoreWindow(); - struct Init; - inline SurfaceDescriptorFromWindowsCoreWindow(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsCoreWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * coreWindow = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel : ChainedStruct { - inline SurfaceDescriptorFromWindowsUWPSwapChainPanel(); - struct Init; - inline SurfaceDescriptorFromWindowsUWPSwapChainPanel(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * swapChainPanel = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel : ChainedStruct { - inline SurfaceDescriptorFromWindowsWinUISwapChainPanel(); - struct Init; - inline SurfaceDescriptorFromWindowsWinUISwapChainPanel(Init&& init); - inline operator const WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * swapChainPanel = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceAndroidNativeWindow : ChainedStruct { - inline SurfaceSourceAndroidNativeWindow(); - struct Init; - inline SurfaceSourceAndroidNativeWindow(Init&& init); - inline operator const WGPUSurfaceSourceAndroidNativeWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * window; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceMetalLayer : ChainedStruct { - inline SurfaceSourceMetalLayer(); - struct Init; - inline SurfaceSourceMetalLayer(Init&& init); - inline operator const WGPUSurfaceSourceMetalLayer&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * layer = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceWaylandSurface : ChainedStruct { - inline SurfaceSourceWaylandSurface(); - struct Init; - inline SurfaceSourceWaylandSurface(Init&& init); - inline operator const WGPUSurfaceSourceWaylandSurface&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * display = nullptr; - void * surface = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceWindowsHWND : ChainedStruct { - inline SurfaceSourceWindowsHWND(); - struct Init; - inline SurfaceSourceWindowsHWND(Init&& init); - inline operator const WGPUSurfaceSourceWindowsHWND&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * hinstance = nullptr; - void * hwnd = nullptr; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceXCBWindow : ChainedStruct { - inline SurfaceSourceXCBWindow(); - struct Init; - inline SurfaceSourceXCBWindow(Init&& init); - inline operator const WGPUSurfaceSourceXCBWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * connection = nullptr; - uint32_t window; -}; - -// Can be chained in SurfaceDescriptor -struct SurfaceSourceXlibWindow : ChainedStruct { - inline SurfaceSourceXlibWindow(); - struct Init; - inline SurfaceSourceXlibWindow(Init&& init); - inline operator const WGPUSurfaceSourceXlibWindow&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(void *)); - alignas(kFirstMemberAlignment) void * display = nullptr; - uint64_t window; -}; - -struct SurfaceTexture { - inline operator const WGPUSurfaceTexture&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Texture texture = nullptr; - SurfaceGetCurrentTextureStatus status = {}; -}; - -// Can be chained in BindGroupEntry -struct TexelBufferBindingEntry : ChainedStruct { - inline TexelBufferBindingEntry(); - struct Init; - inline TexelBufferBindingEntry(Init&& init); - inline operator const WGPUTexelBufferBindingEntry&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TexelBufferView)); - alignas(kFirstMemberAlignment) TexelBufferView texelBufferView = nullptr; -}; - -// Can be chained in BindGroupLayoutEntry -struct TexelBufferBindingLayout : ChainedStruct { - inline TexelBufferBindingLayout(); - struct Init; - inline TexelBufferBindingLayout(Init&& init); - inline operator const WGPUTexelBufferBindingLayout&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TexelBufferAccess)); - alignas(kFirstMemberAlignment) TexelBufferAccess access = TexelBufferAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; -}; - -struct TexelBufferViewDescriptor { - inline operator const WGPUTexelBufferViewDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureFormat format = TextureFormat::Undefined; - uint64_t offset = 0; - uint64_t size = kWholeSize; -}; - -struct TexelCopyBufferLayout { - inline operator const WGPUTexelCopyBufferLayout&() const noexcept; - - uint64_t offset = 0; - uint32_t bytesPerRow = kCopyStrideUndefined; - uint32_t rowsPerImage = kCopyStrideUndefined; -}; - -struct TextureBindingLayout { - inline operator const WGPUTextureBindingLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureSampleType sampleType = TextureSampleType::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - Bool multisampled = false; -}; - -// Can be chained in TextureDescriptor -struct TextureBindingViewDimension : ChainedStruct { - inline TextureBindingViewDimension(); - struct Init; - inline TextureBindingViewDimension(Init&& init); - inline operator const WGPUTextureBindingViewDimension&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureViewDimension)); - alignas(kFirstMemberAlignment) TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; -}; - -struct TextureComponentSwizzle { - inline operator const WGPUTextureComponentSwizzle&() const noexcept; - - ComponentSwizzle r = ComponentSwizzle::Undefined; - ComponentSwizzle g = ComponentSwizzle::Undefined; - ComponentSwizzle b = ComponentSwizzle::Undefined; - ComponentSwizzle a = ComponentSwizzle::Undefined; -}; - -struct VertexAttribute { - inline operator const WGPUVertexAttribute&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - VertexFormat format = {}; - uint64_t offset; - uint32_t shaderLocation; -}; - -// Can be chained in SamplerDescriptor -// Can be chained in TextureViewDescriptor -struct YCbCrVkDescriptor : ChainedStruct { - inline YCbCrVkDescriptor(); - struct Init; - inline YCbCrVkDescriptor(Init&& init); - inline operator const WGPUYCbCrVkDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint32_t)); - alignas(kFirstMemberAlignment) uint32_t vkFormat = 0; - uint32_t vkYCbCrModel = 0; - uint32_t vkYCbCrRange = 0; - uint32_t vkComponentSwizzleRed = 0; - uint32_t vkComponentSwizzleGreen = 0; - uint32_t vkComponentSwizzleBlue = 0; - uint32_t vkComponentSwizzleAlpha = 0; - uint32_t vkXChromaOffset = 0; - uint32_t vkYChromaOffset = 0; - FilterMode vkChromaFilter = FilterMode::Undefined; - Bool forceExplicitReconstruction = false; - uint64_t externalFormat = 0; -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesMemoryHeaps : ChainedStructOut { - inline AdapterPropertiesMemoryHeaps(); - struct Init; - inline AdapterPropertiesMemoryHeaps(Init&& init); - inline ~AdapterPropertiesMemoryHeaps(); - AdapterPropertiesMemoryHeaps(const AdapterPropertiesMemoryHeaps&) = delete; - AdapterPropertiesMemoryHeaps& operator=(const AdapterPropertiesMemoryHeaps&) = delete; - inline AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&&); - inline AdapterPropertiesMemoryHeaps& operator=(AdapterPropertiesMemoryHeaps&&); - inline operator const WGPUAdapterPropertiesMemoryHeaps&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const heapCount = {}; - MemoryHeapInfo const * const heapInfo = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterPropertiesMemoryHeaps& value); -}; - -// Can be chained in AdapterInfo -struct AdapterPropertiesSubgroupMatrixConfigs : ChainedStructOut { - inline AdapterPropertiesSubgroupMatrixConfigs(); - struct Init; - inline AdapterPropertiesSubgroupMatrixConfigs(Init&& init); - inline ~AdapterPropertiesSubgroupMatrixConfigs(); - AdapterPropertiesSubgroupMatrixConfigs(const AdapterPropertiesSubgroupMatrixConfigs&) = delete; - AdapterPropertiesSubgroupMatrixConfigs& operator=(const AdapterPropertiesSubgroupMatrixConfigs&) = delete; - inline AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs&&); - inline AdapterPropertiesSubgroupMatrixConfigs& operator=(AdapterPropertiesSubgroupMatrixConfigs&&); - inline operator const WGPUAdapterPropertiesSubgroupMatrixConfigs&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const configCount = {}; - SubgroupMatrixConfig const * const configs = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterPropertiesSubgroupMatrixConfigs& value); -}; - -struct AHardwareBufferProperties { - inline operator const WGPUAHardwareBufferProperties&() const noexcept; - - YCbCrVkDescriptor yCbCrInfo = {}; -}; - -struct BindGroupEntry { - inline operator const WGPUBindGroupEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size = kWholeSize; - Sampler sampler = nullptr; - TextureView textureView = nullptr; -}; - -struct BindGroupLayoutEntry { - inline operator const WGPUBindGroupLayoutEntry&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint32_t binding; - ShaderStage visibility = ShaderStage::None; - uint32_t bindingArraySize = 0; - BufferBindingLayout buffer = { nullptr, BufferBindingType::BindingNotUsed, false, 0 }; - SamplerBindingLayout sampler = { nullptr, SamplerBindingType::BindingNotUsed }; - TextureBindingLayout texture = { nullptr, TextureSampleType::BindingNotUsed, TextureViewDimension::e2D, false }; - StorageTextureBindingLayout storageTexture = { nullptr, StorageTextureAccess::BindingNotUsed, TextureFormat::Undefined, TextureViewDimension::e2D }; -}; - -struct BlendState { - inline operator const WGPUBlendState&() const noexcept; - - BlendComponent color = {}; - BlendComponent alpha = {}; -}; - -struct BufferDescriptor { - inline operator const WGPUBufferDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - BufferUsage usage = BufferUsage::None; - uint64_t size; - Bool mappedAtCreation = false; -}; - -struct CommandEncoderDescriptor { - inline operator const WGPUCommandEncoderDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct CompilationMessage { - inline operator const WGPUCompilationMessage&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView message = {}; - CompilationMessageType type = {}; - uint64_t lineNum; - uint64_t linePos; - uint64_t offset; - uint64_t length; -}; - -struct ComputePassDescriptor { - inline operator const WGPUComputePassDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PassTimestampWrites const * timestampWrites = nullptr; -}; - -struct ComputeState { - inline operator const WGPUComputeState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; -}; - -// Can be chained in DawnFormatCapabilities -struct DawnDrmFormatCapabilities : ChainedStructOut { - inline DawnDrmFormatCapabilities(); - struct Init; - inline DawnDrmFormatCapabilities(Init&& init); - inline ~DawnDrmFormatCapabilities(); - DawnDrmFormatCapabilities(const DawnDrmFormatCapabilities&) = delete; - DawnDrmFormatCapabilities& operator=(const DawnDrmFormatCapabilities&) = delete; - inline DawnDrmFormatCapabilities(DawnDrmFormatCapabilities&&); - inline DawnDrmFormatCapabilities& operator=(DawnDrmFormatCapabilities&&); - inline operator const WGPUDawnDrmFormatCapabilities&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(size_t)); - alignas(kFirstMemberAlignment) size_t const propertiesCount = {}; - DawnDrmFormatProperties const * const properties = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(DawnDrmFormatCapabilities& value); -}; - -struct DepthStencilState { - inline operator const WGPUDepthStencilState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureFormat format = TextureFormat::Undefined; - OptionalBool depthWriteEnabled = OptionalBool::Undefined; - CompareFunction depthCompare = CompareFunction::Undefined; - StencilFaceState stencilFront = {}; - StencilFaceState stencilBack = {}; - uint32_t stencilReadMask = 0xFFFFFFFF; - uint32_t stencilWriteMask = 0xFFFFFFFF; - int32_t depthBias = 0; - float depthBiasSlopeScale = 0.f; - float depthBiasClamp = 0.f; -}; - -struct ExternalTextureDescriptor { - inline operator const WGPUExternalTextureDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureView plane0 = nullptr; - TextureView plane1 = nullptr; - Origin2D cropOrigin = {}; - Extent2D cropSize = {}; - Extent2D apparentSize = {}; - Bool doYuvToRgbConversionOnly = false; - float const * yuvToRgbConversionMatrix = nullptr; - float const * srcTransferFunctionParameters = nullptr; - float const * dstTransferFunctionParameters = nullptr; - float const * gamutConversionMatrix = nullptr; - Bool mirrored = false; - ExternalTextureRotation rotation = ExternalTextureRotation::Rotate0Degrees; -}; - -struct FutureWaitInfo { - inline operator const WGPUFutureWaitInfo&() const noexcept; - - Future future = {}; - Bool completed = false; -}; - -struct ImageCopyExternalTexture { - inline operator const WGPUImageCopyExternalTexture&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ExternalTexture externalTexture = nullptr; - Origin3D origin = {}; - Extent2D naturalSize = {}; -}; - -struct InstanceDescriptor { - inline operator const WGPUInstanceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - size_t requiredFeatureCount = 0; - InstanceFeatureName const * requiredFeatures = nullptr; - InstanceLimits const * requiredLimits = nullptr; -}; - -struct Limits { - inline operator const WGPULimits&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - uint32_t maxTextureDimension1D = kLimitU32Undefined; - uint32_t maxTextureDimension2D = kLimitU32Undefined; - uint32_t maxTextureDimension3D = kLimitU32Undefined; - uint32_t maxTextureArrayLayers = kLimitU32Undefined; - uint32_t maxBindGroups = kLimitU32Undefined; - uint32_t maxBindGroupsPlusVertexBuffers = kLimitU32Undefined; - uint32_t maxBindingsPerBindGroup = kLimitU32Undefined; - uint32_t maxDynamicUniformBuffersPerPipelineLayout = kLimitU32Undefined; - uint32_t maxDynamicStorageBuffersPerPipelineLayout = kLimitU32Undefined; - uint32_t maxSampledTexturesPerShaderStage = kLimitU32Undefined; - uint32_t maxSamplersPerShaderStage = kLimitU32Undefined; - uint32_t maxStorageBuffersPerShaderStage = kLimitU32Undefined; - uint32_t maxStorageTexturesPerShaderStage = kLimitU32Undefined; - uint32_t maxUniformBuffersPerShaderStage = kLimitU32Undefined; - uint64_t maxUniformBufferBindingSize = kLimitU64Undefined; - uint64_t maxStorageBufferBindingSize = kLimitU64Undefined; - uint32_t minUniformBufferOffsetAlignment = kLimitU32Undefined; - uint32_t minStorageBufferOffsetAlignment = kLimitU32Undefined; - uint32_t maxVertexBuffers = kLimitU32Undefined; - uint64_t maxBufferSize = kLimitU64Undefined; - uint32_t maxVertexAttributes = kLimitU32Undefined; - uint32_t maxVertexBufferArrayStride = kLimitU32Undefined; - uint32_t maxInterStageShaderVariables = kLimitU32Undefined; - uint32_t maxColorAttachments = kLimitU32Undefined; - uint32_t maxColorAttachmentBytesPerSample = kLimitU32Undefined; - uint32_t maxComputeWorkgroupStorageSize = kLimitU32Undefined; - uint32_t maxComputeInvocationsPerWorkgroup = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeX = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeY = kLimitU32Undefined; - uint32_t maxComputeWorkgroupSizeZ = kLimitU32Undefined; - uint32_t maxComputeWorkgroupsPerDimension = kLimitU32Undefined; - uint32_t maxImmediateSize = kLimitU32Undefined; -}; - -// Can be chained in PipelineLayoutDescriptor -struct PipelineLayoutPixelLocalStorage : ChainedStruct { - inline PipelineLayoutPixelLocalStorage(); - struct Init; - inline PipelineLayoutPixelLocalStorage(Init&& init); - inline operator const WGPUPipelineLayoutPixelLocalStorage&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - PipelineLayoutStorageAttachment const * storageAttachments = nullptr; -}; - -struct RenderPassColorAttachment { - inline operator const WGPURenderPassColorAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureView view = nullptr; - uint32_t depthSlice = kDepthSliceUndefined; - TextureView resolveTarget = nullptr; - LoadOp loadOp = LoadOp::Undefined; - StoreOp storeOp = StoreOp::Undefined; - Color clearValue = {}; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassRenderAreaRect : ChainedStruct { - inline RenderPassRenderAreaRect(); - struct Init; - inline RenderPassRenderAreaRect(Init&& init); - inline operator const WGPURenderPassRenderAreaRect&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Origin2D)); - alignas(kFirstMemberAlignment) Origin2D origin = {}; - Extent2D size = {}; -}; - -struct RenderPassStorageAttachment { - inline operator const WGPURenderPassStorageAttachment&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - TextureView storage = nullptr; - LoadOp loadOp = LoadOp::Undefined; - StoreOp storeOp = StoreOp::Undefined; - Color clearValue = {}; -}; - -struct RequestAdapterOptions { - inline operator const WGPURequestAdapterOptions&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - FeatureLevel featureLevel = FeatureLevel::Undefined; - PowerPreference powerPreference = PowerPreference::Undefined; - Bool forceFallbackAdapter = false; - BackendType backendType = BackendType::Undefined; - Surface compatibleSurface = nullptr; -}; - -struct SamplerDescriptor { - inline operator const WGPUSamplerDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - AddressMode addressModeU = AddressMode::Undefined; - AddressMode addressModeV = AddressMode::Undefined; - AddressMode addressModeW = AddressMode::Undefined; - FilterMode magFilter = FilterMode::Undefined; - FilterMode minFilter = FilterMode::Undefined; - MipmapFilterMode mipmapFilter = MipmapFilterMode::Undefined; - float lodMinClamp = 0.f; - float lodMaxClamp = 32.f; - CompareFunction compare = CompareFunction::Undefined; - uint16_t maxAnisotropy = 1; -}; - -struct ShaderModuleDescriptor { - inline operator const WGPUShaderModuleDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedBufferMemoryDescriptor { - inline operator const WGPUSharedBufferMemoryDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedFenceDescriptor { - inline operator const WGPUSharedFenceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedFenceExportInfo { - inline operator const WGPUSharedFenceExportInfo&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - SharedFenceType type = {}; -}; - -// Can be chained in SharedTextureMemoryProperties -struct SharedTextureMemoryAHardwareBufferProperties : ChainedStructOut { - inline SharedTextureMemoryAHardwareBufferProperties(); - struct Init; - inline SharedTextureMemoryAHardwareBufferProperties(Init&& init); - inline operator const WGPUSharedTextureMemoryAHardwareBufferProperties&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(YCbCrVkDescriptor)); - alignas(kFirstMemberAlignment) YCbCrVkDescriptor yCbCrInfo = {}; -}; - -struct SharedTextureMemoryBeginAccessDescriptor { - inline operator const WGPUSharedTextureMemoryBeginAccessDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - Bool concurrentRead; - Bool initialized; - size_t fenceCount; - SharedFence const * fences = nullptr; - size_t signaledValueCount = 0; - uint64_t const * signaledValues = nullptr; -}; - -// Can be chained in SharedTextureMemoryDescriptor -struct SharedTextureMemoryDmaBufDescriptor : ChainedStruct { - inline SharedTextureMemoryDmaBufDescriptor(); - struct Init; - inline SharedTextureMemoryDmaBufDescriptor(Init&& init); - inline operator const WGPUSharedTextureMemoryDmaBufDescriptor&() const noexcept; - - 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 = nullptr; -}; - -// Can be chained in SharedTextureMemoryEndAccessState -struct SharedTextureMemoryMetalEndAccessState : ChainedStructOut { - inline SharedTextureMemoryMetalEndAccessState(); - struct Init; - inline SharedTextureMemoryMetalEndAccessState(Init&& init); - inline operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStructOut), alignof(Future)); - alignas(kFirstMemberAlignment) Future commandsScheduledFuture = {}; -}; - -struct SurfaceDescriptor { - inline operator const WGPUSurfaceDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct TexelCopyBufferInfo { - inline operator const WGPUTexelCopyBufferInfo&() const noexcept; - - TexelCopyBufferLayout layout = {}; - Buffer buffer = nullptr; -}; - -struct TexelCopyTextureInfo { - inline operator const WGPUTexelCopyTextureInfo&() const noexcept; - - Texture texture = nullptr; - uint32_t mipLevel = 0; - Origin3D origin = {}; - TextureAspect aspect = TextureAspect::Undefined; -}; - -// Can be chained in TextureViewDescriptor -struct TextureComponentSwizzleDescriptor : ChainedStruct { - inline TextureComponentSwizzleDescriptor(); - struct Init; - inline TextureComponentSwizzleDescriptor(Init&& init); - inline operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(TextureComponentSwizzle)); - alignas(kFirstMemberAlignment) TextureComponentSwizzle swizzle = {}; -}; - -struct TextureDescriptor { - inline operator const WGPUTextureDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureUsage usage = TextureUsage::None; - TextureDimension dimension = TextureDimension::Undefined; - Extent3D size = {}; - TextureFormat format = TextureFormat::Undefined; - uint32_t mipLevelCount = 1; - uint32_t sampleCount = 1; - size_t viewFormatCount = 0; - TextureFormat const * viewFormats = nullptr; -}; - -struct VertexBufferLayout { - inline operator const WGPUVertexBufferLayout&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - VertexStepMode stepMode = VertexStepMode::Undefined; - uint64_t arrayStride; - size_t attributeCount; - VertexAttribute const * attributes = nullptr; -}; - -struct AdapterInfo { - inline AdapterInfo(); - inline ~AdapterInfo(); - AdapterInfo(const AdapterInfo&) = delete; - AdapterInfo& operator=(const AdapterInfo&) = delete; - inline AdapterInfo(AdapterInfo&&); - inline AdapterInfo& operator=(AdapterInfo&&); - inline operator const WGPUAdapterInfo&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - StringView const vendor = {}; - StringView const architecture = {}; - StringView const device = {}; - StringView const description = {}; - BackendType const backendType = BackendType::Undefined; - AdapterType const adapterType = {}; - uint32_t const vendorID = {}; - uint32_t const deviceID = {}; - uint32_t const subgroupMinSize = {}; - uint32_t const subgroupMaxSize = {}; - - private: - inline void FreeMembers(); - static inline void Reset(AdapterInfo& value); -}; - -struct BindGroupDescriptor { - inline operator const WGPUBindGroupDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - BindGroupLayout layout = nullptr; - size_t entryCount = 0; - BindGroupEntry const * entries = nullptr; -}; - -struct BindGroupLayoutDescriptor { - inline operator const WGPUBindGroupLayoutDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t entryCount = 0; - BindGroupLayoutEntry const * entries = nullptr; -}; - -struct ColorTargetState { - inline operator const WGPUColorTargetState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - TextureFormat format = TextureFormat::Undefined; - BlendState const * blend = nullptr; - ColorWriteMask writeMask = ColorWriteMask::All; -}; - -struct CompilationInfo { - inline operator const WGPUCompilationInfo&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - size_t messageCount; - CompilationMessage const * messages = nullptr; -}; - -struct ComputePipelineDescriptor { - inline operator const WGPUComputePipelineDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PipelineLayout layout = nullptr; - ComputeState compute = {}; -}; - -struct DawnFormatCapabilities { - inline operator const WGPUDawnFormatCapabilities&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; -}; - -namespace detail { -struct DeviceDescriptor { - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t requiredFeatureCount = 0; - FeatureName const * requiredFeatures = nullptr; - Limits const * requiredLimits = nullptr; - QueueDescriptor defaultQueue = {}; - WGPUDeviceLostCallbackInfo deviceLostCallbackInfo = WGPU_DEVICE_LOST_CALLBACK_INFO_INIT; - WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo = WGPU_UNCAPTURED_ERROR_CALLBACK_INFO_INIT; -}; -} // namespace detail -struct DeviceDescriptor : protected detail::DeviceDescriptor { - inline DeviceDescriptor(); - struct Init; - inline DeviceDescriptor(Init&& init); - inline operator const WGPUDeviceDescriptor&() const noexcept; - - using detail::DeviceDescriptor::nextInChain; - using detail::DeviceDescriptor::label; - using detail::DeviceDescriptor::requiredFeatureCount; - using detail::DeviceDescriptor::requiredFeatures; - using detail::DeviceDescriptor::requiredLimits; - using detail::DeviceDescriptor::defaultQueue; - - template - void SetDeviceLostCallback(CallbackMode callbackMode, F callback, T userdata); - template - void SetDeviceLostCallback(CallbackMode callbackMode, F callback); - template - void SetUncapturedErrorCallback(F callback, T userdata); - template - void SetUncapturedErrorCallback(F callback); -}; - -struct PipelineLayoutDescriptor { - inline operator const WGPUPipelineLayoutDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t bindGroupLayoutCount; - BindGroupLayout const * bindGroupLayouts = nullptr; - uint32_t immediateSize = 0; -}; - -// Can be chained in RenderPassDescriptor -struct RenderPassPixelLocalStorage : ChainedStruct { - inline RenderPassPixelLocalStorage(); - struct Init; - inline RenderPassPixelLocalStorage(Init&& init); - inline operator const WGPURenderPassPixelLocalStorage&() const noexcept; - - static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(uint64_t)); - alignas(kFirstMemberAlignment) uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - RenderPassStorageAttachment const * storageAttachments = nullptr; -}; - -struct SharedTextureMemoryDescriptor { - inline operator const WGPUSharedTextureMemoryDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; -}; - -struct SharedTextureMemoryEndAccessState { - inline SharedTextureMemoryEndAccessState(); - inline ~SharedTextureMemoryEndAccessState(); - SharedTextureMemoryEndAccessState(const SharedTextureMemoryEndAccessState&) = delete; - SharedTextureMemoryEndAccessState& operator=(const SharedTextureMemoryEndAccessState&) = delete; - inline SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&&); - inline SharedTextureMemoryEndAccessState& operator=(SharedTextureMemoryEndAccessState&&); - inline operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - Bool const initialized = {}; - size_t const fenceCount = {}; - SharedFence const * const fences = nullptr; - size_t const signaledValueCount = 0; - uint64_t const * const signaledValues = nullptr; - - private: - inline void FreeMembers(); - static inline void Reset(SharedTextureMemoryEndAccessState& value); -}; - -struct SharedTextureMemoryProperties { - inline operator const WGPUSharedTextureMemoryProperties&() const noexcept; - - ChainedStructOut * nextInChain = nullptr; - TextureUsage usage = TextureUsage::None; - Extent3D size = {}; - TextureFormat format = TextureFormat::Undefined; -}; - -struct TextureViewDescriptor { - inline operator const WGPUTextureViewDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension dimension = TextureViewDimension::Undefined; - uint32_t baseMipLevel = 0; - uint32_t mipLevelCount = kMipLevelCountUndefined; - uint32_t baseArrayLayer = 0; - uint32_t arrayLayerCount = kArrayLayerCountUndefined; - TextureAspect aspect = TextureAspect::Undefined; - TextureUsage usage = TextureUsage::None; -}; - -struct VertexState { - inline operator const WGPUVertexState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; - size_t bufferCount = 0; - VertexBufferLayout const * buffers = nullptr; -}; - -struct FragmentState { - inline operator const WGPUFragmentState&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - ShaderModule module = nullptr; - StringView entryPoint = {}; - size_t constantCount = 0; - ConstantEntry const * constants = nullptr; - size_t targetCount; - ColorTargetState const * targets = nullptr; -}; - -struct RenderPassDescriptor { - inline operator const WGPURenderPassDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - size_t colorAttachmentCount; - RenderPassColorAttachment const * colorAttachments = nullptr; - RenderPassDepthStencilAttachment const * depthStencilAttachment = nullptr; - QuerySet occlusionQuerySet = nullptr; - PassTimestampWrites const * timestampWrites = nullptr; -}; - -struct RenderPipelineDescriptor { - inline operator const WGPURenderPipelineDescriptor&() const noexcept; - - ChainedStruct const * nextInChain = nullptr; - StringView label = {}; - PipelineLayout layout = nullptr; - VertexState vertex = {}; - PrimitiveState primitive = {}; - DepthStencilState const * depthStencil = nullptr; - MultisampleState multisample = {}; - FragmentState const * fragment = nullptr; -}; - - -// Callback info handling is generated and/or custom implemented here to convert the types between C and C++. -namespace detail { -struct Untyped {}; - -// The current interface of CppFTraits exposes the following values: -// - CppFTraits::capturing: true if the callback is a capturing callback (i.e. a lambda that -// captures its environment). -// - CppFTraits::PtrT: The C++ callback function pointer type. -// - CppFTraits::ReturnT: The return type of the C++ callback function pointer. -// - CppFTraits::BaseArgsTuple: A tuple of the C++ arguments minus the user specified typed -// parameter. -// -// Implementation notes: -// - The |Untyped| struct is only used to differentiate whether |T| is a user specified type -// in which case we need to strip the type from the callback arguments for speecialization -// deduction. -template -struct CppFTraitsImpl; -// Specialization for raw function pointers. -template -struct CppFTraitsImpl { - using PtrT = R(*)(CppArgs...); - using ReturnT = R; - static constexpr bool capturing = false; - - static constexpr size_t NumCppArgs = sizeof...(CppArgs); - using BaseArgsTuple = typename decltype([](std::index_sequence) { - return std::type_identity>...>>{}; - }(std::make_index_sequence ? NumCppArgs : NumCppArgs - 1>{}) - )::type; -}; -// Specialization for member function pointers (lambdas); -template -struct CppFTraitsImpl { - using PtrT = R(*)(CppArgs...); - using ReturnT = R; - static constexpr bool capturing = !std::is_convertible_v; - - static constexpr size_t NumCppArgs = sizeof...(CppArgs); - using BaseArgsTuple = typename decltype([](std::index_sequence) { - return std::type_identity>...>>{}; - }(std::make_index_sequence ? NumCppArgs : NumCppArgs - 1>{}) - )::type; -}; -template -struct CppFTraits : CppFTraitsImpl {}; -template -struct CppFTraits : - CppFTraitsImpl {}; - -// CArgConverter are specialization structs that specialize a conversion from a C CallbackInfo's -// callback argument types to a set of valid C++ types. These specializations provide us a way to -// support additional C++ callback types, i.e. converting raw pointers to more C++ friendly -// structures when applicable. -template -struct CArgConverter; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUMapAsyncStatus status, WGPUStringView message) { - return std::make_tuple(static_cast(status), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo) { - return std::make_tuple(static_cast(status), reinterpret_cast(compilationInfo)); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, WGPUStringView message) { - return std::make_tuple(static_cast(status), ComputePipeline::Acquire(pipeline), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, WGPUStringView message) { - return std::make_tuple(static_cast(status), RenderPipeline::Acquire(pipeline), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPULoggingType type, WGPUStringView message) { - return std::make_tuple(static_cast(type), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUPopErrorScopeStatus status, WGPUErrorType type, WGPUStringView message) { - return std::make_tuple(static_cast(status), static_cast(type), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUQueueWorkDoneStatus status, WGPUStringView message) { - return std::make_tuple(static_cast(status), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView message) { - return std::make_tuple(static_cast(status), Adapter::Acquire(adapter), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView message) { - return std::make_tuple(static_cast(status), Device::Acquire(device), StringView { - message.data, - message.length -}); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUDevice const* device, - WGPUDeviceLostReason reason, - WGPUStringView message) { - return std::make_tuple(std::cref(*reinterpret_cast(device)), - static_cast(reason), message); - } -}; -template <> -struct CArgConverter> { - using Result = std::tuple; - static Result Convert(WGPUDevice const* device, WGPUErrorType type, WGPUStringView message) { - return std::make_tuple(std::cref(*reinterpret_cast(device)), - static_cast(type), message); - } -}; -template <> -struct CArgConverter, std::span>> { - using Result = std::tuple, std::span>; - static Result Convert(size_t keySize, uint8_t const* key, size_t valueSize, uint8_t* value) { - return std::make_tuple( - std::span(reinterpret_cast(key), keySize), - std::span(reinterpret_cast(value), valueSize) - ); - } -}; -template <> -struct CArgConverter, std::span>> { - using Result = std::tuple, std::span>; - static Result Convert(size_t keySize, uint8_t const* key, size_t valueSize, uint8_t const* value) { - return std::make_tuple( - std::span(reinterpret_cast(key), keySize), - std::span(reinterpret_cast(value), valueSize) - ); - } -}; - -// The CallbackHelper struct implements the static functions needed to convert the base C callbacks -// into the user provided C++ callbacks. More than anything, it handles converting the real C -// callback arguments (i.e. not the userdata pointers we use internally) to C++ arguments, and -// casts the userdata pointers appropriately to ensure that everything is typed. -template -struct CallbackHelperImpl; -template -struct CallbackHelperImpl, std::index_sequence> { - // Implementation for callbacks without an additional typed argument. We support capturing - // lambdas if users can specify a callback mode in this case and make an allocation. - static R Call(std::tuple_element_t>... cArgs, - void* callbackParam, void*) { - using CppFTraits = CppFTraits; - using Converter = CArgConverter; - - if constexpr (CppFTraits::capturing) { - std::unique_ptr callback(reinterpret_cast(callbackParam)); - return std::apply(*callback, Converter::Convert(cArgs...)); - } else { - auto callback = reinterpret_cast(callbackParam); - return std::apply(callback, Converter::Convert(cArgs...)); - } - } - - // Implementation for callbacks where the user specifies an additional typed argument. We do - // not support capturing lambdas in this case since the user is already providing a typed - // argument and would make more sense for any other state to be capturing by that argument - // instead. - template - static R Call(std::tuple_element_t>... cArgs, - void* callbackParam, void* userdataParam) { - using CppFTraits = CppFTraits; - using Converter = CArgConverter; - - auto callback = reinterpret_cast(callbackParam); - auto param = std::make_tuple(static_cast(userdataParam)); - return std::apply(callback, std::tuple_cat(Converter::Convert(cArgs...), param)); - } -}; -template -struct CallbackHelper; -template -struct CallbackHelper { - static constexpr size_t NumCArgs = sizeof...(CArgs); - using CArgsTuple = std::tuple; - static_assert(NumCArgs >= 2, "C Function pointers must have two void* trailing arguments."); - static_assert( - std::is_same_v, void*>, - "C Function pointer's last argument must be void*." - ); - static_assert( - std::is_same_v, void*>, - "C Function pointer's second to last argument must be void*." - ); - - using Impl = CallbackHelperImpl>; - static R Call(CArgs... args) { - return Impl::Call(std::forward(args)...); - } - template - static R Call(CArgs... args) { - return Impl::template Call(std::forward(args)...); - } -}; - -// The CallbackInfoHelper provides a utility to create a C CallbackInfo struct type from a C++ -// callback. This allows us to de-duplicates the logic used for WebGPU structs that have -// CallbackInfo members and WebGPU API functions that return a Future. -template -struct CallbackInfoHelper { - static CInfoT Create(F lambda) { - CInfoT info = {}; - if constexpr (CppFTraits::capturing) { - if constexpr (requires(CInfoT x) { x.mode; }) { - // If we have a mode argument, then the callback is guaranteed to be called only - // once so we can support it by moving it and making an allocation for it. - std::unique_ptr alloc = std::make_unique(std::move(lambda)); - info.userdata1 = reinterpret_cast(alloc.release()); - } else { - // MSVC <=19.39 doesn't support static_assert(false) and this was fixed in later C++ - // standards https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html - constexpr bool kAlwaysFalse = sizeof(F) == 0; - static_assert( - kAlwaysFalse, "capturing lambdas aren't supported for repeatable callbacks" - ); - } - } else { - // Otherwise, if the lambda is not capturing, that means we can refer to it as a - // pointer directly. - info.userdata1 = reinterpret_cast(+lambda); - } - info.callback = CallbackHelper::Call; - info.userdata2 = nullptr; - return info; - } - - template - requires (!CppFTraits::capturing) - static CInfoT Create(F lambda, T userdata) { - CInfoT info = {}; - info.callback = CallbackHelper::template Call; - info.userdata1 = reinterpret_cast(+lambda); - info.userdata2 = userdata; - return info; - } -}; - -} // namespace detail - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -// error: 'offsetof' within non-standard-layout type 'wgpu::XXX' is conditionally-supported -#pragma GCC diagnostic ignored "-Winvalid-offsetof" -#endif - -// AdapterPropertiesD3D implementation -AdapterPropertiesD3D::AdapterPropertiesD3D() -: ChainedStructOut { nullptr, SType::AdapterPropertiesD3D } {} -struct AdapterPropertiesD3D::Init { - ChainedStructOut * nextInChain; - uint32_t shaderModel; -}; -AdapterPropertiesD3D::AdapterPropertiesD3D(AdapterPropertiesD3D::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesD3D }, - shaderModel(std::move(init.shaderModel)) {} - -AdapterPropertiesD3D::operator const WGPUAdapterPropertiesD3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesD3D) == sizeof(WGPUAdapterPropertiesD3D), "sizeof mismatch for AdapterPropertiesD3D"); -static_assert(alignof(AdapterPropertiesD3D) == alignof(WGPUAdapterPropertiesD3D), "alignof mismatch for AdapterPropertiesD3D"); -static_assert(offsetof(AdapterPropertiesD3D, shaderModel) == offsetof(WGPUAdapterPropertiesD3D, shaderModel), - "offsetof mismatch for AdapterPropertiesD3D::shaderModel"); - -// AdapterPropertiesDrm implementation -AdapterPropertiesDrm::AdapterPropertiesDrm() -: ChainedStructOut { nullptr, SType::AdapterPropertiesDrm } {} -struct AdapterPropertiesDrm::Init { - ChainedStructOut * nextInChain; - Bool hasPrimary = false; - Bool hasRender = false; - uint64_t primaryMajor = 0; - uint64_t primaryMinor = 0; - uint64_t renderMajor = 0; - uint64_t renderMinor = 0; -}; -AdapterPropertiesDrm::AdapterPropertiesDrm(AdapterPropertiesDrm::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesDrm }, - hasPrimary(std::move(init.hasPrimary)), - hasRender(std::move(init.hasRender)), - primaryMajor(std::move(init.primaryMajor)), - primaryMinor(std::move(init.primaryMinor)), - renderMajor(std::move(init.renderMajor)), - renderMinor(std::move(init.renderMinor)) {} - -AdapterPropertiesDrm::operator const WGPUAdapterPropertiesDrm&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesDrm) == sizeof(WGPUAdapterPropertiesDrm), "sizeof mismatch for AdapterPropertiesDrm"); -static_assert(alignof(AdapterPropertiesDrm) == alignof(WGPUAdapterPropertiesDrm), "alignof mismatch for AdapterPropertiesDrm"); -static_assert(offsetof(AdapterPropertiesDrm, hasPrimary) == offsetof(WGPUAdapterPropertiesDrm, hasPrimary), - "offsetof mismatch for AdapterPropertiesDrm::hasPrimary"); -static_assert(offsetof(AdapterPropertiesDrm, hasRender) == offsetof(WGPUAdapterPropertiesDrm, hasRender), - "offsetof mismatch for AdapterPropertiesDrm::hasRender"); -static_assert(offsetof(AdapterPropertiesDrm, primaryMajor) == offsetof(WGPUAdapterPropertiesDrm, primaryMajor), - "offsetof mismatch for AdapterPropertiesDrm::primaryMajor"); -static_assert(offsetof(AdapterPropertiesDrm, primaryMinor) == offsetof(WGPUAdapterPropertiesDrm, primaryMinor), - "offsetof mismatch for AdapterPropertiesDrm::primaryMinor"); -static_assert(offsetof(AdapterPropertiesDrm, renderMajor) == offsetof(WGPUAdapterPropertiesDrm, renderMajor), - "offsetof mismatch for AdapterPropertiesDrm::renderMajor"); -static_assert(offsetof(AdapterPropertiesDrm, renderMinor) == offsetof(WGPUAdapterPropertiesDrm, renderMinor), - "offsetof mismatch for AdapterPropertiesDrm::renderMinor"); - -// AdapterPropertiesVk implementation -AdapterPropertiesVk::AdapterPropertiesVk() -: ChainedStructOut { nullptr, SType::AdapterPropertiesVk } {} -struct AdapterPropertiesVk::Init { - ChainedStructOut * nextInChain; - uint32_t driverVersion; -}; -AdapterPropertiesVk::AdapterPropertiesVk(AdapterPropertiesVk::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesVk }, - driverVersion(std::move(init.driverVersion)) {} - -AdapterPropertiesVk::operator const WGPUAdapterPropertiesVk&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesVk) == sizeof(WGPUAdapterPropertiesVk), "sizeof mismatch for AdapterPropertiesVk"); -static_assert(alignof(AdapterPropertiesVk) == alignof(WGPUAdapterPropertiesVk), "alignof mismatch for AdapterPropertiesVk"); -static_assert(offsetof(AdapterPropertiesVk, driverVersion) == offsetof(WGPUAdapterPropertiesVk, driverVersion), - "offsetof mismatch for AdapterPropertiesVk::driverVersion"); - -// AdapterPropertiesWGPU implementation -AdapterPropertiesWGPU::AdapterPropertiesWGPU() -: ChainedStructOut { nullptr, SType::AdapterPropertiesWGPU } {} -struct AdapterPropertiesWGPU::Init { - ChainedStructOut * nextInChain; - BackendType backendType = BackendType::Undefined; -}; -AdapterPropertiesWGPU::AdapterPropertiesWGPU(AdapterPropertiesWGPU::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesWGPU }, - backendType(std::move(init.backendType)) {} - -AdapterPropertiesWGPU::operator const WGPUAdapterPropertiesWGPU&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesWGPU) == sizeof(WGPUAdapterPropertiesWGPU), "sizeof mismatch for AdapterPropertiesWGPU"); -static_assert(alignof(AdapterPropertiesWGPU) == alignof(WGPUAdapterPropertiesWGPU), "alignof mismatch for AdapterPropertiesWGPU"); -static_assert(offsetof(AdapterPropertiesWGPU, backendType) == offsetof(WGPUAdapterPropertiesWGPU, backendType), - "offsetof mismatch for AdapterPropertiesWGPU::backendType"); - -// BindingResource implementation - -BindingResource::operator const WGPUBindingResource&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindingResource) == sizeof(WGPUBindingResource), "sizeof mismatch for BindingResource"); -static_assert(alignof(BindingResource) == alignof(WGPUBindingResource), "alignof mismatch for BindingResource"); -static_assert(offsetof(BindingResource, nextInChain) == offsetof(WGPUBindingResource, nextInChain), - "offsetof mismatch for BindingResource::nextInChain"); -static_assert(offsetof(BindingResource, buffer) == offsetof(WGPUBindingResource, buffer), - "offsetof mismatch for BindingResource::buffer"); -static_assert(offsetof(BindingResource, offset) == offsetof(WGPUBindingResource, offset), - "offsetof mismatch for BindingResource::offset"); -static_assert(offsetof(BindingResource, size) == offsetof(WGPUBindingResource, size), - "offsetof mismatch for BindingResource::size"); -static_assert(offsetof(BindingResource, sampler) == offsetof(WGPUBindingResource, sampler), - "offsetof mismatch for BindingResource::sampler"); -static_assert(offsetof(BindingResource, textureView) == offsetof(WGPUBindingResource, textureView), - "offsetof mismatch for BindingResource::textureView"); - -// BlendComponent implementation - -BlendComponent::operator const WGPUBlendComponent&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BlendComponent) == sizeof(WGPUBlendComponent), "sizeof mismatch for BlendComponent"); -static_assert(alignof(BlendComponent) == alignof(WGPUBlendComponent), "alignof mismatch for BlendComponent"); -static_assert(offsetof(BlendComponent, operation) == offsetof(WGPUBlendComponent, operation), - "offsetof mismatch for BlendComponent::operation"); -static_assert(offsetof(BlendComponent, srcFactor) == offsetof(WGPUBlendComponent, srcFactor), - "offsetof mismatch for BlendComponent::srcFactor"); -static_assert(offsetof(BlendComponent, dstFactor) == offsetof(WGPUBlendComponent, dstFactor), - "offsetof mismatch for BlendComponent::dstFactor"); - -// BufferBindingLayout implementation - -BufferBindingLayout::operator const WGPUBufferBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferBindingLayout) == sizeof(WGPUBufferBindingLayout), "sizeof mismatch for BufferBindingLayout"); -static_assert(alignof(BufferBindingLayout) == alignof(WGPUBufferBindingLayout), "alignof mismatch for BufferBindingLayout"); -static_assert(offsetof(BufferBindingLayout, nextInChain) == offsetof(WGPUBufferBindingLayout, nextInChain), - "offsetof mismatch for BufferBindingLayout::nextInChain"); -static_assert(offsetof(BufferBindingLayout, type) == offsetof(WGPUBufferBindingLayout, type), - "offsetof mismatch for BufferBindingLayout::type"); -static_assert(offsetof(BufferBindingLayout, hasDynamicOffset) == offsetof(WGPUBufferBindingLayout, hasDynamicOffset), - "offsetof mismatch for BufferBindingLayout::hasDynamicOffset"); -static_assert(offsetof(BufferBindingLayout, minBindingSize) == offsetof(WGPUBufferBindingLayout, minBindingSize), - "offsetof mismatch for BufferBindingLayout::minBindingSize"); - -// BufferHostMappedPointer implementation -BufferHostMappedPointer::BufferHostMappedPointer() -: ChainedStruct { nullptr, SType::BufferHostMappedPointer } {} -struct BufferHostMappedPointer::Init { - ChainedStruct * const nextInChain; - void * pointer; - Callback disposeCallback; - void * userdata; -}; -BufferHostMappedPointer::BufferHostMappedPointer(BufferHostMappedPointer::Init&& init) : - ChainedStruct { init.nextInChain, SType::BufferHostMappedPointer }, - pointer(std::move(init.pointer)), - disposeCallback(std::move(init.disposeCallback)), - userdata(std::move(init.userdata)) {} - -BufferHostMappedPointer::operator const WGPUBufferHostMappedPointer&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferHostMappedPointer) == sizeof(WGPUBufferHostMappedPointer), "sizeof mismatch for BufferHostMappedPointer"); -static_assert(alignof(BufferHostMappedPointer) == alignof(WGPUBufferHostMappedPointer), "alignof mismatch for BufferHostMappedPointer"); -static_assert(offsetof(BufferHostMappedPointer, pointer) == offsetof(WGPUBufferHostMappedPointer, pointer), - "offsetof mismatch for BufferHostMappedPointer::pointer"); -static_assert(offsetof(BufferHostMappedPointer, disposeCallback) == offsetof(WGPUBufferHostMappedPointer, disposeCallback), - "offsetof mismatch for BufferHostMappedPointer::disposeCallback"); -static_assert(offsetof(BufferHostMappedPointer, userdata) == offsetof(WGPUBufferHostMappedPointer, userdata), - "offsetof mismatch for BufferHostMappedPointer::userdata"); - -// Color implementation - -Color::operator const WGPUColor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Color) == sizeof(WGPUColor), "sizeof mismatch for Color"); -static_assert(alignof(Color) == alignof(WGPUColor), "alignof mismatch for Color"); -static_assert(offsetof(Color, r) == offsetof(WGPUColor, r), - "offsetof mismatch for Color::r"); -static_assert(offsetof(Color, g) == offsetof(WGPUColor, g), - "offsetof mismatch for Color::g"); -static_assert(offsetof(Color, b) == offsetof(WGPUColor, b), - "offsetof mismatch for Color::b"); -static_assert(offsetof(Color, a) == offsetof(WGPUColor, a), - "offsetof mismatch for Color::a"); - -// ColorSpaceDawn implementation - -ColorSpaceDawn::operator const WGPUColorSpaceDawn&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorSpaceDawn) == sizeof(WGPUColorSpaceDawn), "sizeof mismatch for ColorSpaceDawn"); -static_assert(alignof(ColorSpaceDawn) == alignof(WGPUColorSpaceDawn), "alignof mismatch for ColorSpaceDawn"); -static_assert(offsetof(ColorSpaceDawn, nextInChain) == offsetof(WGPUColorSpaceDawn, nextInChain), - "offsetof mismatch for ColorSpaceDawn::nextInChain"); -static_assert(offsetof(ColorSpaceDawn, primaries) == offsetof(WGPUColorSpaceDawn, primaries), - "offsetof mismatch for ColorSpaceDawn::primaries"); -static_assert(offsetof(ColorSpaceDawn, transfer) == offsetof(WGPUColorSpaceDawn, transfer), - "offsetof mismatch for ColorSpaceDawn::transfer"); -static_assert(offsetof(ColorSpaceDawn, yCbCrRange) == offsetof(WGPUColorSpaceDawn, yCbCrRange), - "offsetof mismatch for ColorSpaceDawn::yCbCrRange"); -static_assert(offsetof(ColorSpaceDawn, yCbCrMatrix) == offsetof(WGPUColorSpaceDawn, yCbCrMatrix), - "offsetof mismatch for ColorSpaceDawn::yCbCrMatrix"); - -// ColorTargetStateExpandResolveTextureDawn implementation -ColorTargetStateExpandResolveTextureDawn::ColorTargetStateExpandResolveTextureDawn() -: ChainedStruct { nullptr, SType::ColorTargetStateExpandResolveTextureDawn } {} -struct ColorTargetStateExpandResolveTextureDawn::Init { - ChainedStruct * const nextInChain; - Bool enabled = false; -}; -ColorTargetStateExpandResolveTextureDawn::ColorTargetStateExpandResolveTextureDawn(ColorTargetStateExpandResolveTextureDawn::Init&& init) : - ChainedStruct { init.nextInChain, SType::ColorTargetStateExpandResolveTextureDawn }, - enabled(std::move(init.enabled)) {} - -ColorTargetStateExpandResolveTextureDawn::operator const WGPUColorTargetStateExpandResolveTextureDawn&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorTargetStateExpandResolveTextureDawn) == sizeof(WGPUColorTargetStateExpandResolveTextureDawn), "sizeof mismatch for ColorTargetStateExpandResolveTextureDawn"); -static_assert(alignof(ColorTargetStateExpandResolveTextureDawn) == alignof(WGPUColorTargetStateExpandResolveTextureDawn), "alignof mismatch for ColorTargetStateExpandResolveTextureDawn"); -static_assert(offsetof(ColorTargetStateExpandResolveTextureDawn, enabled) == offsetof(WGPUColorTargetStateExpandResolveTextureDawn, enabled), - "offsetof mismatch for ColorTargetStateExpandResolveTextureDawn::enabled"); - -// CommandBufferDescriptor implementation - -CommandBufferDescriptor::operator const WGPUCommandBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CommandBufferDescriptor) == sizeof(WGPUCommandBufferDescriptor), "sizeof mismatch for CommandBufferDescriptor"); -static_assert(alignof(CommandBufferDescriptor) == alignof(WGPUCommandBufferDescriptor), "alignof mismatch for CommandBufferDescriptor"); -static_assert(offsetof(CommandBufferDescriptor, nextInChain) == offsetof(WGPUCommandBufferDescriptor, nextInChain), - "offsetof mismatch for CommandBufferDescriptor::nextInChain"); -static_assert(offsetof(CommandBufferDescriptor, label) == offsetof(WGPUCommandBufferDescriptor, label), - "offsetof mismatch for CommandBufferDescriptor::label"); - -// CompatibilityModeLimits implementation -CompatibilityModeLimits::CompatibilityModeLimits() -: ChainedStructOut { nullptr, SType::CompatibilityModeLimits } {} -struct CompatibilityModeLimits::Init { - ChainedStructOut * nextInChain; - uint32_t maxStorageBuffersInVertexStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInVertexStage = kLimitU32Undefined; - uint32_t maxStorageBuffersInFragmentStage = kLimitU32Undefined; - uint32_t maxStorageTexturesInFragmentStage = kLimitU32Undefined; -}; -CompatibilityModeLimits::CompatibilityModeLimits(CompatibilityModeLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::CompatibilityModeLimits }, - maxStorageBuffersInVertexStage(std::move(init.maxStorageBuffersInVertexStage)), - maxStorageTexturesInVertexStage(std::move(init.maxStorageTexturesInVertexStage)), - maxStorageBuffersInFragmentStage(std::move(init.maxStorageBuffersInFragmentStage)), - maxStorageTexturesInFragmentStage(std::move(init.maxStorageTexturesInFragmentStage)) {} - -CompatibilityModeLimits::operator const WGPUCompatibilityModeLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompatibilityModeLimits) == sizeof(WGPUCompatibilityModeLimits), "sizeof mismatch for CompatibilityModeLimits"); -static_assert(alignof(CompatibilityModeLimits) == alignof(WGPUCompatibilityModeLimits), "alignof mismatch for CompatibilityModeLimits"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageBuffersInVertexStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageBuffersInVertexStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageBuffersInVertexStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageTexturesInVertexStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageTexturesInVertexStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageTexturesInVertexStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageBuffersInFragmentStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageBuffersInFragmentStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageBuffersInFragmentStage"); -static_assert(offsetof(CompatibilityModeLimits, maxStorageTexturesInFragmentStage) == offsetof(WGPUCompatibilityModeLimits, maxStorageTexturesInFragmentStage), - "offsetof mismatch for CompatibilityModeLimits::maxStorageTexturesInFragmentStage"); - -// ConstantEntry implementation - -ConstantEntry::operator const WGPUConstantEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ConstantEntry) == sizeof(WGPUConstantEntry), "sizeof mismatch for ConstantEntry"); -static_assert(alignof(ConstantEntry) == alignof(WGPUConstantEntry), "alignof mismatch for ConstantEntry"); -static_assert(offsetof(ConstantEntry, nextInChain) == offsetof(WGPUConstantEntry, nextInChain), - "offsetof mismatch for ConstantEntry::nextInChain"); -static_assert(offsetof(ConstantEntry, key) == offsetof(WGPUConstantEntry, key), - "offsetof mismatch for ConstantEntry::key"); -static_assert(offsetof(ConstantEntry, value) == offsetof(WGPUConstantEntry, value), - "offsetof mismatch for ConstantEntry::value"); - -// CopyTextureForBrowserOptions implementation - -CopyTextureForBrowserOptions::operator const WGPUCopyTextureForBrowserOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CopyTextureForBrowserOptions) == sizeof(WGPUCopyTextureForBrowserOptions), "sizeof mismatch for CopyTextureForBrowserOptions"); -static_assert(alignof(CopyTextureForBrowserOptions) == alignof(WGPUCopyTextureForBrowserOptions), "alignof mismatch for CopyTextureForBrowserOptions"); -static_assert(offsetof(CopyTextureForBrowserOptions, nextInChain) == offsetof(WGPUCopyTextureForBrowserOptions, nextInChain), - "offsetof mismatch for CopyTextureForBrowserOptions::nextInChain"); -static_assert(offsetof(CopyTextureForBrowserOptions, flipY) == offsetof(WGPUCopyTextureForBrowserOptions, flipY), - "offsetof mismatch for CopyTextureForBrowserOptions::flipY"); -static_assert(offsetof(CopyTextureForBrowserOptions, needsColorSpaceConversion) == offsetof(WGPUCopyTextureForBrowserOptions, needsColorSpaceConversion), - "offsetof mismatch for CopyTextureForBrowserOptions::needsColorSpaceConversion"); -static_assert(offsetof(CopyTextureForBrowserOptions, srcAlphaMode) == offsetof(WGPUCopyTextureForBrowserOptions, srcAlphaMode), - "offsetof mismatch for CopyTextureForBrowserOptions::srcAlphaMode"); -static_assert(offsetof(CopyTextureForBrowserOptions, srcTransferFunctionParameters) == offsetof(WGPUCopyTextureForBrowserOptions, srcTransferFunctionParameters), - "offsetof mismatch for CopyTextureForBrowserOptions::srcTransferFunctionParameters"); -static_assert(offsetof(CopyTextureForBrowserOptions, conversionMatrix) == offsetof(WGPUCopyTextureForBrowserOptions, conversionMatrix), - "offsetof mismatch for CopyTextureForBrowserOptions::conversionMatrix"); -static_assert(offsetof(CopyTextureForBrowserOptions, dstTransferFunctionParameters) == offsetof(WGPUCopyTextureForBrowserOptions, dstTransferFunctionParameters), - "offsetof mismatch for CopyTextureForBrowserOptions::dstTransferFunctionParameters"); -static_assert(offsetof(CopyTextureForBrowserOptions, dstAlphaMode) == offsetof(WGPUCopyTextureForBrowserOptions, dstAlphaMode), - "offsetof mismatch for CopyTextureForBrowserOptions::dstAlphaMode"); -static_assert(offsetof(CopyTextureForBrowserOptions, internalUsage) == offsetof(WGPUCopyTextureForBrowserOptions, internalUsage), - "offsetof mismatch for CopyTextureForBrowserOptions::internalUsage"); - -// DawnAdapterPropertiesPowerPreference implementation -DawnAdapterPropertiesPowerPreference::DawnAdapterPropertiesPowerPreference() -: ChainedStructOut { nullptr, SType::DawnAdapterPropertiesPowerPreference } {} -struct DawnAdapterPropertiesPowerPreference::Init { - ChainedStructOut * nextInChain; - PowerPreference powerPreference = PowerPreference::Undefined; -}; -DawnAdapterPropertiesPowerPreference::DawnAdapterPropertiesPowerPreference(DawnAdapterPropertiesPowerPreference::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnAdapterPropertiesPowerPreference }, - powerPreference(std::move(init.powerPreference)) {} - -DawnAdapterPropertiesPowerPreference::operator const WGPUDawnAdapterPropertiesPowerPreference&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnAdapterPropertiesPowerPreference) == sizeof(WGPUDawnAdapterPropertiesPowerPreference), "sizeof mismatch for DawnAdapterPropertiesPowerPreference"); -static_assert(alignof(DawnAdapterPropertiesPowerPreference) == alignof(WGPUDawnAdapterPropertiesPowerPreference), "alignof mismatch for DawnAdapterPropertiesPowerPreference"); -static_assert(offsetof(DawnAdapterPropertiesPowerPreference, powerPreference) == offsetof(WGPUDawnAdapterPropertiesPowerPreference, powerPreference), - "offsetof mismatch for DawnAdapterPropertiesPowerPreference::powerPreference"); - -// DawnBufferDescriptorErrorInfoFromWireClient implementation -DawnBufferDescriptorErrorInfoFromWireClient::DawnBufferDescriptorErrorInfoFromWireClient() -: ChainedStruct { nullptr, SType::DawnBufferDescriptorErrorInfoFromWireClient } {} -struct DawnBufferDescriptorErrorInfoFromWireClient::Init { - ChainedStruct * const nextInChain; - Bool outOfMemory = false; -}; -DawnBufferDescriptorErrorInfoFromWireClient::DawnBufferDescriptorErrorInfoFromWireClient(DawnBufferDescriptorErrorInfoFromWireClient::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnBufferDescriptorErrorInfoFromWireClient }, - outOfMemory(std::move(init.outOfMemory)) {} - -DawnBufferDescriptorErrorInfoFromWireClient::operator const WGPUDawnBufferDescriptorErrorInfoFromWireClient&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnBufferDescriptorErrorInfoFromWireClient) == sizeof(WGPUDawnBufferDescriptorErrorInfoFromWireClient), "sizeof mismatch for DawnBufferDescriptorErrorInfoFromWireClient"); -static_assert(alignof(DawnBufferDescriptorErrorInfoFromWireClient) == alignof(WGPUDawnBufferDescriptorErrorInfoFromWireClient), "alignof mismatch for DawnBufferDescriptorErrorInfoFromWireClient"); -static_assert(offsetof(DawnBufferDescriptorErrorInfoFromWireClient, outOfMemory) == offsetof(WGPUDawnBufferDescriptorErrorInfoFromWireClient, outOfMemory), - "offsetof mismatch for DawnBufferDescriptorErrorInfoFromWireClient::outOfMemory"); - -// DawnCacheDeviceDescriptor implementation -DawnCacheDeviceDescriptor::DawnCacheDeviceDescriptor() -: ChainedStruct { nullptr, SType::DawnCacheDeviceDescriptor } {} -struct DawnCacheDeviceDescriptor::Init { - ChainedStruct * const nextInChain; - StringView isolationKey = {}; - DawnLoadCacheDataFunction loadDataFunction = nullptr; - DawnStoreCacheDataFunction storeDataFunction = nullptr; - void * functionUserdata = nullptr; -}; -DawnCacheDeviceDescriptor::DawnCacheDeviceDescriptor(DawnCacheDeviceDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnCacheDeviceDescriptor }, - detail::DawnCacheDeviceDescriptor { - std::move(init.isolationKey), - std::move(init.loadDataFunction), - std::move(init.storeDataFunction), - std::move(init.functionUserdata), - } {} -template -void DawnCacheDeviceDescriptor::SetDawnLoadCacheDataCallback(F callback, T userdata) { - static_assert(offsetof(DawnCacheDeviceDescriptor, dawnLoadCacheDataCallbackInfo) == offsetof(WGPUDawnCacheDeviceDescriptor, dawnLoadCacheDataCallbackInfo), - "offsetof mismatch for DawnCacheDeviceDescriptor::dawnLoadCacheDataCallbackInfo"); - - assert(dawnLoadCacheDataCallbackInfo.callback == nullptr); - dawnLoadCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DawnCacheDeviceDescriptor::SetDawnLoadCacheDataCallback(F callback) { - assert(dawnLoadCacheDataCallbackInfo.callback == nullptr); - dawnLoadCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} -template -void DawnCacheDeviceDescriptor::SetDawnStoreCacheDataCallback(F callback, T userdata) { - static_assert(offsetof(DawnCacheDeviceDescriptor, dawnStoreCacheDataCallbackInfo) == offsetof(WGPUDawnCacheDeviceDescriptor, dawnStoreCacheDataCallbackInfo), - "offsetof mismatch for DawnCacheDeviceDescriptor::dawnStoreCacheDataCallbackInfo"); - - assert(dawnStoreCacheDataCallbackInfo.callback == nullptr); - dawnStoreCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DawnCacheDeviceDescriptor::SetDawnStoreCacheDataCallback(F callback) { - assert(dawnStoreCacheDataCallbackInfo.callback == nullptr); - dawnStoreCacheDataCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} - -DawnCacheDeviceDescriptor::operator const WGPUDawnCacheDeviceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnCacheDeviceDescriptor) == sizeof(WGPUDawnCacheDeviceDescriptor), "sizeof mismatch for DawnCacheDeviceDescriptor"); -static_assert(alignof(DawnCacheDeviceDescriptor) == alignof(WGPUDawnCacheDeviceDescriptor), "alignof mismatch for DawnCacheDeviceDescriptor"); -static_assert(offsetof(DawnCacheDeviceDescriptor, isolationKey) == offsetof(WGPUDawnCacheDeviceDescriptor, isolationKey), - "offsetof mismatch for DawnCacheDeviceDescriptor::isolationKey"); -static_assert(offsetof(DawnCacheDeviceDescriptor, loadDataFunction) == offsetof(WGPUDawnCacheDeviceDescriptor, loadDataFunction), - "offsetof mismatch for DawnCacheDeviceDescriptor::loadDataFunction"); -static_assert(offsetof(DawnCacheDeviceDescriptor, storeDataFunction) == offsetof(WGPUDawnCacheDeviceDescriptor, storeDataFunction), - "offsetof mismatch for DawnCacheDeviceDescriptor::storeDataFunction"); -static_assert(offsetof(DawnCacheDeviceDescriptor, functionUserdata) == offsetof(WGPUDawnCacheDeviceDescriptor, functionUserdata), - "offsetof mismatch for DawnCacheDeviceDescriptor::functionUserdata"); - -// DawnCompilationMessageUtf16 implementation -DawnCompilationMessageUtf16::DawnCompilationMessageUtf16() -: ChainedStruct { nullptr, SType::DawnCompilationMessageUtf16 } {} -struct DawnCompilationMessageUtf16::Init { - ChainedStruct * const nextInChain; - uint64_t linePos; - uint64_t offset; - uint64_t length; -}; -DawnCompilationMessageUtf16::DawnCompilationMessageUtf16(DawnCompilationMessageUtf16::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnCompilationMessageUtf16 }, - linePos(std::move(init.linePos)), - offset(std::move(init.offset)), - length(std::move(init.length)) {} - -DawnCompilationMessageUtf16::operator const WGPUDawnCompilationMessageUtf16&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnCompilationMessageUtf16) == sizeof(WGPUDawnCompilationMessageUtf16), "sizeof mismatch for DawnCompilationMessageUtf16"); -static_assert(alignof(DawnCompilationMessageUtf16) == alignof(WGPUDawnCompilationMessageUtf16), "alignof mismatch for DawnCompilationMessageUtf16"); -static_assert(offsetof(DawnCompilationMessageUtf16, linePos) == offsetof(WGPUDawnCompilationMessageUtf16, linePos), - "offsetof mismatch for DawnCompilationMessageUtf16::linePos"); -static_assert(offsetof(DawnCompilationMessageUtf16, offset) == offsetof(WGPUDawnCompilationMessageUtf16, offset), - "offsetof mismatch for DawnCompilationMessageUtf16::offset"); -static_assert(offsetof(DawnCompilationMessageUtf16, length) == offsetof(WGPUDawnCompilationMessageUtf16, length), - "offsetof mismatch for DawnCompilationMessageUtf16::length"); - -// DawnConsumeAdapterDescriptor implementation -DawnConsumeAdapterDescriptor::DawnConsumeAdapterDescriptor() -: ChainedStruct { nullptr, SType::DawnConsumeAdapterDescriptor } {} -struct DawnConsumeAdapterDescriptor::Init { - ChainedStruct * const nextInChain; - Bool consumeAdapter = false; -}; -DawnConsumeAdapterDescriptor::DawnConsumeAdapterDescriptor(DawnConsumeAdapterDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnConsumeAdapterDescriptor }, - consumeAdapter(std::move(init.consumeAdapter)) {} - -DawnConsumeAdapterDescriptor::operator const WGPUDawnConsumeAdapterDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnConsumeAdapterDescriptor) == sizeof(WGPUDawnConsumeAdapterDescriptor), "sizeof mismatch for DawnConsumeAdapterDescriptor"); -static_assert(alignof(DawnConsumeAdapterDescriptor) == alignof(WGPUDawnConsumeAdapterDescriptor), "alignof mismatch for DawnConsumeAdapterDescriptor"); -static_assert(offsetof(DawnConsumeAdapterDescriptor, consumeAdapter) == offsetof(WGPUDawnConsumeAdapterDescriptor, consumeAdapter), - "offsetof mismatch for DawnConsumeAdapterDescriptor::consumeAdapter"); - -// DawnDeviceAllocatorControl implementation -DawnDeviceAllocatorControl::DawnDeviceAllocatorControl() -: ChainedStruct { nullptr, SType::DawnDeviceAllocatorControl } {} -struct DawnDeviceAllocatorControl::Init { - ChainedStruct * const nextInChain; - size_t allocatorHeapBlockSize = 0; -}; -DawnDeviceAllocatorControl::DawnDeviceAllocatorControl(DawnDeviceAllocatorControl::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnDeviceAllocatorControl }, - allocatorHeapBlockSize(std::move(init.allocatorHeapBlockSize)) {} - -DawnDeviceAllocatorControl::operator const WGPUDawnDeviceAllocatorControl&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDeviceAllocatorControl) == sizeof(WGPUDawnDeviceAllocatorControl), "sizeof mismatch for DawnDeviceAllocatorControl"); -static_assert(alignof(DawnDeviceAllocatorControl) == alignof(WGPUDawnDeviceAllocatorControl), "alignof mismatch for DawnDeviceAllocatorControl"); -static_assert(offsetof(DawnDeviceAllocatorControl, allocatorHeapBlockSize) == offsetof(WGPUDawnDeviceAllocatorControl, allocatorHeapBlockSize), - "offsetof mismatch for DawnDeviceAllocatorControl::allocatorHeapBlockSize"); - -// DawnDrmFormatProperties implementation - -DawnDrmFormatProperties::operator const WGPUDawnDrmFormatProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDrmFormatProperties) == sizeof(WGPUDawnDrmFormatProperties), "sizeof mismatch for DawnDrmFormatProperties"); -static_assert(alignof(DawnDrmFormatProperties) == alignof(WGPUDawnDrmFormatProperties), "alignof mismatch for DawnDrmFormatProperties"); -static_assert(offsetof(DawnDrmFormatProperties, modifier) == offsetof(WGPUDawnDrmFormatProperties, modifier), - "offsetof mismatch for DawnDrmFormatProperties::modifier"); -static_assert(offsetof(DawnDrmFormatProperties, modifierPlaneCount) == offsetof(WGPUDawnDrmFormatProperties, modifierPlaneCount), - "offsetof mismatch for DawnDrmFormatProperties::modifierPlaneCount"); - -// DawnEncoderInternalUsageDescriptor implementation -DawnEncoderInternalUsageDescriptor::DawnEncoderInternalUsageDescriptor() -: ChainedStruct { nullptr, SType::DawnEncoderInternalUsageDescriptor } {} -struct DawnEncoderInternalUsageDescriptor::Init { - ChainedStruct * const nextInChain; - Bool useInternalUsages = false; -}; -DawnEncoderInternalUsageDescriptor::DawnEncoderInternalUsageDescriptor(DawnEncoderInternalUsageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnEncoderInternalUsageDescriptor }, - useInternalUsages(std::move(init.useInternalUsages)) {} - -DawnEncoderInternalUsageDescriptor::operator const WGPUDawnEncoderInternalUsageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnEncoderInternalUsageDescriptor) == sizeof(WGPUDawnEncoderInternalUsageDescriptor), "sizeof mismatch for DawnEncoderInternalUsageDescriptor"); -static_assert(alignof(DawnEncoderInternalUsageDescriptor) == alignof(WGPUDawnEncoderInternalUsageDescriptor), "alignof mismatch for DawnEncoderInternalUsageDescriptor"); -static_assert(offsetof(DawnEncoderInternalUsageDescriptor, useInternalUsages) == offsetof(WGPUDawnEncoderInternalUsageDescriptor, useInternalUsages), - "offsetof mismatch for DawnEncoderInternalUsageDescriptor::useInternalUsages"); - -// DawnFakeBufferOOMForTesting implementation -DawnFakeBufferOOMForTesting::DawnFakeBufferOOMForTesting() -: ChainedStruct { nullptr, SType::DawnFakeBufferOOMForTesting } {} -struct DawnFakeBufferOOMForTesting::Init { - ChainedStruct * const nextInChain; - Bool fakeOOMAtWireClientMap; - Bool fakeOOMAtNativeMap; - Bool fakeOOMAtDevice; -}; -DawnFakeBufferOOMForTesting::DawnFakeBufferOOMForTesting(DawnFakeBufferOOMForTesting::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnFakeBufferOOMForTesting }, - fakeOOMAtWireClientMap(std::move(init.fakeOOMAtWireClientMap)), - fakeOOMAtNativeMap(std::move(init.fakeOOMAtNativeMap)), - fakeOOMAtDevice(std::move(init.fakeOOMAtDevice)) {} - -DawnFakeBufferOOMForTesting::operator const WGPUDawnFakeBufferOOMForTesting&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFakeBufferOOMForTesting) == sizeof(WGPUDawnFakeBufferOOMForTesting), "sizeof mismatch for DawnFakeBufferOOMForTesting"); -static_assert(alignof(DawnFakeBufferOOMForTesting) == alignof(WGPUDawnFakeBufferOOMForTesting), "alignof mismatch for DawnFakeBufferOOMForTesting"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtWireClientMap) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtWireClientMap), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtWireClientMap"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtNativeMap) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtNativeMap), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtNativeMap"); -static_assert(offsetof(DawnFakeBufferOOMForTesting, fakeOOMAtDevice) == offsetof(WGPUDawnFakeBufferOOMForTesting, fakeOOMAtDevice), - "offsetof mismatch for DawnFakeBufferOOMForTesting::fakeOOMAtDevice"); - -// DawnFakeDeviceInitializeErrorForTesting implementation -DawnFakeDeviceInitializeErrorForTesting::DawnFakeDeviceInitializeErrorForTesting() -: ChainedStruct { nullptr, SType::DawnFakeDeviceInitializeErrorForTesting } {} -struct DawnFakeDeviceInitializeErrorForTesting::Init { - ChainedStruct * const nextInChain; -}; -DawnFakeDeviceInitializeErrorForTesting::DawnFakeDeviceInitializeErrorForTesting(DawnFakeDeviceInitializeErrorForTesting::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnFakeDeviceInitializeErrorForTesting } {} - -DawnFakeDeviceInitializeErrorForTesting::operator const WGPUDawnFakeDeviceInitializeErrorForTesting&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFakeDeviceInitializeErrorForTesting) == sizeof(WGPUDawnFakeDeviceInitializeErrorForTesting), "sizeof mismatch for DawnFakeDeviceInitializeErrorForTesting"); -static_assert(alignof(DawnFakeDeviceInitializeErrorForTesting) == alignof(WGPUDawnFakeDeviceInitializeErrorForTesting), "alignof mismatch for DawnFakeDeviceInitializeErrorForTesting"); - -// DawnHostMappedPointerLimits implementation -DawnHostMappedPointerLimits::DawnHostMappedPointerLimits() -: ChainedStructOut { nullptr, SType::DawnHostMappedPointerLimits } {} -struct DawnHostMappedPointerLimits::Init { - ChainedStructOut * nextInChain; - uint32_t hostMappedPointerAlignment = kLimitU32Undefined; -}; -DawnHostMappedPointerLimits::DawnHostMappedPointerLimits(DawnHostMappedPointerLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnHostMappedPointerLimits }, - hostMappedPointerAlignment(std::move(init.hostMappedPointerAlignment)) {} - -DawnHostMappedPointerLimits::operator const WGPUDawnHostMappedPointerLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnHostMappedPointerLimits) == sizeof(WGPUDawnHostMappedPointerLimits), "sizeof mismatch for DawnHostMappedPointerLimits"); -static_assert(alignof(DawnHostMappedPointerLimits) == alignof(WGPUDawnHostMappedPointerLimits), "alignof mismatch for DawnHostMappedPointerLimits"); -static_assert(offsetof(DawnHostMappedPointerLimits, hostMappedPointerAlignment) == offsetof(WGPUDawnHostMappedPointerLimits, hostMappedPointerAlignment), - "offsetof mismatch for DawnHostMappedPointerLimits::hostMappedPointerAlignment"); - -// DawnInjectedInvalidSType implementation -DawnInjectedInvalidSType::DawnInjectedInvalidSType() -: ChainedStruct { nullptr, SType::DawnInjectedInvalidSType } {} -struct DawnInjectedInvalidSType::Init { - ChainedStruct * const nextInChain; - SType invalidSType = {}; -}; -DawnInjectedInvalidSType::DawnInjectedInvalidSType(DawnInjectedInvalidSType::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnInjectedInvalidSType }, - invalidSType(std::move(init.invalidSType)) {} - -DawnInjectedInvalidSType::operator const WGPUDawnInjectedInvalidSType&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnInjectedInvalidSType) == sizeof(WGPUDawnInjectedInvalidSType), "sizeof mismatch for DawnInjectedInvalidSType"); -static_assert(alignof(DawnInjectedInvalidSType) == alignof(WGPUDawnInjectedInvalidSType), "alignof mismatch for DawnInjectedInvalidSType"); -static_assert(offsetof(DawnInjectedInvalidSType, invalidSType) == offsetof(WGPUDawnInjectedInvalidSType, invalidSType), - "offsetof mismatch for DawnInjectedInvalidSType::invalidSType"); - -// DawnRenderPassSampleCount implementation -DawnRenderPassSampleCount::DawnRenderPassSampleCount() -: ChainedStruct { nullptr, SType::DawnRenderPassSampleCount } {} -struct DawnRenderPassSampleCount::Init { - ChainedStruct * const nextInChain; - uint32_t sampleCount = 1; -}; -DawnRenderPassSampleCount::DawnRenderPassSampleCount(DawnRenderPassSampleCount::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnRenderPassSampleCount }, - sampleCount(std::move(init.sampleCount)) {} - -DawnRenderPassSampleCount::operator const WGPUDawnRenderPassSampleCount&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnRenderPassSampleCount) == sizeof(WGPUDawnRenderPassSampleCount), "sizeof mismatch for DawnRenderPassSampleCount"); -static_assert(alignof(DawnRenderPassSampleCount) == alignof(WGPUDawnRenderPassSampleCount), "alignof mismatch for DawnRenderPassSampleCount"); -static_assert(offsetof(DawnRenderPassSampleCount, sampleCount) == offsetof(WGPUDawnRenderPassSampleCount, sampleCount), - "offsetof mismatch for DawnRenderPassSampleCount::sampleCount"); - -// DawnShaderModuleSPIRVOptionsDescriptor implementation -DawnShaderModuleSPIRVOptionsDescriptor::DawnShaderModuleSPIRVOptionsDescriptor() -: ChainedStruct { nullptr, SType::DawnShaderModuleSPIRVOptionsDescriptor } {} -struct DawnShaderModuleSPIRVOptionsDescriptor::Init { - ChainedStruct * const nextInChain; - Bool allowNonUniformDerivatives = false; -}; -DawnShaderModuleSPIRVOptionsDescriptor::DawnShaderModuleSPIRVOptionsDescriptor(DawnShaderModuleSPIRVOptionsDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnShaderModuleSPIRVOptionsDescriptor }, - allowNonUniformDerivatives(std::move(init.allowNonUniformDerivatives)) {} - -DawnShaderModuleSPIRVOptionsDescriptor::operator const WGPUDawnShaderModuleSPIRVOptionsDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnShaderModuleSPIRVOptionsDescriptor) == sizeof(WGPUDawnShaderModuleSPIRVOptionsDescriptor), "sizeof mismatch for DawnShaderModuleSPIRVOptionsDescriptor"); -static_assert(alignof(DawnShaderModuleSPIRVOptionsDescriptor) == alignof(WGPUDawnShaderModuleSPIRVOptionsDescriptor), "alignof mismatch for DawnShaderModuleSPIRVOptionsDescriptor"); -static_assert(offsetof(DawnShaderModuleSPIRVOptionsDescriptor, allowNonUniformDerivatives) == offsetof(WGPUDawnShaderModuleSPIRVOptionsDescriptor, allowNonUniformDerivatives), - "offsetof mismatch for DawnShaderModuleSPIRVOptionsDescriptor::allowNonUniformDerivatives"); - -// DawnTexelCopyBufferRowAlignmentLimits implementation -DawnTexelCopyBufferRowAlignmentLimits::DawnTexelCopyBufferRowAlignmentLimits() -: ChainedStructOut { nullptr, SType::DawnTexelCopyBufferRowAlignmentLimits } {} -struct DawnTexelCopyBufferRowAlignmentLimits::Init { - ChainedStructOut * nextInChain; - uint32_t minTexelCopyBufferRowAlignment = kLimitU32Undefined; -}; -DawnTexelCopyBufferRowAlignmentLimits::DawnTexelCopyBufferRowAlignmentLimits(DawnTexelCopyBufferRowAlignmentLimits::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnTexelCopyBufferRowAlignmentLimits }, - minTexelCopyBufferRowAlignment(std::move(init.minTexelCopyBufferRowAlignment)) {} - -DawnTexelCopyBufferRowAlignmentLimits::operator const WGPUDawnTexelCopyBufferRowAlignmentLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTexelCopyBufferRowAlignmentLimits) == sizeof(WGPUDawnTexelCopyBufferRowAlignmentLimits), "sizeof mismatch for DawnTexelCopyBufferRowAlignmentLimits"); -static_assert(alignof(DawnTexelCopyBufferRowAlignmentLimits) == alignof(WGPUDawnTexelCopyBufferRowAlignmentLimits), "alignof mismatch for DawnTexelCopyBufferRowAlignmentLimits"); -static_assert(offsetof(DawnTexelCopyBufferRowAlignmentLimits, minTexelCopyBufferRowAlignment) == offsetof(WGPUDawnTexelCopyBufferRowAlignmentLimits, minTexelCopyBufferRowAlignment), - "offsetof mismatch for DawnTexelCopyBufferRowAlignmentLimits::minTexelCopyBufferRowAlignment"); - -// DawnTextureInternalUsageDescriptor implementation -DawnTextureInternalUsageDescriptor::DawnTextureInternalUsageDescriptor() -: ChainedStruct { nullptr, SType::DawnTextureInternalUsageDescriptor } {} -struct DawnTextureInternalUsageDescriptor::Init { - ChainedStruct * const nextInChain; - TextureUsage internalUsage = TextureUsage::None; -}; -DawnTextureInternalUsageDescriptor::DawnTextureInternalUsageDescriptor(DawnTextureInternalUsageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnTextureInternalUsageDescriptor }, - internalUsage(std::move(init.internalUsage)) {} - -DawnTextureInternalUsageDescriptor::operator const WGPUDawnTextureInternalUsageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTextureInternalUsageDescriptor) == sizeof(WGPUDawnTextureInternalUsageDescriptor), "sizeof mismatch for DawnTextureInternalUsageDescriptor"); -static_assert(alignof(DawnTextureInternalUsageDescriptor) == alignof(WGPUDawnTextureInternalUsageDescriptor), "alignof mismatch for DawnTextureInternalUsageDescriptor"); -static_assert(offsetof(DawnTextureInternalUsageDescriptor, internalUsage) == offsetof(WGPUDawnTextureInternalUsageDescriptor, internalUsage), - "offsetof mismatch for DawnTextureInternalUsageDescriptor::internalUsage"); - -// DawnTogglesDescriptor implementation -DawnTogglesDescriptor::DawnTogglesDescriptor() -: ChainedStruct { nullptr, SType::DawnTogglesDescriptor } {} -struct DawnTogglesDescriptor::Init { - ChainedStruct * const nextInChain; - size_t enabledToggleCount = 0; - const char* const * enabledToggles = nullptr; - size_t disabledToggleCount = 0; - const char* const * disabledToggles = nullptr; -}; -DawnTogglesDescriptor::DawnTogglesDescriptor(DawnTogglesDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnTogglesDescriptor }, - enabledToggleCount(std::move(init.enabledToggleCount)), - enabledToggles(std::move(init.enabledToggles)), - disabledToggleCount(std::move(init.disabledToggleCount)), - disabledToggles(std::move(init.disabledToggles)) {} - -DawnTogglesDescriptor::operator const WGPUDawnTogglesDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnTogglesDescriptor) == sizeof(WGPUDawnTogglesDescriptor), "sizeof mismatch for DawnTogglesDescriptor"); -static_assert(alignof(DawnTogglesDescriptor) == alignof(WGPUDawnTogglesDescriptor), "alignof mismatch for DawnTogglesDescriptor"); -static_assert(offsetof(DawnTogglesDescriptor, enabledToggleCount) == offsetof(WGPUDawnTogglesDescriptor, enabledToggleCount), - "offsetof mismatch for DawnTogglesDescriptor::enabledToggleCount"); -static_assert(offsetof(DawnTogglesDescriptor, enabledToggles) == offsetof(WGPUDawnTogglesDescriptor, enabledToggles), - "offsetof mismatch for DawnTogglesDescriptor::enabledToggles"); -static_assert(offsetof(DawnTogglesDescriptor, disabledToggleCount) == offsetof(WGPUDawnTogglesDescriptor, disabledToggleCount), - "offsetof mismatch for DawnTogglesDescriptor::disabledToggleCount"); -static_assert(offsetof(DawnTogglesDescriptor, disabledToggles) == offsetof(WGPUDawnTogglesDescriptor, disabledToggles), - "offsetof mismatch for DawnTogglesDescriptor::disabledToggles"); - -// DawnWGSLBlocklist implementation -DawnWGSLBlocklist::DawnWGSLBlocklist() -: ChainedStruct { nullptr, SType::DawnWGSLBlocklist } {} -struct DawnWGSLBlocklist::Init { - ChainedStruct * const nextInChain; - size_t blocklistedFeatureCount = 0; - const char* const * blocklistedFeatures = nullptr; -}; -DawnWGSLBlocklist::DawnWGSLBlocklist(DawnWGSLBlocklist::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnWGSLBlocklist }, - blocklistedFeatureCount(std::move(init.blocklistedFeatureCount)), - blocklistedFeatures(std::move(init.blocklistedFeatures)) {} - -DawnWGSLBlocklist::operator const WGPUDawnWGSLBlocklist&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnWGSLBlocklist) == sizeof(WGPUDawnWGSLBlocklist), "sizeof mismatch for DawnWGSLBlocklist"); -static_assert(alignof(DawnWGSLBlocklist) == alignof(WGPUDawnWGSLBlocklist), "alignof mismatch for DawnWGSLBlocklist"); -static_assert(offsetof(DawnWGSLBlocklist, blocklistedFeatureCount) == offsetof(WGPUDawnWGSLBlocklist, blocklistedFeatureCount), - "offsetof mismatch for DawnWGSLBlocklist::blocklistedFeatureCount"); -static_assert(offsetof(DawnWGSLBlocklist, blocklistedFeatures) == offsetof(WGPUDawnWGSLBlocklist, blocklistedFeatures), - "offsetof mismatch for DawnWGSLBlocklist::blocklistedFeatures"); - -// DawnWireWGSLControl implementation -DawnWireWGSLControl::DawnWireWGSLControl() -: ChainedStruct { nullptr, SType::DawnWireWGSLControl } {} -struct DawnWireWGSLControl::Init { - ChainedStruct * const nextInChain; - Bool enableExperimental = false; - Bool enableUnsafe = false; - Bool enableTesting = false; -}; -DawnWireWGSLControl::DawnWireWGSLControl(DawnWireWGSLControl::Init&& init) : - ChainedStruct { init.nextInChain, SType::DawnWireWGSLControl }, - enableExperimental(std::move(init.enableExperimental)), - enableUnsafe(std::move(init.enableUnsafe)), - enableTesting(std::move(init.enableTesting)) {} - -DawnWireWGSLControl::operator const WGPUDawnWireWGSLControl&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnWireWGSLControl) == sizeof(WGPUDawnWireWGSLControl), "sizeof mismatch for DawnWireWGSLControl"); -static_assert(alignof(DawnWireWGSLControl) == alignof(WGPUDawnWireWGSLControl), "alignof mismatch for DawnWireWGSLControl"); -static_assert(offsetof(DawnWireWGSLControl, enableExperimental) == offsetof(WGPUDawnWireWGSLControl, enableExperimental), - "offsetof mismatch for DawnWireWGSLControl::enableExperimental"); -static_assert(offsetof(DawnWireWGSLControl, enableUnsafe) == offsetof(WGPUDawnWireWGSLControl, enableUnsafe), - "offsetof mismatch for DawnWireWGSLControl::enableUnsafe"); -static_assert(offsetof(DawnWireWGSLControl, enableTesting) == offsetof(WGPUDawnWireWGSLControl, enableTesting), - "offsetof mismatch for DawnWireWGSLControl::enableTesting"); - -// Extent2D implementation - -Extent2D::operator const WGPUExtent2D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Extent2D) == sizeof(WGPUExtent2D), "sizeof mismatch for Extent2D"); -static_assert(alignof(Extent2D) == alignof(WGPUExtent2D), "alignof mismatch for Extent2D"); -static_assert(offsetof(Extent2D, width) == offsetof(WGPUExtent2D, width), - "offsetof mismatch for Extent2D::width"); -static_assert(offsetof(Extent2D, height) == offsetof(WGPUExtent2D, height), - "offsetof mismatch for Extent2D::height"); - -// Extent3D implementation - -Extent3D::operator const WGPUExtent3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Extent3D) == sizeof(WGPUExtent3D), "sizeof mismatch for Extent3D"); -static_assert(alignof(Extent3D) == alignof(WGPUExtent3D), "alignof mismatch for Extent3D"); -static_assert(offsetof(Extent3D, width) == offsetof(WGPUExtent3D, width), - "offsetof mismatch for Extent3D::width"); -static_assert(offsetof(Extent3D, height) == offsetof(WGPUExtent3D, height), - "offsetof mismatch for Extent3D::height"); -static_assert(offsetof(Extent3D, depthOrArrayLayers) == offsetof(WGPUExtent3D, depthOrArrayLayers), - "offsetof mismatch for Extent3D::depthOrArrayLayers"); - -// ExternalTextureBindingEntry implementation -ExternalTextureBindingEntry::ExternalTextureBindingEntry() -: ChainedStruct { nullptr, SType::ExternalTextureBindingEntry } {} -struct ExternalTextureBindingEntry::Init { - ChainedStruct * const nextInChain; - ExternalTexture externalTexture = nullptr; -}; -ExternalTextureBindingEntry::ExternalTextureBindingEntry(ExternalTextureBindingEntry::Init&& init) : - ChainedStruct { init.nextInChain, SType::ExternalTextureBindingEntry }, - externalTexture(std::move(init.externalTexture)) {} - -ExternalTextureBindingEntry::operator const WGPUExternalTextureBindingEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureBindingEntry) == sizeof(WGPUExternalTextureBindingEntry), "sizeof mismatch for ExternalTextureBindingEntry"); -static_assert(alignof(ExternalTextureBindingEntry) == alignof(WGPUExternalTextureBindingEntry), "alignof mismatch for ExternalTextureBindingEntry"); -static_assert(offsetof(ExternalTextureBindingEntry, externalTexture) == offsetof(WGPUExternalTextureBindingEntry, externalTexture), - "offsetof mismatch for ExternalTextureBindingEntry::externalTexture"); - -// ExternalTextureBindingLayout implementation -ExternalTextureBindingLayout::ExternalTextureBindingLayout() -: ChainedStruct { nullptr, SType::ExternalTextureBindingLayout } {} -struct ExternalTextureBindingLayout::Init { - ChainedStruct * const nextInChain; -}; -ExternalTextureBindingLayout::ExternalTextureBindingLayout(ExternalTextureBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::ExternalTextureBindingLayout } {} - -ExternalTextureBindingLayout::operator const WGPUExternalTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureBindingLayout) == sizeof(WGPUExternalTextureBindingLayout), "sizeof mismatch for ExternalTextureBindingLayout"); -static_assert(alignof(ExternalTextureBindingLayout) == alignof(WGPUExternalTextureBindingLayout), "alignof mismatch for ExternalTextureBindingLayout"); - -// Future implementation - -Future::operator const WGPUFuture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Future) == sizeof(WGPUFuture), "sizeof mismatch for Future"); -static_assert(alignof(Future) == alignof(WGPUFuture), "alignof mismatch for Future"); -static_assert(offsetof(Future, id) == offsetof(WGPUFuture, id), - "offsetof mismatch for Future::id"); - -// InstanceLimits implementation - -InstanceLimits::operator const WGPUInstanceLimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(InstanceLimits) == sizeof(WGPUInstanceLimits), "sizeof mismatch for InstanceLimits"); -static_assert(alignof(InstanceLimits) == alignof(WGPUInstanceLimits), "alignof mismatch for InstanceLimits"); -static_assert(offsetof(InstanceLimits, nextInChain) == offsetof(WGPUInstanceLimits, nextInChain), - "offsetof mismatch for InstanceLimits::nextInChain"); -static_assert(offsetof(InstanceLimits, timedWaitAnyMaxCount) == offsetof(WGPUInstanceLimits, timedWaitAnyMaxCount), - "offsetof mismatch for InstanceLimits::timedWaitAnyMaxCount"); - -// MemoryHeapInfo implementation - -MemoryHeapInfo::operator const WGPUMemoryHeapInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(MemoryHeapInfo) == sizeof(WGPUMemoryHeapInfo), "sizeof mismatch for MemoryHeapInfo"); -static_assert(alignof(MemoryHeapInfo) == alignof(WGPUMemoryHeapInfo), "alignof mismatch for MemoryHeapInfo"); -static_assert(offsetof(MemoryHeapInfo, properties) == offsetof(WGPUMemoryHeapInfo, properties), - "offsetof mismatch for MemoryHeapInfo::properties"); -static_assert(offsetof(MemoryHeapInfo, size) == offsetof(WGPUMemoryHeapInfo, size), - "offsetof mismatch for MemoryHeapInfo::size"); - -// MultisampleState implementation - -MultisampleState::operator const WGPUMultisampleState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(MultisampleState) == sizeof(WGPUMultisampleState), "sizeof mismatch for MultisampleState"); -static_assert(alignof(MultisampleState) == alignof(WGPUMultisampleState), "alignof mismatch for MultisampleState"); -static_assert(offsetof(MultisampleState, nextInChain) == offsetof(WGPUMultisampleState, nextInChain), - "offsetof mismatch for MultisampleState::nextInChain"); -static_assert(offsetof(MultisampleState, count) == offsetof(WGPUMultisampleState, count), - "offsetof mismatch for MultisampleState::count"); -static_assert(offsetof(MultisampleState, mask) == offsetof(WGPUMultisampleState, mask), - "offsetof mismatch for MultisampleState::mask"); -static_assert(offsetof(MultisampleState, alphaToCoverageEnabled) == offsetof(WGPUMultisampleState, alphaToCoverageEnabled), - "offsetof mismatch for MultisampleState::alphaToCoverageEnabled"); - -// Origin2D implementation - -Origin2D::operator const WGPUOrigin2D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Origin2D) == sizeof(WGPUOrigin2D), "sizeof mismatch for Origin2D"); -static_assert(alignof(Origin2D) == alignof(WGPUOrigin2D), "alignof mismatch for Origin2D"); -static_assert(offsetof(Origin2D, x) == offsetof(WGPUOrigin2D, x), - "offsetof mismatch for Origin2D::x"); -static_assert(offsetof(Origin2D, y) == offsetof(WGPUOrigin2D, y), - "offsetof mismatch for Origin2D::y"); - -// Origin3D implementation - -Origin3D::operator const WGPUOrigin3D&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Origin3D) == sizeof(WGPUOrigin3D), "sizeof mismatch for Origin3D"); -static_assert(alignof(Origin3D) == alignof(WGPUOrigin3D), "alignof mismatch for Origin3D"); -static_assert(offsetof(Origin3D, x) == offsetof(WGPUOrigin3D, x), - "offsetof mismatch for Origin3D::x"); -static_assert(offsetof(Origin3D, y) == offsetof(WGPUOrigin3D, y), - "offsetof mismatch for Origin3D::y"); -static_assert(offsetof(Origin3D, z) == offsetof(WGPUOrigin3D, z), - "offsetof mismatch for Origin3D::z"); - -// PassTimestampWrites implementation - -PassTimestampWrites::operator const WGPUPassTimestampWrites&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PassTimestampWrites) == sizeof(WGPUPassTimestampWrites), "sizeof mismatch for PassTimestampWrites"); -static_assert(alignof(PassTimestampWrites) == alignof(WGPUPassTimestampWrites), "alignof mismatch for PassTimestampWrites"); -static_assert(offsetof(PassTimestampWrites, nextInChain) == offsetof(WGPUPassTimestampWrites, nextInChain), - "offsetof mismatch for PassTimestampWrites::nextInChain"); -static_assert(offsetof(PassTimestampWrites, querySet) == offsetof(WGPUPassTimestampWrites, querySet), - "offsetof mismatch for PassTimestampWrites::querySet"); -static_assert(offsetof(PassTimestampWrites, beginningOfPassWriteIndex) == offsetof(WGPUPassTimestampWrites, beginningOfPassWriteIndex), - "offsetof mismatch for PassTimestampWrites::beginningOfPassWriteIndex"); -static_assert(offsetof(PassTimestampWrites, endOfPassWriteIndex) == offsetof(WGPUPassTimestampWrites, endOfPassWriteIndex), - "offsetof mismatch for PassTimestampWrites::endOfPassWriteIndex"); - -// PipelineLayoutResourceTable implementation -PipelineLayoutResourceTable::PipelineLayoutResourceTable() -: ChainedStruct { nullptr, SType::PipelineLayoutResourceTable } {} -struct PipelineLayoutResourceTable::Init { - ChainedStruct * const nextInChain; - Bool usesResourceTable = false; -}; -PipelineLayoutResourceTable::PipelineLayoutResourceTable(PipelineLayoutResourceTable::Init&& init) : - ChainedStruct { init.nextInChain, SType::PipelineLayoutResourceTable }, - usesResourceTable(std::move(init.usesResourceTable)) {} - -PipelineLayoutResourceTable::operator const WGPUPipelineLayoutResourceTable&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutResourceTable) == sizeof(WGPUPipelineLayoutResourceTable), "sizeof mismatch for PipelineLayoutResourceTable"); -static_assert(alignof(PipelineLayoutResourceTable) == alignof(WGPUPipelineLayoutResourceTable), "alignof mismatch for PipelineLayoutResourceTable"); -static_assert(offsetof(PipelineLayoutResourceTable, usesResourceTable) == offsetof(WGPUPipelineLayoutResourceTable, usesResourceTable), - "offsetof mismatch for PipelineLayoutResourceTable::usesResourceTable"); - -// PipelineLayoutStorageAttachment implementation - -PipelineLayoutStorageAttachment::operator const WGPUPipelineLayoutStorageAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutStorageAttachment) == sizeof(WGPUPipelineLayoutStorageAttachment), "sizeof mismatch for PipelineLayoutStorageAttachment"); -static_assert(alignof(PipelineLayoutStorageAttachment) == alignof(WGPUPipelineLayoutStorageAttachment), "alignof mismatch for PipelineLayoutStorageAttachment"); -static_assert(offsetof(PipelineLayoutStorageAttachment, nextInChain) == offsetof(WGPUPipelineLayoutStorageAttachment, nextInChain), - "offsetof mismatch for PipelineLayoutStorageAttachment::nextInChain"); -static_assert(offsetof(PipelineLayoutStorageAttachment, offset) == offsetof(WGPUPipelineLayoutStorageAttachment, offset), - "offsetof mismatch for PipelineLayoutStorageAttachment::offset"); -static_assert(offsetof(PipelineLayoutStorageAttachment, format) == offsetof(WGPUPipelineLayoutStorageAttachment, format), - "offsetof mismatch for PipelineLayoutStorageAttachment::format"); - -// PrimitiveState implementation - -PrimitiveState::operator const WGPUPrimitiveState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PrimitiveState) == sizeof(WGPUPrimitiveState), "sizeof mismatch for PrimitiveState"); -static_assert(alignof(PrimitiveState) == alignof(WGPUPrimitiveState), "alignof mismatch for PrimitiveState"); -static_assert(offsetof(PrimitiveState, nextInChain) == offsetof(WGPUPrimitiveState, nextInChain), - "offsetof mismatch for PrimitiveState::nextInChain"); -static_assert(offsetof(PrimitiveState, topology) == offsetof(WGPUPrimitiveState, topology), - "offsetof mismatch for PrimitiveState::topology"); -static_assert(offsetof(PrimitiveState, stripIndexFormat) == offsetof(WGPUPrimitiveState, stripIndexFormat), - "offsetof mismatch for PrimitiveState::stripIndexFormat"); -static_assert(offsetof(PrimitiveState, frontFace) == offsetof(WGPUPrimitiveState, frontFace), - "offsetof mismatch for PrimitiveState::frontFace"); -static_assert(offsetof(PrimitiveState, cullMode) == offsetof(WGPUPrimitiveState, cullMode), - "offsetof mismatch for PrimitiveState::cullMode"); -static_assert(offsetof(PrimitiveState, unclippedDepth) == offsetof(WGPUPrimitiveState, unclippedDepth), - "offsetof mismatch for PrimitiveState::unclippedDepth"); - -// QuerySetDescriptor implementation - -QuerySetDescriptor::operator const WGPUQuerySetDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(QuerySetDescriptor) == sizeof(WGPUQuerySetDescriptor), "sizeof mismatch for QuerySetDescriptor"); -static_assert(alignof(QuerySetDescriptor) == alignof(WGPUQuerySetDescriptor), "alignof mismatch for QuerySetDescriptor"); -static_assert(offsetof(QuerySetDescriptor, nextInChain) == offsetof(WGPUQuerySetDescriptor, nextInChain), - "offsetof mismatch for QuerySetDescriptor::nextInChain"); -static_assert(offsetof(QuerySetDescriptor, label) == offsetof(WGPUQuerySetDescriptor, label), - "offsetof mismatch for QuerySetDescriptor::label"); -static_assert(offsetof(QuerySetDescriptor, type) == offsetof(WGPUQuerySetDescriptor, type), - "offsetof mismatch for QuerySetDescriptor::type"); -static_assert(offsetof(QuerySetDescriptor, count) == offsetof(WGPUQuerySetDescriptor, count), - "offsetof mismatch for QuerySetDescriptor::count"); - -// QueueDescriptor implementation - -QueueDescriptor::operator const WGPUQueueDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(QueueDescriptor) == sizeof(WGPUQueueDescriptor), "sizeof mismatch for QueueDescriptor"); -static_assert(alignof(QueueDescriptor) == alignof(WGPUQueueDescriptor), "alignof mismatch for QueueDescriptor"); -static_assert(offsetof(QueueDescriptor, nextInChain) == offsetof(WGPUQueueDescriptor, nextInChain), - "offsetof mismatch for QueueDescriptor::nextInChain"); -static_assert(offsetof(QueueDescriptor, label) == offsetof(WGPUQueueDescriptor, label), - "offsetof mismatch for QueueDescriptor::label"); - -// RenderBundleDescriptor implementation - -RenderBundleDescriptor::operator const WGPURenderBundleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderBundleDescriptor) == sizeof(WGPURenderBundleDescriptor), "sizeof mismatch for RenderBundleDescriptor"); -static_assert(alignof(RenderBundleDescriptor) == alignof(WGPURenderBundleDescriptor), "alignof mismatch for RenderBundleDescriptor"); -static_assert(offsetof(RenderBundleDescriptor, nextInChain) == offsetof(WGPURenderBundleDescriptor, nextInChain), - "offsetof mismatch for RenderBundleDescriptor::nextInChain"); -static_assert(offsetof(RenderBundleDescriptor, label) == offsetof(WGPURenderBundleDescriptor, label), - "offsetof mismatch for RenderBundleDescriptor::label"); - -// RenderBundleEncoderDescriptor implementation - -RenderBundleEncoderDescriptor::operator const WGPURenderBundleEncoderDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderBundleEncoderDescriptor) == sizeof(WGPURenderBundleEncoderDescriptor), "sizeof mismatch for RenderBundleEncoderDescriptor"); -static_assert(alignof(RenderBundleEncoderDescriptor) == alignof(WGPURenderBundleEncoderDescriptor), "alignof mismatch for RenderBundleEncoderDescriptor"); -static_assert(offsetof(RenderBundleEncoderDescriptor, nextInChain) == offsetof(WGPURenderBundleEncoderDescriptor, nextInChain), - "offsetof mismatch for RenderBundleEncoderDescriptor::nextInChain"); -static_assert(offsetof(RenderBundleEncoderDescriptor, label) == offsetof(WGPURenderBundleEncoderDescriptor, label), - "offsetof mismatch for RenderBundleEncoderDescriptor::label"); -static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormatCount) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormatCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormatCount"); -static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormats) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormats), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormats"); -static_assert(offsetof(RenderBundleEncoderDescriptor, depthStencilFormat) == offsetof(WGPURenderBundleEncoderDescriptor, depthStencilFormat), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthStencilFormat"); -static_assert(offsetof(RenderBundleEncoderDescriptor, sampleCount) == offsetof(WGPURenderBundleEncoderDescriptor, sampleCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::sampleCount"); -static_assert(offsetof(RenderBundleEncoderDescriptor, depthReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, depthReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthReadOnly"); -static_assert(offsetof(RenderBundleEncoderDescriptor, stencilReadOnly) == offsetof(WGPURenderBundleEncoderDescriptor, stencilReadOnly), - "offsetof mismatch for RenderBundleEncoderDescriptor::stencilReadOnly"); - -// RenderPassDepthStencilAttachment implementation - -RenderPassDepthStencilAttachment::operator const WGPURenderPassDepthStencilAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDepthStencilAttachment) == sizeof(WGPURenderPassDepthStencilAttachment), "sizeof mismatch for RenderPassDepthStencilAttachment"); -static_assert(alignof(RenderPassDepthStencilAttachment) == alignof(WGPURenderPassDepthStencilAttachment), "alignof mismatch for RenderPassDepthStencilAttachment"); -static_assert(offsetof(RenderPassDepthStencilAttachment, nextInChain) == offsetof(WGPURenderPassDepthStencilAttachment, nextInChain), - "offsetof mismatch for RenderPassDepthStencilAttachment::nextInChain"); -static_assert(offsetof(RenderPassDepthStencilAttachment, view) == offsetof(WGPURenderPassDepthStencilAttachment, view), - "offsetof mismatch for RenderPassDepthStencilAttachment::view"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthLoadOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, depthStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthStoreOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, depthClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthClearValue"); -static_assert(offsetof(RenderPassDepthStencilAttachment, depthReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, depthReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::depthReadOnly"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilLoadOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilLoadOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilStoreOp) == offsetof(WGPURenderPassDepthStencilAttachment, stencilStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilStoreOp"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilClearValue) == offsetof(WGPURenderPassDepthStencilAttachment, stencilClearValue), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilClearValue"); -static_assert(offsetof(RenderPassDepthStencilAttachment, stencilReadOnly) == offsetof(WGPURenderPassDepthStencilAttachment, stencilReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachment::stencilReadOnly"); - -// RenderPassDescriptorResolveRect implementation -RenderPassDescriptorResolveRect::RenderPassDescriptorResolveRect() -: ChainedStruct { nullptr, SType::RenderPassDescriptorResolveRect } {} -struct RenderPassDescriptorResolveRect::Init { - ChainedStruct * const nextInChain; - uint32_t colorOffsetX; - uint32_t colorOffsetY; - uint32_t resolveOffsetX; - uint32_t resolveOffsetY; - uint32_t width; - uint32_t height; -}; -RenderPassDescriptorResolveRect::RenderPassDescriptorResolveRect(RenderPassDescriptorResolveRect::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassDescriptorResolveRect }, - colorOffsetX(std::move(init.colorOffsetX)), - colorOffsetY(std::move(init.colorOffsetY)), - resolveOffsetX(std::move(init.resolveOffsetX)), - resolveOffsetY(std::move(init.resolveOffsetY)), - width(std::move(init.width)), - height(std::move(init.height)) {} - -RenderPassDescriptorResolveRect::operator const WGPURenderPassDescriptorResolveRect&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDescriptorResolveRect) == sizeof(WGPURenderPassDescriptorResolveRect), "sizeof mismatch for RenderPassDescriptorResolveRect"); -static_assert(alignof(RenderPassDescriptorResolveRect) == alignof(WGPURenderPassDescriptorResolveRect), "alignof mismatch for RenderPassDescriptorResolveRect"); -static_assert(offsetof(RenderPassDescriptorResolveRect, colorOffsetX) == offsetof(WGPURenderPassDescriptorResolveRect, colorOffsetX), - "offsetof mismatch for RenderPassDescriptorResolveRect::colorOffsetX"); -static_assert(offsetof(RenderPassDescriptorResolveRect, colorOffsetY) == offsetof(WGPURenderPassDescriptorResolveRect, colorOffsetY), - "offsetof mismatch for RenderPassDescriptorResolveRect::colorOffsetY"); -static_assert(offsetof(RenderPassDescriptorResolveRect, resolveOffsetX) == offsetof(WGPURenderPassDescriptorResolveRect, resolveOffsetX), - "offsetof mismatch for RenderPassDescriptorResolveRect::resolveOffsetX"); -static_assert(offsetof(RenderPassDescriptorResolveRect, resolveOffsetY) == offsetof(WGPURenderPassDescriptorResolveRect, resolveOffsetY), - "offsetof mismatch for RenderPassDescriptorResolveRect::resolveOffsetY"); -static_assert(offsetof(RenderPassDescriptorResolveRect, width) == offsetof(WGPURenderPassDescriptorResolveRect, width), - "offsetof mismatch for RenderPassDescriptorResolveRect::width"); -static_assert(offsetof(RenderPassDescriptorResolveRect, height) == offsetof(WGPURenderPassDescriptorResolveRect, height), - "offsetof mismatch for RenderPassDescriptorResolveRect::height"); - -// RenderPassMaxDrawCount implementation -RenderPassMaxDrawCount::RenderPassMaxDrawCount() -: ChainedStruct { nullptr, SType::RenderPassMaxDrawCount } {} -struct RenderPassMaxDrawCount::Init { - ChainedStruct * const nextInChain; - uint64_t maxDrawCount = 50000000; -}; -RenderPassMaxDrawCount::RenderPassMaxDrawCount(RenderPassMaxDrawCount::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassMaxDrawCount }, - maxDrawCount(std::move(init.maxDrawCount)) {} - -RenderPassMaxDrawCount::operator const WGPURenderPassMaxDrawCount&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassMaxDrawCount) == sizeof(WGPURenderPassMaxDrawCount), "sizeof mismatch for RenderPassMaxDrawCount"); -static_assert(alignof(RenderPassMaxDrawCount) == alignof(WGPURenderPassMaxDrawCount), "alignof mismatch for RenderPassMaxDrawCount"); -static_assert(offsetof(RenderPassMaxDrawCount, maxDrawCount) == offsetof(WGPURenderPassMaxDrawCount, maxDrawCount), - "offsetof mismatch for RenderPassMaxDrawCount::maxDrawCount"); - -// RequestAdapterWebGPUBackendOptions implementation -RequestAdapterWebGPUBackendOptions::RequestAdapterWebGPUBackendOptions() -: ChainedStruct { nullptr, SType::RequestAdapterWebGPUBackendOptions } {} -struct RequestAdapterWebGPUBackendOptions::Init { - ChainedStruct * const nextInChain; -}; -RequestAdapterWebGPUBackendOptions::RequestAdapterWebGPUBackendOptions(RequestAdapterWebGPUBackendOptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::RequestAdapterWebGPUBackendOptions } {} - -RequestAdapterWebGPUBackendOptions::operator const WGPURequestAdapterWebGPUBackendOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterWebGPUBackendOptions) == sizeof(WGPURequestAdapterWebGPUBackendOptions), "sizeof mismatch for RequestAdapterWebGPUBackendOptions"); -static_assert(alignof(RequestAdapterWebGPUBackendOptions) == alignof(WGPURequestAdapterWebGPUBackendOptions), "alignof mismatch for RequestAdapterWebGPUBackendOptions"); - -// RequestAdapterWebXROptions implementation -RequestAdapterWebXROptions::RequestAdapterWebXROptions() -: ChainedStruct { nullptr, SType::RequestAdapterWebXROptions } {} -struct RequestAdapterWebXROptions::Init { - ChainedStruct * const nextInChain; - Bool xrCompatible; -}; -RequestAdapterWebXROptions::RequestAdapterWebXROptions(RequestAdapterWebXROptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::RequestAdapterWebXROptions }, - xrCompatible(std::move(init.xrCompatible)) {} - -RequestAdapterWebXROptions::operator const WGPURequestAdapterWebXROptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterWebXROptions) == sizeof(WGPURequestAdapterWebXROptions), "sizeof mismatch for RequestAdapterWebXROptions"); -static_assert(alignof(RequestAdapterWebXROptions) == alignof(WGPURequestAdapterWebXROptions), "alignof mismatch for RequestAdapterWebXROptions"); -static_assert(offsetof(RequestAdapterWebXROptions, xrCompatible) == offsetof(WGPURequestAdapterWebXROptions, xrCompatible), - "offsetof mismatch for RequestAdapterWebXROptions::xrCompatible"); - -// ResourceTableDescriptor implementation - -ResourceTableDescriptor::operator const WGPUResourceTableDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ResourceTableDescriptor) == sizeof(WGPUResourceTableDescriptor), "sizeof mismatch for ResourceTableDescriptor"); -static_assert(alignof(ResourceTableDescriptor) == alignof(WGPUResourceTableDescriptor), "alignof mismatch for ResourceTableDescriptor"); -static_assert(offsetof(ResourceTableDescriptor, nextInChain) == offsetof(WGPUResourceTableDescriptor, nextInChain), - "offsetof mismatch for ResourceTableDescriptor::nextInChain"); -static_assert(offsetof(ResourceTableDescriptor, label) == offsetof(WGPUResourceTableDescriptor, label), - "offsetof mismatch for ResourceTableDescriptor::label"); -static_assert(offsetof(ResourceTableDescriptor, size) == offsetof(WGPUResourceTableDescriptor, size), - "offsetof mismatch for ResourceTableDescriptor::size"); - -// SamplerBindingLayout implementation - -SamplerBindingLayout::operator const WGPUSamplerBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SamplerBindingLayout) == sizeof(WGPUSamplerBindingLayout), "sizeof mismatch for SamplerBindingLayout"); -static_assert(alignof(SamplerBindingLayout) == alignof(WGPUSamplerBindingLayout), "alignof mismatch for SamplerBindingLayout"); -static_assert(offsetof(SamplerBindingLayout, nextInChain) == offsetof(WGPUSamplerBindingLayout, nextInChain), - "offsetof mismatch for SamplerBindingLayout::nextInChain"); -static_assert(offsetof(SamplerBindingLayout, type) == offsetof(WGPUSamplerBindingLayout, type), - "offsetof mismatch for SamplerBindingLayout::type"); - -// ShaderModuleCompilationOptions implementation -ShaderModuleCompilationOptions::ShaderModuleCompilationOptions() -: ChainedStruct { nullptr, SType::ShaderModuleCompilationOptions } {} -struct ShaderModuleCompilationOptions::Init { - ChainedStruct * const nextInChain; - Bool strictMath; -}; -ShaderModuleCompilationOptions::ShaderModuleCompilationOptions(ShaderModuleCompilationOptions::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderModuleCompilationOptions }, - strictMath(std::move(init.strictMath)) {} - -ShaderModuleCompilationOptions::operator const WGPUShaderModuleCompilationOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderModuleCompilationOptions) == sizeof(WGPUShaderModuleCompilationOptions), "sizeof mismatch for ShaderModuleCompilationOptions"); -static_assert(alignof(ShaderModuleCompilationOptions) == alignof(WGPUShaderModuleCompilationOptions), "alignof mismatch for ShaderModuleCompilationOptions"); -static_assert(offsetof(ShaderModuleCompilationOptions, strictMath) == offsetof(WGPUShaderModuleCompilationOptions, strictMath), - "offsetof mismatch for ShaderModuleCompilationOptions::strictMath"); - -// ShaderSourceSPIRV implementation -ShaderSourceSPIRV::ShaderSourceSPIRV() -: ChainedStruct { nullptr, SType::ShaderSourceSPIRV } {} -struct ShaderSourceSPIRV::Init { - ChainedStruct * const nextInChain; - uint32_t codeSize; - uint32_t const * code = nullptr; -}; -ShaderSourceSPIRV::ShaderSourceSPIRV(ShaderSourceSPIRV::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderSourceSPIRV }, - codeSize(std::move(init.codeSize)), - code(std::move(init.code)) {} - -ShaderSourceSPIRV::operator const WGPUShaderSourceSPIRV&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderSourceSPIRV) == sizeof(WGPUShaderSourceSPIRV), "sizeof mismatch for ShaderSourceSPIRV"); -static_assert(alignof(ShaderSourceSPIRV) == alignof(WGPUShaderSourceSPIRV), "alignof mismatch for ShaderSourceSPIRV"); -static_assert(offsetof(ShaderSourceSPIRV, codeSize) == offsetof(WGPUShaderSourceSPIRV, codeSize), - "offsetof mismatch for ShaderSourceSPIRV::codeSize"); -static_assert(offsetof(ShaderSourceSPIRV, code) == offsetof(WGPUShaderSourceSPIRV, code), - "offsetof mismatch for ShaderSourceSPIRV::code"); - -// ShaderSourceWGSL implementation -ShaderSourceWGSL::ShaderSourceWGSL() -: ChainedStruct { nullptr, SType::ShaderSourceWGSL } {} -struct ShaderSourceWGSL::Init { - ChainedStruct * const nextInChain; - StringView code = {}; -}; -ShaderSourceWGSL::ShaderSourceWGSL(ShaderSourceWGSL::Init&& init) : - ChainedStruct { init.nextInChain, SType::ShaderSourceWGSL }, - code(std::move(init.code)) {} - -ShaderSourceWGSL::operator const WGPUShaderSourceWGSL&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderSourceWGSL) == sizeof(WGPUShaderSourceWGSL), "sizeof mismatch for ShaderSourceWGSL"); -static_assert(alignof(ShaderSourceWGSL) == alignof(WGPUShaderSourceWGSL), "alignof mismatch for ShaderSourceWGSL"); -static_assert(offsetof(ShaderSourceWGSL, code) == offsetof(WGPUShaderSourceWGSL, code), - "offsetof mismatch for ShaderSourceWGSL::code"); - -// SharedBufferMemoryBeginAccessDescriptor implementation - -SharedBufferMemoryBeginAccessDescriptor::operator const WGPUSharedBufferMemoryBeginAccessDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryBeginAccessDescriptor) == sizeof(WGPUSharedBufferMemoryBeginAccessDescriptor), "sizeof mismatch for SharedBufferMemoryBeginAccessDescriptor"); -static_assert(alignof(SharedBufferMemoryBeginAccessDescriptor) == alignof(WGPUSharedBufferMemoryBeginAccessDescriptor), "alignof mismatch for SharedBufferMemoryBeginAccessDescriptor"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, nextInChain) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, nextInChain), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::nextInChain"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, initialized) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, initialized), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::initialized"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, fenceCount) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, fenceCount), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::fenceCount"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, fences) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, fences), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::fences"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, signaledValueCount) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, signaledValueCount), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::signaledValueCount"); -static_assert(offsetof(SharedBufferMemoryBeginAccessDescriptor, signaledValues) == offsetof(WGPUSharedBufferMemoryBeginAccessDescriptor, signaledValues), - "offsetof mismatch for SharedBufferMemoryBeginAccessDescriptor::signaledValues"); - -// SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor implementation -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor } {} -struct SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; - uint64_t size; -}; -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor }, - handle(std::move(init.handle)), - size(std::move(init.size)) {} - -SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::operator const WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor) == sizeof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor), "sizeof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"); -static_assert(alignof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor) == alignof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor), "alignof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"); -static_assert(offsetof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, handle) == offsetof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, handle), - "offsetof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::handle"); -static_assert(offsetof(SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, size) == offsetof(WGPUSharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor, size), - "offsetof mismatch for SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor::size"); - -// SharedBufferMemoryEndAccessState implementation -SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState() = default; -SharedBufferMemoryEndAccessState::~SharedBufferMemoryEndAccessState() { - FreeMembers(); -} - -SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&& rhs) - : initialized(rhs.initialized), - fenceCount(rhs.fenceCount), - fences(rhs.fences), - signaledValueCount(rhs.signaledValueCount), - signaledValues(rhs.signaledValues){ - Reset(rhs); -} - -SharedBufferMemoryEndAccessState& SharedBufferMemoryEndAccessState::operator=(SharedBufferMemoryEndAccessState&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized); - detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount); - detail::AsNonConstReference(this->fences) = std::move(rhs.fences); - detail::AsNonConstReference(this->signaledValueCount) = std::move(rhs.signaledValueCount); - detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues); - Reset(rhs); - return *this; -} - -void SharedBufferMemoryEndAccessState::FreeMembers() { - bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSharedBufferMemoryEndAccessStateFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SharedBufferMemoryEndAccessState::Reset(SharedBufferMemoryEndAccessState& value) { - SharedBufferMemoryEndAccessState defaultValue{}; - detail::AsNonConstReference(value.initialized) = defaultValue.initialized; - detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount; - detail::AsNonConstReference(value.fences) = defaultValue.fences; - detail::AsNonConstReference(value.signaledValueCount) = defaultValue.signaledValueCount; - detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues; -} - -SharedBufferMemoryEndAccessState::operator const WGPUSharedBufferMemoryEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryEndAccessState) == sizeof(WGPUSharedBufferMemoryEndAccessState), "sizeof mismatch for SharedBufferMemoryEndAccessState"); -static_assert(alignof(SharedBufferMemoryEndAccessState) == alignof(WGPUSharedBufferMemoryEndAccessState), "alignof mismatch for SharedBufferMemoryEndAccessState"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedBufferMemoryEndAccessState, nextInChain), - "offsetof mismatch for SharedBufferMemoryEndAccessState::nextInChain"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, initialized) == offsetof(WGPUSharedBufferMemoryEndAccessState, initialized), - "offsetof mismatch for SharedBufferMemoryEndAccessState::initialized"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedBufferMemoryEndAccessState, fenceCount), - "offsetof mismatch for SharedBufferMemoryEndAccessState::fenceCount"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, fences) == offsetof(WGPUSharedBufferMemoryEndAccessState, fences), - "offsetof mismatch for SharedBufferMemoryEndAccessState::fences"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, signaledValueCount) == offsetof(WGPUSharedBufferMemoryEndAccessState, signaledValueCount), - "offsetof mismatch for SharedBufferMemoryEndAccessState::signaledValueCount"); -static_assert(offsetof(SharedBufferMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedBufferMemoryEndAccessState, signaledValues), - "offsetof mismatch for SharedBufferMemoryEndAccessState::signaledValues"); - -// SharedBufferMemoryProperties implementation - -SharedBufferMemoryProperties::operator const WGPUSharedBufferMemoryProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryProperties) == sizeof(WGPUSharedBufferMemoryProperties), "sizeof mismatch for SharedBufferMemoryProperties"); -static_assert(alignof(SharedBufferMemoryProperties) == alignof(WGPUSharedBufferMemoryProperties), "alignof mismatch for SharedBufferMemoryProperties"); -static_assert(offsetof(SharedBufferMemoryProperties, nextInChain) == offsetof(WGPUSharedBufferMemoryProperties, nextInChain), - "offsetof mismatch for SharedBufferMemoryProperties::nextInChain"); -static_assert(offsetof(SharedBufferMemoryProperties, usage) == offsetof(WGPUSharedBufferMemoryProperties, usage), - "offsetof mismatch for SharedBufferMemoryProperties::usage"); -static_assert(offsetof(SharedBufferMemoryProperties, size) == offsetof(WGPUSharedBufferMemoryProperties, size), - "offsetof mismatch for SharedBufferMemoryProperties::size"); - -// SharedFenceDXGISharedHandleDescriptor implementation -SharedFenceDXGISharedHandleDescriptor::SharedFenceDXGISharedHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceDXGISharedHandleDescriptor } {} -struct SharedFenceDXGISharedHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; -}; -SharedFenceDXGISharedHandleDescriptor::SharedFenceDXGISharedHandleDescriptor(SharedFenceDXGISharedHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceDXGISharedHandleDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceDXGISharedHandleDescriptor::operator const WGPUSharedFenceDXGISharedHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDXGISharedHandleDescriptor) == sizeof(WGPUSharedFenceDXGISharedHandleDescriptor), "sizeof mismatch for SharedFenceDXGISharedHandleDescriptor"); -static_assert(alignof(SharedFenceDXGISharedHandleDescriptor) == alignof(WGPUSharedFenceDXGISharedHandleDescriptor), "alignof mismatch for SharedFenceDXGISharedHandleDescriptor"); -static_assert(offsetof(SharedFenceDXGISharedHandleDescriptor, handle) == offsetof(WGPUSharedFenceDXGISharedHandleDescriptor, handle), - "offsetof mismatch for SharedFenceDXGISharedHandleDescriptor::handle"); - -// SharedFenceDXGISharedHandleExportInfo implementation -SharedFenceDXGISharedHandleExportInfo::SharedFenceDXGISharedHandleExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceDXGISharedHandleExportInfo } {} -struct SharedFenceDXGISharedHandleExportInfo::Init { - ChainedStructOut * nextInChain; - void * handle; -}; -SharedFenceDXGISharedHandleExportInfo::SharedFenceDXGISharedHandleExportInfo(SharedFenceDXGISharedHandleExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceDXGISharedHandleExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceDXGISharedHandleExportInfo::operator const WGPUSharedFenceDXGISharedHandleExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDXGISharedHandleExportInfo) == sizeof(WGPUSharedFenceDXGISharedHandleExportInfo), "sizeof mismatch for SharedFenceDXGISharedHandleExportInfo"); -static_assert(alignof(SharedFenceDXGISharedHandleExportInfo) == alignof(WGPUSharedFenceDXGISharedHandleExportInfo), "alignof mismatch for SharedFenceDXGISharedHandleExportInfo"); -static_assert(offsetof(SharedFenceDXGISharedHandleExportInfo, handle) == offsetof(WGPUSharedFenceDXGISharedHandleExportInfo, handle), - "offsetof mismatch for SharedFenceDXGISharedHandleExportInfo::handle"); - -// SharedFenceEGLSyncDescriptor implementation -SharedFenceEGLSyncDescriptor::SharedFenceEGLSyncDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceEGLSyncDescriptor } {} -struct SharedFenceEGLSyncDescriptor::Init { - ChainedStruct * const nextInChain; - void * sync; -}; -SharedFenceEGLSyncDescriptor::SharedFenceEGLSyncDescriptor(SharedFenceEGLSyncDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceEGLSyncDescriptor }, - sync(std::move(init.sync)) {} - -SharedFenceEGLSyncDescriptor::operator const WGPUSharedFenceEGLSyncDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceEGLSyncDescriptor) == sizeof(WGPUSharedFenceEGLSyncDescriptor), "sizeof mismatch for SharedFenceEGLSyncDescriptor"); -static_assert(alignof(SharedFenceEGLSyncDescriptor) == alignof(WGPUSharedFenceEGLSyncDescriptor), "alignof mismatch for SharedFenceEGLSyncDescriptor"); -static_assert(offsetof(SharedFenceEGLSyncDescriptor, sync) == offsetof(WGPUSharedFenceEGLSyncDescriptor, sync), - "offsetof mismatch for SharedFenceEGLSyncDescriptor::sync"); - -// SharedFenceEGLSyncExportInfo implementation -SharedFenceEGLSyncExportInfo::SharedFenceEGLSyncExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceEGLSyncExportInfo } {} -struct SharedFenceEGLSyncExportInfo::Init { - ChainedStructOut * nextInChain; - void * sync; -}; -SharedFenceEGLSyncExportInfo::SharedFenceEGLSyncExportInfo(SharedFenceEGLSyncExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceEGLSyncExportInfo }, - sync(std::move(init.sync)) {} - -SharedFenceEGLSyncExportInfo::operator const WGPUSharedFenceEGLSyncExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceEGLSyncExportInfo) == sizeof(WGPUSharedFenceEGLSyncExportInfo), "sizeof mismatch for SharedFenceEGLSyncExportInfo"); -static_assert(alignof(SharedFenceEGLSyncExportInfo) == alignof(WGPUSharedFenceEGLSyncExportInfo), "alignof mismatch for SharedFenceEGLSyncExportInfo"); -static_assert(offsetof(SharedFenceEGLSyncExportInfo, sync) == offsetof(WGPUSharedFenceEGLSyncExportInfo, sync), - "offsetof mismatch for SharedFenceEGLSyncExportInfo::sync"); - -// SharedFenceMTLSharedEventDescriptor implementation -SharedFenceMTLSharedEventDescriptor::SharedFenceMTLSharedEventDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceMTLSharedEventDescriptor } {} -struct SharedFenceMTLSharedEventDescriptor::Init { - ChainedStruct * const nextInChain; - void * sharedEvent; -}; -SharedFenceMTLSharedEventDescriptor::SharedFenceMTLSharedEventDescriptor(SharedFenceMTLSharedEventDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceMTLSharedEventDescriptor }, - sharedEvent(std::move(init.sharedEvent)) {} - -SharedFenceMTLSharedEventDescriptor::operator const WGPUSharedFenceMTLSharedEventDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceMTLSharedEventDescriptor) == sizeof(WGPUSharedFenceMTLSharedEventDescriptor), "sizeof mismatch for SharedFenceMTLSharedEventDescriptor"); -static_assert(alignof(SharedFenceMTLSharedEventDescriptor) == alignof(WGPUSharedFenceMTLSharedEventDescriptor), "alignof mismatch for SharedFenceMTLSharedEventDescriptor"); -static_assert(offsetof(SharedFenceMTLSharedEventDescriptor, sharedEvent) == offsetof(WGPUSharedFenceMTLSharedEventDescriptor, sharedEvent), - "offsetof mismatch for SharedFenceMTLSharedEventDescriptor::sharedEvent"); - -// SharedFenceMTLSharedEventExportInfo implementation -SharedFenceMTLSharedEventExportInfo::SharedFenceMTLSharedEventExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceMTLSharedEventExportInfo } {} -struct SharedFenceMTLSharedEventExportInfo::Init { - ChainedStructOut * nextInChain; - void * sharedEvent; -}; -SharedFenceMTLSharedEventExportInfo::SharedFenceMTLSharedEventExportInfo(SharedFenceMTLSharedEventExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceMTLSharedEventExportInfo }, - sharedEvent(std::move(init.sharedEvent)) {} - -SharedFenceMTLSharedEventExportInfo::operator const WGPUSharedFenceMTLSharedEventExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceMTLSharedEventExportInfo) == sizeof(WGPUSharedFenceMTLSharedEventExportInfo), "sizeof mismatch for SharedFenceMTLSharedEventExportInfo"); -static_assert(alignof(SharedFenceMTLSharedEventExportInfo) == alignof(WGPUSharedFenceMTLSharedEventExportInfo), "alignof mismatch for SharedFenceMTLSharedEventExportInfo"); -static_assert(offsetof(SharedFenceMTLSharedEventExportInfo, sharedEvent) == offsetof(WGPUSharedFenceMTLSharedEventExportInfo, sharedEvent), - "offsetof mismatch for SharedFenceMTLSharedEventExportInfo::sharedEvent"); - -// SharedFenceSyncFDDescriptor implementation -SharedFenceSyncFDDescriptor::SharedFenceSyncFDDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceSyncFDDescriptor } {} -struct SharedFenceSyncFDDescriptor::Init { - ChainedStruct * const nextInChain; - int handle; -}; -SharedFenceSyncFDDescriptor::SharedFenceSyncFDDescriptor(SharedFenceSyncFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceSyncFDDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceSyncFDDescriptor::operator const WGPUSharedFenceSyncFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceSyncFDDescriptor) == sizeof(WGPUSharedFenceSyncFDDescriptor), "sizeof mismatch for SharedFenceSyncFDDescriptor"); -static_assert(alignof(SharedFenceSyncFDDescriptor) == alignof(WGPUSharedFenceSyncFDDescriptor), "alignof mismatch for SharedFenceSyncFDDescriptor"); -static_assert(offsetof(SharedFenceSyncFDDescriptor, handle) == offsetof(WGPUSharedFenceSyncFDDescriptor, handle), - "offsetof mismatch for SharedFenceSyncFDDescriptor::handle"); - -// SharedFenceSyncFDExportInfo implementation -SharedFenceSyncFDExportInfo::SharedFenceSyncFDExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceSyncFDExportInfo } {} -struct SharedFenceSyncFDExportInfo::Init { - ChainedStructOut * nextInChain; - int handle; -}; -SharedFenceSyncFDExportInfo::SharedFenceSyncFDExportInfo(SharedFenceSyncFDExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceSyncFDExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceSyncFDExportInfo::operator const WGPUSharedFenceSyncFDExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceSyncFDExportInfo) == sizeof(WGPUSharedFenceSyncFDExportInfo), "sizeof mismatch for SharedFenceSyncFDExportInfo"); -static_assert(alignof(SharedFenceSyncFDExportInfo) == alignof(WGPUSharedFenceSyncFDExportInfo), "alignof mismatch for SharedFenceSyncFDExportInfo"); -static_assert(offsetof(SharedFenceSyncFDExportInfo, handle) == offsetof(WGPUSharedFenceSyncFDExportInfo, handle), - "offsetof mismatch for SharedFenceSyncFDExportInfo::handle"); - -// SharedFenceVkSemaphoreOpaqueFDDescriptor implementation -SharedFenceVkSemaphoreOpaqueFDDescriptor::SharedFenceVkSemaphoreOpaqueFDDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceVkSemaphoreOpaqueFDDescriptor } {} -struct SharedFenceVkSemaphoreOpaqueFDDescriptor::Init { - ChainedStruct * const nextInChain; - int handle; -}; -SharedFenceVkSemaphoreOpaqueFDDescriptor::SharedFenceVkSemaphoreOpaqueFDDescriptor(SharedFenceVkSemaphoreOpaqueFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceVkSemaphoreOpaqueFDDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreOpaqueFDDescriptor::operator const WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreOpaqueFDDescriptor) == sizeof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor), "sizeof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor"); -static_assert(alignof(SharedFenceVkSemaphoreOpaqueFDDescriptor) == alignof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor), "alignof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor"); -static_assert(offsetof(SharedFenceVkSemaphoreOpaqueFDDescriptor, handle) == offsetof(WGPUSharedFenceVkSemaphoreOpaqueFDDescriptor, handle), - "offsetof mismatch for SharedFenceVkSemaphoreOpaqueFDDescriptor::handle"); - -// SharedFenceVkSemaphoreOpaqueFDExportInfo implementation -SharedFenceVkSemaphoreOpaqueFDExportInfo::SharedFenceVkSemaphoreOpaqueFDExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceVkSemaphoreOpaqueFDExportInfo } {} -struct SharedFenceVkSemaphoreOpaqueFDExportInfo::Init { - ChainedStructOut * nextInChain; - int handle; -}; -SharedFenceVkSemaphoreOpaqueFDExportInfo::SharedFenceVkSemaphoreOpaqueFDExportInfo(SharedFenceVkSemaphoreOpaqueFDExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceVkSemaphoreOpaqueFDExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreOpaqueFDExportInfo::operator const WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreOpaqueFDExportInfo) == sizeof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo), "sizeof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo"); -static_assert(alignof(SharedFenceVkSemaphoreOpaqueFDExportInfo) == alignof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo), "alignof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo"); -static_assert(offsetof(SharedFenceVkSemaphoreOpaqueFDExportInfo, handle) == offsetof(WGPUSharedFenceVkSemaphoreOpaqueFDExportInfo, handle), - "offsetof mismatch for SharedFenceVkSemaphoreOpaqueFDExportInfo::handle"); - -// SharedFenceVkSemaphoreZirconHandleDescriptor implementation -SharedFenceVkSemaphoreZirconHandleDescriptor::SharedFenceVkSemaphoreZirconHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedFenceVkSemaphoreZirconHandleDescriptor } {} -struct SharedFenceVkSemaphoreZirconHandleDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t handle; -}; -SharedFenceVkSemaphoreZirconHandleDescriptor::SharedFenceVkSemaphoreZirconHandleDescriptor(SharedFenceVkSemaphoreZirconHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedFenceVkSemaphoreZirconHandleDescriptor }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreZirconHandleDescriptor::operator const WGPUSharedFenceVkSemaphoreZirconHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreZirconHandleDescriptor) == sizeof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor), "sizeof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor"); -static_assert(alignof(SharedFenceVkSemaphoreZirconHandleDescriptor) == alignof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor), "alignof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor"); -static_assert(offsetof(SharedFenceVkSemaphoreZirconHandleDescriptor, handle) == offsetof(WGPUSharedFenceVkSemaphoreZirconHandleDescriptor, handle), - "offsetof mismatch for SharedFenceVkSemaphoreZirconHandleDescriptor::handle"); - -// SharedFenceVkSemaphoreZirconHandleExportInfo implementation -SharedFenceVkSemaphoreZirconHandleExportInfo::SharedFenceVkSemaphoreZirconHandleExportInfo() -: ChainedStructOut { nullptr, SType::SharedFenceVkSemaphoreZirconHandleExportInfo } {} -struct SharedFenceVkSemaphoreZirconHandleExportInfo::Init { - ChainedStructOut * nextInChain; - uint32_t handle; -}; -SharedFenceVkSemaphoreZirconHandleExportInfo::SharedFenceVkSemaphoreZirconHandleExportInfo(SharedFenceVkSemaphoreZirconHandleExportInfo::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedFenceVkSemaphoreZirconHandleExportInfo }, - handle(std::move(init.handle)) {} - -SharedFenceVkSemaphoreZirconHandleExportInfo::operator const WGPUSharedFenceVkSemaphoreZirconHandleExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceVkSemaphoreZirconHandleExportInfo) == sizeof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo), "sizeof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo"); -static_assert(alignof(SharedFenceVkSemaphoreZirconHandleExportInfo) == alignof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo), "alignof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo"); -static_assert(offsetof(SharedFenceVkSemaphoreZirconHandleExportInfo, handle) == offsetof(WGPUSharedFenceVkSemaphoreZirconHandleExportInfo, handle), - "offsetof mismatch for SharedFenceVkSemaphoreZirconHandleExportInfo::handle"); - -// SharedTextureMemoryAHardwareBufferDescriptor implementation -SharedTextureMemoryAHardwareBufferDescriptor::SharedTextureMemoryAHardwareBufferDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryAHardwareBufferDescriptor } {} -struct SharedTextureMemoryAHardwareBufferDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; -}; -SharedTextureMemoryAHardwareBufferDescriptor::SharedTextureMemoryAHardwareBufferDescriptor(SharedTextureMemoryAHardwareBufferDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryAHardwareBufferDescriptor }, - handle(std::move(init.handle)) {} - -SharedTextureMemoryAHardwareBufferDescriptor::operator const WGPUSharedTextureMemoryAHardwareBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryAHardwareBufferDescriptor) == sizeof(WGPUSharedTextureMemoryAHardwareBufferDescriptor), "sizeof mismatch for SharedTextureMemoryAHardwareBufferDescriptor"); -static_assert(alignof(SharedTextureMemoryAHardwareBufferDescriptor) == alignof(WGPUSharedTextureMemoryAHardwareBufferDescriptor), "alignof mismatch for SharedTextureMemoryAHardwareBufferDescriptor"); -static_assert(offsetof(SharedTextureMemoryAHardwareBufferDescriptor, handle) == offsetof(WGPUSharedTextureMemoryAHardwareBufferDescriptor, handle), - "offsetof mismatch for SharedTextureMemoryAHardwareBufferDescriptor::handle"); - -// SharedTextureMemoryD3D11BeginState implementation -SharedTextureMemoryD3D11BeginState::SharedTextureMemoryD3D11BeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryD3D11BeginState } {} -struct SharedTextureMemoryD3D11BeginState::Init { - ChainedStruct * const nextInChain; - Bool requiresEndAccessFence = true; -}; -SharedTextureMemoryD3D11BeginState::SharedTextureMemoryD3D11BeginState(SharedTextureMemoryD3D11BeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryD3D11BeginState }, - requiresEndAccessFence(std::move(init.requiresEndAccessFence)) {} - -SharedTextureMemoryD3D11BeginState::operator const WGPUSharedTextureMemoryD3D11BeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryD3D11BeginState) == sizeof(WGPUSharedTextureMemoryD3D11BeginState), "sizeof mismatch for SharedTextureMemoryD3D11BeginState"); -static_assert(alignof(SharedTextureMemoryD3D11BeginState) == alignof(WGPUSharedTextureMemoryD3D11BeginState), "alignof mismatch for SharedTextureMemoryD3D11BeginState"); -static_assert(offsetof(SharedTextureMemoryD3D11BeginState, requiresEndAccessFence) == offsetof(WGPUSharedTextureMemoryD3D11BeginState, requiresEndAccessFence), - "offsetof mismatch for SharedTextureMemoryD3D11BeginState::requiresEndAccessFence"); - -// SharedTextureMemoryD3DSwapchainBeginState implementation -SharedTextureMemoryD3DSwapchainBeginState::SharedTextureMemoryD3DSwapchainBeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryD3DSwapchainBeginState } {} -struct SharedTextureMemoryD3DSwapchainBeginState::Init { - ChainedStruct * const nextInChain; - Bool isSwapchain = false; -}; -SharedTextureMemoryD3DSwapchainBeginState::SharedTextureMemoryD3DSwapchainBeginState(SharedTextureMemoryD3DSwapchainBeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryD3DSwapchainBeginState }, - isSwapchain(std::move(init.isSwapchain)) {} - -SharedTextureMemoryD3DSwapchainBeginState::operator const WGPUSharedTextureMemoryD3DSwapchainBeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryD3DSwapchainBeginState) == sizeof(WGPUSharedTextureMemoryD3DSwapchainBeginState), "sizeof mismatch for SharedTextureMemoryD3DSwapchainBeginState"); -static_assert(alignof(SharedTextureMemoryD3DSwapchainBeginState) == alignof(WGPUSharedTextureMemoryD3DSwapchainBeginState), "alignof mismatch for SharedTextureMemoryD3DSwapchainBeginState"); -static_assert(offsetof(SharedTextureMemoryD3DSwapchainBeginState, isSwapchain) == offsetof(WGPUSharedTextureMemoryD3DSwapchainBeginState, isSwapchain), - "offsetof mismatch for SharedTextureMemoryD3DSwapchainBeginState::isSwapchain"); - -// SharedTextureMemoryDmaBufPlane implementation - -SharedTextureMemoryDmaBufPlane::operator const WGPUSharedTextureMemoryDmaBufPlane&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDmaBufPlane) == sizeof(WGPUSharedTextureMemoryDmaBufPlane), "sizeof mismatch for SharedTextureMemoryDmaBufPlane"); -static_assert(alignof(SharedTextureMemoryDmaBufPlane) == alignof(WGPUSharedTextureMemoryDmaBufPlane), "alignof mismatch for SharedTextureMemoryDmaBufPlane"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, fd) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, fd), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::fd"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, offset) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, offset), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::offset"); -static_assert(offsetof(SharedTextureMemoryDmaBufPlane, stride) == offsetof(WGPUSharedTextureMemoryDmaBufPlane, stride), - "offsetof mismatch for SharedTextureMemoryDmaBufPlane::stride"); - -// SharedTextureMemoryDXGISharedHandleDescriptor implementation -SharedTextureMemoryDXGISharedHandleDescriptor::SharedTextureMemoryDXGISharedHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryDXGISharedHandleDescriptor } {} -struct SharedTextureMemoryDXGISharedHandleDescriptor::Init { - ChainedStruct * const nextInChain; - void * handle; - Bool useKeyedMutex; -}; -SharedTextureMemoryDXGISharedHandleDescriptor::SharedTextureMemoryDXGISharedHandleDescriptor(SharedTextureMemoryDXGISharedHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryDXGISharedHandleDescriptor }, - handle(std::move(init.handle)), - useKeyedMutex(std::move(init.useKeyedMutex)) {} - -SharedTextureMemoryDXGISharedHandleDescriptor::operator const WGPUSharedTextureMemoryDXGISharedHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDXGISharedHandleDescriptor) == sizeof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor), "sizeof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor"); -static_assert(alignof(SharedTextureMemoryDXGISharedHandleDescriptor) == alignof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor), "alignof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor"); -static_assert(offsetof(SharedTextureMemoryDXGISharedHandleDescriptor, handle) == offsetof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor, handle), - "offsetof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor::handle"); -static_assert(offsetof(SharedTextureMemoryDXGISharedHandleDescriptor, useKeyedMutex) == offsetof(WGPUSharedTextureMemoryDXGISharedHandleDescriptor, useKeyedMutex), - "offsetof mismatch for SharedTextureMemoryDXGISharedHandleDescriptor::useKeyedMutex"); - -// SharedTextureMemoryEGLImageDescriptor implementation -SharedTextureMemoryEGLImageDescriptor::SharedTextureMemoryEGLImageDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryEGLImageDescriptor } {} -struct SharedTextureMemoryEGLImageDescriptor::Init { - ChainedStruct * const nextInChain; - void * image; -}; -SharedTextureMemoryEGLImageDescriptor::SharedTextureMemoryEGLImageDescriptor(SharedTextureMemoryEGLImageDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryEGLImageDescriptor }, - image(std::move(init.image)) {} - -SharedTextureMemoryEGLImageDescriptor::operator const WGPUSharedTextureMemoryEGLImageDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryEGLImageDescriptor) == sizeof(WGPUSharedTextureMemoryEGLImageDescriptor), "sizeof mismatch for SharedTextureMemoryEGLImageDescriptor"); -static_assert(alignof(SharedTextureMemoryEGLImageDescriptor) == alignof(WGPUSharedTextureMemoryEGLImageDescriptor), "alignof mismatch for SharedTextureMemoryEGLImageDescriptor"); -static_assert(offsetof(SharedTextureMemoryEGLImageDescriptor, image) == offsetof(WGPUSharedTextureMemoryEGLImageDescriptor, image), - "offsetof mismatch for SharedTextureMemoryEGLImageDescriptor::image"); - -// SharedTextureMemoryIOSurfaceDescriptor implementation -SharedTextureMemoryIOSurfaceDescriptor::SharedTextureMemoryIOSurfaceDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryIOSurfaceDescriptor } {} -struct SharedTextureMemoryIOSurfaceDescriptor::Init { - ChainedStruct * const nextInChain; - void * ioSurface; - Bool allowStorageBinding = true; -}; -SharedTextureMemoryIOSurfaceDescriptor::SharedTextureMemoryIOSurfaceDescriptor(SharedTextureMemoryIOSurfaceDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryIOSurfaceDescriptor }, - ioSurface(std::move(init.ioSurface)), - allowStorageBinding(std::move(init.allowStorageBinding)) {} - -SharedTextureMemoryIOSurfaceDescriptor::operator const WGPUSharedTextureMemoryIOSurfaceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryIOSurfaceDescriptor) == sizeof(WGPUSharedTextureMemoryIOSurfaceDescriptor), "sizeof mismatch for SharedTextureMemoryIOSurfaceDescriptor"); -static_assert(alignof(SharedTextureMemoryIOSurfaceDescriptor) == alignof(WGPUSharedTextureMemoryIOSurfaceDescriptor), "alignof mismatch for SharedTextureMemoryIOSurfaceDescriptor"); -static_assert(offsetof(SharedTextureMemoryIOSurfaceDescriptor, ioSurface) == offsetof(WGPUSharedTextureMemoryIOSurfaceDescriptor, ioSurface), - "offsetof mismatch for SharedTextureMemoryIOSurfaceDescriptor::ioSurface"); -static_assert(offsetof(SharedTextureMemoryIOSurfaceDescriptor, allowStorageBinding) == offsetof(WGPUSharedTextureMemoryIOSurfaceDescriptor, allowStorageBinding), - "offsetof mismatch for SharedTextureMemoryIOSurfaceDescriptor::allowStorageBinding"); - -// SharedTextureMemoryOpaqueFDDescriptor implementation -SharedTextureMemoryOpaqueFDDescriptor::SharedTextureMemoryOpaqueFDDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryOpaqueFDDescriptor } {} -struct SharedTextureMemoryOpaqueFDDescriptor::Init { - ChainedStruct * const nextInChain; - void const * vkImageCreateInfo; - int memoryFD; - uint32_t memoryTypeIndex; - uint64_t allocationSize; - Bool dedicatedAllocation; -}; -SharedTextureMemoryOpaqueFDDescriptor::SharedTextureMemoryOpaqueFDDescriptor(SharedTextureMemoryOpaqueFDDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryOpaqueFDDescriptor }, - vkImageCreateInfo(std::move(init.vkImageCreateInfo)), - memoryFD(std::move(init.memoryFD)), - memoryTypeIndex(std::move(init.memoryTypeIndex)), - allocationSize(std::move(init.allocationSize)), - dedicatedAllocation(std::move(init.dedicatedAllocation)) {} - -SharedTextureMemoryOpaqueFDDescriptor::operator const WGPUSharedTextureMemoryOpaqueFDDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryOpaqueFDDescriptor) == sizeof(WGPUSharedTextureMemoryOpaqueFDDescriptor), "sizeof mismatch for SharedTextureMemoryOpaqueFDDescriptor"); -static_assert(alignof(SharedTextureMemoryOpaqueFDDescriptor) == alignof(WGPUSharedTextureMemoryOpaqueFDDescriptor), "alignof mismatch for SharedTextureMemoryOpaqueFDDescriptor"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, vkImageCreateInfo) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, vkImageCreateInfo), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::vkImageCreateInfo"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, memoryFD) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, memoryFD), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::memoryFD"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, memoryTypeIndex) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, memoryTypeIndex), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::memoryTypeIndex"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, allocationSize) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, allocationSize), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::allocationSize"); -static_assert(offsetof(SharedTextureMemoryOpaqueFDDescriptor, dedicatedAllocation) == offsetof(WGPUSharedTextureMemoryOpaqueFDDescriptor, dedicatedAllocation), - "offsetof mismatch for SharedTextureMemoryOpaqueFDDescriptor::dedicatedAllocation"); - -// SharedTextureMemoryVkDedicatedAllocationDescriptor implementation -SharedTextureMemoryVkDedicatedAllocationDescriptor::SharedTextureMemoryVkDedicatedAllocationDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryVkDedicatedAllocationDescriptor } {} -struct SharedTextureMemoryVkDedicatedAllocationDescriptor::Init { - ChainedStruct * const nextInChain; - Bool dedicatedAllocation; -}; -SharedTextureMemoryVkDedicatedAllocationDescriptor::SharedTextureMemoryVkDedicatedAllocationDescriptor(SharedTextureMemoryVkDedicatedAllocationDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryVkDedicatedAllocationDescriptor }, - dedicatedAllocation(std::move(init.dedicatedAllocation)) {} - -SharedTextureMemoryVkDedicatedAllocationDescriptor::operator const WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkDedicatedAllocationDescriptor) == sizeof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor), "sizeof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor"); -static_assert(alignof(SharedTextureMemoryVkDedicatedAllocationDescriptor) == alignof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor), "alignof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor"); -static_assert(offsetof(SharedTextureMemoryVkDedicatedAllocationDescriptor, dedicatedAllocation) == offsetof(WGPUSharedTextureMemoryVkDedicatedAllocationDescriptor, dedicatedAllocation), - "offsetof mismatch for SharedTextureMemoryVkDedicatedAllocationDescriptor::dedicatedAllocation"); - -// SharedTextureMemoryVkImageLayoutBeginState implementation -SharedTextureMemoryVkImageLayoutBeginState::SharedTextureMemoryVkImageLayoutBeginState() -: ChainedStruct { nullptr, SType::SharedTextureMemoryVkImageLayoutBeginState } {} -struct SharedTextureMemoryVkImageLayoutBeginState::Init { - ChainedStruct * const nextInChain; - int32_t oldLayout; - int32_t newLayout; -}; -SharedTextureMemoryVkImageLayoutBeginState::SharedTextureMemoryVkImageLayoutBeginState(SharedTextureMemoryVkImageLayoutBeginState::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryVkImageLayoutBeginState }, - oldLayout(std::move(init.oldLayout)), - newLayout(std::move(init.newLayout)) {} - -SharedTextureMemoryVkImageLayoutBeginState::operator const WGPUSharedTextureMemoryVkImageLayoutBeginState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkImageLayoutBeginState) == sizeof(WGPUSharedTextureMemoryVkImageLayoutBeginState), "sizeof mismatch for SharedTextureMemoryVkImageLayoutBeginState"); -static_assert(alignof(SharedTextureMemoryVkImageLayoutBeginState) == alignof(WGPUSharedTextureMemoryVkImageLayoutBeginState), "alignof mismatch for SharedTextureMemoryVkImageLayoutBeginState"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutBeginState, oldLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutBeginState, oldLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutBeginState::oldLayout"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutBeginState, newLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutBeginState, newLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutBeginState::newLayout"); - -// SharedTextureMemoryVkImageLayoutEndState implementation -SharedTextureMemoryVkImageLayoutEndState::SharedTextureMemoryVkImageLayoutEndState() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryVkImageLayoutEndState } {} -struct SharedTextureMemoryVkImageLayoutEndState::Init { - ChainedStructOut * nextInChain; - int32_t oldLayout; - int32_t newLayout; -}; -SharedTextureMemoryVkImageLayoutEndState::SharedTextureMemoryVkImageLayoutEndState(SharedTextureMemoryVkImageLayoutEndState::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryVkImageLayoutEndState }, - oldLayout(std::move(init.oldLayout)), - newLayout(std::move(init.newLayout)) {} - -SharedTextureMemoryVkImageLayoutEndState::operator const WGPUSharedTextureMemoryVkImageLayoutEndState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryVkImageLayoutEndState) == sizeof(WGPUSharedTextureMemoryVkImageLayoutEndState), "sizeof mismatch for SharedTextureMemoryVkImageLayoutEndState"); -static_assert(alignof(SharedTextureMemoryVkImageLayoutEndState) == alignof(WGPUSharedTextureMemoryVkImageLayoutEndState), "alignof mismatch for SharedTextureMemoryVkImageLayoutEndState"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutEndState, oldLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutEndState, oldLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutEndState::oldLayout"); -static_assert(offsetof(SharedTextureMemoryVkImageLayoutEndState, newLayout) == offsetof(WGPUSharedTextureMemoryVkImageLayoutEndState, newLayout), - "offsetof mismatch for SharedTextureMemoryVkImageLayoutEndState::newLayout"); - -// SharedTextureMemoryZirconHandleDescriptor implementation -SharedTextureMemoryZirconHandleDescriptor::SharedTextureMemoryZirconHandleDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryZirconHandleDescriptor } {} -struct SharedTextureMemoryZirconHandleDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t memoryFD; - uint64_t allocationSize; -}; -SharedTextureMemoryZirconHandleDescriptor::SharedTextureMemoryZirconHandleDescriptor(SharedTextureMemoryZirconHandleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryZirconHandleDescriptor }, - memoryFD(std::move(init.memoryFD)), - allocationSize(std::move(init.allocationSize)) {} - -SharedTextureMemoryZirconHandleDescriptor::operator const WGPUSharedTextureMemoryZirconHandleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryZirconHandleDescriptor) == sizeof(WGPUSharedTextureMemoryZirconHandleDescriptor), "sizeof mismatch for SharedTextureMemoryZirconHandleDescriptor"); -static_assert(alignof(SharedTextureMemoryZirconHandleDescriptor) == alignof(WGPUSharedTextureMemoryZirconHandleDescriptor), "alignof mismatch for SharedTextureMemoryZirconHandleDescriptor"); -static_assert(offsetof(SharedTextureMemoryZirconHandleDescriptor, memoryFD) == offsetof(WGPUSharedTextureMemoryZirconHandleDescriptor, memoryFD), - "offsetof mismatch for SharedTextureMemoryZirconHandleDescriptor::memoryFD"); -static_assert(offsetof(SharedTextureMemoryZirconHandleDescriptor, allocationSize) == offsetof(WGPUSharedTextureMemoryZirconHandleDescriptor, allocationSize), - "offsetof mismatch for SharedTextureMemoryZirconHandleDescriptor::allocationSize"); - -// StaticSamplerBindingLayout implementation -StaticSamplerBindingLayout::StaticSamplerBindingLayout() -: ChainedStruct { nullptr, SType::StaticSamplerBindingLayout } {} -struct StaticSamplerBindingLayout::Init { - ChainedStruct * const nextInChain; - Sampler sampler = nullptr; - uint32_t sampledTextureBinding = kLimitU32Undefined; -}; -StaticSamplerBindingLayout::StaticSamplerBindingLayout(StaticSamplerBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::StaticSamplerBindingLayout }, - sampler(std::move(init.sampler)), - sampledTextureBinding(std::move(init.sampledTextureBinding)) {} - -StaticSamplerBindingLayout::operator const WGPUStaticSamplerBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StaticSamplerBindingLayout) == sizeof(WGPUStaticSamplerBindingLayout), "sizeof mismatch for StaticSamplerBindingLayout"); -static_assert(alignof(StaticSamplerBindingLayout) == alignof(WGPUStaticSamplerBindingLayout), "alignof mismatch for StaticSamplerBindingLayout"); -static_assert(offsetof(StaticSamplerBindingLayout, sampler) == offsetof(WGPUStaticSamplerBindingLayout, sampler), - "offsetof mismatch for StaticSamplerBindingLayout::sampler"); -static_assert(offsetof(StaticSamplerBindingLayout, sampledTextureBinding) == offsetof(WGPUStaticSamplerBindingLayout, sampledTextureBinding), - "offsetof mismatch for StaticSamplerBindingLayout::sampledTextureBinding"); - -// StencilFaceState implementation - -StencilFaceState::operator const WGPUStencilFaceState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StencilFaceState) == sizeof(WGPUStencilFaceState), "sizeof mismatch for StencilFaceState"); -static_assert(alignof(StencilFaceState) == alignof(WGPUStencilFaceState), "alignof mismatch for StencilFaceState"); -static_assert(offsetof(StencilFaceState, compare) == offsetof(WGPUStencilFaceState, compare), - "offsetof mismatch for StencilFaceState::compare"); -static_assert(offsetof(StencilFaceState, failOp) == offsetof(WGPUStencilFaceState, failOp), - "offsetof mismatch for StencilFaceState::failOp"); -static_assert(offsetof(StencilFaceState, depthFailOp) == offsetof(WGPUStencilFaceState, depthFailOp), - "offsetof mismatch for StencilFaceState::depthFailOp"); -static_assert(offsetof(StencilFaceState, passOp) == offsetof(WGPUStencilFaceState, passOp), - "offsetof mismatch for StencilFaceState::passOp"); - -// StorageTextureBindingLayout implementation - -StorageTextureBindingLayout::operator const WGPUStorageTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(StorageTextureBindingLayout) == sizeof(WGPUStorageTextureBindingLayout), "sizeof mismatch for StorageTextureBindingLayout"); -static_assert(alignof(StorageTextureBindingLayout) == alignof(WGPUStorageTextureBindingLayout), "alignof mismatch for StorageTextureBindingLayout"); -static_assert(offsetof(StorageTextureBindingLayout, nextInChain) == offsetof(WGPUStorageTextureBindingLayout, nextInChain), - "offsetof mismatch for StorageTextureBindingLayout::nextInChain"); -static_assert(offsetof(StorageTextureBindingLayout, access) == offsetof(WGPUStorageTextureBindingLayout, access), - "offsetof mismatch for StorageTextureBindingLayout::access"); -static_assert(offsetof(StorageTextureBindingLayout, format) == offsetof(WGPUStorageTextureBindingLayout, format), - "offsetof mismatch for StorageTextureBindingLayout::format"); -static_assert(offsetof(StorageTextureBindingLayout, viewDimension) == offsetof(WGPUStorageTextureBindingLayout, viewDimension), - "offsetof mismatch for StorageTextureBindingLayout::viewDimension"); - -// SubgroupMatrixConfig implementation - -SubgroupMatrixConfig::operator const WGPUSubgroupMatrixConfig&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SubgroupMatrixConfig) == sizeof(WGPUSubgroupMatrixConfig), "sizeof mismatch for SubgroupMatrixConfig"); -static_assert(alignof(SubgroupMatrixConfig) == alignof(WGPUSubgroupMatrixConfig), "alignof mismatch for SubgroupMatrixConfig"); -static_assert(offsetof(SubgroupMatrixConfig, componentType) == offsetof(WGPUSubgroupMatrixConfig, componentType), - "offsetof mismatch for SubgroupMatrixConfig::componentType"); -static_assert(offsetof(SubgroupMatrixConfig, resultComponentType) == offsetof(WGPUSubgroupMatrixConfig, resultComponentType), - "offsetof mismatch for SubgroupMatrixConfig::resultComponentType"); -static_assert(offsetof(SubgroupMatrixConfig, M) == offsetof(WGPUSubgroupMatrixConfig, M), - "offsetof mismatch for SubgroupMatrixConfig::M"); -static_assert(offsetof(SubgroupMatrixConfig, N) == offsetof(WGPUSubgroupMatrixConfig, N), - "offsetof mismatch for SubgroupMatrixConfig::N"); -static_assert(offsetof(SubgroupMatrixConfig, K) == offsetof(WGPUSubgroupMatrixConfig, K), - "offsetof mismatch for SubgroupMatrixConfig::K"); - -// SupportedFeatures implementation -SupportedFeatures::SupportedFeatures() = default; -SupportedFeatures::~SupportedFeatures() { - FreeMembers(); -} - -SupportedFeatures::SupportedFeatures(SupportedFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedFeatures& SupportedFeatures::operator=(SupportedFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSupportedFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedFeatures::Reset(SupportedFeatures& value) { - SupportedFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedFeatures::operator const WGPUSupportedFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedFeatures) == sizeof(WGPUSupportedFeatures), "sizeof mismatch for SupportedFeatures"); -static_assert(alignof(SupportedFeatures) == alignof(WGPUSupportedFeatures), "alignof mismatch for SupportedFeatures"); -static_assert(offsetof(SupportedFeatures, featureCount) == offsetof(WGPUSupportedFeatures, featureCount), - "offsetof mismatch for SupportedFeatures::featureCount"); -static_assert(offsetof(SupportedFeatures, features) == offsetof(WGPUSupportedFeatures, features), - "offsetof mismatch for SupportedFeatures::features"); - -// SupportedInstanceFeatures implementation -SupportedInstanceFeatures::SupportedInstanceFeatures() = default; -SupportedInstanceFeatures::~SupportedInstanceFeatures() { - FreeMembers(); -} - -SupportedInstanceFeatures::SupportedInstanceFeatures(SupportedInstanceFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedInstanceFeatures& SupportedInstanceFeatures::operator=(SupportedInstanceFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedInstanceFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSupportedInstanceFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedInstanceFeatures::Reset(SupportedInstanceFeatures& value) { - SupportedInstanceFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedInstanceFeatures::operator const WGPUSupportedInstanceFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedInstanceFeatures) == sizeof(WGPUSupportedInstanceFeatures), "sizeof mismatch for SupportedInstanceFeatures"); -static_assert(alignof(SupportedInstanceFeatures) == alignof(WGPUSupportedInstanceFeatures), "alignof mismatch for SupportedInstanceFeatures"); -static_assert(offsetof(SupportedInstanceFeatures, featureCount) == offsetof(WGPUSupportedInstanceFeatures, featureCount), - "offsetof mismatch for SupportedInstanceFeatures::featureCount"); -static_assert(offsetof(SupportedInstanceFeatures, features) == offsetof(WGPUSupportedInstanceFeatures, features), - "offsetof mismatch for SupportedInstanceFeatures::features"); - -// SupportedWGSLLanguageFeatures implementation -SupportedWGSLLanguageFeatures::SupportedWGSLLanguageFeatures() = default; -SupportedWGSLLanguageFeatures::~SupportedWGSLLanguageFeatures() { - FreeMembers(); -} - -SupportedWGSLLanguageFeatures::SupportedWGSLLanguageFeatures(SupportedWGSLLanguageFeatures&& rhs) - : featureCount(rhs.featureCount), - features(rhs.features){ - Reset(rhs); -} - -SupportedWGSLLanguageFeatures& SupportedWGSLLanguageFeatures::operator=(SupportedWGSLLanguageFeatures&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->featureCount) = std::move(rhs.featureCount); - detail::AsNonConstReference(this->features) = std::move(rhs.features); - Reset(rhs); - return *this; -} - -void SupportedWGSLLanguageFeatures::FreeMembers() { - bool needsFreeing = false; if (this->features != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSupportedWGSLLanguageFeaturesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SupportedWGSLLanguageFeatures::Reset(SupportedWGSLLanguageFeatures& value) { - SupportedWGSLLanguageFeatures defaultValue{}; - detail::AsNonConstReference(value.featureCount) = defaultValue.featureCount; - detail::AsNonConstReference(value.features) = defaultValue.features; -} - -SupportedWGSLLanguageFeatures::operator const WGPUSupportedWGSLLanguageFeatures&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SupportedWGSLLanguageFeatures) == sizeof(WGPUSupportedWGSLLanguageFeatures), "sizeof mismatch for SupportedWGSLLanguageFeatures"); -static_assert(alignof(SupportedWGSLLanguageFeatures) == alignof(WGPUSupportedWGSLLanguageFeatures), "alignof mismatch for SupportedWGSLLanguageFeatures"); -static_assert(offsetof(SupportedWGSLLanguageFeatures, featureCount) == offsetof(WGPUSupportedWGSLLanguageFeatures, featureCount), - "offsetof mismatch for SupportedWGSLLanguageFeatures::featureCount"); -static_assert(offsetof(SupportedWGSLLanguageFeatures, features) == offsetof(WGPUSupportedWGSLLanguageFeatures, features), - "offsetof mismatch for SupportedWGSLLanguageFeatures::features"); - -// SurfaceCapabilities implementation -SurfaceCapabilities::SurfaceCapabilities() = default; -SurfaceCapabilities::~SurfaceCapabilities() { - FreeMembers(); -} - -SurfaceCapabilities::SurfaceCapabilities(SurfaceCapabilities&& rhs) - : usages(rhs.usages), - formatCount(rhs.formatCount), - formats(rhs.formats), - presentModeCount(rhs.presentModeCount), - presentModes(rhs.presentModes), - alphaModeCount(rhs.alphaModeCount), - alphaModes(rhs.alphaModes){ - Reset(rhs); -} - -SurfaceCapabilities& SurfaceCapabilities::operator=(SurfaceCapabilities&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->usages) = std::move(rhs.usages); - detail::AsNonConstReference(this->formatCount) = std::move(rhs.formatCount); - detail::AsNonConstReference(this->formats) = std::move(rhs.formats); - detail::AsNonConstReference(this->presentModeCount) = std::move(rhs.presentModeCount); - detail::AsNonConstReference(this->presentModes) = std::move(rhs.presentModes); - detail::AsNonConstReference(this->alphaModeCount) = std::move(rhs.alphaModeCount); - detail::AsNonConstReference(this->alphaModes) = std::move(rhs.alphaModes); - Reset(rhs); - return *this; -} - -void SurfaceCapabilities::FreeMembers() { - bool needsFreeing = false; if (this->formats != nullptr) { needsFreeing = true; } if (this->presentModes != nullptr) { needsFreeing = true; } if (this->alphaModes != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSurfaceCapabilitiesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SurfaceCapabilities::Reset(SurfaceCapabilities& value) { - SurfaceCapabilities defaultValue{}; - detail::AsNonConstReference(value.usages) = defaultValue.usages; - detail::AsNonConstReference(value.formatCount) = defaultValue.formatCount; - detail::AsNonConstReference(value.formats) = defaultValue.formats; - detail::AsNonConstReference(value.presentModeCount) = defaultValue.presentModeCount; - detail::AsNonConstReference(value.presentModes) = defaultValue.presentModes; - detail::AsNonConstReference(value.alphaModeCount) = defaultValue.alphaModeCount; - detail::AsNonConstReference(value.alphaModes) = defaultValue.alphaModes; -} - -SurfaceCapabilities::operator const WGPUSurfaceCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceCapabilities) == sizeof(WGPUSurfaceCapabilities), "sizeof mismatch for SurfaceCapabilities"); -static_assert(alignof(SurfaceCapabilities) == alignof(WGPUSurfaceCapabilities), "alignof mismatch for SurfaceCapabilities"); -static_assert(offsetof(SurfaceCapabilities, nextInChain) == offsetof(WGPUSurfaceCapabilities, nextInChain), - "offsetof mismatch for SurfaceCapabilities::nextInChain"); -static_assert(offsetof(SurfaceCapabilities, usages) == offsetof(WGPUSurfaceCapabilities, usages), - "offsetof mismatch for SurfaceCapabilities::usages"); -static_assert(offsetof(SurfaceCapabilities, formatCount) == offsetof(WGPUSurfaceCapabilities, formatCount), - "offsetof mismatch for SurfaceCapabilities::formatCount"); -static_assert(offsetof(SurfaceCapabilities, formats) == offsetof(WGPUSurfaceCapabilities, formats), - "offsetof mismatch for SurfaceCapabilities::formats"); -static_assert(offsetof(SurfaceCapabilities, presentModeCount) == offsetof(WGPUSurfaceCapabilities, presentModeCount), - "offsetof mismatch for SurfaceCapabilities::presentModeCount"); -static_assert(offsetof(SurfaceCapabilities, presentModes) == offsetof(WGPUSurfaceCapabilities, presentModes), - "offsetof mismatch for SurfaceCapabilities::presentModes"); -static_assert(offsetof(SurfaceCapabilities, alphaModeCount) == offsetof(WGPUSurfaceCapabilities, alphaModeCount), - "offsetof mismatch for SurfaceCapabilities::alphaModeCount"); -static_assert(offsetof(SurfaceCapabilities, alphaModes) == offsetof(WGPUSurfaceCapabilities, alphaModes), - "offsetof mismatch for SurfaceCapabilities::alphaModes"); - -// SurfaceColorManagement implementation -SurfaceColorManagement::SurfaceColorManagement() -: ChainedStruct { nullptr, SType::SurfaceColorManagement } {} -struct SurfaceColorManagement::Init { - ChainedStruct * const nextInChain; - PredefinedColorSpace colorSpace = {}; - ToneMappingMode toneMappingMode = {}; -}; -SurfaceColorManagement::SurfaceColorManagement(SurfaceColorManagement::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceColorManagement }, - colorSpace(std::move(init.colorSpace)), - toneMappingMode(std::move(init.toneMappingMode)) {} - -SurfaceColorManagement::operator const WGPUSurfaceColorManagement&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceColorManagement) == sizeof(WGPUSurfaceColorManagement), "sizeof mismatch for SurfaceColorManagement"); -static_assert(alignof(SurfaceColorManagement) == alignof(WGPUSurfaceColorManagement), "alignof mismatch for SurfaceColorManagement"); -static_assert(offsetof(SurfaceColorManagement, colorSpace) == offsetof(WGPUSurfaceColorManagement, colorSpace), - "offsetof mismatch for SurfaceColorManagement::colorSpace"); -static_assert(offsetof(SurfaceColorManagement, toneMappingMode) == offsetof(WGPUSurfaceColorManagement, toneMappingMode), - "offsetof mismatch for SurfaceColorManagement::toneMappingMode"); - -// SurfaceConfiguration implementation - -SurfaceConfiguration::operator const WGPUSurfaceConfiguration&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceConfiguration) == sizeof(WGPUSurfaceConfiguration), "sizeof mismatch for SurfaceConfiguration"); -static_assert(alignof(SurfaceConfiguration) == alignof(WGPUSurfaceConfiguration), "alignof mismatch for SurfaceConfiguration"); -static_assert(offsetof(SurfaceConfiguration, nextInChain) == offsetof(WGPUSurfaceConfiguration, nextInChain), - "offsetof mismatch for SurfaceConfiguration::nextInChain"); -static_assert(offsetof(SurfaceConfiguration, device) == offsetof(WGPUSurfaceConfiguration, device), - "offsetof mismatch for SurfaceConfiguration::device"); -static_assert(offsetof(SurfaceConfiguration, format) == offsetof(WGPUSurfaceConfiguration, format), - "offsetof mismatch for SurfaceConfiguration::format"); -static_assert(offsetof(SurfaceConfiguration, usage) == offsetof(WGPUSurfaceConfiguration, usage), - "offsetof mismatch for SurfaceConfiguration::usage"); -static_assert(offsetof(SurfaceConfiguration, width) == offsetof(WGPUSurfaceConfiguration, width), - "offsetof mismatch for SurfaceConfiguration::width"); -static_assert(offsetof(SurfaceConfiguration, height) == offsetof(WGPUSurfaceConfiguration, height), - "offsetof mismatch for SurfaceConfiguration::height"); -static_assert(offsetof(SurfaceConfiguration, viewFormatCount) == offsetof(WGPUSurfaceConfiguration, viewFormatCount), - "offsetof mismatch for SurfaceConfiguration::viewFormatCount"); -static_assert(offsetof(SurfaceConfiguration, viewFormats) == offsetof(WGPUSurfaceConfiguration, viewFormats), - "offsetof mismatch for SurfaceConfiguration::viewFormats"); -static_assert(offsetof(SurfaceConfiguration, alphaMode) == offsetof(WGPUSurfaceConfiguration, alphaMode), - "offsetof mismatch for SurfaceConfiguration::alphaMode"); -static_assert(offsetof(SurfaceConfiguration, presentMode) == offsetof(WGPUSurfaceConfiguration, presentMode), - "offsetof mismatch for SurfaceConfiguration::presentMode"); - -// SurfaceDescriptorFromWindowsCoreWindow implementation -SurfaceDescriptorFromWindowsCoreWindow::SurfaceDescriptorFromWindowsCoreWindow() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsCoreWindow } {} -struct SurfaceDescriptorFromWindowsCoreWindow::Init { - ChainedStruct * const nextInChain; - void * coreWindow = nullptr; -}; -SurfaceDescriptorFromWindowsCoreWindow::SurfaceDescriptorFromWindowsCoreWindow(SurfaceDescriptorFromWindowsCoreWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsCoreWindow }, - coreWindow(std::move(init.coreWindow)) {} - -SurfaceDescriptorFromWindowsCoreWindow::operator const WGPUSurfaceDescriptorFromWindowsCoreWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsCoreWindow) == sizeof(WGPUSurfaceDescriptorFromWindowsCoreWindow), "sizeof mismatch for SurfaceDescriptorFromWindowsCoreWindow"); -static_assert(alignof(SurfaceDescriptorFromWindowsCoreWindow) == alignof(WGPUSurfaceDescriptorFromWindowsCoreWindow), "alignof mismatch for SurfaceDescriptorFromWindowsCoreWindow"); -static_assert(offsetof(SurfaceDescriptorFromWindowsCoreWindow, coreWindow) == offsetof(WGPUSurfaceDescriptorFromWindowsCoreWindow, coreWindow), - "offsetof mismatch for SurfaceDescriptorFromWindowsCoreWindow::coreWindow"); - -// SurfaceDescriptorFromWindowsUWPSwapChainPanel implementation -SurfaceDescriptorFromWindowsUWPSwapChainPanel::SurfaceDescriptorFromWindowsUWPSwapChainPanel() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel } {} -struct SurfaceDescriptorFromWindowsUWPSwapChainPanel::Init { - ChainedStruct * const nextInChain; - void * swapChainPanel = nullptr; -}; -SurfaceDescriptorFromWindowsUWPSwapChainPanel::SurfaceDescriptorFromWindowsUWPSwapChainPanel(SurfaceDescriptorFromWindowsUWPSwapChainPanel::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel }, - swapChainPanel(std::move(init.swapChainPanel)) {} - -SurfaceDescriptorFromWindowsUWPSwapChainPanel::operator const WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsUWPSwapChainPanel) == sizeof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel), "sizeof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel"); -static_assert(alignof(SurfaceDescriptorFromWindowsUWPSwapChainPanel) == alignof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel), "alignof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel"); -static_assert(offsetof(SurfaceDescriptorFromWindowsUWPSwapChainPanel, swapChainPanel) == offsetof(WGPUSurfaceDescriptorFromWindowsUWPSwapChainPanel, swapChainPanel), - "offsetof mismatch for SurfaceDescriptorFromWindowsUWPSwapChainPanel::swapChainPanel"); - -// SurfaceDescriptorFromWindowsWinUISwapChainPanel implementation -SurfaceDescriptorFromWindowsWinUISwapChainPanel::SurfaceDescriptorFromWindowsWinUISwapChainPanel() -: ChainedStruct { nullptr, SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel } {} -struct SurfaceDescriptorFromWindowsWinUISwapChainPanel::Init { - ChainedStruct * const nextInChain; - void * swapChainPanel = nullptr; -}; -SurfaceDescriptorFromWindowsWinUISwapChainPanel::SurfaceDescriptorFromWindowsWinUISwapChainPanel(SurfaceDescriptorFromWindowsWinUISwapChainPanel::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel }, - swapChainPanel(std::move(init.swapChainPanel)) {} - -SurfaceDescriptorFromWindowsWinUISwapChainPanel::operator const WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptorFromWindowsWinUISwapChainPanel) == sizeof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel), "sizeof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel"); -static_assert(alignof(SurfaceDescriptorFromWindowsWinUISwapChainPanel) == alignof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel), "alignof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel"); -static_assert(offsetof(SurfaceDescriptorFromWindowsWinUISwapChainPanel, swapChainPanel) == offsetof(WGPUSurfaceDescriptorFromWindowsWinUISwapChainPanel, swapChainPanel), - "offsetof mismatch for SurfaceDescriptorFromWindowsWinUISwapChainPanel::swapChainPanel"); - -// SurfaceSourceAndroidNativeWindow implementation -SurfaceSourceAndroidNativeWindow::SurfaceSourceAndroidNativeWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceAndroidNativeWindow } {} -struct SurfaceSourceAndroidNativeWindow::Init { - ChainedStruct * const nextInChain; - void * window; -}; -SurfaceSourceAndroidNativeWindow::SurfaceSourceAndroidNativeWindow(SurfaceSourceAndroidNativeWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceAndroidNativeWindow }, - window(std::move(init.window)) {} - -SurfaceSourceAndroidNativeWindow::operator const WGPUSurfaceSourceAndroidNativeWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceAndroidNativeWindow) == sizeof(WGPUSurfaceSourceAndroidNativeWindow), "sizeof mismatch for SurfaceSourceAndroidNativeWindow"); -static_assert(alignof(SurfaceSourceAndroidNativeWindow) == alignof(WGPUSurfaceSourceAndroidNativeWindow), "alignof mismatch for SurfaceSourceAndroidNativeWindow"); -static_assert(offsetof(SurfaceSourceAndroidNativeWindow, window) == offsetof(WGPUSurfaceSourceAndroidNativeWindow, window), - "offsetof mismatch for SurfaceSourceAndroidNativeWindow::window"); - -// SurfaceSourceMetalLayer implementation -SurfaceSourceMetalLayer::SurfaceSourceMetalLayer() -: ChainedStruct { nullptr, SType::SurfaceSourceMetalLayer } {} -struct SurfaceSourceMetalLayer::Init { - ChainedStruct * const nextInChain; - void * layer = nullptr; -}; -SurfaceSourceMetalLayer::SurfaceSourceMetalLayer(SurfaceSourceMetalLayer::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceMetalLayer }, - layer(std::move(init.layer)) {} - -SurfaceSourceMetalLayer::operator const WGPUSurfaceSourceMetalLayer&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceMetalLayer) == sizeof(WGPUSurfaceSourceMetalLayer), "sizeof mismatch for SurfaceSourceMetalLayer"); -static_assert(alignof(SurfaceSourceMetalLayer) == alignof(WGPUSurfaceSourceMetalLayer), "alignof mismatch for SurfaceSourceMetalLayer"); -static_assert(offsetof(SurfaceSourceMetalLayer, layer) == offsetof(WGPUSurfaceSourceMetalLayer, layer), - "offsetof mismatch for SurfaceSourceMetalLayer::layer"); - -// SurfaceSourceWaylandSurface implementation -SurfaceSourceWaylandSurface::SurfaceSourceWaylandSurface() -: ChainedStruct { nullptr, SType::SurfaceSourceWaylandSurface } {} -struct SurfaceSourceWaylandSurface::Init { - ChainedStruct * const nextInChain; - void * display = nullptr; - void * surface = nullptr; -}; -SurfaceSourceWaylandSurface::SurfaceSourceWaylandSurface(SurfaceSourceWaylandSurface::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceWaylandSurface }, - display(std::move(init.display)), - surface(std::move(init.surface)) {} - -SurfaceSourceWaylandSurface::operator const WGPUSurfaceSourceWaylandSurface&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceWaylandSurface) == sizeof(WGPUSurfaceSourceWaylandSurface), "sizeof mismatch for SurfaceSourceWaylandSurface"); -static_assert(alignof(SurfaceSourceWaylandSurface) == alignof(WGPUSurfaceSourceWaylandSurface), "alignof mismatch for SurfaceSourceWaylandSurface"); -static_assert(offsetof(SurfaceSourceWaylandSurface, display) == offsetof(WGPUSurfaceSourceWaylandSurface, display), - "offsetof mismatch for SurfaceSourceWaylandSurface::display"); -static_assert(offsetof(SurfaceSourceWaylandSurface, surface) == offsetof(WGPUSurfaceSourceWaylandSurface, surface), - "offsetof mismatch for SurfaceSourceWaylandSurface::surface"); - -// SurfaceSourceWindowsHWND implementation -SurfaceSourceWindowsHWND::SurfaceSourceWindowsHWND() -: ChainedStruct { nullptr, SType::SurfaceSourceWindowsHWND } {} -struct SurfaceSourceWindowsHWND::Init { - ChainedStruct * const nextInChain; - void * hinstance = nullptr; - void * hwnd = nullptr; -}; -SurfaceSourceWindowsHWND::SurfaceSourceWindowsHWND(SurfaceSourceWindowsHWND::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceWindowsHWND }, - hinstance(std::move(init.hinstance)), - hwnd(std::move(init.hwnd)) {} - -SurfaceSourceWindowsHWND::operator const WGPUSurfaceSourceWindowsHWND&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceWindowsHWND) == sizeof(WGPUSurfaceSourceWindowsHWND), "sizeof mismatch for SurfaceSourceWindowsHWND"); -static_assert(alignof(SurfaceSourceWindowsHWND) == alignof(WGPUSurfaceSourceWindowsHWND), "alignof mismatch for SurfaceSourceWindowsHWND"); -static_assert(offsetof(SurfaceSourceWindowsHWND, hinstance) == offsetof(WGPUSurfaceSourceWindowsHWND, hinstance), - "offsetof mismatch for SurfaceSourceWindowsHWND::hinstance"); -static_assert(offsetof(SurfaceSourceWindowsHWND, hwnd) == offsetof(WGPUSurfaceSourceWindowsHWND, hwnd), - "offsetof mismatch for SurfaceSourceWindowsHWND::hwnd"); - -// SurfaceSourceXCBWindow implementation -SurfaceSourceXCBWindow::SurfaceSourceXCBWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceXCBWindow } {} -struct SurfaceSourceXCBWindow::Init { - ChainedStruct * const nextInChain; - void * connection = nullptr; - uint32_t window; -}; -SurfaceSourceXCBWindow::SurfaceSourceXCBWindow(SurfaceSourceXCBWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceXCBWindow }, - connection(std::move(init.connection)), - window(std::move(init.window)) {} - -SurfaceSourceXCBWindow::operator const WGPUSurfaceSourceXCBWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceXCBWindow) == sizeof(WGPUSurfaceSourceXCBWindow), "sizeof mismatch for SurfaceSourceXCBWindow"); -static_assert(alignof(SurfaceSourceXCBWindow) == alignof(WGPUSurfaceSourceXCBWindow), "alignof mismatch for SurfaceSourceXCBWindow"); -static_assert(offsetof(SurfaceSourceXCBWindow, connection) == offsetof(WGPUSurfaceSourceXCBWindow, connection), - "offsetof mismatch for SurfaceSourceXCBWindow::connection"); -static_assert(offsetof(SurfaceSourceXCBWindow, window) == offsetof(WGPUSurfaceSourceXCBWindow, window), - "offsetof mismatch for SurfaceSourceXCBWindow::window"); - -// SurfaceSourceXlibWindow implementation -SurfaceSourceXlibWindow::SurfaceSourceXlibWindow() -: ChainedStruct { nullptr, SType::SurfaceSourceXlibWindow } {} -struct SurfaceSourceXlibWindow::Init { - ChainedStruct * const nextInChain; - void * display = nullptr; - uint64_t window; -}; -SurfaceSourceXlibWindow::SurfaceSourceXlibWindow(SurfaceSourceXlibWindow::Init&& init) : - ChainedStruct { init.nextInChain, SType::SurfaceSourceXlibWindow }, - display(std::move(init.display)), - window(std::move(init.window)) {} - -SurfaceSourceXlibWindow::operator const WGPUSurfaceSourceXlibWindow&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceSourceXlibWindow) == sizeof(WGPUSurfaceSourceXlibWindow), "sizeof mismatch for SurfaceSourceXlibWindow"); -static_assert(alignof(SurfaceSourceXlibWindow) == alignof(WGPUSurfaceSourceXlibWindow), "alignof mismatch for SurfaceSourceXlibWindow"); -static_assert(offsetof(SurfaceSourceXlibWindow, display) == offsetof(WGPUSurfaceSourceXlibWindow, display), - "offsetof mismatch for SurfaceSourceXlibWindow::display"); -static_assert(offsetof(SurfaceSourceXlibWindow, window) == offsetof(WGPUSurfaceSourceXlibWindow, window), - "offsetof mismatch for SurfaceSourceXlibWindow::window"); - -// SurfaceTexture implementation - -SurfaceTexture::operator const WGPUSurfaceTexture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceTexture) == sizeof(WGPUSurfaceTexture), "sizeof mismatch for SurfaceTexture"); -static_assert(alignof(SurfaceTexture) == alignof(WGPUSurfaceTexture), "alignof mismatch for SurfaceTexture"); -static_assert(offsetof(SurfaceTexture, nextInChain) == offsetof(WGPUSurfaceTexture, nextInChain), - "offsetof mismatch for SurfaceTexture::nextInChain"); -static_assert(offsetof(SurfaceTexture, texture) == offsetof(WGPUSurfaceTexture, texture), - "offsetof mismatch for SurfaceTexture::texture"); -static_assert(offsetof(SurfaceTexture, status) == offsetof(WGPUSurfaceTexture, status), - "offsetof mismatch for SurfaceTexture::status"); - -// TexelBufferBindingEntry implementation -TexelBufferBindingEntry::TexelBufferBindingEntry() -: ChainedStruct { nullptr, SType::TexelBufferBindingEntry } {} -struct TexelBufferBindingEntry::Init { - ChainedStruct * const nextInChain; - TexelBufferView texelBufferView = nullptr; -}; -TexelBufferBindingEntry::TexelBufferBindingEntry(TexelBufferBindingEntry::Init&& init) : - ChainedStruct { init.nextInChain, SType::TexelBufferBindingEntry }, - texelBufferView(std::move(init.texelBufferView)) {} - -TexelBufferBindingEntry::operator const WGPUTexelBufferBindingEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferBindingEntry) == sizeof(WGPUTexelBufferBindingEntry), "sizeof mismatch for TexelBufferBindingEntry"); -static_assert(alignof(TexelBufferBindingEntry) == alignof(WGPUTexelBufferBindingEntry), "alignof mismatch for TexelBufferBindingEntry"); -static_assert(offsetof(TexelBufferBindingEntry, texelBufferView) == offsetof(WGPUTexelBufferBindingEntry, texelBufferView), - "offsetof mismatch for TexelBufferBindingEntry::texelBufferView"); - -// TexelBufferBindingLayout implementation -TexelBufferBindingLayout::TexelBufferBindingLayout() -: ChainedStruct { nullptr, SType::TexelBufferBindingLayout } {} -struct TexelBufferBindingLayout::Init { - ChainedStruct * const nextInChain; - TexelBufferAccess access = TexelBufferAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; -}; -TexelBufferBindingLayout::TexelBufferBindingLayout(TexelBufferBindingLayout::Init&& init) : - ChainedStruct { init.nextInChain, SType::TexelBufferBindingLayout }, - access(std::move(init.access)), - format(std::move(init.format)) {} - -TexelBufferBindingLayout::operator const WGPUTexelBufferBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferBindingLayout) == sizeof(WGPUTexelBufferBindingLayout), "sizeof mismatch for TexelBufferBindingLayout"); -static_assert(alignof(TexelBufferBindingLayout) == alignof(WGPUTexelBufferBindingLayout), "alignof mismatch for TexelBufferBindingLayout"); -static_assert(offsetof(TexelBufferBindingLayout, access) == offsetof(WGPUTexelBufferBindingLayout, access), - "offsetof mismatch for TexelBufferBindingLayout::access"); -static_assert(offsetof(TexelBufferBindingLayout, format) == offsetof(WGPUTexelBufferBindingLayout, format), - "offsetof mismatch for TexelBufferBindingLayout::format"); - -// TexelBufferViewDescriptor implementation - -TexelBufferViewDescriptor::operator const WGPUTexelBufferViewDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelBufferViewDescriptor) == sizeof(WGPUTexelBufferViewDescriptor), "sizeof mismatch for TexelBufferViewDescriptor"); -static_assert(alignof(TexelBufferViewDescriptor) == alignof(WGPUTexelBufferViewDescriptor), "alignof mismatch for TexelBufferViewDescriptor"); -static_assert(offsetof(TexelBufferViewDescriptor, nextInChain) == offsetof(WGPUTexelBufferViewDescriptor, nextInChain), - "offsetof mismatch for TexelBufferViewDescriptor::nextInChain"); -static_assert(offsetof(TexelBufferViewDescriptor, label) == offsetof(WGPUTexelBufferViewDescriptor, label), - "offsetof mismatch for TexelBufferViewDescriptor::label"); -static_assert(offsetof(TexelBufferViewDescriptor, format) == offsetof(WGPUTexelBufferViewDescriptor, format), - "offsetof mismatch for TexelBufferViewDescriptor::format"); -static_assert(offsetof(TexelBufferViewDescriptor, offset) == offsetof(WGPUTexelBufferViewDescriptor, offset), - "offsetof mismatch for TexelBufferViewDescriptor::offset"); -static_assert(offsetof(TexelBufferViewDescriptor, size) == offsetof(WGPUTexelBufferViewDescriptor, size), - "offsetof mismatch for TexelBufferViewDescriptor::size"); - -// TexelCopyBufferLayout implementation - -TexelCopyBufferLayout::operator const WGPUTexelCopyBufferLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyBufferLayout) == sizeof(WGPUTexelCopyBufferLayout), "sizeof mismatch for TexelCopyBufferLayout"); -static_assert(alignof(TexelCopyBufferLayout) == alignof(WGPUTexelCopyBufferLayout), "alignof mismatch for TexelCopyBufferLayout"); -static_assert(offsetof(TexelCopyBufferLayout, offset) == offsetof(WGPUTexelCopyBufferLayout, offset), - "offsetof mismatch for TexelCopyBufferLayout::offset"); -static_assert(offsetof(TexelCopyBufferLayout, bytesPerRow) == offsetof(WGPUTexelCopyBufferLayout, bytesPerRow), - "offsetof mismatch for TexelCopyBufferLayout::bytesPerRow"); -static_assert(offsetof(TexelCopyBufferLayout, rowsPerImage) == offsetof(WGPUTexelCopyBufferLayout, rowsPerImage), - "offsetof mismatch for TexelCopyBufferLayout::rowsPerImage"); - -// TextureBindingLayout implementation - -TextureBindingLayout::operator const WGPUTextureBindingLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureBindingLayout) == sizeof(WGPUTextureBindingLayout), "sizeof mismatch for TextureBindingLayout"); -static_assert(alignof(TextureBindingLayout) == alignof(WGPUTextureBindingLayout), "alignof mismatch for TextureBindingLayout"); -static_assert(offsetof(TextureBindingLayout, nextInChain) == offsetof(WGPUTextureBindingLayout, nextInChain), - "offsetof mismatch for TextureBindingLayout::nextInChain"); -static_assert(offsetof(TextureBindingLayout, sampleType) == offsetof(WGPUTextureBindingLayout, sampleType), - "offsetof mismatch for TextureBindingLayout::sampleType"); -static_assert(offsetof(TextureBindingLayout, viewDimension) == offsetof(WGPUTextureBindingLayout, viewDimension), - "offsetof mismatch for TextureBindingLayout::viewDimension"); -static_assert(offsetof(TextureBindingLayout, multisampled) == offsetof(WGPUTextureBindingLayout, multisampled), - "offsetof mismatch for TextureBindingLayout::multisampled"); - -// TextureBindingViewDimension implementation -TextureBindingViewDimension::TextureBindingViewDimension() -: ChainedStruct { nullptr, SType::TextureBindingViewDimension } {} -struct TextureBindingViewDimension::Init { - ChainedStruct * const nextInChain; - TextureViewDimension textureBindingViewDimension = TextureViewDimension::Undefined; -}; -TextureBindingViewDimension::TextureBindingViewDimension(TextureBindingViewDimension::Init&& init) : - ChainedStruct { init.nextInChain, SType::TextureBindingViewDimension }, - textureBindingViewDimension(std::move(init.textureBindingViewDimension)) {} - -TextureBindingViewDimension::operator const WGPUTextureBindingViewDimension&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureBindingViewDimension) == sizeof(WGPUTextureBindingViewDimension), "sizeof mismatch for TextureBindingViewDimension"); -static_assert(alignof(TextureBindingViewDimension) == alignof(WGPUTextureBindingViewDimension), "alignof mismatch for TextureBindingViewDimension"); -static_assert(offsetof(TextureBindingViewDimension, textureBindingViewDimension) == offsetof(WGPUTextureBindingViewDimension, textureBindingViewDimension), - "offsetof mismatch for TextureBindingViewDimension::textureBindingViewDimension"); - -// TextureComponentSwizzle implementation - -TextureComponentSwizzle::operator const WGPUTextureComponentSwizzle&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureComponentSwizzle) == sizeof(WGPUTextureComponentSwizzle), "sizeof mismatch for TextureComponentSwizzle"); -static_assert(alignof(TextureComponentSwizzle) == alignof(WGPUTextureComponentSwizzle), "alignof mismatch for TextureComponentSwizzle"); -static_assert(offsetof(TextureComponentSwizzle, r) == offsetof(WGPUTextureComponentSwizzle, r), - "offsetof mismatch for TextureComponentSwizzle::r"); -static_assert(offsetof(TextureComponentSwizzle, g) == offsetof(WGPUTextureComponentSwizzle, g), - "offsetof mismatch for TextureComponentSwizzle::g"); -static_assert(offsetof(TextureComponentSwizzle, b) == offsetof(WGPUTextureComponentSwizzle, b), - "offsetof mismatch for TextureComponentSwizzle::b"); -static_assert(offsetof(TextureComponentSwizzle, a) == offsetof(WGPUTextureComponentSwizzle, a), - "offsetof mismatch for TextureComponentSwizzle::a"); - -// VertexAttribute implementation - -VertexAttribute::operator const WGPUVertexAttribute&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexAttribute) == sizeof(WGPUVertexAttribute), "sizeof mismatch for VertexAttribute"); -static_assert(alignof(VertexAttribute) == alignof(WGPUVertexAttribute), "alignof mismatch for VertexAttribute"); -static_assert(offsetof(VertexAttribute, nextInChain) == offsetof(WGPUVertexAttribute, nextInChain), - "offsetof mismatch for VertexAttribute::nextInChain"); -static_assert(offsetof(VertexAttribute, format) == offsetof(WGPUVertexAttribute, format), - "offsetof mismatch for VertexAttribute::format"); -static_assert(offsetof(VertexAttribute, offset) == offsetof(WGPUVertexAttribute, offset), - "offsetof mismatch for VertexAttribute::offset"); -static_assert(offsetof(VertexAttribute, shaderLocation) == offsetof(WGPUVertexAttribute, shaderLocation), - "offsetof mismatch for VertexAttribute::shaderLocation"); - -// YCbCrVkDescriptor implementation -YCbCrVkDescriptor::YCbCrVkDescriptor() -: ChainedStruct { nullptr, SType::YCbCrVkDescriptor } {} -struct YCbCrVkDescriptor::Init { - ChainedStruct * const nextInChain; - uint32_t vkFormat = 0; - uint32_t vkYCbCrModel = 0; - uint32_t vkYCbCrRange = 0; - uint32_t vkComponentSwizzleRed = 0; - uint32_t vkComponentSwizzleGreen = 0; - uint32_t vkComponentSwizzleBlue = 0; - uint32_t vkComponentSwizzleAlpha = 0; - uint32_t vkXChromaOffset = 0; - uint32_t vkYChromaOffset = 0; - FilterMode vkChromaFilter = FilterMode::Undefined; - Bool forceExplicitReconstruction = false; - uint64_t externalFormat = 0; -}; -YCbCrVkDescriptor::YCbCrVkDescriptor(YCbCrVkDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::YCbCrVkDescriptor }, - vkFormat(std::move(init.vkFormat)), - vkYCbCrModel(std::move(init.vkYCbCrModel)), - vkYCbCrRange(std::move(init.vkYCbCrRange)), - vkComponentSwizzleRed(std::move(init.vkComponentSwizzleRed)), - vkComponentSwizzleGreen(std::move(init.vkComponentSwizzleGreen)), - vkComponentSwizzleBlue(std::move(init.vkComponentSwizzleBlue)), - vkComponentSwizzleAlpha(std::move(init.vkComponentSwizzleAlpha)), - vkXChromaOffset(std::move(init.vkXChromaOffset)), - vkYChromaOffset(std::move(init.vkYChromaOffset)), - vkChromaFilter(std::move(init.vkChromaFilter)), - forceExplicitReconstruction(std::move(init.forceExplicitReconstruction)), - externalFormat(std::move(init.externalFormat)) {} - -YCbCrVkDescriptor::operator const WGPUYCbCrVkDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(YCbCrVkDescriptor) == sizeof(WGPUYCbCrVkDescriptor), "sizeof mismatch for YCbCrVkDescriptor"); -static_assert(alignof(YCbCrVkDescriptor) == alignof(WGPUYCbCrVkDescriptor), "alignof mismatch for YCbCrVkDescriptor"); -static_assert(offsetof(YCbCrVkDescriptor, vkFormat) == offsetof(WGPUYCbCrVkDescriptor, vkFormat), - "offsetof mismatch for YCbCrVkDescriptor::vkFormat"); -static_assert(offsetof(YCbCrVkDescriptor, vkYCbCrModel) == offsetof(WGPUYCbCrVkDescriptor, vkYCbCrModel), - "offsetof mismatch for YCbCrVkDescriptor::vkYCbCrModel"); -static_assert(offsetof(YCbCrVkDescriptor, vkYCbCrRange) == offsetof(WGPUYCbCrVkDescriptor, vkYCbCrRange), - "offsetof mismatch for YCbCrVkDescriptor::vkYCbCrRange"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleRed) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleRed), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleRed"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleGreen) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleGreen), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleGreen"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleBlue) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleBlue), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleBlue"); -static_assert(offsetof(YCbCrVkDescriptor, vkComponentSwizzleAlpha) == offsetof(WGPUYCbCrVkDescriptor, vkComponentSwizzleAlpha), - "offsetof mismatch for YCbCrVkDescriptor::vkComponentSwizzleAlpha"); -static_assert(offsetof(YCbCrVkDescriptor, vkXChromaOffset) == offsetof(WGPUYCbCrVkDescriptor, vkXChromaOffset), - "offsetof mismatch for YCbCrVkDescriptor::vkXChromaOffset"); -static_assert(offsetof(YCbCrVkDescriptor, vkYChromaOffset) == offsetof(WGPUYCbCrVkDescriptor, vkYChromaOffset), - "offsetof mismatch for YCbCrVkDescriptor::vkYChromaOffset"); -static_assert(offsetof(YCbCrVkDescriptor, vkChromaFilter) == offsetof(WGPUYCbCrVkDescriptor, vkChromaFilter), - "offsetof mismatch for YCbCrVkDescriptor::vkChromaFilter"); -static_assert(offsetof(YCbCrVkDescriptor, forceExplicitReconstruction) == offsetof(WGPUYCbCrVkDescriptor, forceExplicitReconstruction), - "offsetof mismatch for YCbCrVkDescriptor::forceExplicitReconstruction"); -static_assert(offsetof(YCbCrVkDescriptor, externalFormat) == offsetof(WGPUYCbCrVkDescriptor, externalFormat), - "offsetof mismatch for YCbCrVkDescriptor::externalFormat"); - -// AdapterPropertiesMemoryHeaps implementation -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps() -: ChainedStructOut { nullptr, SType::AdapterPropertiesMemoryHeaps } {} -struct AdapterPropertiesMemoryHeaps::Init { - ChainedStructOut * nextInChain; - size_t const heapCount = {}; - MemoryHeapInfo const * const heapInfo = nullptr; -}; -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesMemoryHeaps }, - heapCount(std::move(init.heapCount)), - heapInfo(std::move(init.heapInfo)) {} -AdapterPropertiesMemoryHeaps::~AdapterPropertiesMemoryHeaps() { - FreeMembers(); -} - -AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&& rhs) - : heapCount(rhs.heapCount), - heapInfo(rhs.heapInfo){ - Reset(rhs); -} - -AdapterPropertiesMemoryHeaps& AdapterPropertiesMemoryHeaps::operator=(AdapterPropertiesMemoryHeaps&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->heapCount) = std::move(rhs.heapCount); - detail::AsNonConstReference(this->heapInfo) = std::move(rhs.heapInfo); - Reset(rhs); - return *this; -} - -void AdapterPropertiesMemoryHeaps::FreeMembers() { - bool needsFreeing = false; if (this->heapInfo != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientAdapterPropertiesMemoryHeapsFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterPropertiesMemoryHeaps::Reset(AdapterPropertiesMemoryHeaps& value) { - AdapterPropertiesMemoryHeaps defaultValue{}; - detail::AsNonConstReference(value.heapCount) = defaultValue.heapCount; - detail::AsNonConstReference(value.heapInfo) = defaultValue.heapInfo; -} - -AdapterPropertiesMemoryHeaps::operator const WGPUAdapterPropertiesMemoryHeaps&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesMemoryHeaps) == sizeof(WGPUAdapterPropertiesMemoryHeaps), "sizeof mismatch for AdapterPropertiesMemoryHeaps"); -static_assert(alignof(AdapterPropertiesMemoryHeaps) == alignof(WGPUAdapterPropertiesMemoryHeaps), "alignof mismatch for AdapterPropertiesMemoryHeaps"); -static_assert(offsetof(AdapterPropertiesMemoryHeaps, heapCount) == offsetof(WGPUAdapterPropertiesMemoryHeaps, heapCount), - "offsetof mismatch for AdapterPropertiesMemoryHeaps::heapCount"); -static_assert(offsetof(AdapterPropertiesMemoryHeaps, heapInfo) == offsetof(WGPUAdapterPropertiesMemoryHeaps, heapInfo), - "offsetof mismatch for AdapterPropertiesMemoryHeaps::heapInfo"); - -// AdapterPropertiesSubgroupMatrixConfigs implementation -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs() -: ChainedStructOut { nullptr, SType::AdapterPropertiesSubgroupMatrixConfigs } {} -struct AdapterPropertiesSubgroupMatrixConfigs::Init { - ChainedStructOut * nextInChain; - size_t const configCount = {}; - SubgroupMatrixConfig const * const configs = nullptr; -}; -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs::Init&& init) : - ChainedStructOut { init.nextInChain, SType::AdapterPropertiesSubgroupMatrixConfigs }, - configCount(std::move(init.configCount)), - configs(std::move(init.configs)) {} -AdapterPropertiesSubgroupMatrixConfigs::~AdapterPropertiesSubgroupMatrixConfigs() { - FreeMembers(); -} - -AdapterPropertiesSubgroupMatrixConfigs::AdapterPropertiesSubgroupMatrixConfigs(AdapterPropertiesSubgroupMatrixConfigs&& rhs) - : configCount(rhs.configCount), - configs(rhs.configs){ - Reset(rhs); -} - -AdapterPropertiesSubgroupMatrixConfigs& AdapterPropertiesSubgroupMatrixConfigs::operator=(AdapterPropertiesSubgroupMatrixConfigs&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->configCount) = std::move(rhs.configCount); - detail::AsNonConstReference(this->configs) = std::move(rhs.configs); - Reset(rhs); - return *this; -} - -void AdapterPropertiesSubgroupMatrixConfigs::FreeMembers() { - bool needsFreeing = false; if (this->configs != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientAdapterPropertiesSubgroupMatrixConfigsFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterPropertiesSubgroupMatrixConfigs::Reset(AdapterPropertiesSubgroupMatrixConfigs& value) { - AdapterPropertiesSubgroupMatrixConfigs defaultValue{}; - detail::AsNonConstReference(value.configCount) = defaultValue.configCount; - detail::AsNonConstReference(value.configs) = defaultValue.configs; -} - -AdapterPropertiesSubgroupMatrixConfigs::operator const WGPUAdapterPropertiesSubgroupMatrixConfigs&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterPropertiesSubgroupMatrixConfigs) == sizeof(WGPUAdapterPropertiesSubgroupMatrixConfigs), "sizeof mismatch for AdapterPropertiesSubgroupMatrixConfigs"); -static_assert(alignof(AdapterPropertiesSubgroupMatrixConfigs) == alignof(WGPUAdapterPropertiesSubgroupMatrixConfigs), "alignof mismatch for AdapterPropertiesSubgroupMatrixConfigs"); -static_assert(offsetof(AdapterPropertiesSubgroupMatrixConfigs, configCount) == offsetof(WGPUAdapterPropertiesSubgroupMatrixConfigs, configCount), - "offsetof mismatch for AdapterPropertiesSubgroupMatrixConfigs::configCount"); -static_assert(offsetof(AdapterPropertiesSubgroupMatrixConfigs, configs) == offsetof(WGPUAdapterPropertiesSubgroupMatrixConfigs, configs), - "offsetof mismatch for AdapterPropertiesSubgroupMatrixConfigs::configs"); - -// AHardwareBufferProperties implementation - -AHardwareBufferProperties::operator const WGPUAHardwareBufferProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AHardwareBufferProperties) == sizeof(WGPUAHardwareBufferProperties), "sizeof mismatch for AHardwareBufferProperties"); -static_assert(alignof(AHardwareBufferProperties) == alignof(WGPUAHardwareBufferProperties), "alignof mismatch for AHardwareBufferProperties"); -static_assert(offsetof(AHardwareBufferProperties, yCbCrInfo) == offsetof(WGPUAHardwareBufferProperties, yCbCrInfo), - "offsetof mismatch for AHardwareBufferProperties::yCbCrInfo"); - -// BindGroupEntry implementation - -BindGroupEntry::operator const WGPUBindGroupEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupEntry) == sizeof(WGPUBindGroupEntry), "sizeof mismatch for BindGroupEntry"); -static_assert(alignof(BindGroupEntry) == alignof(WGPUBindGroupEntry), "alignof mismatch for BindGroupEntry"); -static_assert(offsetof(BindGroupEntry, nextInChain) == offsetof(WGPUBindGroupEntry, nextInChain), - "offsetof mismatch for BindGroupEntry::nextInChain"); -static_assert(offsetof(BindGroupEntry, binding) == offsetof(WGPUBindGroupEntry, binding), - "offsetof mismatch for BindGroupEntry::binding"); -static_assert(offsetof(BindGroupEntry, buffer) == offsetof(WGPUBindGroupEntry, buffer), - "offsetof mismatch for BindGroupEntry::buffer"); -static_assert(offsetof(BindGroupEntry, offset) == offsetof(WGPUBindGroupEntry, offset), - "offsetof mismatch for BindGroupEntry::offset"); -static_assert(offsetof(BindGroupEntry, size) == offsetof(WGPUBindGroupEntry, size), - "offsetof mismatch for BindGroupEntry::size"); -static_assert(offsetof(BindGroupEntry, sampler) == offsetof(WGPUBindGroupEntry, sampler), - "offsetof mismatch for BindGroupEntry::sampler"); -static_assert(offsetof(BindGroupEntry, textureView) == offsetof(WGPUBindGroupEntry, textureView), - "offsetof mismatch for BindGroupEntry::textureView"); - -// BindGroupLayoutEntry implementation - -BindGroupLayoutEntry::operator const WGPUBindGroupLayoutEntry&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupLayoutEntry) == sizeof(WGPUBindGroupLayoutEntry), "sizeof mismatch for BindGroupLayoutEntry"); -static_assert(alignof(BindGroupLayoutEntry) == alignof(WGPUBindGroupLayoutEntry), "alignof mismatch for BindGroupLayoutEntry"); -static_assert(offsetof(BindGroupLayoutEntry, nextInChain) == offsetof(WGPUBindGroupLayoutEntry, nextInChain), - "offsetof mismatch for BindGroupLayoutEntry::nextInChain"); -static_assert(offsetof(BindGroupLayoutEntry, binding) == offsetof(WGPUBindGroupLayoutEntry, binding), - "offsetof mismatch for BindGroupLayoutEntry::binding"); -static_assert(offsetof(BindGroupLayoutEntry, visibility) == offsetof(WGPUBindGroupLayoutEntry, visibility), - "offsetof mismatch for BindGroupLayoutEntry::visibility"); -static_assert(offsetof(BindGroupLayoutEntry, bindingArraySize) == offsetof(WGPUBindGroupLayoutEntry, bindingArraySize), - "offsetof mismatch for BindGroupLayoutEntry::bindingArraySize"); -static_assert(offsetof(BindGroupLayoutEntry, buffer) == offsetof(WGPUBindGroupLayoutEntry, buffer), - "offsetof mismatch for BindGroupLayoutEntry::buffer"); -static_assert(offsetof(BindGroupLayoutEntry, sampler) == offsetof(WGPUBindGroupLayoutEntry, sampler), - "offsetof mismatch for BindGroupLayoutEntry::sampler"); -static_assert(offsetof(BindGroupLayoutEntry, texture) == offsetof(WGPUBindGroupLayoutEntry, texture), - "offsetof mismatch for BindGroupLayoutEntry::texture"); -static_assert(offsetof(BindGroupLayoutEntry, storageTexture) == offsetof(WGPUBindGroupLayoutEntry, storageTexture), - "offsetof mismatch for BindGroupLayoutEntry::storageTexture"); - -// BlendState implementation - -BlendState::operator const WGPUBlendState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BlendState) == sizeof(WGPUBlendState), "sizeof mismatch for BlendState"); -static_assert(alignof(BlendState) == alignof(WGPUBlendState), "alignof mismatch for BlendState"); -static_assert(offsetof(BlendState, color) == offsetof(WGPUBlendState, color), - "offsetof mismatch for BlendState::color"); -static_assert(offsetof(BlendState, alpha) == offsetof(WGPUBlendState, alpha), - "offsetof mismatch for BlendState::alpha"); - -// BufferDescriptor implementation - -BufferDescriptor::operator const WGPUBufferDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BufferDescriptor) == sizeof(WGPUBufferDescriptor), "sizeof mismatch for BufferDescriptor"); -static_assert(alignof(BufferDescriptor) == alignof(WGPUBufferDescriptor), "alignof mismatch for BufferDescriptor"); -static_assert(offsetof(BufferDescriptor, nextInChain) == offsetof(WGPUBufferDescriptor, nextInChain), - "offsetof mismatch for BufferDescriptor::nextInChain"); -static_assert(offsetof(BufferDescriptor, label) == offsetof(WGPUBufferDescriptor, label), - "offsetof mismatch for BufferDescriptor::label"); -static_assert(offsetof(BufferDescriptor, usage) == offsetof(WGPUBufferDescriptor, usage), - "offsetof mismatch for BufferDescriptor::usage"); -static_assert(offsetof(BufferDescriptor, size) == offsetof(WGPUBufferDescriptor, size), - "offsetof mismatch for BufferDescriptor::size"); -static_assert(offsetof(BufferDescriptor, mappedAtCreation) == offsetof(WGPUBufferDescriptor, mappedAtCreation), - "offsetof mismatch for BufferDescriptor::mappedAtCreation"); - -// CommandEncoderDescriptor implementation - -CommandEncoderDescriptor::operator const WGPUCommandEncoderDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CommandEncoderDescriptor) == sizeof(WGPUCommandEncoderDescriptor), "sizeof mismatch for CommandEncoderDescriptor"); -static_assert(alignof(CommandEncoderDescriptor) == alignof(WGPUCommandEncoderDescriptor), "alignof mismatch for CommandEncoderDescriptor"); -static_assert(offsetof(CommandEncoderDescriptor, nextInChain) == offsetof(WGPUCommandEncoderDescriptor, nextInChain), - "offsetof mismatch for CommandEncoderDescriptor::nextInChain"); -static_assert(offsetof(CommandEncoderDescriptor, label) == offsetof(WGPUCommandEncoderDescriptor, label), - "offsetof mismatch for CommandEncoderDescriptor::label"); - -// CompilationMessage implementation - -CompilationMessage::operator const WGPUCompilationMessage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompilationMessage) == sizeof(WGPUCompilationMessage), "sizeof mismatch for CompilationMessage"); -static_assert(alignof(CompilationMessage) == alignof(WGPUCompilationMessage), "alignof mismatch for CompilationMessage"); -static_assert(offsetof(CompilationMessage, nextInChain) == offsetof(WGPUCompilationMessage, nextInChain), - "offsetof mismatch for CompilationMessage::nextInChain"); -static_assert(offsetof(CompilationMessage, message) == offsetof(WGPUCompilationMessage, message), - "offsetof mismatch for CompilationMessage::message"); -static_assert(offsetof(CompilationMessage, type) == offsetof(WGPUCompilationMessage, type), - "offsetof mismatch for CompilationMessage::type"); -static_assert(offsetof(CompilationMessage, lineNum) == offsetof(WGPUCompilationMessage, lineNum), - "offsetof mismatch for CompilationMessage::lineNum"); -static_assert(offsetof(CompilationMessage, linePos) == offsetof(WGPUCompilationMessage, linePos), - "offsetof mismatch for CompilationMessage::linePos"); -static_assert(offsetof(CompilationMessage, offset) == offsetof(WGPUCompilationMessage, offset), - "offsetof mismatch for CompilationMessage::offset"); -static_assert(offsetof(CompilationMessage, length) == offsetof(WGPUCompilationMessage, length), - "offsetof mismatch for CompilationMessage::length"); - -// ComputePassDescriptor implementation - -ComputePassDescriptor::operator const WGPUComputePassDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputePassDescriptor) == sizeof(WGPUComputePassDescriptor), "sizeof mismatch for ComputePassDescriptor"); -static_assert(alignof(ComputePassDescriptor) == alignof(WGPUComputePassDescriptor), "alignof mismatch for ComputePassDescriptor"); -static_assert(offsetof(ComputePassDescriptor, nextInChain) == offsetof(WGPUComputePassDescriptor, nextInChain), - "offsetof mismatch for ComputePassDescriptor::nextInChain"); -static_assert(offsetof(ComputePassDescriptor, label) == offsetof(WGPUComputePassDescriptor, label), - "offsetof mismatch for ComputePassDescriptor::label"); -static_assert(offsetof(ComputePassDescriptor, timestampWrites) == offsetof(WGPUComputePassDescriptor, timestampWrites), - "offsetof mismatch for ComputePassDescriptor::timestampWrites"); - -// ComputeState implementation - -ComputeState::operator const WGPUComputeState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputeState) == sizeof(WGPUComputeState), "sizeof mismatch for ComputeState"); -static_assert(alignof(ComputeState) == alignof(WGPUComputeState), "alignof mismatch for ComputeState"); -static_assert(offsetof(ComputeState, nextInChain) == offsetof(WGPUComputeState, nextInChain), - "offsetof mismatch for ComputeState::nextInChain"); -static_assert(offsetof(ComputeState, module) == offsetof(WGPUComputeState, module), - "offsetof mismatch for ComputeState::module"); -static_assert(offsetof(ComputeState, entryPoint) == offsetof(WGPUComputeState, entryPoint), - "offsetof mismatch for ComputeState::entryPoint"); -static_assert(offsetof(ComputeState, constantCount) == offsetof(WGPUComputeState, constantCount), - "offsetof mismatch for ComputeState::constantCount"); -static_assert(offsetof(ComputeState, constants) == offsetof(WGPUComputeState, constants), - "offsetof mismatch for ComputeState::constants"); - -// DawnDrmFormatCapabilities implementation -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities() -: ChainedStructOut { nullptr, SType::DawnDrmFormatCapabilities } {} -struct DawnDrmFormatCapabilities::Init { - ChainedStructOut * nextInChain; - size_t const propertiesCount = {}; - DawnDrmFormatProperties const * const properties = nullptr; -}; -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities(DawnDrmFormatCapabilities::Init&& init) : - ChainedStructOut { init.nextInChain, SType::DawnDrmFormatCapabilities }, - propertiesCount(std::move(init.propertiesCount)), - properties(std::move(init.properties)) {} -DawnDrmFormatCapabilities::~DawnDrmFormatCapabilities() { - FreeMembers(); -} - -DawnDrmFormatCapabilities::DawnDrmFormatCapabilities(DawnDrmFormatCapabilities&& rhs) - : propertiesCount(rhs.propertiesCount), - properties(rhs.properties){ - Reset(rhs); -} - -DawnDrmFormatCapabilities& DawnDrmFormatCapabilities::operator=(DawnDrmFormatCapabilities&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->propertiesCount) = std::move(rhs.propertiesCount); - detail::AsNonConstReference(this->properties) = std::move(rhs.properties); - Reset(rhs); - return *this; -} - -void DawnDrmFormatCapabilities::FreeMembers() { - bool needsFreeing = false; if (this->properties != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientDawnDrmFormatCapabilitiesFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void DawnDrmFormatCapabilities::Reset(DawnDrmFormatCapabilities& value) { - DawnDrmFormatCapabilities defaultValue{}; - detail::AsNonConstReference(value.propertiesCount) = defaultValue.propertiesCount; - detail::AsNonConstReference(value.properties) = defaultValue.properties; -} - -DawnDrmFormatCapabilities::operator const WGPUDawnDrmFormatCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnDrmFormatCapabilities) == sizeof(WGPUDawnDrmFormatCapabilities), "sizeof mismatch for DawnDrmFormatCapabilities"); -static_assert(alignof(DawnDrmFormatCapabilities) == alignof(WGPUDawnDrmFormatCapabilities), "alignof mismatch for DawnDrmFormatCapabilities"); -static_assert(offsetof(DawnDrmFormatCapabilities, propertiesCount) == offsetof(WGPUDawnDrmFormatCapabilities, propertiesCount), - "offsetof mismatch for DawnDrmFormatCapabilities::propertiesCount"); -static_assert(offsetof(DawnDrmFormatCapabilities, properties) == offsetof(WGPUDawnDrmFormatCapabilities, properties), - "offsetof mismatch for DawnDrmFormatCapabilities::properties"); - -// DepthStencilState implementation - -DepthStencilState::operator const WGPUDepthStencilState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DepthStencilState) == sizeof(WGPUDepthStencilState), "sizeof mismatch for DepthStencilState"); -static_assert(alignof(DepthStencilState) == alignof(WGPUDepthStencilState), "alignof mismatch for DepthStencilState"); -static_assert(offsetof(DepthStencilState, nextInChain) == offsetof(WGPUDepthStencilState, nextInChain), - "offsetof mismatch for DepthStencilState::nextInChain"); -static_assert(offsetof(DepthStencilState, format) == offsetof(WGPUDepthStencilState, format), - "offsetof mismatch for DepthStencilState::format"); -static_assert(offsetof(DepthStencilState, depthWriteEnabled) == offsetof(WGPUDepthStencilState, depthWriteEnabled), - "offsetof mismatch for DepthStencilState::depthWriteEnabled"); -static_assert(offsetof(DepthStencilState, depthCompare) == offsetof(WGPUDepthStencilState, depthCompare), - "offsetof mismatch for DepthStencilState::depthCompare"); -static_assert(offsetof(DepthStencilState, stencilFront) == offsetof(WGPUDepthStencilState, stencilFront), - "offsetof mismatch for DepthStencilState::stencilFront"); -static_assert(offsetof(DepthStencilState, stencilBack) == offsetof(WGPUDepthStencilState, stencilBack), - "offsetof mismatch for DepthStencilState::stencilBack"); -static_assert(offsetof(DepthStencilState, stencilReadMask) == offsetof(WGPUDepthStencilState, stencilReadMask), - "offsetof mismatch for DepthStencilState::stencilReadMask"); -static_assert(offsetof(DepthStencilState, stencilWriteMask) == offsetof(WGPUDepthStencilState, stencilWriteMask), - "offsetof mismatch for DepthStencilState::stencilWriteMask"); -static_assert(offsetof(DepthStencilState, depthBias) == offsetof(WGPUDepthStencilState, depthBias), - "offsetof mismatch for DepthStencilState::depthBias"); -static_assert(offsetof(DepthStencilState, depthBiasSlopeScale) == offsetof(WGPUDepthStencilState, depthBiasSlopeScale), - "offsetof mismatch for DepthStencilState::depthBiasSlopeScale"); -static_assert(offsetof(DepthStencilState, depthBiasClamp) == offsetof(WGPUDepthStencilState, depthBiasClamp), - "offsetof mismatch for DepthStencilState::depthBiasClamp"); - -// ExternalTextureDescriptor implementation - -ExternalTextureDescriptor::operator const WGPUExternalTextureDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ExternalTextureDescriptor) == sizeof(WGPUExternalTextureDescriptor), "sizeof mismatch for ExternalTextureDescriptor"); -static_assert(alignof(ExternalTextureDescriptor) == alignof(WGPUExternalTextureDescriptor), "alignof mismatch for ExternalTextureDescriptor"); -static_assert(offsetof(ExternalTextureDescriptor, nextInChain) == offsetof(WGPUExternalTextureDescriptor, nextInChain), - "offsetof mismatch for ExternalTextureDescriptor::nextInChain"); -static_assert(offsetof(ExternalTextureDescriptor, label) == offsetof(WGPUExternalTextureDescriptor, label), - "offsetof mismatch for ExternalTextureDescriptor::label"); -static_assert(offsetof(ExternalTextureDescriptor, plane0) == offsetof(WGPUExternalTextureDescriptor, plane0), - "offsetof mismatch for ExternalTextureDescriptor::plane0"); -static_assert(offsetof(ExternalTextureDescriptor, plane1) == offsetof(WGPUExternalTextureDescriptor, plane1), - "offsetof mismatch for ExternalTextureDescriptor::plane1"); -static_assert(offsetof(ExternalTextureDescriptor, cropOrigin) == offsetof(WGPUExternalTextureDescriptor, cropOrigin), - "offsetof mismatch for ExternalTextureDescriptor::cropOrigin"); -static_assert(offsetof(ExternalTextureDescriptor, cropSize) == offsetof(WGPUExternalTextureDescriptor, cropSize), - "offsetof mismatch for ExternalTextureDescriptor::cropSize"); -static_assert(offsetof(ExternalTextureDescriptor, apparentSize) == offsetof(WGPUExternalTextureDescriptor, apparentSize), - "offsetof mismatch for ExternalTextureDescriptor::apparentSize"); -static_assert(offsetof(ExternalTextureDescriptor, doYuvToRgbConversionOnly) == offsetof(WGPUExternalTextureDescriptor, doYuvToRgbConversionOnly), - "offsetof mismatch for ExternalTextureDescriptor::doYuvToRgbConversionOnly"); -static_assert(offsetof(ExternalTextureDescriptor, yuvToRgbConversionMatrix) == offsetof(WGPUExternalTextureDescriptor, yuvToRgbConversionMatrix), - "offsetof mismatch for ExternalTextureDescriptor::yuvToRgbConversionMatrix"); -static_assert(offsetof(ExternalTextureDescriptor, srcTransferFunctionParameters) == offsetof(WGPUExternalTextureDescriptor, srcTransferFunctionParameters), - "offsetof mismatch for ExternalTextureDescriptor::srcTransferFunctionParameters"); -static_assert(offsetof(ExternalTextureDescriptor, dstTransferFunctionParameters) == offsetof(WGPUExternalTextureDescriptor, dstTransferFunctionParameters), - "offsetof mismatch for ExternalTextureDescriptor::dstTransferFunctionParameters"); -static_assert(offsetof(ExternalTextureDescriptor, gamutConversionMatrix) == offsetof(WGPUExternalTextureDescriptor, gamutConversionMatrix), - "offsetof mismatch for ExternalTextureDescriptor::gamutConversionMatrix"); -static_assert(offsetof(ExternalTextureDescriptor, mirrored) == offsetof(WGPUExternalTextureDescriptor, mirrored), - "offsetof mismatch for ExternalTextureDescriptor::mirrored"); -static_assert(offsetof(ExternalTextureDescriptor, rotation) == offsetof(WGPUExternalTextureDescriptor, rotation), - "offsetof mismatch for ExternalTextureDescriptor::rotation"); - -// FutureWaitInfo implementation - -FutureWaitInfo::operator const WGPUFutureWaitInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(FutureWaitInfo) == sizeof(WGPUFutureWaitInfo), "sizeof mismatch for FutureWaitInfo"); -static_assert(alignof(FutureWaitInfo) == alignof(WGPUFutureWaitInfo), "alignof mismatch for FutureWaitInfo"); -static_assert(offsetof(FutureWaitInfo, future) == offsetof(WGPUFutureWaitInfo, future), - "offsetof mismatch for FutureWaitInfo::future"); -static_assert(offsetof(FutureWaitInfo, completed) == offsetof(WGPUFutureWaitInfo, completed), - "offsetof mismatch for FutureWaitInfo::completed"); - -// ImageCopyExternalTexture implementation - -ImageCopyExternalTexture::operator const WGPUImageCopyExternalTexture&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ImageCopyExternalTexture) == sizeof(WGPUImageCopyExternalTexture), "sizeof mismatch for ImageCopyExternalTexture"); -static_assert(alignof(ImageCopyExternalTexture) == alignof(WGPUImageCopyExternalTexture), "alignof mismatch for ImageCopyExternalTexture"); -static_assert(offsetof(ImageCopyExternalTexture, nextInChain) == offsetof(WGPUImageCopyExternalTexture, nextInChain), - "offsetof mismatch for ImageCopyExternalTexture::nextInChain"); -static_assert(offsetof(ImageCopyExternalTexture, externalTexture) == offsetof(WGPUImageCopyExternalTexture, externalTexture), - "offsetof mismatch for ImageCopyExternalTexture::externalTexture"); -static_assert(offsetof(ImageCopyExternalTexture, origin) == offsetof(WGPUImageCopyExternalTexture, origin), - "offsetof mismatch for ImageCopyExternalTexture::origin"); -static_assert(offsetof(ImageCopyExternalTexture, naturalSize) == offsetof(WGPUImageCopyExternalTexture, naturalSize), - "offsetof mismatch for ImageCopyExternalTexture::naturalSize"); - -// InstanceDescriptor implementation - -InstanceDescriptor::operator const WGPUInstanceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(InstanceDescriptor) == sizeof(WGPUInstanceDescriptor), "sizeof mismatch for InstanceDescriptor"); -static_assert(alignof(InstanceDescriptor) == alignof(WGPUInstanceDescriptor), "alignof mismatch for InstanceDescriptor"); -static_assert(offsetof(InstanceDescriptor, nextInChain) == offsetof(WGPUInstanceDescriptor, nextInChain), - "offsetof mismatch for InstanceDescriptor::nextInChain"); -static_assert(offsetof(InstanceDescriptor, requiredFeatureCount) == offsetof(WGPUInstanceDescriptor, requiredFeatureCount), - "offsetof mismatch for InstanceDescriptor::requiredFeatureCount"); -static_assert(offsetof(InstanceDescriptor, requiredFeatures) == offsetof(WGPUInstanceDescriptor, requiredFeatures), - "offsetof mismatch for InstanceDescriptor::requiredFeatures"); -static_assert(offsetof(InstanceDescriptor, requiredLimits) == offsetof(WGPUInstanceDescriptor, requiredLimits), - "offsetof mismatch for InstanceDescriptor::requiredLimits"); - -// Limits implementation - -Limits::operator const WGPULimits&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(Limits) == sizeof(WGPULimits), "sizeof mismatch for Limits"); -static_assert(alignof(Limits) == alignof(WGPULimits), "alignof mismatch for Limits"); -static_assert(offsetof(Limits, nextInChain) == offsetof(WGPULimits, nextInChain), - "offsetof mismatch for Limits::nextInChain"); -static_assert(offsetof(Limits, maxTextureDimension1D) == offsetof(WGPULimits, maxTextureDimension1D), - "offsetof mismatch for Limits::maxTextureDimension1D"); -static_assert(offsetof(Limits, maxTextureDimension2D) == offsetof(WGPULimits, maxTextureDimension2D), - "offsetof mismatch for Limits::maxTextureDimension2D"); -static_assert(offsetof(Limits, maxTextureDimension3D) == offsetof(WGPULimits, maxTextureDimension3D), - "offsetof mismatch for Limits::maxTextureDimension3D"); -static_assert(offsetof(Limits, maxTextureArrayLayers) == offsetof(WGPULimits, maxTextureArrayLayers), - "offsetof mismatch for Limits::maxTextureArrayLayers"); -static_assert(offsetof(Limits, maxBindGroups) == offsetof(WGPULimits, maxBindGroups), - "offsetof mismatch for Limits::maxBindGroups"); -static_assert(offsetof(Limits, maxBindGroupsPlusVertexBuffers) == offsetof(WGPULimits, maxBindGroupsPlusVertexBuffers), - "offsetof mismatch for Limits::maxBindGroupsPlusVertexBuffers"); -static_assert(offsetof(Limits, maxBindingsPerBindGroup) == offsetof(WGPULimits, maxBindingsPerBindGroup), - "offsetof mismatch for Limits::maxBindingsPerBindGroup"); -static_assert(offsetof(Limits, maxDynamicUniformBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicUniformBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicUniformBuffersPerPipelineLayout"); -static_assert(offsetof(Limits, maxDynamicStorageBuffersPerPipelineLayout) == offsetof(WGPULimits, maxDynamicStorageBuffersPerPipelineLayout), - "offsetof mismatch for Limits::maxDynamicStorageBuffersPerPipelineLayout"); -static_assert(offsetof(Limits, maxSampledTexturesPerShaderStage) == offsetof(WGPULimits, maxSampledTexturesPerShaderStage), - "offsetof mismatch for Limits::maxSampledTexturesPerShaderStage"); -static_assert(offsetof(Limits, maxSamplersPerShaderStage) == offsetof(WGPULimits, maxSamplersPerShaderStage), - "offsetof mismatch for Limits::maxSamplersPerShaderStage"); -static_assert(offsetof(Limits, maxStorageBuffersPerShaderStage) == offsetof(WGPULimits, maxStorageBuffersPerShaderStage), - "offsetof mismatch for Limits::maxStorageBuffersPerShaderStage"); -static_assert(offsetof(Limits, maxStorageTexturesPerShaderStage) == offsetof(WGPULimits, maxStorageTexturesPerShaderStage), - "offsetof mismatch for Limits::maxStorageTexturesPerShaderStage"); -static_assert(offsetof(Limits, maxUniformBuffersPerShaderStage) == offsetof(WGPULimits, maxUniformBuffersPerShaderStage), - "offsetof mismatch for Limits::maxUniformBuffersPerShaderStage"); -static_assert(offsetof(Limits, maxUniformBufferBindingSize) == offsetof(WGPULimits, maxUniformBufferBindingSize), - "offsetof mismatch for Limits::maxUniformBufferBindingSize"); -static_assert(offsetof(Limits, maxStorageBufferBindingSize) == offsetof(WGPULimits, maxStorageBufferBindingSize), - "offsetof mismatch for Limits::maxStorageBufferBindingSize"); -static_assert(offsetof(Limits, minUniformBufferOffsetAlignment) == offsetof(WGPULimits, minUniformBufferOffsetAlignment), - "offsetof mismatch for Limits::minUniformBufferOffsetAlignment"); -static_assert(offsetof(Limits, minStorageBufferOffsetAlignment) == offsetof(WGPULimits, minStorageBufferOffsetAlignment), - "offsetof mismatch for Limits::minStorageBufferOffsetAlignment"); -static_assert(offsetof(Limits, maxVertexBuffers) == offsetof(WGPULimits, maxVertexBuffers), - "offsetof mismatch for Limits::maxVertexBuffers"); -static_assert(offsetof(Limits, maxBufferSize) == offsetof(WGPULimits, maxBufferSize), - "offsetof mismatch for Limits::maxBufferSize"); -static_assert(offsetof(Limits, maxVertexAttributes) == offsetof(WGPULimits, maxVertexAttributes), - "offsetof mismatch for Limits::maxVertexAttributes"); -static_assert(offsetof(Limits, maxVertexBufferArrayStride) == offsetof(WGPULimits, maxVertexBufferArrayStride), - "offsetof mismatch for Limits::maxVertexBufferArrayStride"); -static_assert(offsetof(Limits, maxInterStageShaderVariables) == offsetof(WGPULimits, maxInterStageShaderVariables), - "offsetof mismatch for Limits::maxInterStageShaderVariables"); -static_assert(offsetof(Limits, maxColorAttachments) == offsetof(WGPULimits, maxColorAttachments), - "offsetof mismatch for Limits::maxColorAttachments"); -static_assert(offsetof(Limits, maxColorAttachmentBytesPerSample) == offsetof(WGPULimits, maxColorAttachmentBytesPerSample), - "offsetof mismatch for Limits::maxColorAttachmentBytesPerSample"); -static_assert(offsetof(Limits, maxComputeWorkgroupStorageSize) == offsetof(WGPULimits, maxComputeWorkgroupStorageSize), - "offsetof mismatch for Limits::maxComputeWorkgroupStorageSize"); -static_assert(offsetof(Limits, maxComputeInvocationsPerWorkgroup) == offsetof(WGPULimits, maxComputeInvocationsPerWorkgroup), - "offsetof mismatch for Limits::maxComputeInvocationsPerWorkgroup"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeX) == offsetof(WGPULimits, maxComputeWorkgroupSizeX), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeX"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeY) == offsetof(WGPULimits, maxComputeWorkgroupSizeY), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeY"); -static_assert(offsetof(Limits, maxComputeWorkgroupSizeZ) == offsetof(WGPULimits, maxComputeWorkgroupSizeZ), - "offsetof mismatch for Limits::maxComputeWorkgroupSizeZ"); -static_assert(offsetof(Limits, maxComputeWorkgroupsPerDimension) == offsetof(WGPULimits, maxComputeWorkgroupsPerDimension), - "offsetof mismatch for Limits::maxComputeWorkgroupsPerDimension"); -static_assert(offsetof(Limits, maxImmediateSize) == offsetof(WGPULimits, maxImmediateSize), - "offsetof mismatch for Limits::maxImmediateSize"); - -// PipelineLayoutPixelLocalStorage implementation -PipelineLayoutPixelLocalStorage::PipelineLayoutPixelLocalStorage() -: ChainedStruct { nullptr, SType::PipelineLayoutPixelLocalStorage } {} -struct PipelineLayoutPixelLocalStorage::Init { - ChainedStruct * const nextInChain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - PipelineLayoutStorageAttachment const * storageAttachments = nullptr; -}; -PipelineLayoutPixelLocalStorage::PipelineLayoutPixelLocalStorage(PipelineLayoutPixelLocalStorage::Init&& init) : - ChainedStruct { init.nextInChain, SType::PipelineLayoutPixelLocalStorage }, - totalPixelLocalStorageSize(std::move(init.totalPixelLocalStorageSize)), - storageAttachmentCount(std::move(init.storageAttachmentCount)), - storageAttachments(std::move(init.storageAttachments)) {} - -PipelineLayoutPixelLocalStorage::operator const WGPUPipelineLayoutPixelLocalStorage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutPixelLocalStorage) == sizeof(WGPUPipelineLayoutPixelLocalStorage), "sizeof mismatch for PipelineLayoutPixelLocalStorage"); -static_assert(alignof(PipelineLayoutPixelLocalStorage) == alignof(WGPUPipelineLayoutPixelLocalStorage), "alignof mismatch for PipelineLayoutPixelLocalStorage"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, totalPixelLocalStorageSize) == offsetof(WGPUPipelineLayoutPixelLocalStorage, totalPixelLocalStorageSize), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::totalPixelLocalStorageSize"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, storageAttachmentCount) == offsetof(WGPUPipelineLayoutPixelLocalStorage, storageAttachmentCount), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::storageAttachmentCount"); -static_assert(offsetof(PipelineLayoutPixelLocalStorage, storageAttachments) == offsetof(WGPUPipelineLayoutPixelLocalStorage, storageAttachments), - "offsetof mismatch for PipelineLayoutPixelLocalStorage::storageAttachments"); - -// RenderPassColorAttachment implementation - -RenderPassColorAttachment::operator const WGPURenderPassColorAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassColorAttachment) == sizeof(WGPURenderPassColorAttachment), "sizeof mismatch for RenderPassColorAttachment"); -static_assert(alignof(RenderPassColorAttachment) == alignof(WGPURenderPassColorAttachment), "alignof mismatch for RenderPassColorAttachment"); -static_assert(offsetof(RenderPassColorAttachment, nextInChain) == offsetof(WGPURenderPassColorAttachment, nextInChain), - "offsetof mismatch for RenderPassColorAttachment::nextInChain"); -static_assert(offsetof(RenderPassColorAttachment, view) == offsetof(WGPURenderPassColorAttachment, view), - "offsetof mismatch for RenderPassColorAttachment::view"); -static_assert(offsetof(RenderPassColorAttachment, depthSlice) == offsetof(WGPURenderPassColorAttachment, depthSlice), - "offsetof mismatch for RenderPassColorAttachment::depthSlice"); -static_assert(offsetof(RenderPassColorAttachment, resolveTarget) == offsetof(WGPURenderPassColorAttachment, resolveTarget), - "offsetof mismatch for RenderPassColorAttachment::resolveTarget"); -static_assert(offsetof(RenderPassColorAttachment, loadOp) == offsetof(WGPURenderPassColorAttachment, loadOp), - "offsetof mismatch for RenderPassColorAttachment::loadOp"); -static_assert(offsetof(RenderPassColorAttachment, storeOp) == offsetof(WGPURenderPassColorAttachment, storeOp), - "offsetof mismatch for RenderPassColorAttachment::storeOp"); -static_assert(offsetof(RenderPassColorAttachment, clearValue) == offsetof(WGPURenderPassColorAttachment, clearValue), - "offsetof mismatch for RenderPassColorAttachment::clearValue"); - -// RenderPassRenderAreaRect implementation -RenderPassRenderAreaRect::RenderPassRenderAreaRect() -: ChainedStruct { nullptr, SType::RenderPassRenderAreaRect } {} -struct RenderPassRenderAreaRect::Init { - ChainedStruct * const nextInChain; - Origin2D origin = {}; - Extent2D size = {}; -}; -RenderPassRenderAreaRect::RenderPassRenderAreaRect(RenderPassRenderAreaRect::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassRenderAreaRect }, - origin(std::move(init.origin)), - size(std::move(init.size)) {} - -RenderPassRenderAreaRect::operator const WGPURenderPassRenderAreaRect&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassRenderAreaRect) == sizeof(WGPURenderPassRenderAreaRect), "sizeof mismatch for RenderPassRenderAreaRect"); -static_assert(alignof(RenderPassRenderAreaRect) == alignof(WGPURenderPassRenderAreaRect), "alignof mismatch for RenderPassRenderAreaRect"); -static_assert(offsetof(RenderPassRenderAreaRect, origin) == offsetof(WGPURenderPassRenderAreaRect, origin), - "offsetof mismatch for RenderPassRenderAreaRect::origin"); -static_assert(offsetof(RenderPassRenderAreaRect, size) == offsetof(WGPURenderPassRenderAreaRect, size), - "offsetof mismatch for RenderPassRenderAreaRect::size"); - -// RenderPassStorageAttachment implementation - -RenderPassStorageAttachment::operator const WGPURenderPassStorageAttachment&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassStorageAttachment) == sizeof(WGPURenderPassStorageAttachment), "sizeof mismatch for RenderPassStorageAttachment"); -static_assert(alignof(RenderPassStorageAttachment) == alignof(WGPURenderPassStorageAttachment), "alignof mismatch for RenderPassStorageAttachment"); -static_assert(offsetof(RenderPassStorageAttachment, nextInChain) == offsetof(WGPURenderPassStorageAttachment, nextInChain), - "offsetof mismatch for RenderPassStorageAttachment::nextInChain"); -static_assert(offsetof(RenderPassStorageAttachment, offset) == offsetof(WGPURenderPassStorageAttachment, offset), - "offsetof mismatch for RenderPassStorageAttachment::offset"); -static_assert(offsetof(RenderPassStorageAttachment, storage) == offsetof(WGPURenderPassStorageAttachment, storage), - "offsetof mismatch for RenderPassStorageAttachment::storage"); -static_assert(offsetof(RenderPassStorageAttachment, loadOp) == offsetof(WGPURenderPassStorageAttachment, loadOp), - "offsetof mismatch for RenderPassStorageAttachment::loadOp"); -static_assert(offsetof(RenderPassStorageAttachment, storeOp) == offsetof(WGPURenderPassStorageAttachment, storeOp), - "offsetof mismatch for RenderPassStorageAttachment::storeOp"); -static_assert(offsetof(RenderPassStorageAttachment, clearValue) == offsetof(WGPURenderPassStorageAttachment, clearValue), - "offsetof mismatch for RenderPassStorageAttachment::clearValue"); - -// RequestAdapterOptions implementation - -RequestAdapterOptions::operator const WGPURequestAdapterOptions&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RequestAdapterOptions) == sizeof(WGPURequestAdapterOptions), "sizeof mismatch for RequestAdapterOptions"); -static_assert(alignof(RequestAdapterOptions) == alignof(WGPURequestAdapterOptions), "alignof mismatch for RequestAdapterOptions"); -static_assert(offsetof(RequestAdapterOptions, nextInChain) == offsetof(WGPURequestAdapterOptions, nextInChain), - "offsetof mismatch for RequestAdapterOptions::nextInChain"); -static_assert(offsetof(RequestAdapterOptions, featureLevel) == offsetof(WGPURequestAdapterOptions, featureLevel), - "offsetof mismatch for RequestAdapterOptions::featureLevel"); -static_assert(offsetof(RequestAdapterOptions, powerPreference) == offsetof(WGPURequestAdapterOptions, powerPreference), - "offsetof mismatch for RequestAdapterOptions::powerPreference"); -static_assert(offsetof(RequestAdapterOptions, forceFallbackAdapter) == offsetof(WGPURequestAdapterOptions, forceFallbackAdapter), - "offsetof mismatch for RequestAdapterOptions::forceFallbackAdapter"); -static_assert(offsetof(RequestAdapterOptions, backendType) == offsetof(WGPURequestAdapterOptions, backendType), - "offsetof mismatch for RequestAdapterOptions::backendType"); -static_assert(offsetof(RequestAdapterOptions, compatibleSurface) == offsetof(WGPURequestAdapterOptions, compatibleSurface), - "offsetof mismatch for RequestAdapterOptions::compatibleSurface"); - -// SamplerDescriptor implementation - -SamplerDescriptor::operator const WGPUSamplerDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SamplerDescriptor) == sizeof(WGPUSamplerDescriptor), "sizeof mismatch for SamplerDescriptor"); -static_assert(alignof(SamplerDescriptor) == alignof(WGPUSamplerDescriptor), "alignof mismatch for SamplerDescriptor"); -static_assert(offsetof(SamplerDescriptor, nextInChain) == offsetof(WGPUSamplerDescriptor, nextInChain), - "offsetof mismatch for SamplerDescriptor::nextInChain"); -static_assert(offsetof(SamplerDescriptor, label) == offsetof(WGPUSamplerDescriptor, label), - "offsetof mismatch for SamplerDescriptor::label"); -static_assert(offsetof(SamplerDescriptor, addressModeU) == offsetof(WGPUSamplerDescriptor, addressModeU), - "offsetof mismatch for SamplerDescriptor::addressModeU"); -static_assert(offsetof(SamplerDescriptor, addressModeV) == offsetof(WGPUSamplerDescriptor, addressModeV), - "offsetof mismatch for SamplerDescriptor::addressModeV"); -static_assert(offsetof(SamplerDescriptor, addressModeW) == offsetof(WGPUSamplerDescriptor, addressModeW), - "offsetof mismatch for SamplerDescriptor::addressModeW"); -static_assert(offsetof(SamplerDescriptor, magFilter) == offsetof(WGPUSamplerDescriptor, magFilter), - "offsetof mismatch for SamplerDescriptor::magFilter"); -static_assert(offsetof(SamplerDescriptor, minFilter) == offsetof(WGPUSamplerDescriptor, minFilter), - "offsetof mismatch for SamplerDescriptor::minFilter"); -static_assert(offsetof(SamplerDescriptor, mipmapFilter) == offsetof(WGPUSamplerDescriptor, mipmapFilter), - "offsetof mismatch for SamplerDescriptor::mipmapFilter"); -static_assert(offsetof(SamplerDescriptor, lodMinClamp) == offsetof(WGPUSamplerDescriptor, lodMinClamp), - "offsetof mismatch for SamplerDescriptor::lodMinClamp"); -static_assert(offsetof(SamplerDescriptor, lodMaxClamp) == offsetof(WGPUSamplerDescriptor, lodMaxClamp), - "offsetof mismatch for SamplerDescriptor::lodMaxClamp"); -static_assert(offsetof(SamplerDescriptor, compare) == offsetof(WGPUSamplerDescriptor, compare), - "offsetof mismatch for SamplerDescriptor::compare"); -static_assert(offsetof(SamplerDescriptor, maxAnisotropy) == offsetof(WGPUSamplerDescriptor, maxAnisotropy), - "offsetof mismatch for SamplerDescriptor::maxAnisotropy"); - -// ShaderModuleDescriptor implementation - -ShaderModuleDescriptor::operator const WGPUShaderModuleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ShaderModuleDescriptor) == sizeof(WGPUShaderModuleDescriptor), "sizeof mismatch for ShaderModuleDescriptor"); -static_assert(alignof(ShaderModuleDescriptor) == alignof(WGPUShaderModuleDescriptor), "alignof mismatch for ShaderModuleDescriptor"); -static_assert(offsetof(ShaderModuleDescriptor, nextInChain) == offsetof(WGPUShaderModuleDescriptor, nextInChain), - "offsetof mismatch for ShaderModuleDescriptor::nextInChain"); -static_assert(offsetof(ShaderModuleDescriptor, label) == offsetof(WGPUShaderModuleDescriptor, label), - "offsetof mismatch for ShaderModuleDescriptor::label"); - -// SharedBufferMemoryDescriptor implementation - -SharedBufferMemoryDescriptor::operator const WGPUSharedBufferMemoryDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedBufferMemoryDescriptor) == sizeof(WGPUSharedBufferMemoryDescriptor), "sizeof mismatch for SharedBufferMemoryDescriptor"); -static_assert(alignof(SharedBufferMemoryDescriptor) == alignof(WGPUSharedBufferMemoryDescriptor), "alignof mismatch for SharedBufferMemoryDescriptor"); -static_assert(offsetof(SharedBufferMemoryDescriptor, nextInChain) == offsetof(WGPUSharedBufferMemoryDescriptor, nextInChain), - "offsetof mismatch for SharedBufferMemoryDescriptor::nextInChain"); -static_assert(offsetof(SharedBufferMemoryDescriptor, label) == offsetof(WGPUSharedBufferMemoryDescriptor, label), - "offsetof mismatch for SharedBufferMemoryDescriptor::label"); - -// SharedFenceDescriptor implementation - -SharedFenceDescriptor::operator const WGPUSharedFenceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceDescriptor) == sizeof(WGPUSharedFenceDescriptor), "sizeof mismatch for SharedFenceDescriptor"); -static_assert(alignof(SharedFenceDescriptor) == alignof(WGPUSharedFenceDescriptor), "alignof mismatch for SharedFenceDescriptor"); -static_assert(offsetof(SharedFenceDescriptor, nextInChain) == offsetof(WGPUSharedFenceDescriptor, nextInChain), - "offsetof mismatch for SharedFenceDescriptor::nextInChain"); -static_assert(offsetof(SharedFenceDescriptor, label) == offsetof(WGPUSharedFenceDescriptor, label), - "offsetof mismatch for SharedFenceDescriptor::label"); - -// SharedFenceExportInfo implementation - -SharedFenceExportInfo::operator const WGPUSharedFenceExportInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedFenceExportInfo) == sizeof(WGPUSharedFenceExportInfo), "sizeof mismatch for SharedFenceExportInfo"); -static_assert(alignof(SharedFenceExportInfo) == alignof(WGPUSharedFenceExportInfo), "alignof mismatch for SharedFenceExportInfo"); -static_assert(offsetof(SharedFenceExportInfo, nextInChain) == offsetof(WGPUSharedFenceExportInfo, nextInChain), - "offsetof mismatch for SharedFenceExportInfo::nextInChain"); -static_assert(offsetof(SharedFenceExportInfo, type) == offsetof(WGPUSharedFenceExportInfo, type), - "offsetof mismatch for SharedFenceExportInfo::type"); - -// SharedTextureMemoryAHardwareBufferProperties implementation -SharedTextureMemoryAHardwareBufferProperties::SharedTextureMemoryAHardwareBufferProperties() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryAHardwareBufferProperties } {} -struct SharedTextureMemoryAHardwareBufferProperties::Init { - ChainedStructOut * nextInChain; - YCbCrVkDescriptor yCbCrInfo = {}; -}; -SharedTextureMemoryAHardwareBufferProperties::SharedTextureMemoryAHardwareBufferProperties(SharedTextureMemoryAHardwareBufferProperties::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryAHardwareBufferProperties }, - yCbCrInfo(std::move(init.yCbCrInfo)) {} - -SharedTextureMemoryAHardwareBufferProperties::operator const WGPUSharedTextureMemoryAHardwareBufferProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryAHardwareBufferProperties) == sizeof(WGPUSharedTextureMemoryAHardwareBufferProperties), "sizeof mismatch for SharedTextureMemoryAHardwareBufferProperties"); -static_assert(alignof(SharedTextureMemoryAHardwareBufferProperties) == alignof(WGPUSharedTextureMemoryAHardwareBufferProperties), "alignof mismatch for SharedTextureMemoryAHardwareBufferProperties"); -static_assert(offsetof(SharedTextureMemoryAHardwareBufferProperties, yCbCrInfo) == offsetof(WGPUSharedTextureMemoryAHardwareBufferProperties, yCbCrInfo), - "offsetof mismatch for SharedTextureMemoryAHardwareBufferProperties::yCbCrInfo"); - -// SharedTextureMemoryBeginAccessDescriptor implementation - -SharedTextureMemoryBeginAccessDescriptor::operator const WGPUSharedTextureMemoryBeginAccessDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryBeginAccessDescriptor) == sizeof(WGPUSharedTextureMemoryBeginAccessDescriptor), "sizeof mismatch for SharedTextureMemoryBeginAccessDescriptor"); -static_assert(alignof(SharedTextureMemoryBeginAccessDescriptor) == alignof(WGPUSharedTextureMemoryBeginAccessDescriptor), "alignof mismatch for SharedTextureMemoryBeginAccessDescriptor"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, nextInChain) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, nextInChain), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::nextInChain"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, concurrentRead) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, concurrentRead), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::concurrentRead"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, initialized) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, initialized), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::initialized"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, fenceCount) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, fenceCount), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::fenceCount"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, fences) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, fences), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::fences"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, signaledValueCount) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, signaledValueCount), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::signaledValueCount"); -static_assert(offsetof(SharedTextureMemoryBeginAccessDescriptor, signaledValues) == offsetof(WGPUSharedTextureMemoryBeginAccessDescriptor, signaledValues), - "offsetof mismatch for SharedTextureMemoryBeginAccessDescriptor::signaledValues"); - -// SharedTextureMemoryDmaBufDescriptor implementation -SharedTextureMemoryDmaBufDescriptor::SharedTextureMemoryDmaBufDescriptor() -: ChainedStruct { nullptr, SType::SharedTextureMemoryDmaBufDescriptor } {} -struct SharedTextureMemoryDmaBufDescriptor::Init { - ChainedStruct * const nextInChain; - Extent3D size = {}; - uint32_t drmFormat; - uint64_t drmModifier; - size_t planeCount; - SharedTextureMemoryDmaBufPlane const * planes = nullptr; -}; -SharedTextureMemoryDmaBufDescriptor::SharedTextureMemoryDmaBufDescriptor(SharedTextureMemoryDmaBufDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::SharedTextureMemoryDmaBufDescriptor }, - size(std::move(init.size)), - drmFormat(std::move(init.drmFormat)), - drmModifier(std::move(init.drmModifier)), - planeCount(std::move(init.planeCount)), - planes(std::move(init.planes)) {} - -SharedTextureMemoryDmaBufDescriptor::operator const WGPUSharedTextureMemoryDmaBufDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDmaBufDescriptor) == sizeof(WGPUSharedTextureMemoryDmaBufDescriptor), "sizeof mismatch for SharedTextureMemoryDmaBufDescriptor"); -static_assert(alignof(SharedTextureMemoryDmaBufDescriptor) == alignof(WGPUSharedTextureMemoryDmaBufDescriptor), "alignof mismatch for SharedTextureMemoryDmaBufDescriptor"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, size) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, size), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::size"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, drmFormat) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, drmFormat), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::drmFormat"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, drmModifier) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, drmModifier), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::drmModifier"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planeCount) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, planeCount), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::planeCount"); -static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planes) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, planes), - "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::planes"); - -// SharedTextureMemoryMetalEndAccessState implementation -SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState() -: ChainedStructOut { nullptr, SType::SharedTextureMemoryMetalEndAccessState } {} -struct SharedTextureMemoryMetalEndAccessState::Init { - ChainedStructOut * nextInChain; - Future commandsScheduledFuture = {}; -}; -SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState(SharedTextureMemoryMetalEndAccessState::Init&& init) : - ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryMetalEndAccessState }, - commandsScheduledFuture(std::move(init.commandsScheduledFuture)) {} - -SharedTextureMemoryMetalEndAccessState::operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryMetalEndAccessState) == sizeof(WGPUSharedTextureMemoryMetalEndAccessState), "sizeof mismatch for SharedTextureMemoryMetalEndAccessState"); -static_assert(alignof(SharedTextureMemoryMetalEndAccessState) == alignof(WGPUSharedTextureMemoryMetalEndAccessState), "alignof mismatch for SharedTextureMemoryMetalEndAccessState"); -static_assert(offsetof(SharedTextureMemoryMetalEndAccessState, commandsScheduledFuture) == offsetof(WGPUSharedTextureMemoryMetalEndAccessState, commandsScheduledFuture), - "offsetof mismatch for SharedTextureMemoryMetalEndAccessState::commandsScheduledFuture"); - -// SurfaceDescriptor implementation - -SurfaceDescriptor::operator const WGPUSurfaceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SurfaceDescriptor) == sizeof(WGPUSurfaceDescriptor), "sizeof mismatch for SurfaceDescriptor"); -static_assert(alignof(SurfaceDescriptor) == alignof(WGPUSurfaceDescriptor), "alignof mismatch for SurfaceDescriptor"); -static_assert(offsetof(SurfaceDescriptor, nextInChain) == offsetof(WGPUSurfaceDescriptor, nextInChain), - "offsetof mismatch for SurfaceDescriptor::nextInChain"); -static_assert(offsetof(SurfaceDescriptor, label) == offsetof(WGPUSurfaceDescriptor, label), - "offsetof mismatch for SurfaceDescriptor::label"); - -// TexelCopyBufferInfo implementation - -TexelCopyBufferInfo::operator const WGPUTexelCopyBufferInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyBufferInfo) == sizeof(WGPUTexelCopyBufferInfo), "sizeof mismatch for TexelCopyBufferInfo"); -static_assert(alignof(TexelCopyBufferInfo) == alignof(WGPUTexelCopyBufferInfo), "alignof mismatch for TexelCopyBufferInfo"); -static_assert(offsetof(TexelCopyBufferInfo, layout) == offsetof(WGPUTexelCopyBufferInfo, layout), - "offsetof mismatch for TexelCopyBufferInfo::layout"); -static_assert(offsetof(TexelCopyBufferInfo, buffer) == offsetof(WGPUTexelCopyBufferInfo, buffer), - "offsetof mismatch for TexelCopyBufferInfo::buffer"); - -// TexelCopyTextureInfo implementation - -TexelCopyTextureInfo::operator const WGPUTexelCopyTextureInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TexelCopyTextureInfo) == sizeof(WGPUTexelCopyTextureInfo), "sizeof mismatch for TexelCopyTextureInfo"); -static_assert(alignof(TexelCopyTextureInfo) == alignof(WGPUTexelCopyTextureInfo), "alignof mismatch for TexelCopyTextureInfo"); -static_assert(offsetof(TexelCopyTextureInfo, texture) == offsetof(WGPUTexelCopyTextureInfo, texture), - "offsetof mismatch for TexelCopyTextureInfo::texture"); -static_assert(offsetof(TexelCopyTextureInfo, mipLevel) == offsetof(WGPUTexelCopyTextureInfo, mipLevel), - "offsetof mismatch for TexelCopyTextureInfo::mipLevel"); -static_assert(offsetof(TexelCopyTextureInfo, origin) == offsetof(WGPUTexelCopyTextureInfo, origin), - "offsetof mismatch for TexelCopyTextureInfo::origin"); -static_assert(offsetof(TexelCopyTextureInfo, aspect) == offsetof(WGPUTexelCopyTextureInfo, aspect), - "offsetof mismatch for TexelCopyTextureInfo::aspect"); - -// TextureComponentSwizzleDescriptor implementation -TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor() -: ChainedStruct { nullptr, SType::TextureComponentSwizzleDescriptor } {} -struct TextureComponentSwizzleDescriptor::Init { - ChainedStruct * const nextInChain; - TextureComponentSwizzle swizzle = {}; -}; -TextureComponentSwizzleDescriptor::TextureComponentSwizzleDescriptor(TextureComponentSwizzleDescriptor::Init&& init) : - ChainedStruct { init.nextInChain, SType::TextureComponentSwizzleDescriptor }, - swizzle(std::move(init.swizzle)) {} - -TextureComponentSwizzleDescriptor::operator const WGPUTextureComponentSwizzleDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureComponentSwizzleDescriptor) == sizeof(WGPUTextureComponentSwizzleDescriptor), "sizeof mismatch for TextureComponentSwizzleDescriptor"); -static_assert(alignof(TextureComponentSwizzleDescriptor) == alignof(WGPUTextureComponentSwizzleDescriptor), "alignof mismatch for TextureComponentSwizzleDescriptor"); -static_assert(offsetof(TextureComponentSwizzleDescriptor, swizzle) == offsetof(WGPUTextureComponentSwizzleDescriptor, swizzle), - "offsetof mismatch for TextureComponentSwizzleDescriptor::swizzle"); - -// TextureDescriptor implementation - -TextureDescriptor::operator const WGPUTextureDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureDescriptor) == sizeof(WGPUTextureDescriptor), "sizeof mismatch for TextureDescriptor"); -static_assert(alignof(TextureDescriptor) == alignof(WGPUTextureDescriptor), "alignof mismatch for TextureDescriptor"); -static_assert(offsetof(TextureDescriptor, nextInChain) == offsetof(WGPUTextureDescriptor, nextInChain), - "offsetof mismatch for TextureDescriptor::nextInChain"); -static_assert(offsetof(TextureDescriptor, label) == offsetof(WGPUTextureDescriptor, label), - "offsetof mismatch for TextureDescriptor::label"); -static_assert(offsetof(TextureDescriptor, usage) == offsetof(WGPUTextureDescriptor, usage), - "offsetof mismatch for TextureDescriptor::usage"); -static_assert(offsetof(TextureDescriptor, dimension) == offsetof(WGPUTextureDescriptor, dimension), - "offsetof mismatch for TextureDescriptor::dimension"); -static_assert(offsetof(TextureDescriptor, size) == offsetof(WGPUTextureDescriptor, size), - "offsetof mismatch for TextureDescriptor::size"); -static_assert(offsetof(TextureDescriptor, format) == offsetof(WGPUTextureDescriptor, format), - "offsetof mismatch for TextureDescriptor::format"); -static_assert(offsetof(TextureDescriptor, mipLevelCount) == offsetof(WGPUTextureDescriptor, mipLevelCount), - "offsetof mismatch for TextureDescriptor::mipLevelCount"); -static_assert(offsetof(TextureDescriptor, sampleCount) == offsetof(WGPUTextureDescriptor, sampleCount), - "offsetof mismatch for TextureDescriptor::sampleCount"); -static_assert(offsetof(TextureDescriptor, viewFormatCount) == offsetof(WGPUTextureDescriptor, viewFormatCount), - "offsetof mismatch for TextureDescriptor::viewFormatCount"); -static_assert(offsetof(TextureDescriptor, viewFormats) == offsetof(WGPUTextureDescriptor, viewFormats), - "offsetof mismatch for TextureDescriptor::viewFormats"); - -// VertexBufferLayout implementation - -VertexBufferLayout::operator const WGPUVertexBufferLayout&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexBufferLayout) == sizeof(WGPUVertexBufferLayout), "sizeof mismatch for VertexBufferLayout"); -static_assert(alignof(VertexBufferLayout) == alignof(WGPUVertexBufferLayout), "alignof mismatch for VertexBufferLayout"); -static_assert(offsetof(VertexBufferLayout, nextInChain) == offsetof(WGPUVertexBufferLayout, nextInChain), - "offsetof mismatch for VertexBufferLayout::nextInChain"); -static_assert(offsetof(VertexBufferLayout, stepMode) == offsetof(WGPUVertexBufferLayout, stepMode), - "offsetof mismatch for VertexBufferLayout::stepMode"); -static_assert(offsetof(VertexBufferLayout, arrayStride) == offsetof(WGPUVertexBufferLayout, arrayStride), - "offsetof mismatch for VertexBufferLayout::arrayStride"); -static_assert(offsetof(VertexBufferLayout, attributeCount) == offsetof(WGPUVertexBufferLayout, attributeCount), - "offsetof mismatch for VertexBufferLayout::attributeCount"); -static_assert(offsetof(VertexBufferLayout, attributes) == offsetof(WGPUVertexBufferLayout, attributes), - "offsetof mismatch for VertexBufferLayout::attributes"); - -// AdapterInfo implementation -AdapterInfo::AdapterInfo() = default; -AdapterInfo::~AdapterInfo() { - FreeMembers(); -} - -AdapterInfo::AdapterInfo(AdapterInfo&& rhs) - : vendor(rhs.vendor), - architecture(rhs.architecture), - device(rhs.device), - description(rhs.description), - backendType(rhs.backendType), - adapterType(rhs.adapterType), - vendorID(rhs.vendorID), - deviceID(rhs.deviceID), - subgroupMinSize(rhs.subgroupMinSize), - subgroupMaxSize(rhs.subgroupMaxSize){ - Reset(rhs); -} - -AdapterInfo& AdapterInfo::operator=(AdapterInfo&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->vendor) = std::move(rhs.vendor); - detail::AsNonConstReference(this->architecture) = std::move(rhs.architecture); - detail::AsNonConstReference(this->device) = std::move(rhs.device); - detail::AsNonConstReference(this->description) = std::move(rhs.description); - detail::AsNonConstReference(this->backendType) = std::move(rhs.backendType); - detail::AsNonConstReference(this->adapterType) = std::move(rhs.adapterType); - detail::AsNonConstReference(this->vendorID) = std::move(rhs.vendorID); - detail::AsNonConstReference(this->deviceID) = std::move(rhs.deviceID); - detail::AsNonConstReference(this->subgroupMinSize) = std::move(rhs.subgroupMinSize); - detail::AsNonConstReference(this->subgroupMaxSize) = std::move(rhs.subgroupMaxSize); - Reset(rhs); - return *this; -} - -void AdapterInfo::FreeMembers() { - bool needsFreeing = false; if (this->vendor.data != nullptr) { needsFreeing = true; } if (this->architecture.data != nullptr) { needsFreeing = true; } if (this->device.data != nullptr) { needsFreeing = true; } if (this->description.data != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientAdapterInfoFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void AdapterInfo::Reset(AdapterInfo& value) { - AdapterInfo defaultValue{}; - detail::AsNonConstReference(value.vendor) = defaultValue.vendor; - detail::AsNonConstReference(value.architecture) = defaultValue.architecture; - detail::AsNonConstReference(value.device) = defaultValue.device; - detail::AsNonConstReference(value.description) = defaultValue.description; - detail::AsNonConstReference(value.backendType) = defaultValue.backendType; - detail::AsNonConstReference(value.adapterType) = defaultValue.adapterType; - detail::AsNonConstReference(value.vendorID) = defaultValue.vendorID; - detail::AsNonConstReference(value.deviceID) = defaultValue.deviceID; - detail::AsNonConstReference(value.subgroupMinSize) = defaultValue.subgroupMinSize; - detail::AsNonConstReference(value.subgroupMaxSize) = defaultValue.subgroupMaxSize; -} - -AdapterInfo::operator const WGPUAdapterInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(AdapterInfo) == sizeof(WGPUAdapterInfo), "sizeof mismatch for AdapterInfo"); -static_assert(alignof(AdapterInfo) == alignof(WGPUAdapterInfo), "alignof mismatch for AdapterInfo"); -static_assert(offsetof(AdapterInfo, nextInChain) == offsetof(WGPUAdapterInfo, nextInChain), - "offsetof mismatch for AdapterInfo::nextInChain"); -static_assert(offsetof(AdapterInfo, vendor) == offsetof(WGPUAdapterInfo, vendor), - "offsetof mismatch for AdapterInfo::vendor"); -static_assert(offsetof(AdapterInfo, architecture) == offsetof(WGPUAdapterInfo, architecture), - "offsetof mismatch for AdapterInfo::architecture"); -static_assert(offsetof(AdapterInfo, device) == offsetof(WGPUAdapterInfo, device), - "offsetof mismatch for AdapterInfo::device"); -static_assert(offsetof(AdapterInfo, description) == offsetof(WGPUAdapterInfo, description), - "offsetof mismatch for AdapterInfo::description"); -static_assert(offsetof(AdapterInfo, backendType) == offsetof(WGPUAdapterInfo, backendType), - "offsetof mismatch for AdapterInfo::backendType"); -static_assert(offsetof(AdapterInfo, adapterType) == offsetof(WGPUAdapterInfo, adapterType), - "offsetof mismatch for AdapterInfo::adapterType"); -static_assert(offsetof(AdapterInfo, vendorID) == offsetof(WGPUAdapterInfo, vendorID), - "offsetof mismatch for AdapterInfo::vendorID"); -static_assert(offsetof(AdapterInfo, deviceID) == offsetof(WGPUAdapterInfo, deviceID), - "offsetof mismatch for AdapterInfo::deviceID"); -static_assert(offsetof(AdapterInfo, subgroupMinSize) == offsetof(WGPUAdapterInfo, subgroupMinSize), - "offsetof mismatch for AdapterInfo::subgroupMinSize"); -static_assert(offsetof(AdapterInfo, subgroupMaxSize) == offsetof(WGPUAdapterInfo, subgroupMaxSize), - "offsetof mismatch for AdapterInfo::subgroupMaxSize"); - -// BindGroupDescriptor implementation - -BindGroupDescriptor::operator const WGPUBindGroupDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupDescriptor) == sizeof(WGPUBindGroupDescriptor), "sizeof mismatch for BindGroupDescriptor"); -static_assert(alignof(BindGroupDescriptor) == alignof(WGPUBindGroupDescriptor), "alignof mismatch for BindGroupDescriptor"); -static_assert(offsetof(BindGroupDescriptor, nextInChain) == offsetof(WGPUBindGroupDescriptor, nextInChain), - "offsetof mismatch for BindGroupDescriptor::nextInChain"); -static_assert(offsetof(BindGroupDescriptor, label) == offsetof(WGPUBindGroupDescriptor, label), - "offsetof mismatch for BindGroupDescriptor::label"); -static_assert(offsetof(BindGroupDescriptor, layout) == offsetof(WGPUBindGroupDescriptor, layout), - "offsetof mismatch for BindGroupDescriptor::layout"); -static_assert(offsetof(BindGroupDescriptor, entryCount) == offsetof(WGPUBindGroupDescriptor, entryCount), - "offsetof mismatch for BindGroupDescriptor::entryCount"); -static_assert(offsetof(BindGroupDescriptor, entries) == offsetof(WGPUBindGroupDescriptor, entries), - "offsetof mismatch for BindGroupDescriptor::entries"); - -// BindGroupLayoutDescriptor implementation - -BindGroupLayoutDescriptor::operator const WGPUBindGroupLayoutDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(BindGroupLayoutDescriptor) == sizeof(WGPUBindGroupLayoutDescriptor), "sizeof mismatch for BindGroupLayoutDescriptor"); -static_assert(alignof(BindGroupLayoutDescriptor) == alignof(WGPUBindGroupLayoutDescriptor), "alignof mismatch for BindGroupLayoutDescriptor"); -static_assert(offsetof(BindGroupLayoutDescriptor, nextInChain) == offsetof(WGPUBindGroupLayoutDescriptor, nextInChain), - "offsetof mismatch for BindGroupLayoutDescriptor::nextInChain"); -static_assert(offsetof(BindGroupLayoutDescriptor, label) == offsetof(WGPUBindGroupLayoutDescriptor, label), - "offsetof mismatch for BindGroupLayoutDescriptor::label"); -static_assert(offsetof(BindGroupLayoutDescriptor, entryCount) == offsetof(WGPUBindGroupLayoutDescriptor, entryCount), - "offsetof mismatch for BindGroupLayoutDescriptor::entryCount"); -static_assert(offsetof(BindGroupLayoutDescriptor, entries) == offsetof(WGPUBindGroupLayoutDescriptor, entries), - "offsetof mismatch for BindGroupLayoutDescriptor::entries"); - -// ColorTargetState implementation - -ColorTargetState::operator const WGPUColorTargetState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ColorTargetState) == sizeof(WGPUColorTargetState), "sizeof mismatch for ColorTargetState"); -static_assert(alignof(ColorTargetState) == alignof(WGPUColorTargetState), "alignof mismatch for ColorTargetState"); -static_assert(offsetof(ColorTargetState, nextInChain) == offsetof(WGPUColorTargetState, nextInChain), - "offsetof mismatch for ColorTargetState::nextInChain"); -static_assert(offsetof(ColorTargetState, format) == offsetof(WGPUColorTargetState, format), - "offsetof mismatch for ColorTargetState::format"); -static_assert(offsetof(ColorTargetState, blend) == offsetof(WGPUColorTargetState, blend), - "offsetof mismatch for ColorTargetState::blend"); -static_assert(offsetof(ColorTargetState, writeMask) == offsetof(WGPUColorTargetState, writeMask), - "offsetof mismatch for ColorTargetState::writeMask"); - -// CompilationInfo implementation - -CompilationInfo::operator const WGPUCompilationInfo&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(CompilationInfo) == sizeof(WGPUCompilationInfo), "sizeof mismatch for CompilationInfo"); -static_assert(alignof(CompilationInfo) == alignof(WGPUCompilationInfo), "alignof mismatch for CompilationInfo"); -static_assert(offsetof(CompilationInfo, nextInChain) == offsetof(WGPUCompilationInfo, nextInChain), - "offsetof mismatch for CompilationInfo::nextInChain"); -static_assert(offsetof(CompilationInfo, messageCount) == offsetof(WGPUCompilationInfo, messageCount), - "offsetof mismatch for CompilationInfo::messageCount"); -static_assert(offsetof(CompilationInfo, messages) == offsetof(WGPUCompilationInfo, messages), - "offsetof mismatch for CompilationInfo::messages"); - -// ComputePipelineDescriptor implementation - -ComputePipelineDescriptor::operator const WGPUComputePipelineDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(ComputePipelineDescriptor) == sizeof(WGPUComputePipelineDescriptor), "sizeof mismatch for ComputePipelineDescriptor"); -static_assert(alignof(ComputePipelineDescriptor) == alignof(WGPUComputePipelineDescriptor), "alignof mismatch for ComputePipelineDescriptor"); -static_assert(offsetof(ComputePipelineDescriptor, nextInChain) == offsetof(WGPUComputePipelineDescriptor, nextInChain), - "offsetof mismatch for ComputePipelineDescriptor::nextInChain"); -static_assert(offsetof(ComputePipelineDescriptor, label) == offsetof(WGPUComputePipelineDescriptor, label), - "offsetof mismatch for ComputePipelineDescriptor::label"); -static_assert(offsetof(ComputePipelineDescriptor, layout) == offsetof(WGPUComputePipelineDescriptor, layout), - "offsetof mismatch for ComputePipelineDescriptor::layout"); -static_assert(offsetof(ComputePipelineDescriptor, compute) == offsetof(WGPUComputePipelineDescriptor, compute), - "offsetof mismatch for ComputePipelineDescriptor::compute"); - -// DawnFormatCapabilities implementation - -DawnFormatCapabilities::operator const WGPUDawnFormatCapabilities&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DawnFormatCapabilities) == sizeof(WGPUDawnFormatCapabilities), "sizeof mismatch for DawnFormatCapabilities"); -static_assert(alignof(DawnFormatCapabilities) == alignof(WGPUDawnFormatCapabilities), "alignof mismatch for DawnFormatCapabilities"); -static_assert(offsetof(DawnFormatCapabilities, nextInChain) == offsetof(WGPUDawnFormatCapabilities, nextInChain), - "offsetof mismatch for DawnFormatCapabilities::nextInChain"); - -// DeviceDescriptor implementation -DeviceDescriptor::DeviceDescriptor() = default; -struct DeviceDescriptor::Init { - ChainedStruct * const nextInChain; - StringView label = {}; - size_t requiredFeatureCount = 0; - FeatureName const * requiredFeatures = nullptr; - Limits const * requiredLimits = nullptr; - QueueDescriptor defaultQueue = {}; -}; -DeviceDescriptor::DeviceDescriptor(DeviceDescriptor::Init&& init) : - detail::DeviceDescriptor { - init.nextInChain, - std::move(init.label), - std::move(init.requiredFeatureCount), - std::move(init.requiredFeatures), - std::move(init.requiredLimits), - std::move(init.defaultQueue), - } {} -template -void DeviceDescriptor::SetDeviceLostCallback(CallbackMode callbackMode, F callback, T userdata) { - static_assert(offsetof(DeviceDescriptor, deviceLostCallbackInfo) == offsetof(WGPUDeviceDescriptor, deviceLostCallbackInfo), - "offsetof mismatch for DeviceDescriptor::deviceLostCallbackInfo"); - - assert(deviceLostCallbackInfo.callback == nullptr); - deviceLostCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - deviceLostCallbackInfo.mode = static_cast(callbackMode); -} -template -void DeviceDescriptor::SetDeviceLostCallback(CallbackMode callbackMode, F callback) { - assert(deviceLostCallbackInfo.callback == nullptr); - deviceLostCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - deviceLostCallbackInfo.mode = static_cast(callbackMode); -} -template -void DeviceDescriptor::SetUncapturedErrorCallback(F callback, T userdata) { - static_assert(offsetof(DeviceDescriptor, uncapturedErrorCallbackInfo) == offsetof(WGPUDeviceDescriptor, uncapturedErrorCallbackInfo), - "offsetof mismatch for DeviceDescriptor::uncapturedErrorCallbackInfo"); - - assert(uncapturedErrorCallbackInfo.callback == nullptr); - uncapturedErrorCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); -} -template -void DeviceDescriptor::SetUncapturedErrorCallback(F callback) { - assert(uncapturedErrorCallbackInfo.callback == nullptr); - uncapturedErrorCallbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); -} - -DeviceDescriptor::operator const WGPUDeviceDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(DeviceDescriptor) == sizeof(WGPUDeviceDescriptor), "sizeof mismatch for DeviceDescriptor"); -static_assert(alignof(DeviceDescriptor) == alignof(WGPUDeviceDescriptor), "alignof mismatch for DeviceDescriptor"); -static_assert(offsetof(DeviceDescriptor, nextInChain) == offsetof(WGPUDeviceDescriptor, nextInChain), - "offsetof mismatch for DeviceDescriptor::nextInChain"); -static_assert(offsetof(DeviceDescriptor, label) == offsetof(WGPUDeviceDescriptor, label), - "offsetof mismatch for DeviceDescriptor::label"); -static_assert(offsetof(DeviceDescriptor, requiredFeatureCount) == offsetof(WGPUDeviceDescriptor, requiredFeatureCount), - "offsetof mismatch for DeviceDescriptor::requiredFeatureCount"); -static_assert(offsetof(DeviceDescriptor, requiredFeatures) == offsetof(WGPUDeviceDescriptor, requiredFeatures), - "offsetof mismatch for DeviceDescriptor::requiredFeatures"); -static_assert(offsetof(DeviceDescriptor, requiredLimits) == offsetof(WGPUDeviceDescriptor, requiredLimits), - "offsetof mismatch for DeviceDescriptor::requiredLimits"); -static_assert(offsetof(DeviceDescriptor, defaultQueue) == offsetof(WGPUDeviceDescriptor, defaultQueue), - "offsetof mismatch for DeviceDescriptor::defaultQueue"); - -// PipelineLayoutDescriptor implementation - -PipelineLayoutDescriptor::operator const WGPUPipelineLayoutDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(PipelineLayoutDescriptor) == sizeof(WGPUPipelineLayoutDescriptor), "sizeof mismatch for PipelineLayoutDescriptor"); -static_assert(alignof(PipelineLayoutDescriptor) == alignof(WGPUPipelineLayoutDescriptor), "alignof mismatch for PipelineLayoutDescriptor"); -static_assert(offsetof(PipelineLayoutDescriptor, nextInChain) == offsetof(WGPUPipelineLayoutDescriptor, nextInChain), - "offsetof mismatch for PipelineLayoutDescriptor::nextInChain"); -static_assert(offsetof(PipelineLayoutDescriptor, label) == offsetof(WGPUPipelineLayoutDescriptor, label), - "offsetof mismatch for PipelineLayoutDescriptor::label"); -static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayoutCount) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayoutCount), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayoutCount"); -static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayouts) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayouts), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayouts"); -static_assert(offsetof(PipelineLayoutDescriptor, immediateSize) == offsetof(WGPUPipelineLayoutDescriptor, immediateSize), - "offsetof mismatch for PipelineLayoutDescriptor::immediateSize"); - -// RenderPassPixelLocalStorage implementation -RenderPassPixelLocalStorage::RenderPassPixelLocalStorage() -: ChainedStruct { nullptr, SType::RenderPassPixelLocalStorage } {} -struct RenderPassPixelLocalStorage::Init { - ChainedStruct * const nextInChain; - uint64_t totalPixelLocalStorageSize; - size_t storageAttachmentCount = 0; - RenderPassStorageAttachment const * storageAttachments = nullptr; -}; -RenderPassPixelLocalStorage::RenderPassPixelLocalStorage(RenderPassPixelLocalStorage::Init&& init) : - ChainedStruct { init.nextInChain, SType::RenderPassPixelLocalStorage }, - totalPixelLocalStorageSize(std::move(init.totalPixelLocalStorageSize)), - storageAttachmentCount(std::move(init.storageAttachmentCount)), - storageAttachments(std::move(init.storageAttachments)) {} - -RenderPassPixelLocalStorage::operator const WGPURenderPassPixelLocalStorage&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassPixelLocalStorage) == sizeof(WGPURenderPassPixelLocalStorage), "sizeof mismatch for RenderPassPixelLocalStorage"); -static_assert(alignof(RenderPassPixelLocalStorage) == alignof(WGPURenderPassPixelLocalStorage), "alignof mismatch for RenderPassPixelLocalStorage"); -static_assert(offsetof(RenderPassPixelLocalStorage, totalPixelLocalStorageSize) == offsetof(WGPURenderPassPixelLocalStorage, totalPixelLocalStorageSize), - "offsetof mismatch for RenderPassPixelLocalStorage::totalPixelLocalStorageSize"); -static_assert(offsetof(RenderPassPixelLocalStorage, storageAttachmentCount) == offsetof(WGPURenderPassPixelLocalStorage, storageAttachmentCount), - "offsetof mismatch for RenderPassPixelLocalStorage::storageAttachmentCount"); -static_assert(offsetof(RenderPassPixelLocalStorage, storageAttachments) == offsetof(WGPURenderPassPixelLocalStorage, storageAttachments), - "offsetof mismatch for RenderPassPixelLocalStorage::storageAttachments"); - -// SharedTextureMemoryDescriptor implementation - -SharedTextureMemoryDescriptor::operator const WGPUSharedTextureMemoryDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryDescriptor) == sizeof(WGPUSharedTextureMemoryDescriptor), "sizeof mismatch for SharedTextureMemoryDescriptor"); -static_assert(alignof(SharedTextureMemoryDescriptor) == alignof(WGPUSharedTextureMemoryDescriptor), "alignof mismatch for SharedTextureMemoryDescriptor"); -static_assert(offsetof(SharedTextureMemoryDescriptor, nextInChain) == offsetof(WGPUSharedTextureMemoryDescriptor, nextInChain), - "offsetof mismatch for SharedTextureMemoryDescriptor::nextInChain"); -static_assert(offsetof(SharedTextureMemoryDescriptor, label) == offsetof(WGPUSharedTextureMemoryDescriptor, label), - "offsetof mismatch for SharedTextureMemoryDescriptor::label"); - -// SharedTextureMemoryEndAccessState implementation -SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState() = default; -SharedTextureMemoryEndAccessState::~SharedTextureMemoryEndAccessState() { - FreeMembers(); -} - -SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&& rhs) - : initialized(rhs.initialized), - fenceCount(rhs.fenceCount), - fences(rhs.fences), - signaledValueCount(rhs.signaledValueCount), - signaledValues(rhs.signaledValues){ - Reset(rhs); -} - -SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(SharedTextureMemoryEndAccessState&& rhs) { - if (&rhs == this) { - return *this; - } - FreeMembers(); - detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized); - detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount); - detail::AsNonConstReference(this->fences) = std::move(rhs.fences); - detail::AsNonConstReference(this->signaledValueCount) = std::move(rhs.signaledValueCount); - detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues); - Reset(rhs); - return *this; -} - -void SharedTextureMemoryEndAccessState::FreeMembers() { - bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) { - wgpuDawnWireClientSharedTextureMemoryEndAccessStateFreeMembers( - *reinterpret_cast(this)); - } -} - -// static -void SharedTextureMemoryEndAccessState::Reset(SharedTextureMemoryEndAccessState& value) { - SharedTextureMemoryEndAccessState defaultValue{}; - detail::AsNonConstReference(value.initialized) = defaultValue.initialized; - detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount; - detail::AsNonConstReference(value.fences) = defaultValue.fences; - detail::AsNonConstReference(value.signaledValueCount) = defaultValue.signaledValueCount; - detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues; -} - -SharedTextureMemoryEndAccessState::operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryEndAccessState) == sizeof(WGPUSharedTextureMemoryEndAccessState), "sizeof mismatch for SharedTextureMemoryEndAccessState"); -static_assert(alignof(SharedTextureMemoryEndAccessState) == alignof(WGPUSharedTextureMemoryEndAccessState), "alignof mismatch for SharedTextureMemoryEndAccessState"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedTextureMemoryEndAccessState, nextInChain), - "offsetof mismatch for SharedTextureMemoryEndAccessState::nextInChain"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, initialized) == offsetof(WGPUSharedTextureMemoryEndAccessState, initialized), - "offsetof mismatch for SharedTextureMemoryEndAccessState::initialized"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, fenceCount), - "offsetof mismatch for SharedTextureMemoryEndAccessState::fenceCount"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, fences) == offsetof(WGPUSharedTextureMemoryEndAccessState, fences), - "offsetof mismatch for SharedTextureMemoryEndAccessState::fences"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValueCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValueCount), - "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValueCount"); -static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValues), - "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValues"); - -// SharedTextureMemoryProperties implementation - -SharedTextureMemoryProperties::operator const WGPUSharedTextureMemoryProperties&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(SharedTextureMemoryProperties) == sizeof(WGPUSharedTextureMemoryProperties), "sizeof mismatch for SharedTextureMemoryProperties"); -static_assert(alignof(SharedTextureMemoryProperties) == alignof(WGPUSharedTextureMemoryProperties), "alignof mismatch for SharedTextureMemoryProperties"); -static_assert(offsetof(SharedTextureMemoryProperties, nextInChain) == offsetof(WGPUSharedTextureMemoryProperties, nextInChain), - "offsetof mismatch for SharedTextureMemoryProperties::nextInChain"); -static_assert(offsetof(SharedTextureMemoryProperties, usage) == offsetof(WGPUSharedTextureMemoryProperties, usage), - "offsetof mismatch for SharedTextureMemoryProperties::usage"); -static_assert(offsetof(SharedTextureMemoryProperties, size) == offsetof(WGPUSharedTextureMemoryProperties, size), - "offsetof mismatch for SharedTextureMemoryProperties::size"); -static_assert(offsetof(SharedTextureMemoryProperties, format) == offsetof(WGPUSharedTextureMemoryProperties, format), - "offsetof mismatch for SharedTextureMemoryProperties::format"); - -// TextureViewDescriptor implementation - -TextureViewDescriptor::operator const WGPUTextureViewDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(TextureViewDescriptor) == sizeof(WGPUTextureViewDescriptor), "sizeof mismatch for TextureViewDescriptor"); -static_assert(alignof(TextureViewDescriptor) == alignof(WGPUTextureViewDescriptor), "alignof mismatch for TextureViewDescriptor"); -static_assert(offsetof(TextureViewDescriptor, nextInChain) == offsetof(WGPUTextureViewDescriptor, nextInChain), - "offsetof mismatch for TextureViewDescriptor::nextInChain"); -static_assert(offsetof(TextureViewDescriptor, label) == offsetof(WGPUTextureViewDescriptor, label), - "offsetof mismatch for TextureViewDescriptor::label"); -static_assert(offsetof(TextureViewDescriptor, format) == offsetof(WGPUTextureViewDescriptor, format), - "offsetof mismatch for TextureViewDescriptor::format"); -static_assert(offsetof(TextureViewDescriptor, dimension) == offsetof(WGPUTextureViewDescriptor, dimension), - "offsetof mismatch for TextureViewDescriptor::dimension"); -static_assert(offsetof(TextureViewDescriptor, baseMipLevel) == offsetof(WGPUTextureViewDescriptor, baseMipLevel), - "offsetof mismatch for TextureViewDescriptor::baseMipLevel"); -static_assert(offsetof(TextureViewDescriptor, mipLevelCount) == offsetof(WGPUTextureViewDescriptor, mipLevelCount), - "offsetof mismatch for TextureViewDescriptor::mipLevelCount"); -static_assert(offsetof(TextureViewDescriptor, baseArrayLayer) == offsetof(WGPUTextureViewDescriptor, baseArrayLayer), - "offsetof mismatch for TextureViewDescriptor::baseArrayLayer"); -static_assert(offsetof(TextureViewDescriptor, arrayLayerCount) == offsetof(WGPUTextureViewDescriptor, arrayLayerCount), - "offsetof mismatch for TextureViewDescriptor::arrayLayerCount"); -static_assert(offsetof(TextureViewDescriptor, aspect) == offsetof(WGPUTextureViewDescriptor, aspect), - "offsetof mismatch for TextureViewDescriptor::aspect"); -static_assert(offsetof(TextureViewDescriptor, usage) == offsetof(WGPUTextureViewDescriptor, usage), - "offsetof mismatch for TextureViewDescriptor::usage"); - -// VertexState implementation - -VertexState::operator const WGPUVertexState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(VertexState) == sizeof(WGPUVertexState), "sizeof mismatch for VertexState"); -static_assert(alignof(VertexState) == alignof(WGPUVertexState), "alignof mismatch for VertexState"); -static_assert(offsetof(VertexState, nextInChain) == offsetof(WGPUVertexState, nextInChain), - "offsetof mismatch for VertexState::nextInChain"); -static_assert(offsetof(VertexState, module) == offsetof(WGPUVertexState, module), - "offsetof mismatch for VertexState::module"); -static_assert(offsetof(VertexState, entryPoint) == offsetof(WGPUVertexState, entryPoint), - "offsetof mismatch for VertexState::entryPoint"); -static_assert(offsetof(VertexState, constantCount) == offsetof(WGPUVertexState, constantCount), - "offsetof mismatch for VertexState::constantCount"); -static_assert(offsetof(VertexState, constants) == offsetof(WGPUVertexState, constants), - "offsetof mismatch for VertexState::constants"); -static_assert(offsetof(VertexState, bufferCount) == offsetof(WGPUVertexState, bufferCount), - "offsetof mismatch for VertexState::bufferCount"); -static_assert(offsetof(VertexState, buffers) == offsetof(WGPUVertexState, buffers), - "offsetof mismatch for VertexState::buffers"); - -// FragmentState implementation - -FragmentState::operator const WGPUFragmentState&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(FragmentState) == sizeof(WGPUFragmentState), "sizeof mismatch for FragmentState"); -static_assert(alignof(FragmentState) == alignof(WGPUFragmentState), "alignof mismatch for FragmentState"); -static_assert(offsetof(FragmentState, nextInChain) == offsetof(WGPUFragmentState, nextInChain), - "offsetof mismatch for FragmentState::nextInChain"); -static_assert(offsetof(FragmentState, module) == offsetof(WGPUFragmentState, module), - "offsetof mismatch for FragmentState::module"); -static_assert(offsetof(FragmentState, entryPoint) == offsetof(WGPUFragmentState, entryPoint), - "offsetof mismatch for FragmentState::entryPoint"); -static_assert(offsetof(FragmentState, constantCount) == offsetof(WGPUFragmentState, constantCount), - "offsetof mismatch for FragmentState::constantCount"); -static_assert(offsetof(FragmentState, constants) == offsetof(WGPUFragmentState, constants), - "offsetof mismatch for FragmentState::constants"); -static_assert(offsetof(FragmentState, targetCount) == offsetof(WGPUFragmentState, targetCount), - "offsetof mismatch for FragmentState::targetCount"); -static_assert(offsetof(FragmentState, targets) == offsetof(WGPUFragmentState, targets), - "offsetof mismatch for FragmentState::targets"); - -// RenderPassDescriptor implementation - -RenderPassDescriptor::operator const WGPURenderPassDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPassDescriptor) == sizeof(WGPURenderPassDescriptor), "sizeof mismatch for RenderPassDescriptor"); -static_assert(alignof(RenderPassDescriptor) == alignof(WGPURenderPassDescriptor), "alignof mismatch for RenderPassDescriptor"); -static_assert(offsetof(RenderPassDescriptor, nextInChain) == offsetof(WGPURenderPassDescriptor, nextInChain), - "offsetof mismatch for RenderPassDescriptor::nextInChain"); -static_assert(offsetof(RenderPassDescriptor, label) == offsetof(WGPURenderPassDescriptor, label), - "offsetof mismatch for RenderPassDescriptor::label"); -static_assert(offsetof(RenderPassDescriptor, colorAttachmentCount) == offsetof(WGPURenderPassDescriptor, colorAttachmentCount), - "offsetof mismatch for RenderPassDescriptor::colorAttachmentCount"); -static_assert(offsetof(RenderPassDescriptor, colorAttachments) == offsetof(WGPURenderPassDescriptor, colorAttachments), - "offsetof mismatch for RenderPassDescriptor::colorAttachments"); -static_assert(offsetof(RenderPassDescriptor, depthStencilAttachment) == offsetof(WGPURenderPassDescriptor, depthStencilAttachment), - "offsetof mismatch for RenderPassDescriptor::depthStencilAttachment"); -static_assert(offsetof(RenderPassDescriptor, occlusionQuerySet) == offsetof(WGPURenderPassDescriptor, occlusionQuerySet), - "offsetof mismatch for RenderPassDescriptor::occlusionQuerySet"); -static_assert(offsetof(RenderPassDescriptor, timestampWrites) == offsetof(WGPURenderPassDescriptor, timestampWrites), - "offsetof mismatch for RenderPassDescriptor::timestampWrites"); - -// RenderPipelineDescriptor implementation - -RenderPipelineDescriptor::operator const WGPURenderPipelineDescriptor&() const noexcept { - return *reinterpret_cast(this); -} - -static_assert(sizeof(RenderPipelineDescriptor) == sizeof(WGPURenderPipelineDescriptor), "sizeof mismatch for RenderPipelineDescriptor"); -static_assert(alignof(RenderPipelineDescriptor) == alignof(WGPURenderPipelineDescriptor), "alignof mismatch for RenderPipelineDescriptor"); -static_assert(offsetof(RenderPipelineDescriptor, nextInChain) == offsetof(WGPURenderPipelineDescriptor, nextInChain), - "offsetof mismatch for RenderPipelineDescriptor::nextInChain"); -static_assert(offsetof(RenderPipelineDescriptor, label) == offsetof(WGPURenderPipelineDescriptor, label), - "offsetof mismatch for RenderPipelineDescriptor::label"); -static_assert(offsetof(RenderPipelineDescriptor, layout) == offsetof(WGPURenderPipelineDescriptor, layout), - "offsetof mismatch for RenderPipelineDescriptor::layout"); -static_assert(offsetof(RenderPipelineDescriptor, vertex) == offsetof(WGPURenderPipelineDescriptor, vertex), - "offsetof mismatch for RenderPipelineDescriptor::vertex"); -static_assert(offsetof(RenderPipelineDescriptor, primitive) == offsetof(WGPURenderPipelineDescriptor, primitive), - "offsetof mismatch for RenderPipelineDescriptor::primitive"); -static_assert(offsetof(RenderPipelineDescriptor, depthStencil) == offsetof(WGPURenderPipelineDescriptor, depthStencil), - "offsetof mismatch for RenderPipelineDescriptor::depthStencil"); -static_assert(offsetof(RenderPipelineDescriptor, multisample) == offsetof(WGPURenderPipelineDescriptor, multisample), - "offsetof mismatch for RenderPipelineDescriptor::multisample"); -static_assert(offsetof(RenderPipelineDescriptor, fragment) == offsetof(WGPURenderPipelineDescriptor, fragment), - "offsetof mismatch for RenderPipelineDescriptor::fragment"); - - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -// Adapter implementation - -Device Adapter::CreateDevice(DeviceDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientAdapterCreateDevice(Get(), reinterpret_cast(descriptor)); - return Device::Acquire(result); -} -void Adapter::GetFeatures(SupportedFeatures * features) const { - *features = SupportedFeatures(); - wgpuDawnWireClientAdapterGetFeatures(Get(), reinterpret_cast(features)); -} -ConvertibleStatus Adapter::GetFormatCapabilities(TextureFormat format, DawnFormatCapabilities * capabilities) const { - auto result = wgpuDawnWireClientAdapterGetFormatCapabilities(Get(), static_cast(format), reinterpret_cast(capabilities)); - return static_cast(result); -} -ConvertibleStatus Adapter::GetInfo(AdapterInfo * info) const { - *info = AdapterInfo(); - auto result = wgpuDawnWireClientAdapterGetInfo(Get(), reinterpret_cast(info)); - return static_cast(result); -} -Instance Adapter::GetInstance() const { - auto result = wgpuDawnWireClientAdapterGetInstance(Get()); - return Instance::Acquire(result); -} -ConvertibleStatus Adapter::GetLimits(Limits * limits) const { - auto result = wgpuDawnWireClientAdapterGetLimits(Get(), reinterpret_cast(limits)); - return static_cast(result); -} -Bool Adapter::HasFeature(FeatureName feature) const { - auto result = wgpuDawnWireClientAdapterHasFeature(Get(), static_cast(feature)); - return result; -} -template -Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Adapter::RequestDevice(DeviceDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientAdapterRequestDevice(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} - - -void Adapter::WGPUAddRef(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuDawnWireClientAdapterAddRef(handle); - } -} -void Adapter::WGPURelease(WGPUAdapter handle) { - if (handle != nullptr) { - wgpuDawnWireClientAdapterRelease(handle); - } -} -static_assert(sizeof(Adapter) == sizeof(WGPUAdapter), "sizeof mismatch for Adapter"); -static_assert(alignof(Adapter) == alignof(WGPUAdapter), "alignof mismatch for Adapter"); - -// BindGroup implementation - -void BindGroup::SetLabel(StringView label) const { - wgpuDawnWireClientBindGroupSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void BindGroup::WGPUAddRef(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuDawnWireClientBindGroupAddRef(handle); - } -} -void BindGroup::WGPURelease(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuDawnWireClientBindGroupRelease(handle); - } -} -static_assert(sizeof(BindGroup) == sizeof(WGPUBindGroup), "sizeof mismatch for BindGroup"); -static_assert(alignof(BindGroup) == alignof(WGPUBindGroup), "alignof mismatch for BindGroup"); - -// BindGroupLayout implementation - -void BindGroupLayout::SetLabel(StringView label) const { - wgpuDawnWireClientBindGroupLayoutSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void BindGroupLayout::WGPUAddRef(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuDawnWireClientBindGroupLayoutAddRef(handle); - } -} -void BindGroupLayout::WGPURelease(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuDawnWireClientBindGroupLayoutRelease(handle); - } -} -static_assert(sizeof(BindGroupLayout) == sizeof(WGPUBindGroupLayout), "sizeof mismatch for BindGroupLayout"); -static_assert(alignof(BindGroupLayout) == alignof(WGPUBindGroupLayout), "alignof mismatch for BindGroupLayout"); - -// Buffer implementation - -TexelBufferView Buffer::CreateTexelView(TexelBufferViewDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientBufferCreateTexelView(Get(), reinterpret_cast(descriptor)); - return TexelBufferView::Acquire(result); -} -void Buffer::Destroy() const { - wgpuDawnWireClientBufferDestroy(Get()); -} -void const * Buffer::GetConstMappedRange(size_t offset, size_t size) const { - auto result = wgpuDawnWireClientBufferGetConstMappedRange(Get(), offset, size); - return result; -} -void * Buffer::GetMappedRange(size_t offset, size_t size) const { - auto result = wgpuDawnWireClientBufferGetMappedRange(Get(), offset, size); - return result; -} -BufferMapState Buffer::GetMapState() const { - auto result = wgpuDawnWireClientBufferGetMapState(Get()); - return static_cast(result); -} -uint64_t Buffer::GetSize() const { - auto result = wgpuDawnWireClientBufferGetSize(Get()); - return result; -} -BufferUsage Buffer::GetUsage() const { - auto result = wgpuDawnWireClientBufferGetUsage(Get()); - return static_cast(result); -} -template -Future Buffer::MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientBufferMapAsync(Get(), static_cast(mode), offset, size, callbackInfo); - return Future { - result.id - }; -} -template -Future Buffer::MapAsync(MapMode mode, size_t offset, size_t size, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientBufferMapAsync(Get(), static_cast(mode), offset, size, callbackInfo); - return Future { - result.id - }; -} -ConvertibleStatus Buffer::ReadMappedRange(size_t offset, void * data, size_t size) const { - auto result = wgpuDawnWireClientBufferReadMappedRange(Get(), offset, reinterpret_cast(data), size); - return static_cast(result); -} -void Buffer::SetLabel(StringView label) const { - wgpuDawnWireClientBufferSetLabel(Get(), *reinterpret_cast(&label)); -} -void Buffer::Unmap() const { - wgpuDawnWireClientBufferUnmap(Get()); -} -ConvertibleStatus Buffer::WriteMappedRange(size_t offset, void const * data, size_t size) const { - auto result = wgpuDawnWireClientBufferWriteMappedRange(Get(), offset, reinterpret_cast(data), size); - return static_cast(result); -} - - -void Buffer::WGPUAddRef(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuDawnWireClientBufferAddRef(handle); - } -} -void Buffer::WGPURelease(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuDawnWireClientBufferRelease(handle); - } -} -static_assert(sizeof(Buffer) == sizeof(WGPUBuffer), "sizeof mismatch for Buffer"); -static_assert(alignof(Buffer) == alignof(WGPUBuffer), "alignof mismatch for Buffer"); - -// CommandBuffer implementation - -void CommandBuffer::SetLabel(StringView label) const { - wgpuDawnWireClientCommandBufferSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void CommandBuffer::WGPUAddRef(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuDawnWireClientCommandBufferAddRef(handle); - } -} -void CommandBuffer::WGPURelease(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuDawnWireClientCommandBufferRelease(handle); - } -} -static_assert(sizeof(CommandBuffer) == sizeof(WGPUCommandBuffer), "sizeof mismatch for CommandBuffer"); -static_assert(alignof(CommandBuffer) == alignof(WGPUCommandBuffer), "alignof mismatch for CommandBuffer"); - -// CommandEncoder implementation - -ComputePassEncoder CommandEncoder::BeginComputePass(ComputePassDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientCommandEncoderBeginComputePass(Get(), reinterpret_cast(descriptor)); - return ComputePassEncoder::Acquire(result); -} -RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientCommandEncoderBeginRenderPass(Get(), reinterpret_cast(descriptor)); - return RenderPassEncoder::Acquire(result); -} -void CommandEncoder::ClearBuffer(Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuDawnWireClientCommandEncoderClearBuffer(Get(), buffer.Get(), offset, size); -} -void CommandEncoder::CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const { - wgpuDawnWireClientCommandEncoderCopyBufferToBuffer(Get(), source.Get(), sourceOffset, destination.Get(), destinationOffset, size); -} -void CommandEncoder::CopyBufferToTexture(TexelCopyBufferInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const { - wgpuDawnWireClientCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -void CommandEncoder::CopyTextureToBuffer(TexelCopyTextureInfo const * source, TexelCopyBufferInfo const * destination, Extent3D const * copySize) const { - wgpuDawnWireClientCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -void CommandEncoder::CopyTextureToTexture(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize) const { - wgpuDawnWireClientCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); -} -CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientCommandEncoderFinish(Get(), reinterpret_cast(descriptor)); - return CommandBuffer::Acquire(result); -} -void CommandEncoder::InjectValidationError(StringView message) const { - wgpuDawnWireClientCommandEncoderInjectValidationError(Get(), *reinterpret_cast(&message)); -} -void CommandEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuDawnWireClientCommandEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void CommandEncoder::PopDebugGroup() const { - wgpuDawnWireClientCommandEncoderPopDebugGroup(Get()); -} -void CommandEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuDawnWireClientCommandEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void CommandEncoder::ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const { - wgpuDawnWireClientCommandEncoderResolveQuerySet(Get(), querySet.Get(), firstQuery, queryCount, destination.Get(), destinationOffset); -} -void CommandEncoder::SetLabel(StringView label) const { - wgpuDawnWireClientCommandEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void CommandEncoder::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size) const { - wgpuDawnWireClientCommandEncoderWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); -} -void CommandEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuDawnWireClientCommandEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void CommandEncoder::WGPUAddRef(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientCommandEncoderAddRef(handle); - } -} -void CommandEncoder::WGPURelease(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientCommandEncoderRelease(handle); - } -} -static_assert(sizeof(CommandEncoder) == sizeof(WGPUCommandEncoder), "sizeof mismatch for CommandEncoder"); -static_assert(alignof(CommandEncoder) == alignof(WGPUCommandEncoder), "alignof mismatch for CommandEncoder"); - -// ComputePipeline implementation - -BindGroupLayout ComputePipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuDawnWireClientComputePipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); -} -void ComputePipeline::SetLabel(StringView label) const { - wgpuDawnWireClientComputePipelineSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ComputePipeline::WGPUAddRef(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuDawnWireClientComputePipelineAddRef(handle); - } -} -void ComputePipeline::WGPURelease(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuDawnWireClientComputePipelineRelease(handle); - } -} -static_assert(sizeof(ComputePipeline) == sizeof(WGPUComputePipeline), "sizeof mismatch for ComputePipeline"); -static_assert(alignof(ComputePipeline) == alignof(WGPUComputePipeline), "alignof mismatch for ComputePipeline"); - -// Device implementation - -BindGroup Device::CreateBindGroup(BindGroupDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateBindGroup(Get(), reinterpret_cast(descriptor)); - return BindGroup::Acquire(result); -} -BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); - return BindGroupLayout::Acquire(result); -} -Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); - return CommandEncoder::Acquire(result); -} -ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); - return ComputePipeline::Acquire(result); -} -template -Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDeviceCreateComputePipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -Buffer Device::CreateErrorBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateErrorBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -ExternalTexture Device::CreateErrorExternalTexture() const { - auto result = wgpuDawnWireClientDeviceCreateErrorExternalTexture(Get()); - return ExternalTexture::Acquire(result); -} -ShaderModule Device::CreateErrorShaderModule(ShaderModuleDescriptor const * descriptor, StringView errorMessage) const { - auto result = wgpuDawnWireClientDeviceCreateErrorShaderModule(Get(), reinterpret_cast(descriptor), *reinterpret_cast(&errorMessage)); - return ShaderModule::Acquire(result); -} -Texture Device::CreateErrorTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateErrorTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -ExternalTexture Device::CreateExternalTexture(ExternalTextureDescriptor const * externalTextureDescriptor) const { - auto result = wgpuDawnWireClientDeviceCreateExternalTexture(Get(), reinterpret_cast(externalTextureDescriptor)); - return ExternalTexture::Acquire(result); -} -PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); - return PipelineLayout::Acquire(result); -} -QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); - return QuerySet::Acquire(result); -} -RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); - return RenderBundleEncoder::Acquire(result); -} -RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); - return RenderPipeline::Acquire(result); -} -template -Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDeviceCreateRenderPipelineAsync(Get(), reinterpret_cast(descriptor), callbackInfo); - return Future { - result.id - }; -} -ResourceTable Device::CreateResourceTable(ResourceTableDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateResourceTable(Get(), reinterpret_cast(descriptor)); - return ResourceTable::Acquire(result); -} -Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); - return Sampler::Acquire(result); -} -ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); - return ShaderModule::Acquire(result); -} -Texture Device::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -void Device::Destroy() const { - wgpuDawnWireClientDeviceDestroy(Get()); -} -void Device::ForceLoss(DeviceLostReason type, StringView message) const { - wgpuDawnWireClientDeviceForceLoss(Get(), static_cast(type), *reinterpret_cast(&message)); -} -Adapter Device::GetAdapter() const { - auto result = wgpuDawnWireClientDeviceGetAdapter(Get()); - return Adapter::Acquire(result); -} -ConvertibleStatus Device::GetAdapterInfo(AdapterInfo * adapterInfo) const { - *adapterInfo = AdapterInfo(); - auto result = wgpuDawnWireClientDeviceGetAdapterInfo(Get(), reinterpret_cast(adapterInfo)); - return static_cast(result); -} -ConvertibleStatus Device::GetAHardwareBufferProperties(void * handle, AHardwareBufferProperties * properties) const { - auto result = wgpuDawnWireClientDeviceGetAHardwareBufferProperties(Get(), handle, reinterpret_cast(properties)); - return static_cast(result); -} -void Device::GetFeatures(SupportedFeatures * features) const { - *features = SupportedFeatures(); - wgpuDawnWireClientDeviceGetFeatures(Get(), reinterpret_cast(features)); -} -ConvertibleStatus Device::GetLimits(Limits * limits) const { - auto result = wgpuDawnWireClientDeviceGetLimits(Get(), reinterpret_cast(limits)); - return static_cast(result); -} -Future Device::GetLostFuture() const { - auto result = wgpuDawnWireClientDeviceGetLostFuture(Get()); - return Future { - result.id - }; -} -Queue Device::GetQueue() const { - auto result = wgpuDawnWireClientDeviceGetQueue(Get()); - return Queue::Acquire(result); -} -Bool Device::HasFeature(FeatureName feature) const { - auto result = wgpuDawnWireClientDeviceHasFeature(Get(), static_cast(feature)); - return result; -} -SharedBufferMemory Device::ImportSharedBufferMemory(SharedBufferMemoryDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceImportSharedBufferMemory(Get(), reinterpret_cast(descriptor)); - return SharedBufferMemory::Acquire(result); -} -SharedFence Device::ImportSharedFence(SharedFenceDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceImportSharedFence(Get(), reinterpret_cast(descriptor)); - return SharedFence::Acquire(result); -} -SharedTextureMemory Device::ImportSharedTextureMemory(SharedTextureMemoryDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientDeviceImportSharedTextureMemory(Get(), reinterpret_cast(descriptor)); - return SharedTextureMemory::Acquire(result); -} -void Device::InjectError(ErrorType type, StringView message) const { - wgpuDawnWireClientDeviceInjectError(Get(), static_cast(type), *reinterpret_cast(&message)); -} -template -Future Device::PopErrorScope(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDevicePopErrorScope(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future Device::PopErrorScope(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientDevicePopErrorScope(Get(), callbackInfo); - return Future { - result.id - }; -} -void Device::PushErrorScope(ErrorFilter filter) const { - wgpuDawnWireClientDevicePushErrorScope(Get(), static_cast(filter)); -} -void Device::SetLabel(StringView label) const { - wgpuDawnWireClientDeviceSetLabel(Get(), *reinterpret_cast(&label)); -} -template -void Device::SetLoggingCallback(F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - return wgpuDawnWireClientDeviceSetLoggingCallback(Get(), callbackInfo); -} -template -void Device::SetLoggingCallback(F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - return wgpuDawnWireClientDeviceSetLoggingCallback(Get(), callbackInfo); -} -void Device::Tick() const { - wgpuDawnWireClientDeviceTick(Get()); -} -void Device::ValidateTextureDescriptor(TextureDescriptor const * descriptor) const { - wgpuDawnWireClientDeviceValidateTextureDescriptor(Get(), reinterpret_cast(descriptor)); -} - - -void Device::WGPUAddRef(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDawnWireClientDeviceAddRef(handle); - } -} -void Device::WGPURelease(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDawnWireClientDeviceRelease(handle); - } -} -static_assert(sizeof(Device) == sizeof(WGPUDevice), "sizeof mismatch for Device"); -static_assert(alignof(Device) == alignof(WGPUDevice), "alignof mismatch for Device"); - -// ExternalTexture implementation - -void ExternalTexture::Destroy() const { - wgpuDawnWireClientExternalTextureDestroy(Get()); -} -void ExternalTexture::Expire() const { - wgpuDawnWireClientExternalTextureExpire(Get()); -} -void ExternalTexture::Refresh() const { - wgpuDawnWireClientExternalTextureRefresh(Get()); -} -void ExternalTexture::SetLabel(StringView label) const { - wgpuDawnWireClientExternalTextureSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ExternalTexture::WGPUAddRef(WGPUExternalTexture handle) { - if (handle != nullptr) { - wgpuDawnWireClientExternalTextureAddRef(handle); - } -} -void ExternalTexture::WGPURelease(WGPUExternalTexture handle) { - if (handle != nullptr) { - wgpuDawnWireClientExternalTextureRelease(handle); - } -} -static_assert(sizeof(ExternalTexture) == sizeof(WGPUExternalTexture), "sizeof mismatch for ExternalTexture"); -static_assert(alignof(ExternalTexture) == alignof(WGPUExternalTexture), "alignof mismatch for ExternalTexture"); - -// Instance implementation - -Surface Instance::CreateSurface(SurfaceDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientInstanceCreateSurface(Get(), reinterpret_cast(descriptor)); - return Surface::Acquire(result); -} -void Instance::GetWGSLLanguageFeatures(SupportedWGSLLanguageFeatures * features) const { - *features = SupportedWGSLLanguageFeatures(); - wgpuDawnWireClientInstanceGetWGSLLanguageFeatures(Get(), reinterpret_cast(features)); -} -Bool Instance::HasWGSLLanguageFeature(WGSLLanguageFeatureName feature) const { - auto result = wgpuDawnWireClientInstanceHasWGSLLanguageFeature(Get(), static_cast(feature)); - return result; -} -void Instance::ProcessEvents() const { - wgpuDawnWireClientInstanceProcessEvents(Get()); -} -template -Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); - return Future { - result.id - }; -} -template -Future Instance::RequestAdapter(RequestAdapterOptions const * options, CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientInstanceRequestAdapter(Get(), reinterpret_cast(options), callbackInfo); - return Future { - result.id - }; -} -WaitStatus Instance::WaitAny(size_t futureCount, FutureWaitInfo * futures, uint64_t timeoutNS) const { - auto result = wgpuDawnWireClientInstanceWaitAny(Get(), futureCount, reinterpret_cast(futures), timeoutNS); - return static_cast(result); -} - -WaitStatus Instance::WaitAny(Future f, uint64_t timeout) const { - FutureWaitInfo waitInfo { f }; - return WaitAny(1, &waitInfo, timeout); -} - -void Instance::WGPUAddRef(WGPUInstance handle) { - if (handle != nullptr) { - wgpuDawnWireClientInstanceAddRef(handle); - } -} -void Instance::WGPURelease(WGPUInstance handle) { - if (handle != nullptr) { - wgpuDawnWireClientInstanceRelease(handle); - } -} -static_assert(sizeof(Instance) == sizeof(WGPUInstance), "sizeof mismatch for Instance"); -static_assert(alignof(Instance) == alignof(WGPUInstance), "alignof mismatch for Instance"); - -// PipelineLayout implementation - -void PipelineLayout::SetLabel(StringView label) const { - wgpuDawnWireClientPipelineLayoutSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void PipelineLayout::WGPUAddRef(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuDawnWireClientPipelineLayoutAddRef(handle); - } -} -void PipelineLayout::WGPURelease(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuDawnWireClientPipelineLayoutRelease(handle); - } -} -static_assert(sizeof(PipelineLayout) == sizeof(WGPUPipelineLayout), "sizeof mismatch for PipelineLayout"); -static_assert(alignof(PipelineLayout) == alignof(WGPUPipelineLayout), "alignof mismatch for PipelineLayout"); - -// QuerySet implementation - -void QuerySet::Destroy() const { - wgpuDawnWireClientQuerySetDestroy(Get()); -} -uint32_t QuerySet::GetCount() const { - auto result = wgpuDawnWireClientQuerySetGetCount(Get()); - return result; -} -QueryType QuerySet::GetType() const { - auto result = wgpuDawnWireClientQuerySetGetType(Get()); - return static_cast(result); -} -void QuerySet::SetLabel(StringView label) const { - wgpuDawnWireClientQuerySetSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void QuerySet::WGPUAddRef(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuDawnWireClientQuerySetAddRef(handle); - } -} -void QuerySet::WGPURelease(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuDawnWireClientQuerySetRelease(handle); - } -} -static_assert(sizeof(QuerySet) == sizeof(WGPUQuerySet), "sizeof mismatch for QuerySet"); -static_assert(alignof(QuerySet) == alignof(WGPUQuerySet), "alignof mismatch for QuerySet"); - -// Queue implementation - -void Queue::CopyExternalTextureForBrowser(ImageCopyExternalTexture const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const { - wgpuDawnWireClientQueueCopyExternalTextureForBrowser(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize), reinterpret_cast(options)); -} -void Queue::CopyTextureForBrowser(TexelCopyTextureInfo const * source, TexelCopyTextureInfo const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const { - wgpuDawnWireClientQueueCopyTextureForBrowser(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize), reinterpret_cast(options)); -} -template -Future Queue::OnSubmittedWorkDone(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientQueueOnSubmittedWorkDone(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future Queue::OnSubmittedWorkDone(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientQueueOnSubmittedWorkDone(Get(), callbackInfo); - return Future { - result.id - }; -} -void Queue::SetLabel(StringView label) const { - wgpuDawnWireClientQueueSetLabel(Get(), *reinterpret_cast(&label)); -} -void Queue::Submit(size_t commandCount, CommandBuffer const * commands) const { - wgpuDawnWireClientQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); -} -void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const { - wgpuDawnWireClientQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); -} -void Queue::WriteTexture(TexelCopyTextureInfo const * destination, void const * data, size_t dataSize, TexelCopyBufferLayout const * dataLayout, Extent3D const * writeSize) const { - wgpuDawnWireClientQueueWriteTexture(Get(), reinterpret_cast(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(writeSize)); -} - - -void Queue::WGPUAddRef(WGPUQueue handle) { - if (handle != nullptr) { - wgpuDawnWireClientQueueAddRef(handle); - } -} -void Queue::WGPURelease(WGPUQueue handle) { - if (handle != nullptr) { - wgpuDawnWireClientQueueRelease(handle); - } -} -static_assert(sizeof(Queue) == sizeof(WGPUQueue), "sizeof mismatch for Queue"); -static_assert(alignof(Queue) == alignof(WGPUQueue), "alignof mismatch for Queue"); - -// RenderBundle implementation - -void RenderBundle::SetLabel(StringView label) const { - wgpuDawnWireClientRenderBundleSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void RenderBundle::WGPUAddRef(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderBundleAddRef(handle); - } -} -void RenderBundle::WGPURelease(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderBundleRelease(handle); - } -} -static_assert(sizeof(RenderBundle) == sizeof(WGPURenderBundle), "sizeof mismatch for RenderBundle"); -static_assert(alignof(RenderBundle) == alignof(WGPURenderBundle), "alignof mismatch for RenderBundle"); - -// RenderPipeline implementation - -BindGroupLayout RenderPipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuDawnWireClientRenderPipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); -} -void RenderPipeline::SetLabel(StringView label) const { - wgpuDawnWireClientRenderPipelineSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void RenderPipeline::WGPUAddRef(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderPipelineAddRef(handle); - } -} -void RenderPipeline::WGPURelease(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderPipelineRelease(handle); - } -} -static_assert(sizeof(RenderPipeline) == sizeof(WGPURenderPipeline), "sizeof mismatch for RenderPipeline"); -static_assert(alignof(RenderPipeline) == alignof(WGPURenderPipeline), "alignof mismatch for RenderPipeline"); - -// ResourceTable implementation - -void ResourceTable::Destroy() const { - wgpuDawnWireClientResourceTableDestroy(Get()); -} -uint32_t ResourceTable::GetSize() const { - auto result = wgpuDawnWireClientResourceTableGetSize(Get()); - return result; -} -uint32_t ResourceTable::InsertBinding(BindingResource const * resource) const { - auto result = wgpuDawnWireClientResourceTableInsertBinding(Get(), reinterpret_cast(resource)); - return result; -} -ConvertibleStatus ResourceTable::RemoveBinding(uint32_t slot) const { - auto result = wgpuDawnWireClientResourceTableRemoveBinding(Get(), slot); - return static_cast(result); -} -void ResourceTable::SetLabel(StringView label) const { - wgpuDawnWireClientResourceTableSetLabel(Get(), *reinterpret_cast(&label)); -} -ConvertibleStatus ResourceTable::Update(uint32_t slot, BindingResource const * resource) const { - auto result = wgpuDawnWireClientResourceTableUpdate(Get(), slot, reinterpret_cast(resource)); - return static_cast(result); -} - - -void ResourceTable::WGPUAddRef(WGPUResourceTable handle) { - if (handle != nullptr) { - wgpuDawnWireClientResourceTableAddRef(handle); - } -} -void ResourceTable::WGPURelease(WGPUResourceTable handle) { - if (handle != nullptr) { - wgpuDawnWireClientResourceTableRelease(handle); - } -} -static_assert(sizeof(ResourceTable) == sizeof(WGPUResourceTable), "sizeof mismatch for ResourceTable"); -static_assert(alignof(ResourceTable) == alignof(WGPUResourceTable), "alignof mismatch for ResourceTable"); - -// Sampler implementation - -void Sampler::SetLabel(StringView label) const { - wgpuDawnWireClientSamplerSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void Sampler::WGPUAddRef(WGPUSampler handle) { - if (handle != nullptr) { - wgpuDawnWireClientSamplerAddRef(handle); - } -} -void Sampler::WGPURelease(WGPUSampler handle) { - if (handle != nullptr) { - wgpuDawnWireClientSamplerRelease(handle); - } -} -static_assert(sizeof(Sampler) == sizeof(WGPUSampler), "sizeof mismatch for Sampler"); -static_assert(alignof(Sampler) == alignof(WGPUSampler), "alignof mismatch for Sampler"); - -// ShaderModule implementation - -template -Future ShaderModule::GetCompilationInfo(CallbackMode callbackMode, F callback, T userdata) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback), userdata); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientShaderModuleGetCompilationInfo(Get(), callbackInfo); - return Future { - result.id - }; -} -template -Future ShaderModule::GetCompilationInfo(CallbackMode callbackMode, F callback) const { - auto callbackInfo = detail::CallbackInfoHelper::Create(std::move(callback)); - callbackInfo.mode = static_cast(callbackMode); - auto result = wgpuDawnWireClientShaderModuleGetCompilationInfo(Get(), callbackInfo); - return Future { - result.id - }; -} -void ShaderModule::SetLabel(StringView label) const { - wgpuDawnWireClientShaderModuleSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void ShaderModule::WGPUAddRef(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuDawnWireClientShaderModuleAddRef(handle); - } -} -void ShaderModule::WGPURelease(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuDawnWireClientShaderModuleRelease(handle); - } -} -static_assert(sizeof(ShaderModule) == sizeof(WGPUShaderModule), "sizeof mismatch for ShaderModule"); -static_assert(alignof(ShaderModule) == alignof(WGPUShaderModule), "alignof mismatch for ShaderModule"); - -// SharedBufferMemory implementation - -ConvertibleStatus SharedBufferMemory::BeginAccess(Buffer const& buffer, SharedBufferMemoryBeginAccessDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientSharedBufferMemoryBeginAccess(Get(), buffer.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -Buffer SharedBufferMemory::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientSharedBufferMemoryCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); -} -ConvertibleStatus SharedBufferMemory::EndAccess(Buffer const& buffer, SharedBufferMemoryEndAccessState * descriptor) const { - *descriptor = SharedBufferMemoryEndAccessState(); - auto result = wgpuDawnWireClientSharedBufferMemoryEndAccess(Get(), buffer.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -ConvertibleStatus SharedBufferMemory::GetProperties(SharedBufferMemoryProperties * properties) const { - auto result = wgpuDawnWireClientSharedBufferMemoryGetProperties(Get(), reinterpret_cast(properties)); - return static_cast(result); -} -Bool SharedBufferMemory::IsDeviceLost() const { - auto result = wgpuDawnWireClientSharedBufferMemoryIsDeviceLost(Get()); - return result; -} -void SharedBufferMemory::SetLabel(StringView label) const { - wgpuDawnWireClientSharedBufferMemorySetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedBufferMemory::WGPUAddRef(WGPUSharedBufferMemory handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedBufferMemoryAddRef(handle); - } -} -void SharedBufferMemory::WGPURelease(WGPUSharedBufferMemory handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedBufferMemoryRelease(handle); - } -} -static_assert(sizeof(SharedBufferMemory) == sizeof(WGPUSharedBufferMemory), "sizeof mismatch for SharedBufferMemory"); -static_assert(alignof(SharedBufferMemory) == alignof(WGPUSharedBufferMemory), "alignof mismatch for SharedBufferMemory"); - -// SharedFence implementation - -void SharedFence::ExportInfo(SharedFenceExportInfo * info) const { - wgpuDawnWireClientSharedFenceExportInfo(Get(), reinterpret_cast(info)); -} -void SharedFence::SetLabel(StringView label) const { - wgpuDawnWireClientSharedFenceSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedFence::WGPUAddRef(WGPUSharedFence handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedFenceAddRef(handle); - } -} -void SharedFence::WGPURelease(WGPUSharedFence handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedFenceRelease(handle); - } -} -static_assert(sizeof(SharedFence) == sizeof(WGPUSharedFence), "sizeof mismatch for SharedFence"); -static_assert(alignof(SharedFence) == alignof(WGPUSharedFence), "alignof mismatch for SharedFence"); - -// SharedTextureMemory implementation - -ConvertibleStatus SharedTextureMemory::BeginAccess(Texture const& texture, SharedTextureMemoryBeginAccessDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientSharedTextureMemoryBeginAccess(Get(), texture.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -Texture SharedTextureMemory::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientSharedTextureMemoryCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); -} -ConvertibleStatus SharedTextureMemory::EndAccess(Texture const& texture, SharedTextureMemoryEndAccessState * descriptor) const { - *descriptor = SharedTextureMemoryEndAccessState(); - auto result = wgpuDawnWireClientSharedTextureMemoryEndAccess(Get(), texture.Get(), reinterpret_cast(descriptor)); - return static_cast(result); -} -ConvertibleStatus SharedTextureMemory::GetProperties(SharedTextureMemoryProperties * properties) const { - auto result = wgpuDawnWireClientSharedTextureMemoryGetProperties(Get(), reinterpret_cast(properties)); - return static_cast(result); -} -Bool SharedTextureMemory::IsDeviceLost() const { - auto result = wgpuDawnWireClientSharedTextureMemoryIsDeviceLost(Get()); - return result; -} -void SharedTextureMemory::SetLabel(StringView label) const { - wgpuDawnWireClientSharedTextureMemorySetLabel(Get(), *reinterpret_cast(&label)); -} - - -void SharedTextureMemory::WGPUAddRef(WGPUSharedTextureMemory handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedTextureMemoryAddRef(handle); - } -} -void SharedTextureMemory::WGPURelease(WGPUSharedTextureMemory handle) { - if (handle != nullptr) { - wgpuDawnWireClientSharedTextureMemoryRelease(handle); - } -} -static_assert(sizeof(SharedTextureMemory) == sizeof(WGPUSharedTextureMemory), "sizeof mismatch for SharedTextureMemory"); -static_assert(alignof(SharedTextureMemory) == alignof(WGPUSharedTextureMemory), "alignof mismatch for SharedTextureMemory"); - -// Surface implementation - -void Surface::Configure(SurfaceConfiguration const * config) const { - wgpuDawnWireClientSurfaceConfigure(Get(), reinterpret_cast(config)); -} -ConvertibleStatus Surface::GetCapabilities(Adapter const& adapter, SurfaceCapabilities * capabilities) const { - *capabilities = SurfaceCapabilities(); - auto result = wgpuDawnWireClientSurfaceGetCapabilities(Get(), adapter.Get(), reinterpret_cast(capabilities)); - return static_cast(result); -} -void Surface::GetCurrentTexture(SurfaceTexture * surfaceTexture) const { - wgpuDawnWireClientSurfaceGetCurrentTexture(Get(), reinterpret_cast(surfaceTexture)); -} -ConvertibleStatus Surface::Present() const { - auto result = wgpuDawnWireClientSurfacePresent(Get()); - return static_cast(result); -} -void Surface::SetLabel(StringView label) const { - wgpuDawnWireClientSurfaceSetLabel(Get(), *reinterpret_cast(&label)); -} -void Surface::Unconfigure() const { - wgpuDawnWireClientSurfaceUnconfigure(Get()); -} - - -void Surface::WGPUAddRef(WGPUSurface handle) { - if (handle != nullptr) { - wgpuDawnWireClientSurfaceAddRef(handle); - } -} -void Surface::WGPURelease(WGPUSurface handle) { - if (handle != nullptr) { - wgpuDawnWireClientSurfaceRelease(handle); - } -} -static_assert(sizeof(Surface) == sizeof(WGPUSurface), "sizeof mismatch for Surface"); -static_assert(alignof(Surface) == alignof(WGPUSurface), "alignof mismatch for Surface"); - -// TexelBufferView implementation - -void TexelBufferView::SetLabel(StringView label) const { - wgpuDawnWireClientTexelBufferViewSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void TexelBufferView::WGPUAddRef(WGPUTexelBufferView handle) { - if (handle != nullptr) { - wgpuDawnWireClientTexelBufferViewAddRef(handle); - } -} -void TexelBufferView::WGPURelease(WGPUTexelBufferView handle) { - if (handle != nullptr) { - wgpuDawnWireClientTexelBufferViewRelease(handle); - } -} -static_assert(sizeof(TexelBufferView) == sizeof(WGPUTexelBufferView), "sizeof mismatch for TexelBufferView"); -static_assert(alignof(TexelBufferView) == alignof(WGPUTexelBufferView), "alignof mismatch for TexelBufferView"); - -// Texture implementation - -TextureView Texture::CreateErrorView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientTextureCreateErrorView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); -} -TextureView Texture::CreateView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientTextureCreateView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); -} -void Texture::Destroy() const { - wgpuDawnWireClientTextureDestroy(Get()); -} -uint32_t Texture::GetDepthOrArrayLayers() const { - auto result = wgpuDawnWireClientTextureGetDepthOrArrayLayers(Get()); - return result; -} -TextureDimension Texture::GetDimension() const { - auto result = wgpuDawnWireClientTextureGetDimension(Get()); - return static_cast(result); -} -TextureFormat Texture::GetFormat() const { - auto result = wgpuDawnWireClientTextureGetFormat(Get()); - return static_cast(result); -} -uint32_t Texture::GetHeight() const { - auto result = wgpuDawnWireClientTextureGetHeight(Get()); - return result; -} -uint32_t Texture::GetMipLevelCount() const { - auto result = wgpuDawnWireClientTextureGetMipLevelCount(Get()); - return result; -} -uint32_t Texture::GetSampleCount() const { - auto result = wgpuDawnWireClientTextureGetSampleCount(Get()); - return result; -} -TextureViewDimension Texture::GetTextureBindingViewDimension() const { - auto result = wgpuDawnWireClientTextureGetTextureBindingViewDimension(Get()); - return static_cast(result); -} -TextureUsage Texture::GetUsage() const { - auto result = wgpuDawnWireClientTextureGetUsage(Get()); - return static_cast(result); -} -uint32_t Texture::GetWidth() const { - auto result = wgpuDawnWireClientTextureGetWidth(Get()); - return result; -} -void Texture::Pin(TextureUsage usage) const { - wgpuDawnWireClientTexturePin(Get(), static_cast(usage)); -} -void Texture::SetLabel(StringView label) const { - wgpuDawnWireClientTextureSetLabel(Get(), *reinterpret_cast(&label)); -} -void Texture::SetOwnershipForMemoryDump(uint64_t ownerGuid) const { - wgpuDawnWireClientTextureSetOwnershipForMemoryDump(Get(), ownerGuid); -} -void Texture::Unpin() const { - wgpuDawnWireClientTextureUnpin(Get()); -} - - -void Texture::WGPUAddRef(WGPUTexture handle) { - if (handle != nullptr) { - wgpuDawnWireClientTextureAddRef(handle); - } -} -void Texture::WGPURelease(WGPUTexture handle) { - if (handle != nullptr) { - wgpuDawnWireClientTextureRelease(handle); - } -} -static_assert(sizeof(Texture) == sizeof(WGPUTexture), "sizeof mismatch for Texture"); -static_assert(alignof(Texture) == alignof(WGPUTexture), "alignof mismatch for Texture"); - -// TextureView implementation - -void TextureView::SetLabel(StringView label) const { - wgpuDawnWireClientTextureViewSetLabel(Get(), *reinterpret_cast(&label)); -} - - -void TextureView::WGPUAddRef(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuDawnWireClientTextureViewAddRef(handle); - } -} -void TextureView::WGPURelease(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuDawnWireClientTextureViewRelease(handle); - } -} -static_assert(sizeof(TextureView) == sizeof(WGPUTextureView), "sizeof mismatch for TextureView"); -static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatch for TextureView"); - -// ComputePassEncoder implementation - -void ComputePassEncoder::DispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) const { - wgpuDawnWireClientComputePassEncoderDispatchWorkgroups(Get(), workgroupCountX, workgroupCountY, workgroupCountZ); -} -void ComputePassEncoder::DispatchWorkgroupsIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuDawnWireClientComputePassEncoderDispatchWorkgroupsIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void ComputePassEncoder::End() const { - wgpuDawnWireClientComputePassEncoderEnd(Get()); -} -void ComputePassEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuDawnWireClientComputePassEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void ComputePassEncoder::PopDebugGroup() const { - wgpuDawnWireClientComputePassEncoderPopDebugGroup(Get()); -} -void ComputePassEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuDawnWireClientComputePassEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void ComputePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuDawnWireClientComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void ComputePassEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuDawnWireClientComputePassEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void ComputePassEncoder::SetLabel(StringView label) const { - wgpuDawnWireClientComputePassEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void ComputePassEncoder::SetPipeline(ComputePipeline const& pipeline) const { - wgpuDawnWireClientComputePassEncoderSetPipeline(Get(), pipeline.Get()); -} -void ComputePassEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuDawnWireClientComputePassEncoderSetResourceTable(Get(), table.Get()); -} -void ComputePassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuDawnWireClientComputePassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void ComputePassEncoder::WGPUAddRef(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientComputePassEncoderAddRef(handle); - } -} -void ComputePassEncoder::WGPURelease(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientComputePassEncoderRelease(handle); - } -} -static_assert(sizeof(ComputePassEncoder) == sizeof(WGPUComputePassEncoder), "sizeof mismatch for ComputePassEncoder"); -static_assert(alignof(ComputePassEncoder) == alignof(WGPUComputePassEncoder), "alignof mismatch for ComputePassEncoder"); - -// RenderBundleEncoder implementation - -void RenderBundleEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuDawnWireClientRenderBundleEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderBundleEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuDawnWireClientRenderBundleEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderBundleEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuDawnWireClientRenderBundleEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderBundleEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuDawnWireClientRenderBundleEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -RenderBundle RenderBundleEncoder::Finish(RenderBundleDescriptor const * descriptor) const { - auto result = wgpuDawnWireClientRenderBundleEncoderFinish(Get(), reinterpret_cast(descriptor)); - return RenderBundle::Acquire(result); -} -void RenderBundleEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuDawnWireClientRenderBundleEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void RenderBundleEncoder::PopDebugGroup() const { - wgpuDawnWireClientRenderBundleEncoderPopDebugGroup(Get()); -} -void RenderBundleEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuDawnWireClientRenderBundleEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void RenderBundleEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuDawnWireClientRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void RenderBundleEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuDawnWireClientRenderBundleEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuDawnWireClientRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); -} -void RenderBundleEncoder::SetLabel(StringView label) const { - wgpuDawnWireClientRenderBundleEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void RenderBundleEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuDawnWireClientRenderBundleEncoderSetPipeline(Get(), pipeline.Get()); -} -void RenderBundleEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuDawnWireClientRenderBundleEncoderSetResourceTable(Get(), table.Get()); -} -void RenderBundleEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuDawnWireClientRenderBundleEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); -} - - -void RenderBundleEncoder::WGPUAddRef(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderBundleEncoderAddRef(handle); - } -} -void RenderBundleEncoder::WGPURelease(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderBundleEncoderRelease(handle); - } -} -static_assert(sizeof(RenderBundleEncoder) == sizeof(WGPURenderBundleEncoder), "sizeof mismatch for RenderBundleEncoder"); -static_assert(alignof(RenderBundleEncoder) == alignof(WGPURenderBundleEncoder), "alignof mismatch for RenderBundleEncoder"); - -// RenderPassEncoder implementation - -void RenderPassEncoder::BeginOcclusionQuery(uint32_t queryIndex) const { - wgpuDawnWireClientRenderPassEncoderBeginOcclusionQuery(Get(), queryIndex); -} -void RenderPassEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuDawnWireClientRenderPassEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); -} -void RenderPassEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuDawnWireClientRenderPassEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); -} -void RenderPassEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuDawnWireClientRenderPassEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderPassEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuDawnWireClientRenderPassEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); -} -void RenderPassEncoder::End() const { - wgpuDawnWireClientRenderPassEncoderEnd(Get()); -} -void RenderPassEncoder::EndOcclusionQuery() const { - wgpuDawnWireClientRenderPassEncoderEndOcclusionQuery(Get()); -} -void RenderPassEncoder::ExecuteBundles(size_t bundleCount, RenderBundle const * bundles) const { - wgpuDawnWireClientRenderPassEncoderExecuteBundles(Get(), bundleCount, reinterpret_cast(bundles)); -} -void RenderPassEncoder::InsertDebugMarker(StringView markerLabel) const { - wgpuDawnWireClientRenderPassEncoderInsertDebugMarker(Get(), *reinterpret_cast(&markerLabel)); -} -void RenderPassEncoder::MultiDrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer, uint64_t drawCountBufferOffset) const { - wgpuDawnWireClientRenderPassEncoderMultiDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset, maxDrawCount, drawCountBuffer.Get(), drawCountBufferOffset); -} -void RenderPassEncoder::MultiDrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset, uint32_t maxDrawCount, Buffer const& drawCountBuffer, uint64_t drawCountBufferOffset) const { - wgpuDawnWireClientRenderPassEncoderMultiDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset, maxDrawCount, drawCountBuffer.Get(), drawCountBufferOffset); -} -void RenderPassEncoder::PixelLocalStorageBarrier() const { - wgpuDawnWireClientRenderPassEncoderPixelLocalStorageBarrier(Get()); -} -void RenderPassEncoder::PopDebugGroup() const { - wgpuDawnWireClientRenderPassEncoderPopDebugGroup(Get()); -} -void RenderPassEncoder::PushDebugGroup(StringView groupLabel) const { - wgpuDawnWireClientRenderPassEncoderPushDebugGroup(Get(), *reinterpret_cast(&groupLabel)); -} -void RenderPassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuDawnWireClientRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); -} -void RenderPassEncoder::SetBlendConstant(Color const * color) const { - wgpuDawnWireClientRenderPassEncoderSetBlendConstant(Get(), reinterpret_cast(color)); -} -void RenderPassEncoder::SetImmediates(uint32_t offset, void const * data, size_t size) const { - wgpuDawnWireClientRenderPassEncoderSetImmediates(Get(), offset, reinterpret_cast(data), size); -} -void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuDawnWireClientRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); -} -void RenderPassEncoder::SetLabel(StringView label) const { - wgpuDawnWireClientRenderPassEncoderSetLabel(Get(), *reinterpret_cast(&label)); -} -void RenderPassEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuDawnWireClientRenderPassEncoderSetPipeline(Get(), pipeline.Get()); -} -void RenderPassEncoder::SetResourceTable(ResourceTable const& table) const { - wgpuDawnWireClientRenderPassEncoderSetResourceTable(Get(), table.Get()); -} -void RenderPassEncoder::SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { - wgpuDawnWireClientRenderPassEncoderSetScissorRect(Get(), x, y, width, height); -} -void RenderPassEncoder::SetStencilReference(uint32_t reference) const { - wgpuDawnWireClientRenderPassEncoderSetStencilReference(Get(), reference); -} -void RenderPassEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuDawnWireClientRenderPassEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); -} -void RenderPassEncoder::SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const { - wgpuDawnWireClientRenderPassEncoderSetViewport(Get(), x, y, width, height, minDepth, maxDepth); -} -void RenderPassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuDawnWireClientRenderPassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); -} - - -void RenderPassEncoder::WGPUAddRef(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderPassEncoderAddRef(handle); - } -} -void RenderPassEncoder::WGPURelease(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuDawnWireClientRenderPassEncoderRelease(handle); - } -} -static_assert(sizeof(RenderPassEncoder) == sizeof(WGPURenderPassEncoder), "sizeof mismatch for RenderPassEncoder"); -static_assert(alignof(RenderPassEncoder) == alignof(WGPURenderPassEncoder), "alignof mismatch for RenderPassEncoder"); - - -} // namespace dawn::wire::client - -using Adapter = dawn::wire::client::Adapter; -using BindGroup = dawn::wire::client::BindGroup; -using BindGroupLayout = dawn::wire::client::BindGroupLayout; -using Buffer = dawn::wire::client::Buffer; -using CommandBuffer = dawn::wire::client::CommandBuffer; -using CommandEncoder = dawn::wire::client::CommandEncoder; -using ComputePipeline = dawn::wire::client::ComputePipeline; -using Device = dawn::wire::client::Device; -using ExternalTexture = dawn::wire::client::ExternalTexture; -using Instance = dawn::wire::client::Instance; -using PipelineLayout = dawn::wire::client::PipelineLayout; -using QuerySet = dawn::wire::client::QuerySet; -using Queue = dawn::wire::client::Queue; -using RenderBundle = dawn::wire::client::RenderBundle; -using RenderPipeline = dawn::wire::client::RenderPipeline; -using ResourceTable = dawn::wire::client::ResourceTable; -using Sampler = dawn::wire::client::Sampler; -using ShaderModule = dawn::wire::client::ShaderModule; -using SharedBufferMemory = dawn::wire::client::SharedBufferMemory; -using SharedFence = dawn::wire::client::SharedFence; -using SharedTextureMemory = dawn::wire::client::SharedTextureMemory; -using Surface = dawn::wire::client::Surface; -using TexelBufferView = dawn::wire::client::TexelBufferView; -using Texture = dawn::wire::client::Texture; -using TextureView = dawn::wire::client::TextureView; -using ComputePassEncoder = dawn::wire::client::ComputePassEncoder; -using RenderBundleEncoder = dawn::wire::client::RenderBundleEncoder; -using RenderPassEncoder = dawn::wire::client::RenderPassEncoder; - -using StringView = dawn::wire::client::StringView; -using AdapterPropertiesD3D = dawn::wire::client::AdapterPropertiesD3D; -using AdapterPropertiesDrm = dawn::wire::client::AdapterPropertiesDrm; -using AdapterPropertiesVk = dawn::wire::client::AdapterPropertiesVk; -using AdapterPropertiesWGPU = dawn::wire::client::AdapterPropertiesWGPU; -using BindingResource = dawn::wire::client::BindingResource; -using BlendComponent = dawn::wire::client::BlendComponent; -using BufferBindingLayout = dawn::wire::client::BufferBindingLayout; -using BufferHostMappedPointer = dawn::wire::client::BufferHostMappedPointer; -using Color = dawn::wire::client::Color; -using ColorSpaceDawn = dawn::wire::client::ColorSpaceDawn; -using ColorTargetStateExpandResolveTextureDawn = dawn::wire::client::ColorTargetStateExpandResolveTextureDawn; -using CommandBufferDescriptor = dawn::wire::client::CommandBufferDescriptor; -using CompatibilityModeLimits = dawn::wire::client::CompatibilityModeLimits; -using ConstantEntry = dawn::wire::client::ConstantEntry; -using CopyTextureForBrowserOptions = dawn::wire::client::CopyTextureForBrowserOptions; -using DawnAdapterPropertiesPowerPreference = dawn::wire::client::DawnAdapterPropertiesPowerPreference; -using DawnBufferDescriptorErrorInfoFromWireClient = dawn::wire::client::DawnBufferDescriptorErrorInfoFromWireClient; -using DawnCacheDeviceDescriptor = dawn::wire::client::DawnCacheDeviceDescriptor; -using DawnCompilationMessageUtf16 = dawn::wire::client::DawnCompilationMessageUtf16; -using DawnConsumeAdapterDescriptor = dawn::wire::client::DawnConsumeAdapterDescriptor; -using DawnDeviceAllocatorControl = dawn::wire::client::DawnDeviceAllocatorControl; -using DawnDrmFormatProperties = dawn::wire::client::DawnDrmFormatProperties; -using DawnEncoderInternalUsageDescriptor = dawn::wire::client::DawnEncoderInternalUsageDescriptor; -using DawnFakeBufferOOMForTesting = dawn::wire::client::DawnFakeBufferOOMForTesting; -using DawnFakeDeviceInitializeErrorForTesting = dawn::wire::client::DawnFakeDeviceInitializeErrorForTesting; -using DawnHostMappedPointerLimits = dawn::wire::client::DawnHostMappedPointerLimits; -using DawnInjectedInvalidSType = dawn::wire::client::DawnInjectedInvalidSType; -using DawnRenderPassSampleCount = dawn::wire::client::DawnRenderPassSampleCount; -using DawnShaderModuleSPIRVOptionsDescriptor = dawn::wire::client::DawnShaderModuleSPIRVOptionsDescriptor; -using DawnTexelCopyBufferRowAlignmentLimits = dawn::wire::client::DawnTexelCopyBufferRowAlignmentLimits; -using DawnTextureInternalUsageDescriptor = dawn::wire::client::DawnTextureInternalUsageDescriptor; -using DawnTogglesDescriptor = dawn::wire::client::DawnTogglesDescriptor; -using DawnWGSLBlocklist = dawn::wire::client::DawnWGSLBlocklist; -using DawnWireWGSLControl = dawn::wire::client::DawnWireWGSLControl; -using Extent2D = dawn::wire::client::Extent2D; -using Extent3D = dawn::wire::client::Extent3D; -using ExternalTextureBindingEntry = dawn::wire::client::ExternalTextureBindingEntry; -using ExternalTextureBindingLayout = dawn::wire::client::ExternalTextureBindingLayout; -using Future = dawn::wire::client::Future; -using InstanceLimits = dawn::wire::client::InstanceLimits; -using MemoryHeapInfo = dawn::wire::client::MemoryHeapInfo; -using MultisampleState = dawn::wire::client::MultisampleState; -using Origin2D = dawn::wire::client::Origin2D; -using Origin3D = dawn::wire::client::Origin3D; -using PassTimestampWrites = dawn::wire::client::PassTimestampWrites; -using PipelineLayoutResourceTable = dawn::wire::client::PipelineLayoutResourceTable; -using PipelineLayoutStorageAttachment = dawn::wire::client::PipelineLayoutStorageAttachment; -using PrimitiveState = dawn::wire::client::PrimitiveState; -using QuerySetDescriptor = dawn::wire::client::QuerySetDescriptor; -using QueueDescriptor = dawn::wire::client::QueueDescriptor; -using RenderBundleDescriptor = dawn::wire::client::RenderBundleDescriptor; -using RenderBundleEncoderDescriptor = dawn::wire::client::RenderBundleEncoderDescriptor; -using RenderPassDepthStencilAttachment = dawn::wire::client::RenderPassDepthStencilAttachment; -using RenderPassDescriptorResolveRect = dawn::wire::client::RenderPassDescriptorResolveRect; -using RenderPassMaxDrawCount = dawn::wire::client::RenderPassMaxDrawCount; -using RequestAdapterWebGPUBackendOptions = dawn::wire::client::RequestAdapterWebGPUBackendOptions; -using RequestAdapterWebXROptions = dawn::wire::client::RequestAdapterWebXROptions; -using ResourceTableDescriptor = dawn::wire::client::ResourceTableDescriptor; -using SamplerBindingLayout = dawn::wire::client::SamplerBindingLayout; -using ShaderModuleCompilationOptions = dawn::wire::client::ShaderModuleCompilationOptions; -using ShaderSourceSPIRV = dawn::wire::client::ShaderSourceSPIRV; -using ShaderSourceWGSL = dawn::wire::client::ShaderSourceWGSL; -using SharedBufferMemoryBeginAccessDescriptor = dawn::wire::client::SharedBufferMemoryBeginAccessDescriptor; -using SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor = dawn::wire::client::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor; -using SharedBufferMemoryEndAccessState = dawn::wire::client::SharedBufferMemoryEndAccessState; -using SharedBufferMemoryProperties = dawn::wire::client::SharedBufferMemoryProperties; -using SharedFenceDXGISharedHandleDescriptor = dawn::wire::client::SharedFenceDXGISharedHandleDescriptor; -using SharedFenceDXGISharedHandleExportInfo = dawn::wire::client::SharedFenceDXGISharedHandleExportInfo; -using SharedFenceEGLSyncDescriptor = dawn::wire::client::SharedFenceEGLSyncDescriptor; -using SharedFenceEGLSyncExportInfo = dawn::wire::client::SharedFenceEGLSyncExportInfo; -using SharedFenceMTLSharedEventDescriptor = dawn::wire::client::SharedFenceMTLSharedEventDescriptor; -using SharedFenceMTLSharedEventExportInfo = dawn::wire::client::SharedFenceMTLSharedEventExportInfo; -using SharedFenceSyncFDDescriptor = dawn::wire::client::SharedFenceSyncFDDescriptor; -using SharedFenceSyncFDExportInfo = dawn::wire::client::SharedFenceSyncFDExportInfo; -using SharedFenceVkSemaphoreOpaqueFDDescriptor = dawn::wire::client::SharedFenceVkSemaphoreOpaqueFDDescriptor; -using SharedFenceVkSemaphoreOpaqueFDExportInfo = dawn::wire::client::SharedFenceVkSemaphoreOpaqueFDExportInfo; -using SharedFenceVkSemaphoreZirconHandleDescriptor = dawn::wire::client::SharedFenceVkSemaphoreZirconHandleDescriptor; -using SharedFenceVkSemaphoreZirconHandleExportInfo = dawn::wire::client::SharedFenceVkSemaphoreZirconHandleExportInfo; -using SharedTextureMemoryAHardwareBufferDescriptor = dawn::wire::client::SharedTextureMemoryAHardwareBufferDescriptor; -using SharedTextureMemoryD3D11BeginState = dawn::wire::client::SharedTextureMemoryD3D11BeginState; -using SharedTextureMemoryD3DSwapchainBeginState = dawn::wire::client::SharedTextureMemoryD3DSwapchainBeginState; -using SharedTextureMemoryDmaBufPlane = dawn::wire::client::SharedTextureMemoryDmaBufPlane; -using SharedTextureMemoryDXGISharedHandleDescriptor = dawn::wire::client::SharedTextureMemoryDXGISharedHandleDescriptor; -using SharedTextureMemoryEGLImageDescriptor = dawn::wire::client::SharedTextureMemoryEGLImageDescriptor; -using SharedTextureMemoryIOSurfaceDescriptor = dawn::wire::client::SharedTextureMemoryIOSurfaceDescriptor; -using SharedTextureMemoryOpaqueFDDescriptor = dawn::wire::client::SharedTextureMemoryOpaqueFDDescriptor; -using SharedTextureMemoryVkDedicatedAllocationDescriptor = dawn::wire::client::SharedTextureMemoryVkDedicatedAllocationDescriptor; -using SharedTextureMemoryVkImageLayoutBeginState = dawn::wire::client::SharedTextureMemoryVkImageLayoutBeginState; -using SharedTextureMemoryVkImageLayoutEndState = dawn::wire::client::SharedTextureMemoryVkImageLayoutEndState; -using SharedTextureMemoryZirconHandleDescriptor = dawn::wire::client::SharedTextureMemoryZirconHandleDescriptor; -using StaticSamplerBindingLayout = dawn::wire::client::StaticSamplerBindingLayout; -using StencilFaceState = dawn::wire::client::StencilFaceState; -using StorageTextureBindingLayout = dawn::wire::client::StorageTextureBindingLayout; -using SubgroupMatrixConfig = dawn::wire::client::SubgroupMatrixConfig; -using SupportedFeatures = dawn::wire::client::SupportedFeatures; -using SupportedInstanceFeatures = dawn::wire::client::SupportedInstanceFeatures; -using SupportedWGSLLanguageFeatures = dawn::wire::client::SupportedWGSLLanguageFeatures; -using SurfaceCapabilities = dawn::wire::client::SurfaceCapabilities; -using SurfaceColorManagement = dawn::wire::client::SurfaceColorManagement; -using SurfaceConfiguration = dawn::wire::client::SurfaceConfiguration; -using SurfaceDescriptorFromWindowsCoreWindow = dawn::wire::client::SurfaceDescriptorFromWindowsCoreWindow; -using SurfaceDescriptorFromWindowsUWPSwapChainPanel = dawn::wire::client::SurfaceDescriptorFromWindowsUWPSwapChainPanel; -using SurfaceDescriptorFromWindowsWinUISwapChainPanel = dawn::wire::client::SurfaceDescriptorFromWindowsWinUISwapChainPanel; -using SurfaceSourceAndroidNativeWindow = dawn::wire::client::SurfaceSourceAndroidNativeWindow; -using SurfaceSourceMetalLayer = dawn::wire::client::SurfaceSourceMetalLayer; -using SurfaceSourceWaylandSurface = dawn::wire::client::SurfaceSourceWaylandSurface; -using SurfaceSourceWindowsHWND = dawn::wire::client::SurfaceSourceWindowsHWND; -using SurfaceSourceXCBWindow = dawn::wire::client::SurfaceSourceXCBWindow; -using SurfaceSourceXlibWindow = dawn::wire::client::SurfaceSourceXlibWindow; -using SurfaceTexture = dawn::wire::client::SurfaceTexture; -using TexelBufferBindingEntry = dawn::wire::client::TexelBufferBindingEntry; -using TexelBufferBindingLayout = dawn::wire::client::TexelBufferBindingLayout; -using TexelBufferViewDescriptor = dawn::wire::client::TexelBufferViewDescriptor; -using TexelCopyBufferLayout = dawn::wire::client::TexelCopyBufferLayout; -using TextureBindingLayout = dawn::wire::client::TextureBindingLayout; -using TextureBindingViewDimension = dawn::wire::client::TextureBindingViewDimension; -using TextureComponentSwizzle = dawn::wire::client::TextureComponentSwizzle; -using VertexAttribute = dawn::wire::client::VertexAttribute; -using YCbCrVkDescriptor = dawn::wire::client::YCbCrVkDescriptor; -using AdapterPropertiesMemoryHeaps = dawn::wire::client::AdapterPropertiesMemoryHeaps; -using AdapterPropertiesSubgroupMatrixConfigs = dawn::wire::client::AdapterPropertiesSubgroupMatrixConfigs; -using AHardwareBufferProperties = dawn::wire::client::AHardwareBufferProperties; -using BindGroupEntry = dawn::wire::client::BindGroupEntry; -using BindGroupLayoutEntry = dawn::wire::client::BindGroupLayoutEntry; -using BlendState = dawn::wire::client::BlendState; -using BufferDescriptor = dawn::wire::client::BufferDescriptor; -using CommandEncoderDescriptor = dawn::wire::client::CommandEncoderDescriptor; -using CompilationMessage = dawn::wire::client::CompilationMessage; -using ComputePassDescriptor = dawn::wire::client::ComputePassDescriptor; -using ComputeState = dawn::wire::client::ComputeState; -using DawnDrmFormatCapabilities = dawn::wire::client::DawnDrmFormatCapabilities; -using DepthStencilState = dawn::wire::client::DepthStencilState; -using ExternalTextureDescriptor = dawn::wire::client::ExternalTextureDescriptor; -using FutureWaitInfo = dawn::wire::client::FutureWaitInfo; -using ImageCopyExternalTexture = dawn::wire::client::ImageCopyExternalTexture; -using InstanceDescriptor = dawn::wire::client::InstanceDescriptor; -using Limits = dawn::wire::client::Limits; -using PipelineLayoutPixelLocalStorage = dawn::wire::client::PipelineLayoutPixelLocalStorage; -using RenderPassColorAttachment = dawn::wire::client::RenderPassColorAttachment; -using RenderPassRenderAreaRect = dawn::wire::client::RenderPassRenderAreaRect; -using RenderPassStorageAttachment = dawn::wire::client::RenderPassStorageAttachment; -using RequestAdapterOptions = dawn::wire::client::RequestAdapterOptions; -using SamplerDescriptor = dawn::wire::client::SamplerDescriptor; -using ShaderModuleDescriptor = dawn::wire::client::ShaderModuleDescriptor; -using SharedBufferMemoryDescriptor = dawn::wire::client::SharedBufferMemoryDescriptor; -using SharedFenceDescriptor = dawn::wire::client::SharedFenceDescriptor; -using SharedFenceExportInfo = dawn::wire::client::SharedFenceExportInfo; -using SharedTextureMemoryAHardwareBufferProperties = dawn::wire::client::SharedTextureMemoryAHardwareBufferProperties; -using SharedTextureMemoryBeginAccessDescriptor = dawn::wire::client::SharedTextureMemoryBeginAccessDescriptor; -using SharedTextureMemoryDmaBufDescriptor = dawn::wire::client::SharedTextureMemoryDmaBufDescriptor; -using SharedTextureMemoryMetalEndAccessState = dawn::wire::client::SharedTextureMemoryMetalEndAccessState; -using SurfaceDescriptor = dawn::wire::client::SurfaceDescriptor; -using TexelCopyBufferInfo = dawn::wire::client::TexelCopyBufferInfo; -using TexelCopyTextureInfo = dawn::wire::client::TexelCopyTextureInfo; -using TextureComponentSwizzleDescriptor = dawn::wire::client::TextureComponentSwizzleDescriptor; -using TextureDescriptor = dawn::wire::client::TextureDescriptor; -using VertexBufferLayout = dawn::wire::client::VertexBufferLayout; -using AdapterInfo = dawn::wire::client::AdapterInfo; -using BindGroupDescriptor = dawn::wire::client::BindGroupDescriptor; -using BindGroupLayoutDescriptor = dawn::wire::client::BindGroupLayoutDescriptor; -using ColorTargetState = dawn::wire::client::ColorTargetState; -using CompilationInfo = dawn::wire::client::CompilationInfo; -using ComputePipelineDescriptor = dawn::wire::client::ComputePipelineDescriptor; -using DawnFormatCapabilities = dawn::wire::client::DawnFormatCapabilities; -using DeviceDescriptor = dawn::wire::client::DeviceDescriptor; -using PipelineLayoutDescriptor = dawn::wire::client::PipelineLayoutDescriptor; -using RenderPassPixelLocalStorage = dawn::wire::client::RenderPassPixelLocalStorage; -using SharedTextureMemoryDescriptor = dawn::wire::client::SharedTextureMemoryDescriptor; -using SharedTextureMemoryEndAccessState = dawn::wire::client::SharedTextureMemoryEndAccessState; -using SharedTextureMemoryProperties = dawn::wire::client::SharedTextureMemoryProperties; -using TextureViewDescriptor = dawn::wire::client::TextureViewDescriptor; -using VertexState = dawn::wire::client::VertexState; -using FragmentState = dawn::wire::client::FragmentState; -using RenderPassDescriptor = dawn::wire::client::RenderPassDescriptor; -using RenderPipelineDescriptor = dawn::wire::client::RenderPipelineDescriptor; -template -using BufferMapCallback = typename dawn::wire::client::BufferMapCallback; -template -using CompilationInfoCallback = typename dawn::wire::client::CompilationInfoCallback; -template -using CreateComputePipelineAsyncCallback = typename dawn::wire::client::CreateComputePipelineAsyncCallback; -template -using CreateRenderPipelineAsyncCallback = typename dawn::wire::client::CreateRenderPipelineAsyncCallback; -template -using DawnLoadCacheDataCallback = typename dawn::wire::client::DawnLoadCacheDataCallback; -template -using DawnStoreCacheDataCallback = typename dawn::wire::client::DawnStoreCacheDataCallback; -template -using DeviceLostCallback = typename dawn::wire::client::DeviceLostCallback; -template -using LoggingCallback = typename dawn::wire::client::LoggingCallback; -template -using PopErrorScopeCallback = typename dawn::wire::client::PopErrorScopeCallback; -template -using QueueWorkDoneCallback = typename dawn::wire::client::QueueWorkDoneCallback; -template -using RequestAdapterCallback = typename dawn::wire::client::RequestAdapterCallback; -template -using RequestDeviceCallback = typename dawn::wire::client::RequestDeviceCallback; -template -using UncapturedErrorCallback = typename dawn::wire::client::UncapturedErrorCallback; - - -// Free Functions -static inline Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr) { - auto result = wgpuDawnWireClientCreateInstance(reinterpret_cast(descriptor)); - return Instance::Acquire(result); -} -static inline void GetInstanceFeatures(SupportedInstanceFeatures * features) { - wgpuDawnWireClientGetInstanceFeatures(reinterpret_cast(features)); -} -static inline Status GetInstanceLimits(InstanceLimits * limits) { - auto result = wgpuDawnWireClientGetInstanceLimits(reinterpret_cast(limits)); - return static_cast(result); -} -static inline Bool HasInstanceFeature(InstanceFeatureName feature) { - auto result = wgpuDawnWireClientHasInstanceFeature(static_cast(feature)); - return result; -} -static inline Proc GetProcAddress(StringView procName) { - auto result = wgpuDawnWireClientGetProcAddress(*reinterpret_cast(&procName)); - return reinterpret_cast(result); -} - -} // namespace wgpu - -namespace wgpu { - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - -template<> -struct IsWGPUBitmask { - static constexpr bool enable = true; -}; - - -inline bool operator==(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) { - return s1.r == s2.r && s1.g == s2.g && s1.b == s2.b && s1.a == s2.a; -} -inline bool operator!=(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) { - return !(s1 == s2); -} - -} // namespace wgpu - -namespace std { -// 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); - } -}; -template <> -struct hash { - public: - size_t operator()(const wgpu::OptionalBool &v) const { - return hash()(v.mValue); - } -}; -} // namespace std - -#endif // DAWN_WIRE_CLIENT_WEBGPU_CPP_H_ diff --git a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp_print.h b/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp_print.h deleted file mode 100644 index f6ccffe..0000000 --- a/.scratch/dawn-package/extracted/include/dawn/wire/client/webgpu_cpp_print.h +++ /dev/null @@ -1,2844 +0,0 @@ -// Copyright 2021 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 DAWN_WIRE_CLIENT_WEBGPU_CPP_PRINT_H_ -#define DAWN_WIRE_CLIENT_WEBGPU_CPP_PRINT_H_ - -#include "dawn/wire/client/webgpu_cpp.h" - -#include -#include -#include -#include - -namespace wgpu { - - template - std::basic_ostream& operator<<(std::basic_ostream& o, AdapterType value) { - switch (value) { - case AdapterType::DiscreteGPU: - o << "AdapterType::DiscreteGPU"; - break; - case AdapterType::IntegratedGPU: - o << "AdapterType::IntegratedGPU"; - break; - case AdapterType::CPU: - o << "AdapterType::CPU"; - break; - case AdapterType::Unknown: - o << "AdapterType::Unknown"; - break; - default: - o << "AdapterType::" << 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, 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; - default: - o << "AddressMode::" << 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, 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; - default: - o << "AlphaMode::" << 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, BackendType value) { - switch (value) { - case BackendType::Undefined: - o << "BackendType::Undefined"; - break; - case BackendType::Null: - o << "BackendType::Null"; - break; - case BackendType::WebGPU: - o << "BackendType::WebGPU"; - break; - case BackendType::D3D11: - o << "BackendType::D3D11"; - break; - case BackendType::D3D12: - o << "BackendType::D3D12"; - break; - case BackendType::Metal: - o << "BackendType::Metal"; - break; - case BackendType::Vulkan: - o << "BackendType::Vulkan"; - break; - case BackendType::OpenGL: - o << "BackendType::OpenGL"; - break; - case BackendType::OpenGLES: - o << "BackendType::OpenGLES"; - break; - default: - o << "BackendType::" << 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, BlendFactor value) { - switch (value) { - case BlendFactor::Undefined: - o << "BlendFactor::Undefined"; - break; - case BlendFactor::Zero: - o << "BlendFactor::Zero"; - break; - case BlendFactor::One: - o << "BlendFactor::One"; - break; - case BlendFactor::Src: - o << "BlendFactor::Src"; - break; - case BlendFactor::OneMinusSrc: - o << "BlendFactor::OneMinusSrc"; - break; - case BlendFactor::SrcAlpha: - o << "BlendFactor::SrcAlpha"; - break; - case BlendFactor::OneMinusSrcAlpha: - o << "BlendFactor::OneMinusSrcAlpha"; - break; - case BlendFactor::Dst: - o << "BlendFactor::Dst"; - break; - case BlendFactor::OneMinusDst: - o << "BlendFactor::OneMinusDst"; - break; - case BlendFactor::DstAlpha: - o << "BlendFactor::DstAlpha"; - break; - case BlendFactor::OneMinusDstAlpha: - o << "BlendFactor::OneMinusDstAlpha"; - break; - case BlendFactor::SrcAlphaSaturated: - o << "BlendFactor::SrcAlphaSaturated"; - break; - case BlendFactor::Constant: - o << "BlendFactor::Constant"; - 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); - } - return o; - } - 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; - case BlendOperation::Subtract: - o << "BlendOperation::Subtract"; - break; - case BlendOperation::ReverseSubtract: - o << "BlendOperation::ReverseSubtract"; - break; - case BlendOperation::Min: - o << "BlendOperation::Min"; - break; - case BlendOperation::Max: - o << "BlendOperation::Max"; - break; - default: - o << "BlendOperation::" << 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, BufferBindingType value) { - switch (value) { - case BufferBindingType::BindingNotUsed: - o << "BufferBindingType::BindingNotUsed"; - break; - case BufferBindingType::Undefined: - o << "BufferBindingType::Undefined"; - break; - case BufferBindingType::Uniform: - o << "BufferBindingType::Uniform"; - break; - case BufferBindingType::Storage: - o << "BufferBindingType::Storage"; - break; - case BufferBindingType::ReadOnlyStorage: - o << "BufferBindingType::ReadOnlyStorage"; - break; - default: - o << "BufferBindingType::" << 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, 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, ColorSpacePrimariesDawn value) { - switch (value) { - case ColorSpacePrimariesDawn::SRGB: - o << "ColorSpacePrimariesDawn::SRGB"; - break; - case ColorSpacePrimariesDawn::Rec601: - o << "ColorSpacePrimariesDawn::Rec601"; - break; - case ColorSpacePrimariesDawn::Rec2020: - o << "ColorSpacePrimariesDawn::Rec2020"; - break; - case ColorSpacePrimariesDawn::DisplayP3: - o << "ColorSpacePrimariesDawn::DisplayP3"; - break; - default: - o << "ColorSpacePrimariesDawn::" << 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, ColorSpaceTransferDawn value) { - switch (value) { - case ColorSpaceTransferDawn::Identity: - o << "ColorSpaceTransferDawn::Identity"; - break; - case ColorSpaceTransferDawn::SRGB: - o << "ColorSpaceTransferDawn::SRGB"; - break; - case ColorSpaceTransferDawn::DisplayP3: - o << "ColorSpaceTransferDawn::DisplayP3"; - break; - case ColorSpaceTransferDawn::SMPTE_170M: - o << "ColorSpaceTransferDawn::SMPTE_170M"; - break; - case ColorSpaceTransferDawn::HLG: - o << "ColorSpaceTransferDawn::HLG"; - break; - case ColorSpaceTransferDawn::PQ: - o << "ColorSpaceTransferDawn::PQ"; - break; - default: - o << "ColorSpaceTransferDawn::" << 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, ColorSpaceYCbCrMatrixDawn value) { - switch (value) { - case ColorSpaceYCbCrMatrixDawn::Identity: - o << "ColorSpaceYCbCrMatrixDawn::Identity"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec601: - o << "ColorSpaceYCbCrMatrixDawn::Rec601"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec709: - o << "ColorSpaceYCbCrMatrixDawn::Rec709"; - break; - case ColorSpaceYCbCrMatrixDawn::Rec2020: - o << "ColorSpaceYCbCrMatrixDawn::Rec2020"; - break; - default: - o << "ColorSpaceYCbCrMatrixDawn::" << 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, ColorSpaceYCbCrRangeDawn value) { - switch (value) { - case ColorSpaceYCbCrRangeDawn::Identity: - o << "ColorSpaceYCbCrRangeDawn::Identity"; - break; - case ColorSpaceYCbCrRangeDawn::Narrow: - o << "ColorSpaceYCbCrRangeDawn::Narrow"; - break; - case ColorSpaceYCbCrRangeDawn::Full: - o << "ColorSpaceYCbCrRangeDawn::Full"; - break; - default: - o << "ColorSpaceYCbCrRangeDawn::" << 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: - o << "CompareFunction::Undefined"; - break; - case CompareFunction::Never: - o << "CompareFunction::Never"; - break; - 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::NotEqual: - o << "CompareFunction::NotEqual"; - break; - case CompareFunction::GreaterEqual: - o << "CompareFunction::GreaterEqual"; - break; - case CompareFunction::Always: - o << "CompareFunction::Always"; - break; - default: - o << "CompareFunction::" << 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, CompilationInfoRequestStatus value) { - switch (value) { - case CompilationInfoRequestStatus::Success: - o << "CompilationInfoRequestStatus::Success"; - break; - case CompilationInfoRequestStatus::CallbackCancelled: - o << "CompilationInfoRequestStatus::CallbackCancelled"; - break; - default: - o << "CompilationInfoRequestStatus::" << 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, CompilationMessageType value) { - switch (value) { - case CompilationMessageType::Error: - o << "CompilationMessageType::Error"; - break; - case CompilationMessageType::Warning: - o << "CompilationMessageType::Warning"; - break; - case CompilationMessageType::Info: - o << "CompilationMessageType::Info"; - break; - default: - o << "CompilationMessageType::" << 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, ComponentSwizzle value) { - switch (value) { - case ComponentSwizzle::Undefined: - o << "ComponentSwizzle::Undefined"; - break; - case ComponentSwizzle::Zero: - o << "ComponentSwizzle::Zero"; - break; - case ComponentSwizzle::One: - o << "ComponentSwizzle::One"; - break; - case ComponentSwizzle::R: - o << "ComponentSwizzle::R"; - break; - case ComponentSwizzle::G: - o << "ComponentSwizzle::G"; - break; - case ComponentSwizzle::B: - o << "ComponentSwizzle::B"; - break; - case ComponentSwizzle::A: - o << "ComponentSwizzle::A"; - break; - default: - o << "ComponentSwizzle::" << 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, CompositeAlphaMode value) { - switch (value) { - case CompositeAlphaMode::Auto: - o << "CompositeAlphaMode::Auto"; - break; - case CompositeAlphaMode::Opaque: - o << "CompositeAlphaMode::Opaque"; - break; - case CompositeAlphaMode::Premultiplied: - o << "CompositeAlphaMode::Premultiplied"; - break; - case CompositeAlphaMode::Unpremultiplied: - o << "CompositeAlphaMode::Unpremultiplied"; - break; - case CompositeAlphaMode::Inherit: - o << "CompositeAlphaMode::Inherit"; - break; - default: - o << "CompositeAlphaMode::" << 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::CallbackCancelled: - o << "CreatePipelineAsyncStatus::CallbackCancelled"; - break; - case CreatePipelineAsyncStatus::ValidationError: - o << "CreatePipelineAsyncStatus::ValidationError"; - break; - case CreatePipelineAsyncStatus::InternalError: - o << "CreatePipelineAsyncStatus::InternalError"; - break; - default: - o << "CreatePipelineAsyncStatus::" << 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, CullMode value) { - switch (value) { - case CullMode::Undefined: - o << "CullMode::Undefined"; - break; - case CullMode::None: - o << "CullMode::None"; - break; - case CullMode::Front: - o << "CullMode::Front"; - break; - case CullMode::Back: - o << "CullMode::Back"; - break; - default: - o << "CullMode::" << 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, DeviceLostReason value) { - switch (value) { - case DeviceLostReason::Unknown: - o << "DeviceLostReason::Unknown"; - break; - case DeviceLostReason::Destroyed: - o << "DeviceLostReason::Destroyed"; - break; - case DeviceLostReason::CallbackCancelled: - o << "DeviceLostReason::CallbackCancelled"; - break; - case DeviceLostReason::FailedCreation: - o << "DeviceLostReason::FailedCreation"; - break; - default: - o << "DeviceLostReason::" << 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, ErrorFilter value) { - switch (value) { - case ErrorFilter::Validation: - o << "ErrorFilter::Validation"; - break; - case ErrorFilter::OutOfMemory: - o << "ErrorFilter::OutOfMemory"; - break; - case ErrorFilter::Internal: - o << "ErrorFilter::Internal"; - break; - default: - o << "ErrorFilter::" << 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, ErrorType value) { - switch (value) { - case ErrorType::NoError: - o << "ErrorType::NoError"; - break; - case ErrorType::Validation: - o << "ErrorType::Validation"; - break; - case ErrorType::OutOfMemory: - o << "ErrorType::OutOfMemory"; - break; - case ErrorType::Internal: - o << "ErrorType::Internal"; - break; - case ErrorType::Unknown: - o << "ErrorType::Unknown"; - break; - default: - o << "ErrorType::" << 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, 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, FeatureLevel value) { - switch (value) { - case FeatureLevel::Undefined: - o << "FeatureLevel::Undefined"; - break; - case FeatureLevel::Compatibility: - o << "FeatureLevel::Compatibility"; - break; - case FeatureLevel::Core: - o << "FeatureLevel::Core"; - break; - default: - o << "FeatureLevel::" << 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::CoreFeaturesAndLimits: - o << "FeatureName::CoreFeaturesAndLimits"; - break; - case FeatureName::DepthClipControl: - o << "FeatureName::DepthClipControl"; - break; - case FeatureName::Depth32FloatStencil8: - o << "FeatureName::Depth32FloatStencil8"; - break; - case FeatureName::TextureCompressionBC: - o << "FeatureName::TextureCompressionBC"; - break; - case FeatureName::TextureCompressionBCSliced3D: - o << "FeatureName::TextureCompressionBCSliced3D"; - break; - case FeatureName::TextureCompressionETC2: - o << "FeatureName::TextureCompressionETC2"; - break; - case FeatureName::TextureCompressionASTC: - o << "FeatureName::TextureCompressionASTC"; - break; - case FeatureName::TextureCompressionASTCSliced3D: - o << "FeatureName::TextureCompressionASTCSliced3D"; - break; - case FeatureName::TimestampQuery: - o << "FeatureName::TimestampQuery"; - break; - case FeatureName::IndirectFirstInstance: - o << "FeatureName::IndirectFirstInstance"; - break; - case FeatureName::ShaderF16: - o << "FeatureName::ShaderF16"; - break; - case FeatureName::RG11B10UfloatRenderable: - o << "FeatureName::RG11B10UfloatRenderable"; - break; - case FeatureName::BGRA8UnormStorage: - o << "FeatureName::BGRA8UnormStorage"; - break; - case FeatureName::Float32Filterable: - o << "FeatureName::Float32Filterable"; - break; - case FeatureName::Float32Blendable: - o << "FeatureName::Float32Blendable"; - break; - case FeatureName::ClipDistances: - o << "FeatureName::ClipDistances"; - break; - case FeatureName::DualSourceBlending: - o << "FeatureName::DualSourceBlending"; - break; - case FeatureName::Subgroups: - o << "FeatureName::Subgroups"; - break; - case FeatureName::TextureFormatsTier1: - o << "FeatureName::TextureFormatsTier1"; - break; - case FeatureName::TextureFormatsTier2: - o << "FeatureName::TextureFormatsTier2"; - break; - case FeatureName::PrimitiveIndex: - o << "FeatureName::PrimitiveIndex"; - break; - case FeatureName::TextureComponentSwizzle: - o << "FeatureName::TextureComponentSwizzle"; - break; - case FeatureName::DawnInternalUsages: - o << "FeatureName::DawnInternalUsages"; - break; - case FeatureName::DawnMultiPlanarFormats: - o << "FeatureName::DawnMultiPlanarFormats"; - break; - case FeatureName::DawnNative: - o << "FeatureName::DawnNative"; - break; - case FeatureName::ChromiumExperimentalTimestampQueryInsidePasses: - o << "FeatureName::ChromiumExperimentalTimestampQueryInsidePasses"; - break; - case FeatureName::ImplicitDeviceSynchronization: - o << "FeatureName::ImplicitDeviceSynchronization"; - break; - case FeatureName::TransientAttachments: - o << "FeatureName::TransientAttachments"; - break; - case FeatureName::MSAARenderToSingleSampled: - o << "FeatureName::MSAARenderToSingleSampled"; - break; - case FeatureName::D3D11MultithreadProtected: - o << "FeatureName::D3D11MultithreadProtected"; - break; - case FeatureName::ANGLETextureSharing: - o << "FeatureName::ANGLETextureSharing"; - break; - case FeatureName::PixelLocalStorageCoherent: - o << "FeatureName::PixelLocalStorageCoherent"; - break; - case FeatureName::PixelLocalStorageNonCoherent: - o << "FeatureName::PixelLocalStorageNonCoherent"; - break; - case FeatureName::Unorm16TextureFormats: - o << "FeatureName::Unorm16TextureFormats"; - 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::AdapterPropertiesVk: - o << "FeatureName::AdapterPropertiesVk"; - break; - case FeatureName::DawnFormatCapabilities: - o << "FeatureName::DawnFormatCapabilities"; - break; - case FeatureName::DawnDrmFormatCapabilities: - o << "FeatureName::DawnDrmFormatCapabilities"; - break; - case FeatureName::MultiPlanarFormatNv16: - o << "FeatureName::MultiPlanarFormatNv16"; - break; - case FeatureName::MultiPlanarFormatNv24: - o << "FeatureName::MultiPlanarFormatNv24"; - break; - case FeatureName::MultiPlanarFormatP210: - o << "FeatureName::MultiPlanarFormatP210"; - break; - case FeatureName::MultiPlanarFormatP410: - o << "FeatureName::MultiPlanarFormatP410"; - break; - case FeatureName::SharedTextureMemoryVkDedicatedAllocation: - o << "FeatureName::SharedTextureMemoryVkDedicatedAllocation"; - break; - case FeatureName::SharedTextureMemoryAHardwareBuffer: - o << "FeatureName::SharedTextureMemoryAHardwareBuffer"; - break; - 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::SharedFenceSyncFD: - o << "FeatureName::SharedFenceSyncFD"; - 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; - case FeatureName::StaticSamplers: - o << "FeatureName::StaticSamplers"; - break; - case FeatureName::YCbCrVulkanSamplers: - o << "FeatureName::YCbCrVulkanSamplers"; - break; - case FeatureName::ShaderModuleCompilationOptions: - o << "FeatureName::ShaderModuleCompilationOptions"; - break; - case FeatureName::DawnLoadResolveTexture: - o << "FeatureName::DawnLoadResolveTexture"; - break; - case FeatureName::DawnPartialLoadResolveTexture: - o << "FeatureName::DawnPartialLoadResolveTexture"; - break; - case FeatureName::MultiDrawIndirect: - o << "FeatureName::MultiDrawIndirect"; - break; - case FeatureName::DawnTexelCopyBufferRowAlignment: - o << "FeatureName::DawnTexelCopyBufferRowAlignment"; - break; - case FeatureName::FlexibleTextureViews: - o << "FeatureName::FlexibleTextureViews"; - break; - case FeatureName::ChromiumExperimentalSubgroupMatrix: - o << "FeatureName::ChromiumExperimentalSubgroupMatrix"; - break; - case FeatureName::SharedFenceEGLSync: - o << "FeatureName::SharedFenceEGLSync"; - break; - case FeatureName::DawnDeviceAllocatorControl: - o << "FeatureName::DawnDeviceAllocatorControl"; - break; - case FeatureName::AdapterPropertiesWGPU: - o << "FeatureName::AdapterPropertiesWGPU"; - break; - case FeatureName::SharedBufferMemoryD3D12SharedMemoryFileMappingHandle: - o << "FeatureName::SharedBufferMemoryD3D12SharedMemoryFileMappingHandle"; - break; - case FeatureName::SharedTextureMemoryD3D12Resource: - o << "FeatureName::SharedTextureMemoryD3D12Resource"; - break; - case FeatureName::ChromiumExperimentalSamplingResourceTable: - o << "FeatureName::ChromiumExperimentalSamplingResourceTable"; - break; - case FeatureName::SubgroupSizeControl: - o << "FeatureName::SubgroupSizeControl"; - break; - case FeatureName::AtomicVec2uMinMax: - o << "FeatureName::AtomicVec2uMinMax"; - break; - case FeatureName::Unorm16FormatsForExternalTexture: - o << "FeatureName::Unorm16FormatsForExternalTexture"; - break; - case FeatureName::OpaqueYCbCrAndroidForExternalTexture: - o << "FeatureName::OpaqueYCbCrAndroidForExternalTexture"; - break; - case FeatureName::Unorm16Filterable: - o << "FeatureName::Unorm16Filterable"; - break; - case FeatureName::RenderPassRenderArea: - o << "FeatureName::RenderPassRenderArea"; - break; - case FeatureName::AdapterPropertiesDrm: - o << "FeatureName::AdapterPropertiesDrm"; - break; - default: - o << "FeatureName::" << 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, FilterMode value) { - switch (value) { - case FilterMode::Undefined: - o << "FilterMode::Undefined"; - break; - case FilterMode::Nearest: - o << "FilterMode::Nearest"; - break; - case FilterMode::Linear: - o << "FilterMode::Linear"; - break; - default: - o << "FilterMode::" << 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, FrontFace value) { - switch (value) { - case FrontFace::Undefined: - o << "FrontFace::Undefined"; - break; - case FrontFace::CCW: - o << "FrontFace::CCW"; - break; - case FrontFace::CW: - o << "FrontFace::CW"; - break; - default: - o << "FrontFace::" << 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, IndexFormat value) { - switch (value) { - case IndexFormat::Undefined: - o << "IndexFormat::Undefined"; - break; - case IndexFormat::Uint16: - o << "IndexFormat::Uint16"; - break; - case IndexFormat::Uint32: - o << "IndexFormat::Uint32"; - break; - default: - o << "IndexFormat::" << 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, InstanceFeatureName value) { - switch (value) { - case InstanceFeatureName::TimedWaitAny: - o << "InstanceFeatureName::TimedWaitAny"; - break; - case InstanceFeatureName::ShaderSourceSPIRV: - o << "InstanceFeatureName::ShaderSourceSPIRV"; - break; - case InstanceFeatureName::MultipleDevicesPerAdapter: - o << "InstanceFeatureName::MultipleDevicesPerAdapter"; - break; - default: - o << "InstanceFeatureName::" << 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, LoadOp value) { - switch (value) { - case LoadOp::Undefined: - o << "LoadOp::Undefined"; - break; - case LoadOp::Load: - o << "LoadOp::Load"; - break; - case LoadOp::Clear: - o << "LoadOp::Clear"; - break; - case LoadOp::ExpandResolveTexture: - o << "LoadOp::ExpandResolveTexture"; - break; - default: - o << "LoadOp::" << 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, LoggingType value) { - switch (value) { - case LoggingType::Verbose: - o << "LoggingType::Verbose"; - break; - case LoggingType::Info: - o << "LoggingType::Info"; - break; - case LoggingType::Warning: - o << "LoggingType::Warning"; - break; - case LoggingType::Error: - o << "LoggingType::Error"; - break; - default: - o << "LoggingType::" << 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, MapAsyncStatus value) { - switch (value) { - case MapAsyncStatus::Success: - o << "MapAsyncStatus::Success"; - break; - case MapAsyncStatus::CallbackCancelled: - o << "MapAsyncStatus::CallbackCancelled"; - break; - case MapAsyncStatus::Error: - o << "MapAsyncStatus::Error"; - break; - case MapAsyncStatus::Aborted: - o << "MapAsyncStatus::Aborted"; - break; - default: - o << "MapAsyncStatus::" << 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, MipmapFilterMode value) { - switch (value) { - case MipmapFilterMode::Undefined: - o << "MipmapFilterMode::Undefined"; - break; - case MipmapFilterMode::Nearest: - o << "MipmapFilterMode::Nearest"; - break; - case MipmapFilterMode::Linear: - o << "MipmapFilterMode::Linear"; - break; - 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 PopErrorScopeStatus::CallbackCancelled: - o << "PopErrorScopeStatus::CallbackCancelled"; - break; - case PopErrorScopeStatus::Error: - o << "PopErrorScopeStatus::Error"; - break; - default: - o << "PopErrorScopeStatus::" << 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, PowerPreference value) { - switch (value) { - case PowerPreference::Undefined: - o << "PowerPreference::Undefined"; - break; - case PowerPreference::LowPower: - o << "PowerPreference::LowPower"; - break; - case PowerPreference::HighPerformance: - o << "PowerPreference::HighPerformance"; - break; - default: - o << "PowerPreference::" << 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, PredefinedColorSpace value) { - switch (value) { - case PredefinedColorSpace::SRGB: - o << "PredefinedColorSpace::SRGB"; - break; - case PredefinedColorSpace::DisplayP3: - o << "PredefinedColorSpace::DisplayP3"; - break; - case PredefinedColorSpace::SRGBLinear: - o << "PredefinedColorSpace::SRGBLinear"; - break; - case PredefinedColorSpace::DisplayP3Linear: - o << "PredefinedColorSpace::DisplayP3Linear"; - break; - default: - o << "PredefinedColorSpace::" << 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, PresentMode value) { - switch (value) { - case PresentMode::Undefined: - o << "PresentMode::Undefined"; - break; - case PresentMode::Fifo: - o << "PresentMode::Fifo"; - break; - case PresentMode::FifoRelaxed: - o << "PresentMode::FifoRelaxed"; - break; - case PresentMode::Immediate: - o << "PresentMode::Immediate"; - break; - case PresentMode::Mailbox: - o << "PresentMode::Mailbox"; - break; - default: - o << "PresentMode::" << 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, PrimitiveTopology value) { - switch (value) { - case PrimitiveTopology::Undefined: - o << "PrimitiveTopology::Undefined"; - break; - case PrimitiveTopology::PointList: - o << "PrimitiveTopology::PointList"; - break; - case PrimitiveTopology::LineList: - o << "PrimitiveTopology::LineList"; - break; - case PrimitiveTopology::LineStrip: - o << "PrimitiveTopology::LineStrip"; - break; - case PrimitiveTopology::TriangleList: - o << "PrimitiveTopology::TriangleList"; - break; - case PrimitiveTopology::TriangleStrip: - o << "PrimitiveTopology::TriangleStrip"; - break; - default: - o << "PrimitiveTopology::" << 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, QueryType value) { - switch (value) { - case QueryType::Occlusion: - o << "QueryType::Occlusion"; - break; - case QueryType::Timestamp: - o << "QueryType::Timestamp"; - break; - default: - o << "QueryType::" << 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, QueueWorkDoneStatus value) { - switch (value) { - case QueueWorkDoneStatus::Success: - o << "QueueWorkDoneStatus::Success"; - break; - case QueueWorkDoneStatus::CallbackCancelled: - o << "QueueWorkDoneStatus::CallbackCancelled"; - break; - case QueueWorkDoneStatus::Error: - o << "QueueWorkDoneStatus::Error"; - break; - default: - o << "QueueWorkDoneStatus::" << 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::CallbackCancelled: - o << "RequestAdapterStatus::CallbackCancelled"; - break; - case RequestAdapterStatus::Unavailable: - o << "RequestAdapterStatus::Unavailable"; - break; - case RequestAdapterStatus::Error: - o << "RequestAdapterStatus::Error"; - break; - default: - o << "RequestAdapterStatus::" << 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, RequestDeviceStatus value) { - switch (value) { - case RequestDeviceStatus::Success: - o << "RequestDeviceStatus::Success"; - break; - case RequestDeviceStatus::CallbackCancelled: - o << "RequestDeviceStatus::CallbackCancelled"; - break; - case RequestDeviceStatus::Error: - o << "RequestDeviceStatus::Error"; - break; - default: - o << "RequestDeviceStatus::" << 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, SamplerBindingType value) { - switch (value) { - case SamplerBindingType::BindingNotUsed: - o << "SamplerBindingType::BindingNotUsed"; - break; - case SamplerBindingType::Undefined: - o << "SamplerBindingType::Undefined"; - break; - case SamplerBindingType::Filtering: - o << "SamplerBindingType::Filtering"; - break; - case SamplerBindingType::NonFiltering: - o << "SamplerBindingType::NonFiltering"; - break; - case SamplerBindingType::Comparison: - o << "SamplerBindingType::Comparison"; - break; - default: - o << "SamplerBindingType::" << 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, SharedFenceType value) { - switch (value) { - case SharedFenceType::VkSemaphoreOpaqueFD: - o << "SharedFenceType::VkSemaphoreOpaqueFD"; - break; - case SharedFenceType::SyncFD: - o << "SharedFenceType::SyncFD"; - break; - case SharedFenceType::VkSemaphoreZirconHandle: - o << "SharedFenceType::VkSemaphoreZirconHandle"; - break; - case SharedFenceType::DXGISharedHandle: - o << "SharedFenceType::DXGISharedHandle"; - break; - case SharedFenceType::MTLSharedEvent: - o << "SharedFenceType::MTLSharedEvent"; - break; - case SharedFenceType::EGLSync: - o << "SharedFenceType::EGLSync"; - 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, Status value) { - switch (value) { - case Status::Success: - o << "Status::Success"; - break; - case Status::Error: - o << "Status::Error"; - break; - default: - o << "Status::" << 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; - case StencilOperation::Zero: - o << "StencilOperation::Zero"; - break; - case StencilOperation::Replace: - o << "StencilOperation::Replace"; - break; - case StencilOperation::Invert: - o << "StencilOperation::Invert"; - break; - case StencilOperation::IncrementClamp: - o << "StencilOperation::IncrementClamp"; - break; - case StencilOperation::DecrementClamp: - o << "StencilOperation::DecrementClamp"; - break; - case StencilOperation::IncrementWrap: - o << "StencilOperation::IncrementWrap"; - break; - case StencilOperation::DecrementWrap: - o << "StencilOperation::DecrementWrap"; - break; - default: - o << "StencilOperation::" << 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, StorageTextureAccess value) { - switch (value) { - case StorageTextureAccess::BindingNotUsed: - o << "StorageTextureAccess::BindingNotUsed"; - break; - case StorageTextureAccess::Undefined: - o << "StorageTextureAccess::Undefined"; - 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); - } - return o; - } - template - std::basic_ostream& operator<<(std::basic_ostream& o, StoreOp value) { - switch (value) { - case StoreOp::Undefined: - o << "StoreOp::Undefined"; - break; - case StoreOp::Store: - o << "StoreOp::Store"; - break; - case StoreOp::Discard: - o << "StoreOp::Discard"; - break; - default: - o << "StoreOp::" << 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, SType value) { - switch (value) { - case SType::ShaderSourceSPIRV: - o << "SType::ShaderSourceSPIRV"; - break; - case SType::ShaderSourceWGSL: - o << "SType::ShaderSourceWGSL"; - break; - case SType::RenderPassMaxDrawCount: - o << "SType::RenderPassMaxDrawCount"; - break; - case SType::SurfaceSourceMetalLayer: - o << "SType::SurfaceSourceMetalLayer"; - break; - case SType::SurfaceSourceWindowsHWND: - o << "SType::SurfaceSourceWindowsHWND"; - break; - case SType::SurfaceSourceXlibWindow: - o << "SType::SurfaceSourceXlibWindow"; - break; - case SType::SurfaceSourceWaylandSurface: - o << "SType::SurfaceSourceWaylandSurface"; - break; - case SType::SurfaceSourceAndroidNativeWindow: - o << "SType::SurfaceSourceAndroidNativeWindow"; - break; - case SType::SurfaceSourceXCBWindow: - o << "SType::SurfaceSourceXCBWindow"; - break; - case SType::SurfaceColorManagement: - o << "SType::SurfaceColorManagement"; - break; - case SType::RequestAdapterWebXROptions: - o << "SType::RequestAdapterWebXROptions"; - break; - case SType::TextureComponentSwizzleDescriptor: - o << "SType::TextureComponentSwizzleDescriptor"; - break; - case SType::ExternalTextureBindingLayout: - o << "SType::ExternalTextureBindingLayout"; - break; - case SType::ExternalTextureBindingEntry: - o << "SType::ExternalTextureBindingEntry"; - break; - case SType::CompatibilityModeLimits: - o << "SType::CompatibilityModeLimits"; - break; - case SType::TextureBindingViewDimension: - o << "SType::TextureBindingViewDimension"; - break; - case SType::SurfaceDescriptorFromWindowsCoreWindow: - o << "SType::SurfaceDescriptorFromWindowsCoreWindow"; - break; - case SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel: - o << "SType::SurfaceDescriptorFromWindowsUWPSwapChainPanel"; - break; - case SType::DawnTextureInternalUsageDescriptor: - o << "SType::DawnTextureInternalUsageDescriptor"; - break; - case SType::DawnEncoderInternalUsageDescriptor: - o << "SType::DawnEncoderInternalUsageDescriptor"; - break; - case SType::DawnInstanceDescriptor: - o << "SType::DawnInstanceDescriptor"; - break; - case SType::DawnCacheDeviceDescriptor: - o << "SType::DawnCacheDeviceDescriptor"; - 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::DawnRenderPassSampleCount: - o << "SType::DawnRenderPassSampleCount"; - break; - case SType::RenderPassPixelLocalStorage: - o << "SType::RenderPassPixelLocalStorage"; - break; - case SType::PipelineLayoutPixelLocalStorage: - o << "SType::PipelineLayoutPixelLocalStorage"; - break; - case SType::BufferHostMappedPointer: - o << "SType::BufferHostMappedPointer"; - break; - case SType::AdapterPropertiesMemoryHeaps: - o << "SType::AdapterPropertiesMemoryHeaps"; - break; - case SType::AdapterPropertiesD3D: - o << "SType::AdapterPropertiesD3D"; - break; - case SType::AdapterPropertiesVk: - o << "SType::AdapterPropertiesVk"; - break; - case SType::DawnWireWGSLControl: - o << "SType::DawnWireWGSLControl"; - break; - case SType::DawnWGSLBlocklist: - o << "SType::DawnWGSLBlocklist"; - break; - case SType::DawnDrmFormatCapabilities: - o << "SType::DawnDrmFormatCapabilities"; - break; - case SType::ShaderModuleCompilationOptions: - o << "SType::ShaderModuleCompilationOptions"; - break; - case SType::ColorTargetStateExpandResolveTextureDawn: - o << "SType::ColorTargetStateExpandResolveTextureDawn"; - break; - case SType::RenderPassRenderAreaRect: - o << "SType::RenderPassRenderAreaRect"; - 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::SharedTextureMemoryD3DSwapchainBeginState: - o << "SType::SharedTextureMemoryD3DSwapchainBeginState"; - break; - case SType::SharedFenceVkSemaphoreOpaqueFDDescriptor: - o << "SType::SharedFenceVkSemaphoreOpaqueFDDescriptor"; - break; - case SType::SharedFenceVkSemaphoreOpaqueFDExportInfo: - o << "SType::SharedFenceVkSemaphoreOpaqueFDExportInfo"; - break; - case SType::SharedFenceSyncFDDescriptor: - o << "SType::SharedFenceSyncFDDescriptor"; - break; - case SType::SharedFenceSyncFDExportInfo: - o << "SType::SharedFenceSyncFDExportInfo"; - 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; - case SType::StaticSamplerBindingLayout: - o << "SType::StaticSamplerBindingLayout"; - break; - case SType::YCbCrVkDescriptor: - o << "SType::YCbCrVkDescriptor"; - break; - case SType::SharedTextureMemoryAHardwareBufferProperties: - o << "SType::SharedTextureMemoryAHardwareBufferProperties"; - break; - case SType::AHardwareBufferProperties: - o << "SType::AHardwareBufferProperties"; - break; - case SType::DawnTexelCopyBufferRowAlignmentLimits: - o << "SType::DawnTexelCopyBufferRowAlignmentLimits"; - break; - case SType::AdapterPropertiesSubgroupMatrixConfigs: - o << "SType::AdapterPropertiesSubgroupMatrixConfigs"; - break; - case SType::SharedFenceEGLSyncDescriptor: - o << "SType::SharedFenceEGLSyncDescriptor"; - break; - case SType::SharedFenceEGLSyncExportInfo: - o << "SType::SharedFenceEGLSyncExportInfo"; - break; - case SType::DawnInjectedInvalidSType: - o << "SType::DawnInjectedInvalidSType"; - break; - case SType::DawnCompilationMessageUtf16: - o << "SType::DawnCompilationMessageUtf16"; - break; - case SType::DawnFakeBufferOOMForTesting: - o << "SType::DawnFakeBufferOOMForTesting"; - break; - case SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel: - o << "SType::SurfaceDescriptorFromWindowsWinUISwapChainPanel"; - break; - case SType::DawnDeviceAllocatorControl: - o << "SType::DawnDeviceAllocatorControl"; - break; - case SType::DawnHostMappedPointerLimits: - o << "SType::DawnHostMappedPointerLimits"; - break; - case SType::RenderPassDescriptorResolveRect: - o << "SType::RenderPassDescriptorResolveRect"; - break; - case SType::RequestAdapterWebGPUBackendOptions: - o << "SType::RequestAdapterWebGPUBackendOptions"; - break; - case SType::DawnFakeDeviceInitializeErrorForTesting: - o << "SType::DawnFakeDeviceInitializeErrorForTesting"; - break; - case SType::SharedTextureMemoryD3D11BeginState: - o << "SType::SharedTextureMemoryD3D11BeginState"; - break; - case SType::DawnConsumeAdapterDescriptor: - o << "SType::DawnConsumeAdapterDescriptor"; - break; - case SType::TexelBufferBindingEntry: - o << "SType::TexelBufferBindingEntry"; - break; - case SType::TexelBufferBindingLayout: - o << "SType::TexelBufferBindingLayout"; - break; - case SType::SharedTextureMemoryMetalEndAccessState: - o << "SType::SharedTextureMemoryMetalEndAccessState"; - break; - case SType::AdapterPropertiesWGPU: - o << "SType::AdapterPropertiesWGPU"; - break; - case SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor: - o << "SType::SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor"; - break; - case SType::SharedTextureMemoryD3D12ResourceDescriptor: - o << "SType::SharedTextureMemoryD3D12ResourceDescriptor"; - break; - case SType::RequestAdapterOptionsAngleVirtualizationGroup: - o << "SType::RequestAdapterOptionsAngleVirtualizationGroup"; - break; - case SType::PipelineLayoutResourceTable: - o << "SType::PipelineLayoutResourceTable"; - break; - case SType::AdapterPropertiesDrm: - o << "SType::AdapterPropertiesDrm"; - break; - default: - o << "SType::" << 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, SubgroupMatrixComponentType value) { - switch (value) { - case SubgroupMatrixComponentType::F32: - o << "SubgroupMatrixComponentType::F32"; - break; - case SubgroupMatrixComponentType::F16: - o << "SubgroupMatrixComponentType::F16"; - break; - case SubgroupMatrixComponentType::U32: - o << "SubgroupMatrixComponentType::U32"; - break; - case SubgroupMatrixComponentType::I32: - o << "SubgroupMatrixComponentType::I32"; - break; - case SubgroupMatrixComponentType::U8: - o << "SubgroupMatrixComponentType::U8"; - break; - case SubgroupMatrixComponentType::I8: - o << "SubgroupMatrixComponentType::I8"; - break; - default: - o << "SubgroupMatrixComponentType::" << 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, SurfaceGetCurrentTextureStatus value) { - switch (value) { - case SurfaceGetCurrentTextureStatus::SuccessOptimal: - o << "SurfaceGetCurrentTextureStatus::SuccessOptimal"; - break; - case SurfaceGetCurrentTextureStatus::SuccessSuboptimal: - o << "SurfaceGetCurrentTextureStatus::SuccessSuboptimal"; - break; - case SurfaceGetCurrentTextureStatus::Timeout: - o << "SurfaceGetCurrentTextureStatus::Timeout"; - break; - case SurfaceGetCurrentTextureStatus::Outdated: - o << "SurfaceGetCurrentTextureStatus::Outdated"; - break; - case SurfaceGetCurrentTextureStatus::Lost: - o << "SurfaceGetCurrentTextureStatus::Lost"; - break; - case SurfaceGetCurrentTextureStatus::Error: - o << "SurfaceGetCurrentTextureStatus::Error"; - break; - default: - o << "SurfaceGetCurrentTextureStatus::" << 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, TexelBufferAccess value) { - switch (value) { - case TexelBufferAccess::Undefined: - o << "TexelBufferAccess::Undefined"; - break; - case TexelBufferAccess::ReadOnly: - o << "TexelBufferAccess::ReadOnly"; - break; - case TexelBufferAccess::ReadWrite: - o << "TexelBufferAccess::ReadWrite"; - break; - default: - o << "TexelBufferAccess::" << 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, TextureAspect value) { - switch (value) { - case TextureAspect::Undefined: - o << "TextureAspect::Undefined"; - break; - case TextureAspect::All: - o << "TextureAspect::All"; - break; - case TextureAspect::StencilOnly: - o << "TextureAspect::StencilOnly"; - break; - case TextureAspect::DepthOnly: - o << "TextureAspect::DepthOnly"; - break; - case TextureAspect::Plane0Only: - o << "TextureAspect::Plane0Only"; - break; - case TextureAspect::Plane1Only: - o << "TextureAspect::Plane1Only"; - break; - case TextureAspect::Plane2Only: - o << "TextureAspect::Plane2Only"; - 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, TextureDimension value) { - switch (value) { - case TextureDimension::Undefined: - o << "TextureDimension::Undefined"; - break; - case TextureDimension::e1D: - o << "TextureDimension::e1D"; - break; - case TextureDimension::e2D: - o << "TextureDimension::e2D"; - break; - case TextureDimension::e3D: - o << "TextureDimension::e3D"; - break; - default: - o << "TextureDimension::" << 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, TextureFormat value) { - switch (value) { - case TextureFormat::Undefined: - o << "TextureFormat::Undefined"; - break; - case TextureFormat::R8Unorm: - o << "TextureFormat::R8Unorm"; - break; - case TextureFormat::R8Snorm: - o << "TextureFormat::R8Snorm"; - break; - case TextureFormat::R8Uint: - o << "TextureFormat::R8Uint"; - break; - case TextureFormat::R8Sint: - o << "TextureFormat::R8Sint"; - break; - case TextureFormat::R16Unorm: - o << "TextureFormat::R16Unorm"; - break; - case TextureFormat::R16Snorm: - o << "TextureFormat::R16Snorm"; - break; - case TextureFormat::R16Uint: - o << "TextureFormat::R16Uint"; - break; - case TextureFormat::R16Sint: - o << "TextureFormat::R16Sint"; - break; - case TextureFormat::R16Float: - o << "TextureFormat::R16Float"; - break; - case TextureFormat::RG8Unorm: - o << "TextureFormat::RG8Unorm"; - break; - case TextureFormat::RG8Snorm: - o << "TextureFormat::RG8Snorm"; - break; - case TextureFormat::RG8Uint: - o << "TextureFormat::RG8Uint"; - break; - case TextureFormat::RG8Sint: - o << "TextureFormat::RG8Sint"; - break; - case TextureFormat::R32Float: - o << "TextureFormat::R32Float"; - break; - case TextureFormat::R32Uint: - o << "TextureFormat::R32Uint"; - break; - case TextureFormat::R32Sint: - o << "TextureFormat::R32Sint"; - break; - case TextureFormat::RG16Unorm: - o << "TextureFormat::RG16Unorm"; - break; - case TextureFormat::RG16Snorm: - o << "TextureFormat::RG16Snorm"; - break; - case TextureFormat::RG16Uint: - o << "TextureFormat::RG16Uint"; - break; - case TextureFormat::RG16Sint: - o << "TextureFormat::RG16Sint"; - break; - case TextureFormat::RG16Float: - o << "TextureFormat::RG16Float"; - break; - case TextureFormat::RGBA8Unorm: - o << "TextureFormat::RGBA8Unorm"; - break; - case TextureFormat::RGBA8UnormSrgb: - o << "TextureFormat::RGBA8UnormSrgb"; - break; - case TextureFormat::RGBA8Snorm: - o << "TextureFormat::RGBA8Snorm"; - break; - case TextureFormat::RGBA8Uint: - o << "TextureFormat::RGBA8Uint"; - break; - case TextureFormat::RGBA8Sint: - o << "TextureFormat::RGBA8Sint"; - break; - case TextureFormat::BGRA8Unorm: - o << "TextureFormat::BGRA8Unorm"; - break; - case TextureFormat::BGRA8UnormSrgb: - o << "TextureFormat::BGRA8UnormSrgb"; - break; - case TextureFormat::RGB10A2Uint: - o << "TextureFormat::RGB10A2Uint"; - break; - case TextureFormat::RGB10A2Unorm: - o << "TextureFormat::RGB10A2Unorm"; - break; - case TextureFormat::RG11B10Ufloat: - o << "TextureFormat::RG11B10Ufloat"; - break; - case TextureFormat::RGB9E5Ufloat: - o << "TextureFormat::RGB9E5Ufloat"; - break; - case TextureFormat::RG32Float: - o << "TextureFormat::RG32Float"; - break; - case TextureFormat::RG32Uint: - o << "TextureFormat::RG32Uint"; - break; - case TextureFormat::RG32Sint: - o << "TextureFormat::RG32Sint"; - break; - case TextureFormat::RGBA16Unorm: - o << "TextureFormat::RGBA16Unorm"; - break; - case TextureFormat::RGBA16Snorm: - o << "TextureFormat::RGBA16Snorm"; - break; - case TextureFormat::RGBA16Uint: - o << "TextureFormat::RGBA16Uint"; - break; - case TextureFormat::RGBA16Sint: - o << "TextureFormat::RGBA16Sint"; - break; - case TextureFormat::RGBA16Float: - o << "TextureFormat::RGBA16Float"; - break; - case TextureFormat::RGBA32Float: - o << "TextureFormat::RGBA32Float"; - break; - case TextureFormat::RGBA32Uint: - o << "TextureFormat::RGBA32Uint"; - break; - case TextureFormat::RGBA32Sint: - o << "TextureFormat::RGBA32Sint"; - break; - case TextureFormat::Stencil8: - o << "TextureFormat::Stencil8"; - break; - case TextureFormat::Depth16Unorm: - o << "TextureFormat::Depth16Unorm"; - break; - case TextureFormat::Depth24Plus: - o << "TextureFormat::Depth24Plus"; - break; - case TextureFormat::Depth24PlusStencil8: - o << "TextureFormat::Depth24PlusStencil8"; - break; - case TextureFormat::Depth32Float: - o << "TextureFormat::Depth32Float"; - break; - case TextureFormat::Depth32FloatStencil8: - o << "TextureFormat::Depth32FloatStencil8"; - break; - case TextureFormat::BC1RGBAUnorm: - o << "TextureFormat::BC1RGBAUnorm"; - break; - case TextureFormat::BC1RGBAUnormSrgb: - o << "TextureFormat::BC1RGBAUnormSrgb"; - break; - case TextureFormat::BC2RGBAUnorm: - o << "TextureFormat::BC2RGBAUnorm"; - break; - case TextureFormat::BC2RGBAUnormSrgb: - o << "TextureFormat::BC2RGBAUnormSrgb"; - break; - case TextureFormat::BC3RGBAUnorm: - o << "TextureFormat::BC3RGBAUnorm"; - break; - case TextureFormat::BC3RGBAUnormSrgb: - o << "TextureFormat::BC3RGBAUnormSrgb"; - break; - case TextureFormat::BC4RUnorm: - o << "TextureFormat::BC4RUnorm"; - break; - case TextureFormat::BC4RSnorm: - o << "TextureFormat::BC4RSnorm"; - break; - case TextureFormat::BC5RGUnorm: - o << "TextureFormat::BC5RGUnorm"; - break; - case TextureFormat::BC5RGSnorm: - o << "TextureFormat::BC5RGSnorm"; - break; - case TextureFormat::BC6HRGBUfloat: - o << "TextureFormat::BC6HRGBUfloat"; - break; - case TextureFormat::BC6HRGBFloat: - o << "TextureFormat::BC6HRGBFloat"; - break; - case TextureFormat::BC7RGBAUnorm: - o << "TextureFormat::BC7RGBAUnorm"; - break; - case TextureFormat::BC7RGBAUnormSrgb: - o << "TextureFormat::BC7RGBAUnormSrgb"; - break; - case TextureFormat::ETC2RGB8Unorm: - o << "TextureFormat::ETC2RGB8Unorm"; - break; - case TextureFormat::ETC2RGB8UnormSrgb: - o << "TextureFormat::ETC2RGB8UnormSrgb"; - break; - case TextureFormat::ETC2RGB8A1Unorm: - o << "TextureFormat::ETC2RGB8A1Unorm"; - break; - case TextureFormat::ETC2RGB8A1UnormSrgb: - o << "TextureFormat::ETC2RGB8A1UnormSrgb"; - break; - case TextureFormat::ETC2RGBA8Unorm: - o << "TextureFormat::ETC2RGBA8Unorm"; - break; - case TextureFormat::ETC2RGBA8UnormSrgb: - o << "TextureFormat::ETC2RGBA8UnormSrgb"; - break; - case TextureFormat::EACR11Unorm: - o << "TextureFormat::EACR11Unorm"; - break; - case TextureFormat::EACR11Snorm: - o << "TextureFormat::EACR11Snorm"; - break; - case TextureFormat::EACRG11Unorm: - o << "TextureFormat::EACRG11Unorm"; - break; - case TextureFormat::EACRG11Snorm: - o << "TextureFormat::EACRG11Snorm"; - break; - case TextureFormat::ASTC4x4Unorm: - o << "TextureFormat::ASTC4x4Unorm"; - break; - case TextureFormat::ASTC4x4UnormSrgb: - o << "TextureFormat::ASTC4x4UnormSrgb"; - break; - case TextureFormat::ASTC5x4Unorm: - o << "TextureFormat::ASTC5x4Unorm"; - break; - case TextureFormat::ASTC5x4UnormSrgb: - o << "TextureFormat::ASTC5x4UnormSrgb"; - break; - case TextureFormat::ASTC5x5Unorm: - o << "TextureFormat::ASTC5x5Unorm"; - break; - case TextureFormat::ASTC5x5UnormSrgb: - o << "TextureFormat::ASTC5x5UnormSrgb"; - break; - case TextureFormat::ASTC6x5Unorm: - o << "TextureFormat::ASTC6x5Unorm"; - break; - case TextureFormat::ASTC6x5UnormSrgb: - o << "TextureFormat::ASTC6x5UnormSrgb"; - break; - case TextureFormat::ASTC6x6Unorm: - o << "TextureFormat::ASTC6x6Unorm"; - break; - case TextureFormat::ASTC6x6UnormSrgb: - o << "TextureFormat::ASTC6x6UnormSrgb"; - break; - case TextureFormat::ASTC8x5Unorm: - o << "TextureFormat::ASTC8x5Unorm"; - break; - case TextureFormat::ASTC8x5UnormSrgb: - o << "TextureFormat::ASTC8x5UnormSrgb"; - break; - case TextureFormat::ASTC8x6Unorm: - o << "TextureFormat::ASTC8x6Unorm"; - break; - case TextureFormat::ASTC8x6UnormSrgb: - o << "TextureFormat::ASTC8x6UnormSrgb"; - break; - case TextureFormat::ASTC8x8Unorm: - o << "TextureFormat::ASTC8x8Unorm"; - break; - case TextureFormat::ASTC8x8UnormSrgb: - o << "TextureFormat::ASTC8x8UnormSrgb"; - break; - case TextureFormat::ASTC10x5Unorm: - o << "TextureFormat::ASTC10x5Unorm"; - break; - case TextureFormat::ASTC10x5UnormSrgb: - o << "TextureFormat::ASTC10x5UnormSrgb"; - break; - case TextureFormat::ASTC10x6Unorm: - o << "TextureFormat::ASTC10x6Unorm"; - break; - case TextureFormat::ASTC10x6UnormSrgb: - o << "TextureFormat::ASTC10x6UnormSrgb"; - break; - case TextureFormat::ASTC10x8Unorm: - o << "TextureFormat::ASTC10x8Unorm"; - break; - case TextureFormat::ASTC10x8UnormSrgb: - o << "TextureFormat::ASTC10x8UnormSrgb"; - break; - case TextureFormat::ASTC10x10Unorm: - o << "TextureFormat::ASTC10x10Unorm"; - break; - case TextureFormat::ASTC10x10UnormSrgb: - o << "TextureFormat::ASTC10x10UnormSrgb"; - break; - case TextureFormat::ASTC12x10Unorm: - o << "TextureFormat::ASTC12x10Unorm"; - break; - case TextureFormat::ASTC12x10UnormSrgb: - o << "TextureFormat::ASTC12x10UnormSrgb"; - break; - case TextureFormat::ASTC12x12Unorm: - o << "TextureFormat::ASTC12x12Unorm"; - break; - case TextureFormat::ASTC12x12UnormSrgb: - o << "TextureFormat::ASTC12x12UnormSrgb"; - break; - case TextureFormat::R8BG8Biplanar420Unorm: - o << "TextureFormat::R8BG8Biplanar420Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar420Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar420Unorm"; - break; - case TextureFormat::R8BG8A8Triplanar420Unorm: - o << "TextureFormat::R8BG8A8Triplanar420Unorm"; - break; - case TextureFormat::R8BG8Biplanar422Unorm: - o << "TextureFormat::R8BG8Biplanar422Unorm"; - break; - case TextureFormat::R8BG8Biplanar444Unorm: - o << "TextureFormat::R8BG8Biplanar444Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar422Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar422Unorm"; - break; - case TextureFormat::R10X6BG10X6Biplanar444Unorm: - o << "TextureFormat::R10X6BG10X6Biplanar444Unorm"; - break; - case TextureFormat::OpaqueYCbCrAndroid: - o << "TextureFormat::OpaqueYCbCrAndroid"; - break; - default: - o << "TextureFormat::" << 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, TextureSampleType value) { - switch (value) { - case TextureSampleType::BindingNotUsed: - o << "TextureSampleType::BindingNotUsed"; - break; - case TextureSampleType::Undefined: - o << "TextureSampleType::Undefined"; - break; - case TextureSampleType::Float: - o << "TextureSampleType::Float"; - break; - case TextureSampleType::UnfilterableFloat: - o << "TextureSampleType::UnfilterableFloat"; - break; - case TextureSampleType::Depth: - o << "TextureSampleType::Depth"; - break; - case TextureSampleType::Sint: - o << "TextureSampleType::Sint"; - break; - case TextureSampleType::Uint: - o << "TextureSampleType::Uint"; - break; - default: - o << "TextureSampleType::" << 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, TextureViewDimension value) { - switch (value) { - case TextureViewDimension::Undefined: - o << "TextureViewDimension::Undefined"; - break; - case TextureViewDimension::e1D: - o << "TextureViewDimension::e1D"; - break; - case TextureViewDimension::e2D: - o << "TextureViewDimension::e2D"; - break; - case TextureViewDimension::e2DArray: - o << "TextureViewDimension::e2DArray"; - break; - case TextureViewDimension::Cube: - o << "TextureViewDimension::Cube"; - break; - case TextureViewDimension::CubeArray: - o << "TextureViewDimension::CubeArray"; - break; - case TextureViewDimension::e3D: - o << "TextureViewDimension::e3D"; - break; - default: - o << "TextureViewDimension::" << 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, ToneMappingMode value) { - switch (value) { - case ToneMappingMode::Standard: - o << "ToneMappingMode::Standard"; - break; - case ToneMappingMode::Extended: - o << "ToneMappingMode::Extended"; - break; - default: - o << "ToneMappingMode::" << 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, VertexFormat value) { - switch (value) { - case VertexFormat::Uint8: - o << "VertexFormat::Uint8"; - break; - case VertexFormat::Uint8x2: - o << "VertexFormat::Uint8x2"; - break; - case VertexFormat::Uint8x4: - o << "VertexFormat::Uint8x4"; - break; - case VertexFormat::Sint8: - o << "VertexFormat::Sint8"; - break; - case VertexFormat::Sint8x2: - o << "VertexFormat::Sint8x2"; - break; - case VertexFormat::Sint8x4: - o << "VertexFormat::Sint8x4"; - break; - case VertexFormat::Unorm8: - o << "VertexFormat::Unorm8"; - break; - case VertexFormat::Unorm8x2: - o << "VertexFormat::Unorm8x2"; - break; - case VertexFormat::Unorm8x4: - o << "VertexFormat::Unorm8x4"; - break; - case VertexFormat::Snorm8: - o << "VertexFormat::Snorm8"; - break; - case VertexFormat::Snorm8x2: - o << "VertexFormat::Snorm8x2"; - break; - case VertexFormat::Snorm8x4: - o << "VertexFormat::Snorm8x4"; - break; - case VertexFormat::Uint16: - o << "VertexFormat::Uint16"; - break; - case VertexFormat::Uint16x2: - o << "VertexFormat::Uint16x2"; - break; - case VertexFormat::Uint16x4: - o << "VertexFormat::Uint16x4"; - break; - case VertexFormat::Sint16: - o << "VertexFormat::Sint16"; - break; - case VertexFormat::Sint16x2: - o << "VertexFormat::Sint16x2"; - break; - case VertexFormat::Sint16x4: - o << "VertexFormat::Sint16x4"; - break; - case VertexFormat::Unorm16: - o << "VertexFormat::Unorm16"; - break; - case VertexFormat::Unorm16x2: - o << "VertexFormat::Unorm16x2"; - break; - case VertexFormat::Unorm16x4: - o << "VertexFormat::Unorm16x4"; - break; - case VertexFormat::Snorm16: - o << "VertexFormat::Snorm16"; - break; - case VertexFormat::Snorm16x2: - o << "VertexFormat::Snorm16x2"; - break; - case VertexFormat::Snorm16x4: - o << "VertexFormat::Snorm16x4"; - break; - case VertexFormat::Float16: - o << "VertexFormat::Float16"; - break; - case VertexFormat::Float16x2: - o << "VertexFormat::Float16x2"; - break; - case VertexFormat::Float16x4: - o << "VertexFormat::Float16x4"; - break; - case VertexFormat::Float32: - o << "VertexFormat::Float32"; - break; - case VertexFormat::Float32x2: - o << "VertexFormat::Float32x2"; - break; - case VertexFormat::Float32x3: - o << "VertexFormat::Float32x3"; - break; - case VertexFormat::Float32x4: - o << "VertexFormat::Float32x4"; - break; - case VertexFormat::Uint32: - o << "VertexFormat::Uint32"; - break; - case VertexFormat::Uint32x2: - o << "VertexFormat::Uint32x2"; - break; - case VertexFormat::Uint32x3: - o << "VertexFormat::Uint32x3"; - break; - case VertexFormat::Uint32x4: - o << "VertexFormat::Uint32x4"; - break; - case VertexFormat::Sint32: - o << "VertexFormat::Sint32"; - break; - case VertexFormat::Sint32x2: - o << "VertexFormat::Sint32x2"; - break; - case VertexFormat::Sint32x3: - o << "VertexFormat::Sint32x3"; - break; - case VertexFormat::Sint32x4: - o << "VertexFormat::Sint32x4"; - break; - case VertexFormat::Unorm10_10_10_2: - o << "VertexFormat::Unorm10_10_10_2"; - break; - case VertexFormat::Unorm8x4BGRA: - o << "VertexFormat::Unorm8x4BGRA"; - break; - default: - o << "VertexFormat::" << 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, VertexStepMode value) { - switch (value) { - case VertexStepMode::Undefined: - o << "VertexStepMode::Undefined"; - break; - case VertexStepMode::Vertex: - o << "VertexStepMode::Vertex"; - break; - case VertexStepMode::Instance: - o << "VertexStepMode::Instance"; - 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::Error: - o << "WaitStatus::Error"; - 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, WGSLLanguageFeatureName value) { - switch (value) { - case WGSLLanguageFeatureName::ReadonlyAndReadwriteStorageTextures: - o << "WGSLLanguageFeatureName::ReadonlyAndReadwriteStorageTextures"; - break; - case WGSLLanguageFeatureName::Packed4x8IntegerDotProduct: - o << "WGSLLanguageFeatureName::Packed4x8IntegerDotProduct"; - break; - case WGSLLanguageFeatureName::UnrestrictedPointerParameters: - o << "WGSLLanguageFeatureName::UnrestrictedPointerParameters"; - break; - case WGSLLanguageFeatureName::PointerCompositeAccess: - o << "WGSLLanguageFeatureName::PointerCompositeAccess"; - break; - case WGSLLanguageFeatureName::UniformBufferStandardLayout: - o << "WGSLLanguageFeatureName::UniformBufferStandardLayout"; - break; - case WGSLLanguageFeatureName::SubgroupId: - o << "WGSLLanguageFeatureName::SubgroupId"; - break; - case WGSLLanguageFeatureName::TextureAndSamplerLet: - o << "WGSLLanguageFeatureName::TextureAndSamplerLet"; - break; - case WGSLLanguageFeatureName::SubgroupUniformity: - o << "WGSLLanguageFeatureName::SubgroupUniformity"; - break; - case WGSLLanguageFeatureName::TextureFormatsTier1: - o << "WGSLLanguageFeatureName::TextureFormatsTier1"; - break; - case WGSLLanguageFeatureName::LinearIndexing: - o << "WGSLLanguageFeatureName::LinearIndexing"; - break; - case WGSLLanguageFeatureName::ImmediateAddressSpace: - o << "WGSLLanguageFeatureName::ImmediateAddressSpace"; - break; - case WGSLLanguageFeatureName::ChromiumTestingUnimplemented: - o << "WGSLLanguageFeatureName::ChromiumTestingUnimplemented"; - break; - case WGSLLanguageFeatureName::ChromiumTestingUnsafeExperimental: - o << "WGSLLanguageFeatureName::ChromiumTestingUnsafeExperimental"; - break; - case WGSLLanguageFeatureName::ChromiumTestingExperimental: - o << "WGSLLanguageFeatureName::ChromiumTestingExperimental"; - break; - case WGSLLanguageFeatureName::ChromiumTestingShippedWithKillswitch: - o << "WGSLLanguageFeatureName::ChromiumTestingShippedWithKillswitch"; - break; - case WGSLLanguageFeatureName::ChromiumTestingShipped: - o << "WGSLLanguageFeatureName::ChromiumTestingShipped"; - break; - case WGSLLanguageFeatureName::SizedBindingArray: - o << "WGSLLanguageFeatureName::SizedBindingArray"; - break; - case WGSLLanguageFeatureName::TexelBuffers: - o << "WGSLLanguageFeatureName::TexelBuffers"; - break; - case WGSLLanguageFeatureName::ChromiumPrint: - o << "WGSLLanguageFeatureName::ChromiumPrint"; - break; - case WGSLLanguageFeatureName::FragmentDepth: - o << "WGSLLanguageFeatureName::FragmentDepth"; - break; - case WGSLLanguageFeatureName::BufferView: - o << "WGSLLanguageFeatureName::BufferView"; - break; - case WGSLLanguageFeatureName::SwizzleAssignment: - o << "WGSLLanguageFeatureName::SwizzleAssignment"; - break; - default: - o << "WGSLLanguageFeatureName::" << 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) { - o << "BufferUsage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & BufferUsage::MapRead) { - if (!first) { - o << "|"; - } - first = false; - o << "MapRead"; - value &= ~BufferUsage::MapRead; - } - if (value & BufferUsage::MapWrite) { - if (!first) { - o << "|"; - } - first = false; - o << "MapWrite"; - value &= ~BufferUsage::MapWrite; - } - if (value & BufferUsage::CopySrc) { - if (!first) { - o << "|"; - } - first = false; - o << "CopySrc"; - value &= ~BufferUsage::CopySrc; - } - if (value & BufferUsage::CopyDst) { - if (!first) { - o << "|"; - } - first = false; - o << "CopyDst"; - value &= ~BufferUsage::CopyDst; - } - if (value & BufferUsage::Index) { - if (!first) { - o << "|"; - } - first = false; - o << "Index"; - value &= ~BufferUsage::Index; - } - if (value & BufferUsage::Vertex) { - if (!first) { - o << "|"; - } - first = false; - o << "Vertex"; - value &= ~BufferUsage::Vertex; - } - if (value & BufferUsage::Uniform) { - if (!first) { - o << "|"; - } - first = false; - o << "Uniform"; - value &= ~BufferUsage::Uniform; - } - if (value & BufferUsage::Storage) { - if (!first) { - o << "|"; - } - first = false; - o << "Storage"; - value &= ~BufferUsage::Storage; - } - if (value & BufferUsage::Indirect) { - if (!first) { - o << "|"; - } - first = false; - o << "Indirect"; - value &= ~BufferUsage::Indirect; - } - if (value & BufferUsage::QueryResolve) { - if (!first) { - o << "|"; - } - first = false; - o << "QueryResolve"; - value &= ~BufferUsage::QueryResolve; - } - if (value & BufferUsage::TexelBuffer) { - if (!first) { - o << "|"; - } - first = false; - o << "TexelBuffer"; - value &= ~BufferUsage::TexelBuffer; - } - - 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, ColorWriteMask value) { - o << "ColorWriteMask::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & ColorWriteMask::Red) { - if (!first) { - o << "|"; - } - first = false; - o << "Red"; - value &= ~ColorWriteMask::Red; - } - if (value & ColorWriteMask::Green) { - if (!first) { - o << "|"; - } - first = false; - o << "Green"; - value &= ~ColorWriteMask::Green; - } - if (value & ColorWriteMask::Blue) { - if (!first) { - o << "|"; - } - first = false; - o << "Blue"; - value &= ~ColorWriteMask::Blue; - } - if (value & ColorWriteMask::Alpha) { - if (!first) { - o << "|"; - } - first = false; - o << "Alpha"; - value &= ~ColorWriteMask::Alpha; - } - if (value & ColorWriteMask::All) { - if (!first) { - o << "|"; - } - first = false; - o << "All"; - value &= ~ColorWriteMask::All; - } - - 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, HeapProperty value) { - o << "HeapProperty::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - 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)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & MapMode::Read) { - if (!first) { - o << "|"; - } - first = false; - o << "Read"; - value &= ~MapMode::Read; - } - if (value & MapMode::Write) { - if (!first) { - o << "|"; - } - first = false; - o << "Write"; - value &= ~MapMode::Write; - } - - 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, ShaderStage value) { - o << "ShaderStage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & ShaderStage::Vertex) { - if (!first) { - o << "|"; - } - first = false; - o << "Vertex"; - value &= ~ShaderStage::Vertex; - } - if (value & ShaderStage::Fragment) { - if (!first) { - o << "|"; - } - first = false; - o << "Fragment"; - value &= ~ShaderStage::Fragment; - } - if (value & ShaderStage::Compute) { - if (!first) { - o << "|"; - } - first = false; - o << "Compute"; - value &= ~ShaderStage::Compute; - } - - 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, TextureUsage value) { - o << "TextureUsage::"; - if (!static_cast(value)) { - // 0 is often explicitly declared as None. - o << "None"; - return o; - } - - bool moreThanOneBit = !HasZeroOrOneBits(value); - if (moreThanOneBit) { - o << "("; - } - - bool first = true; - if (value & TextureUsage::CopySrc) { - if (!first) { - o << "|"; - } - first = false; - o << "CopySrc"; - value &= ~TextureUsage::CopySrc; - } - if (value & TextureUsage::CopyDst) { - if (!first) { - o << "|"; - } - first = false; - o << "CopyDst"; - value &= ~TextureUsage::CopyDst; - } - if (value & TextureUsage::TextureBinding) { - if (!first) { - o << "|"; - } - first = false; - o << "TextureBinding"; - value &= ~TextureUsage::TextureBinding; - } - if (value & TextureUsage::StorageBinding) { - if (!first) { - o << "|"; - } - first = false; - o << "StorageBinding"; - value &= ~TextureUsage::StorageBinding; - } - if (value & TextureUsage::RenderAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "RenderAttachment"; - value &= ~TextureUsage::RenderAttachment; - } - if (value & TextureUsage::TransientAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "TransientAttachment"; - value &= ~TextureUsage::TransientAttachment; - } - if (value & TextureUsage::StorageAttachment) { - if (!first) { - o << "|"; - } - first = false; - o << "StorageAttachment"; - value &= ~TextureUsage::StorageAttachment; - } - - 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; - } - -} // namespace wgpu - -namespace wgpu::dawn::wire::client { - - template - std::basic_ostream& operator<<(std::basic_ostream& o, StringView value) { - o << std::string_view(value); - return o; - } - -} // namespace wgpu::dawn::wire::client - -#endif // DAWN_WIRE_CLIENT_WEBGPU_CPP_PRINT_H_ diff --git a/.scratch/dawn-package/extracted/include/webgpu/webgpu.h b/.scratch/dawn-package/extracted/include/webgpu/webgpu.h deleted file mode 100644 index aa36bc1..0000000 --- a/.scratch/dawn-package/extracted/include/webgpu/webgpu.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 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_WEBGPU_WEBGPU_H_ -#define INCLUDE_WEBGPU_WEBGPU_H_ - -#include "dawn/webgpu.h" - -#endif // INCLUDE_WEBGPU_WEBGPU_H_ diff --git a/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp.h b/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp.h deleted file mode 100644 index d717a62..0000000 --- a/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 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_WEBGPU_WEBGPU_CPP_H_ -#define INCLUDE_WEBGPU_WEBGPU_CPP_H_ - -#include "dawn/webgpu_cpp.h" - -#endif // INCLUDE_WEBGPU_WEBGPU_CPP_H_ diff --git a/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_chained_struct.h b/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_chained_struct.h deleted file mode 100644 index 4e0758c..0000000 --- a/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_chained_struct.h +++ /dev/null @@ -1,57 +0,0 @@ -// 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. - -#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/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_print.h b/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_print.h deleted file mode 100644 index da922f8..0000000 --- a/.scratch/dawn-package/extracted/include/webgpu/webgpu_cpp_print.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2025 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_WEBGPU_WEBGPU_CPP_PRINT_H_ -#define INCLUDE_WEBGPU_WEBGPU_CPP_PRINT_H_ - -#include "dawn/webgpu_cpp_print.h" - -#endif // INCLUDE_WEBGPU_WEBGPU_CPP_PRINT_H_ diff --git a/.scratch/dawn-package/extracted/include/webgpu/webgpu_enum_class_bitmasks.h b/.scratch/dawn-package/extracted/include/webgpu/webgpu_enum_class_bitmasks.h deleted file mode 100644 index e98c8c5..0000000 --- a/.scratch/dawn-package/extracted/include/webgpu/webgpu_enum_class_bitmasks.h +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2017 The Dawn & Tint Authors -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef WEBGPU_ENUM_CLASS_BITMASKS_H_ -#define WEBGPU_ENUM_CLASS_BITMASKS_H_ - -#include - -// The operators in wgpu:: namespace need be introduced into other namespaces with -// using-declarations for C++ Argument Dependent Lookup to work. -#define WGPU_IMPORT_BITMASK_OPERATORS \ - using wgpu::operator|; \ - using wgpu::operator&; \ - using wgpu::operator^; \ - using wgpu::operator~; \ - using wgpu::operator&=; \ - using wgpu::operator|=; \ - using wgpu::operator^=; \ - using wgpu::HasZeroOrOneBits; - -namespace wgpu { - -template -struct IsWGPUBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask { - static constexpr bool enable = false; -}; - -template -struct LowerBitmask::enable>::type> { - static constexpr bool enable = true; - using type = T; - constexpr static T Lower(T t) { return t; } -}; - -template -struct BoolConvertible { - using Integral = typename std::underlying_type::type; - - // NOLINTNEXTLINE(runtime/explicit) - explicit constexpr BoolConvertible(Integral value) : value(value) {} - constexpr operator bool() const { return value != 0; } - constexpr operator T() const { return static_cast(value); } - - Integral value; -}; - -template -struct LowerBitmask> { - static constexpr bool enable = true; - using type = T; - static constexpr type Lower(BoolConvertible t) { return t; } -}; - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator|(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) | - static_cast(LowerBitmask::Lower(right))); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator&(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) & - static_cast(LowerBitmask::Lower(right))); -} - -template < - typename T1, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr BoolConvertible::type> operator^(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(static_cast(LowerBitmask::Lower(left)) ^ - static_cast(LowerBitmask::Lower(right))); -} - -template -constexpr BoolConvertible::type> operator~(T1 t) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return BoolConvertible(~static_cast(LowerBitmask::Lower(t))); -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator&=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l & r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator|=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l | r; - return l; -} - -template < - typename T, - typename T2, - typename = typename std::enable_if::enable && LowerBitmask::enable>::type> -constexpr T& operator^=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l ^ r; - return l; -} - -template -constexpr bool HasZeroOrOneBits(T value) { - using Integral = typename std::underlying_type::type; - return (static_cast(value) & (static_cast(value) - 1)) == 0; -} - -} // namespace wgpu - -#endif // WEBGPU_ENUM_CLASS_BITMASKS_H_ diff --git a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfig.cmake b/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfig.cmake deleted file mode 100644 index 5c1830a..0000000 --- a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfig.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2024 The Dawn & Tint Authors -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# This allows CMake find_package() to find all the dawn targets that were exported. -# For a helpful explanation on this subject, please walk through the steps in the CMake tutorial. -# 1. https://cmake.org/cmake/help/latest/guide/tutorial/Installing%20and%20Testing.html -# 2. https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20Export%20Configuration.html - - -####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### -####### Any changes to this file will be overwritten by the next CMake run #### -####### The input file was DawnConfig.cmake.in ######## - -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) - -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -#################################################################################### -include ("${CMAKE_CURRENT_LIST_DIR}/DawnTargets.cmake") diff --git a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfigVersion.cmake b/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfigVersion.cmake deleted file mode 100644 index b5fb8e4..0000000 --- a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnConfigVersion.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# This is a basic version file for the Config-mode of find_package(). -# It is used by write_basic_package_version_file() as input file for configure_file() -# to create a version-file which can be installed along a config.cmake file. -# -# The created file sets PACKAGE_VERSION_EXACT if the current version string and -# the requested version string are exactly the same and it sets -# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. -# The variable CVF_VERSION must be set before calling configure_file(). - -set(PACKAGE_VERSION "0.0.0") - -if (PACKAGE_FIND_VERSION_RANGE) - # Package version must be in the requested version range - if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) - OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) - OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - endif() -else() - if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() - endif() -endif() - - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets-release.cmake b/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets-release.cmake deleted file mode 100644 index e4fdeb8..0000000 --- a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets-release.cmake +++ /dev/null @@ -1,19 +0,0 @@ -#---------------------------------------------------------------- -# Generated CMake target import file for configuration "Release". -#---------------------------------------------------------------- - -# Commands may need to know the format version. -set(CMAKE_IMPORT_FILE_VERSION 1) - -# Import target "dawn::webgpu_dawn" for configuration "Release" -set_property(TARGET dawn::webgpu_dawn APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) -set_target_properties(dawn::webgpu_dawn PROPERTIES - IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/webgpu_dawn.lib" - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/webgpu_dawn.dll" - ) - -list(APPEND _cmake_import_check_targets dawn::webgpu_dawn ) -list(APPEND _cmake_import_check_files_for_dawn::webgpu_dawn "${_IMPORT_PREFIX}/lib/webgpu_dawn.lib" "${_IMPORT_PREFIX}/bin/webgpu_dawn.dll" ) - -# Commands beyond this point should not need to know the version. -set(CMAKE_IMPORT_FILE_VERSION) diff --git a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets.cmake b/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets.cmake deleted file mode 100644 index 4550a88..0000000 --- a/.scratch/dawn-package/extracted/lib/cmake/Dawn/DawnTargets.cmake +++ /dev/null @@ -1,113 +0,0 @@ -# Generated by CMake - -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) - message(FATAL_ERROR "CMake >= 3.0.0 required") -endif() -if(CMAKE_VERSION VERSION_LESS "3.0.0") - message(FATAL_ERROR "CMake >= 3.0.0 required") -endif() -cmake_policy(PUSH) -cmake_policy(VERSION 3.0.0...4.0) -#---------------------------------------------------------------- -# Generated CMake target import file. -#---------------------------------------------------------------- - -# Commands may need to know the format version. -set(CMAKE_IMPORT_FILE_VERSION 1) - -# Protect against multiple inclusion, which would fail when already imported targets are added once more. -set(_cmake_targets_defined "") -set(_cmake_targets_not_defined "") -set(_cmake_expected_targets "") -foreach(_cmake_expected_target IN ITEMS dawn::dawn_public_config dawn::webgpu_dawn) - list(APPEND _cmake_expected_targets "${_cmake_expected_target}") - if(TARGET "${_cmake_expected_target}") - list(APPEND _cmake_targets_defined "${_cmake_expected_target}") - else() - list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") - endif() -endforeach() -unset(_cmake_expected_target) -if(_cmake_targets_defined STREQUAL _cmake_expected_targets) - unset(_cmake_targets_defined) - unset(_cmake_targets_not_defined) - unset(_cmake_expected_targets) - unset(CMAKE_IMPORT_FILE_VERSION) - cmake_policy(POP) - return() -endif() -if(NOT _cmake_targets_defined STREQUAL "") - string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") - string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") - message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") -endif() -unset(_cmake_targets_defined) -unset(_cmake_targets_not_defined) -unset(_cmake_expected_targets) - - -# Compute the installation prefix relative to this file. -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -if(_IMPORT_PREFIX STREQUAL "/") - set(_IMPORT_PREFIX "") -endif() - -# Create imported target dawn::dawn_public_config -add_library(dawn::dawn_public_config INTERFACE IMPORTED) - -set_target_properties(dawn::dawn_public_config PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" -) - -# Create imported target dawn::webgpu_dawn -add_library(dawn::webgpu_dawn SHARED IMPORTED) - -set_target_properties(dawn::webgpu_dawn PROPERTIES - INTERFACE_LINK_LIBRARIES "dawn::dawn_public_config" -) - -# Load information for each installed configuration. -file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/DawnTargets-*.cmake") -foreach(_cmake_config_file IN LISTS _cmake_config_files) - include("${_cmake_config_file}") -endforeach() -unset(_cmake_config_file) -unset(_cmake_config_files) - -# Cleanup temporary variables. -set(_IMPORT_PREFIX) - -# Loop over all imported files and verify that they actually exist -foreach(_cmake_target IN LISTS _cmake_import_check_targets) - if(CMAKE_VERSION VERSION_LESS "3.28" - OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} - OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") - foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") - if(NOT EXISTS "${_cmake_file}") - message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file - \"${_cmake_file}\" -but this file does not exist. Possible reasons include: -* The file was deleted, renamed, or moved to another location. -* An install or uninstall procedure did not complete successfully. -* The installation package was faulty and contained - \"${CMAKE_CURRENT_LIST_FILE}\" -but not all the files it references. -") - endif() - endforeach() - endif() - unset(_cmake_file) - unset("_cmake_import_check_files_for_${_cmake_target}") -endforeach() -unset(_cmake_target) -unset(_cmake_import_check_targets) - -# This file does not depend on other imported targets which have -# been exported from the same project but in a separate export set. - -# Commands beyond this point should not need to know the version. -set(CMAKE_IMPORT_FILE_VERSION) -cmake_policy(POP)