diff --git a/ffi/Makefile b/ffi/Makefile new file mode 100644 index 00000000..f247821f --- /dev/null +++ b/ffi/Makefile @@ -0,0 +1,12 @@ +.PHONY: gen + +# TODO: change 'gen' invocation to use submodule + +gen: + cd ../../webgpu-headers && \ + go run ./gen \ + -schema ./schema.json \ + -yaml ./webgpu.yml \ + -header ./webgpu.h \ + -yaml ../wgpu-native/ffi/wgpu.yml \ + -header ../wgpu-native/ffi/wgpu.h diff --git a/ffi/wgpu.h b/ffi/wgpu.h index ce9c7589..3abe5ae2 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -1,265 +1,356 @@ +/** + * Copyright 2021 The gfx-rs developers + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + */ + #ifndef WGPU_H_ #define WGPU_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 + +#if !defined(__WGPU_EXTEND_ENUM) +#ifdef __cplusplus +#define __WGPU_EXTEND_ENUM(E, N, V) static const E N = E(V) +#else +#define __WGPU_EXTEND_ENUM(E, N, V) static const E N = (E)(V) +#endif +#endif // !defined(__WGPU_EXTEND_ENUM) + #include "webgpu.h" -typedef enum WGPUNativeSType { - // Start at 0003 since that's allocated range for wgpu-native - WGPUSType_DeviceExtras = 0x00030001, - WGPUSType_RequiredLimitsExtras = 0x00030002, - WGPUSType_PipelineLayoutExtras = 0x00030003, - WGPUSType_ShaderModuleGLSLDescriptor = 0x00030004, - WGPUSType_SupportedLimitsExtras = 0x00030005, - WGPUSType_InstanceExtras = 0x00030006, - WGPUSType_BindGroupEntryExtras = 0x00030007, - WGPUSType_BindGroupLayoutEntryExtras = 0x00030008, - WGPUSType_QuerySetDescriptorExtras = 0x00030009, - WGPUSType_SurfaceConfigurationExtras = 0x0003000A, - WGPUNativeSType_Force32 = 0x7FFFFFFF -} WGPUNativeSType; - -typedef enum WGPUNativeFeature { - WGPUNativeFeature_PushConstants = 0x00030001, - WGPUNativeFeature_TextureAdapterSpecificFormatFeatures = 0x00030002, - WGPUNativeFeature_MultiDrawIndirect = 0x00030003, - WGPUNativeFeature_MultiDrawIndirectCount = 0x00030004, - WGPUNativeFeature_VertexWritableStorage = 0x00030005, - WGPUNativeFeature_TextureBindingArray = 0x00030006, - WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing = 0x00030007, - WGPUNativeFeature_PipelineStatisticsQuery = 0x00030008, - WGPUNativeFeature_StorageResourceBindingArray = 0x00030009, - WGPUNativeFeature_PartiallyBoundBindingArray = 0x0003000A, - WGPUNativeFeature_Force32 = 0x7FFFFFFF -} WGPUNativeFeature; - -typedef enum WGPULogLevel { - WGPULogLevel_Off = 0x00000000, - WGPULogLevel_Error = 0x00000001, - WGPULogLevel_Warn = 0x00000002, - WGPULogLevel_Info = 0x00000003, - WGPULogLevel_Debug = 0x00000004, - WGPULogLevel_Trace = 0x00000005, - WGPULogLevel_Force32 = 0x7FFFFFFF -} WGPULogLevel; - -typedef enum WGPUInstanceBackend { - WGPUInstanceBackend_All = 0x00000000, - WGPUInstanceBackend_Vulkan = 1 << 0, - WGPUInstanceBackend_GL = 1 << 1, - WGPUInstanceBackend_Metal = 1 << 2, - WGPUInstanceBackend_DX12 = 1 << 3, - WGPUInstanceBackend_DX11 = 1 << 4, - WGPUInstanceBackend_BrowserWebGPU = 1 << 5, - WGPUInstanceBackend_Primary = WGPUInstanceBackend_Vulkan | WGPUInstanceBackend_Metal | - WGPUInstanceBackend_DX12 | - WGPUInstanceBackend_BrowserWebGPU, - WGPUInstanceBackend_Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11, - WGPUInstanceBackend_Force32 = 0x7FFFFFFF -} WGPUInstanceBackend; -typedef WGPUFlags WGPUInstanceBackendFlags; - -typedef enum WGPUInstanceFlag { - WGPUInstanceFlag_Default = 0x00000000, - WGPUInstanceFlag_Debug = 1 << 0, - WGPUInstanceFlag_Validation = 1 << 1, - WGPUInstanceFlag_DiscardHalLabels = 1 << 2, - WGPUInstanceFlag_Force32 = 0x7FFFFFFF -} WGPUInstanceFlag; -typedef WGPUFlags WGPUInstanceFlags; - -typedef enum WGPUDx12Compiler { - WGPUDx12Compiler_Undefined = 0x00000000, - WGPUDx12Compiler_Fxc = 0x00000001, - WGPUDx12Compiler_Dxc = 0x00000002, - WGPUDx12Compiler_Force32 = 0x7FFFFFFF -} WGPUDx12Compiler; - -typedef enum WGPUGles3MinorVersion { - WGPUGles3MinorVersion_Automatic = 0x00000000, - WGPUGles3MinorVersion_Version0 = 0x00000001, - WGPUGles3MinorVersion_Version1 = 0x00000002, - WGPUGles3MinorVersion_Version2 = 0x00000003, - WGPUGles3MinorVersion_Force32 = 0x7FFFFFFF -} WGPUGles3MinorVersion; - -typedef enum WGPUPipelineStatisticName { - WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000, - WGPUPipelineStatisticName_ClipperInvocations = 0x00000001, - WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002, - WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003, - WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004, - WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF -} WGPUPipelineStatisticName WGPU_ENUM_ATTRIBUTE; - -typedef enum WGPUNativeQueryType { - WGPUNativeQueryType_PipelineStatistics = 0x00030000, - WGPUNativeQueryType_Force32 = 0x7FFFFFFF -} WGPUNativeQueryType WGPU_ENUM_ATTRIBUTE; - -typedef struct WGPUInstanceExtras { - WGPUChainedStruct chain; - WGPUInstanceBackendFlags backends; - WGPUInstanceFlags flags; - WGPUDx12Compiler dx12ShaderCompiler; - WGPUGles3MinorVersion gles3MinorVersion; - const char * dxilPath; - const char * dxcPath; -} WGPUInstanceExtras; - -typedef struct WGPUDeviceExtras { +typedef uint64_t WGPUSubmissionIndexWGPU; + +typedef struct WGPUComputePassEncoderWGPUImpl* WGPUComputePassEncoderWGPU WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUDeviceWGPUImpl* WGPUDeviceWGPU WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUInstanceWGPUImpl* WGPUInstanceWGPU WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUQueueWGPUImpl* WGPUQueueWGPU WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPURenderPassEncoderWGPUImpl* WGPURenderPassEncoderWGPU WGPU_OBJECT_ATTRIBUTE; + +// Structure forward declarations +struct WGPUBindGroupEntryExtrasWGPU; +struct WGPUBindGroupLayoutEntryExtrasWGPU; +struct WGPUDeviceExtrasWGPU; +struct WGPUInstanceEnumerateAdaptersResultWGPU; +struct WGPUInstanceExtrasWGPU; +struct WGPULimitExtrasWGPU; +struct WGPUPushConstantRangeWGPU; +struct WGPUQuerySetDescriptorExtrasWGPU; +struct WGPURegistryReportWGPU; +struct WGPUShaderDefineWGPU; +struct WGPUSurfaceConfigurationExtrasWGPU; +struct WGPUWrappedSubmissionIndexWGPU; +struct WGPUHubReportWGPU; +struct WGPURequiredLimitsExtrasWGPU; +struct WGPUShaderModuleGLSLDescriptorWGPU; +struct WGPUSupportedLimitsExtrasWGPU; +struct WGPUGlobalReportWGPU; + +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_PushConstants_WGPU, 0x00030000); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_TextureAdapterSpecificFormatFeatures_WGPU, 0x00030001); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_MultiDrawIndirect_WGPU, 0x00030002); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_MultiDrawIndirectCount_WGPU, 0x00030003); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_VertexWritableStorage_WGPU, 0x00030004); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_TextureBindingArray_WGPU, 0x00030005); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_SampledTextureAndStorageBufferArrayNonUniformIndexing_WGPU, 0x00030006); +__WGPU_EXTEND_ENUM(WGPUFeatureName, WGPUFeatureName_PipelineStatisticsQuery_WGPU, 0x00030007); + +__WGPU_EXTEND_ENUM(WGPUQueryType, WGPUQueryType_PipelineStatistics_WGPU, 0x00030000); + +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_DeviceExtras_WGPU, 0x00030000); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_RequiredLimitsExtras_WGPU, 0x00030001); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_PipelineLayoutExtras_WGPU, 0x00030002); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_ShaderModuleGLSLDescriptor_WGPU, 0x00030003); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_SupportedLimitsExtras_WGPU, 0x00030004); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_InstanceExtras_WGPU, 0x00030005); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_BindGroupEntryExtras_WGPU, 0x00030006); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_BindGroupLayoutEntryExtras_WGPU, 0x00030007); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_QuerySetDescriptorExtras_WGPU, 0x00030008); +__WGPU_EXTEND_ENUM(WGPUSType, WGPUSType_SurfaceConfigurationExtras_WGPU, 0x00030009); + +typedef enum WGPUDx12CompilerWGPU { + WGPUDx12Compiler_Undefined_WGPU = 0x00030000, + WGPUDx12Compiler_Fxc_WGPU = 0x00030001, + WGPUDx12Compiler_Dxc_WGPU = 0x00030002, + WGPUDx12Compiler_Force32_WGPU = 0x7FFFFFFF +} WGPUDx12CompilerWGPU WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUGles3MinorVersionWGPU { + WGPUGles3MinorVersion_Automatic_WGPU = 0x00030000, + WGPUGles3MinorVersion_Version0_WGPU = 0x00030001, + WGPUGles3MinorVersion_Version1_WGPU = 0x00030002, + WGPUGles3MinorVersion_Version2_WGPU = 0x00030003, + WGPUGles3MinorVersion_Force32_WGPU = 0x7FFFFFFF +} WGPUGles3MinorVersionWGPU WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPULogLevelWGPU { + WGPULogLevel_Off_WGPU = 0x00030000, + WGPULogLevel_Error_WGPU = 0x00030001, + WGPULogLevel_Warn_WGPU = 0x00030002, + WGPULogLevel_Info_WGPU = 0x00030003, + WGPULogLevel_Debug_WGPU = 0x00030004, + WGPULogLevel_Trace_WGPU = 0x00030005, + WGPULogLevel_Force32_WGPU = 0x7FFFFFFF +} WGPULogLevelWGPU WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUPipelineStatisticsNameWGPU { + WGPUPipelineStatisticsName_VertexShaderInvocations_WGPU = 0x00030000, + WGPUPipelineStatisticsName_ClipperInvocations_WGPU = 0x00030001, + WGPUPipelineStatisticsName_ClipperPrimitivesOut_WGPU = 0x00030002, + WGPUPipelineStatisticsName_FragmentShaderInvocations_WGPU = 0x00030003, + WGPUPipelineStatisticsName_ComputeShaderInvocations_WGPU = 0x00030004, + WGPUPipelineStatisticsName_Force32_WGPU = 0x7FFFFFFF +} WGPUPipelineStatisticsNameWGPU WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBackendsWGPU { + WGPUBackends_Vulkan_WGPU = 0x00000000, + WGPUBackends_GL_WGPU = 0x00000001, + WGPUBackends_Metal_WGPU = 0x00000002, + WGPUBackends_DX12_WGPU = 0x00000004, + WGPUBackends_BrowserWebGPU_WGPU = 0x00000008, + WGPUBackends_Primary_WGPU = WGPUBackends_Vulkan_WGPU | WGPUBackends_Metal_WGPU | WGPUBackends_DX12_WGPU | WGPUBackends_BrowserWebGPU_WGPU, + WGPUBackends_Secondary_WGPU = WGPUBackends_GL_WGPU, + WGPUBackends_Force32_WGPU = 0x7FFFFFFF +} WGPUBackendsWGPU WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUBackendsFlagsWGPU WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUInstanceFlagsWGPU { + WGPUInstanceFlags_Debug_WGPU = 0x00000000, + WGPUInstanceFlags_Validation_WGPU = 0x00000001, + WGPUInstanceFlags_DiscardHalLabels_WGPU = 0x00000002, + WGPUInstanceFlags_AllowUnderlyingNoncompliantAdapter_WGPU = 0x00000004, + WGPUInstanceFlags_Force32_WGPU = 0x7FFFFFFF +} WGPUInstanceFlagsWGPU WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUInstanceFlagsFlagsWGPU WGPU_ENUM_ATTRIBUTE; + +typedef void (*WGPULogCallbackWGPU)(WGPULogLevelWGPU level, char const * message) WGPU_FUNCTION_ATTRIBUTE; + + +typedef struct WGPUBindGroupEntryExtrasWGPU { WGPUChainedStruct chain; - const char * tracePath; -} WGPUDeviceExtras; + size_t bufferCount; + WGPUBuffer buffers; + size_t samplerCount; + WGPUSampler samplers; + size_t textureViewCount; + WGPUTextureView textureViews; +} WGPUBindGroupEntryExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUNativeLimits { - uint32_t maxPushConstantSize; - uint32_t maxNonSamplerBindings; -} WGPUNativeLimits; +typedef struct WGPUBindGroupLayoutEntryExtrasWGPU { + WGPUChainedStruct chain; + uint32_t count; +} WGPUBindGroupLayoutEntryExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPURequiredLimitsExtras { +typedef struct WGPUDeviceExtrasWGPU { WGPUChainedStruct chain; - WGPUNativeLimits limits; -} WGPURequiredLimitsExtras; + char const * tracePath; +} WGPUDeviceExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUSupportedLimitsExtras { - WGPUChainedStructOut chain; - WGPUNativeLimits limits; -} WGPUSupportedLimitsExtras; +typedef struct WGPUInstanceEnumerateAdaptersResultWGPU { + size_t adapterCount; + WGPUAdapter adapters; +} WGPUInstanceEnumerateAdaptersResultWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUPushConstantRange { +typedef struct WGPUInstanceExtrasWGPU { + WGPUChainedStruct chain; + WGPUBackendsFlagsWGPU backends; + WGPUInstanceFlagsFlagsWGPU flags; + WGPUDx12CompilerWGPU dx12ShaderCompiler; + WGPUGles3MinorVersionWGPU gles3MinorVersion; + char const * dxilPath; + char const * dxcPath; +} WGPUInstanceExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPULimitExtrasWGPU { + uint32_t maxPushConstantSize; + uint32_t maxNonSamplerBindings; +} WGPULimitExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPushConstantRangeWGPU { WGPUShaderStageFlags stages; uint32_t start; uint32_t end; -} WGPUPushConstantRange; +} WGPUPushConstantRangeWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUPipelineLayoutExtras { +typedef struct WGPUQuerySetDescriptorExtrasWGPU { WGPUChainedStruct chain; - size_t pushConstantRangeCount; - WGPUPushConstantRange const * pushConstantRanges; -} WGPUPipelineLayoutExtras; - -typedef uint64_t WGPUSubmissionIndex; - -typedef struct WGPUWrappedSubmissionIndex { - WGPUQueue queue; - WGPUSubmissionIndex submissionIndex; -} WGPUWrappedSubmissionIndex; - -typedef struct WGPUShaderDefine { + size_t pipelineStatisticCount; + WGPUPipelineStatisticsNameWGPU pipelineStatistics; +} WGPUQuerySetDescriptorExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURegistryReportWGPU { + size_t numAllocated; + size_t numKeptFromUser; + size_t numReleasedFromUser; + size_t numError; + size_t elementSize; +} WGPURegistryReportWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderDefineWGPU { char const * name; char const * value; -} WGPUShaderDefine; +} WGPUShaderDefineWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUShaderModuleGLSLDescriptor { - WGPUChainedStruct chain; - WGPUShaderStage stage; - char const * code; - uint32_t defineCount; - WGPUShaderDefine * defines; -} WGPUShaderModuleGLSLDescriptor; - -typedef struct WGPURegistryReport { - size_t numAllocated; - size_t numKeptFromUser; - size_t numReleasedFromUser; - size_t numError; - size_t elementSize; -} WGPURegistryReport; - -typedef struct WGPUHubReport { - WGPURegistryReport adapters; - WGPURegistryReport devices; - WGPURegistryReport queues; - WGPURegistryReport pipelineLayouts; - WGPURegistryReport shaderModules; - WGPURegistryReport bindGroupLayouts; - WGPURegistryReport bindGroups; - WGPURegistryReport commandBuffers; - WGPURegistryReport renderBundles; - WGPURegistryReport renderPipelines; - WGPURegistryReport computePipelines; - WGPURegistryReport querySets; - WGPURegistryReport buffers; - WGPURegistryReport textures; - WGPURegistryReport textureViews; - WGPURegistryReport samplers; -} WGPUHubReport; - -typedef struct WGPUGlobalReport { - WGPURegistryReport surfaces; - WGPUBackendType backendType; - WGPUHubReport vulkan; - WGPUHubReport metal; - WGPUHubReport dx12; - WGPUHubReport gl; -} WGPUGlobalReport; - -typedef struct WGPUInstanceEnumerateAdapterOptions { - WGPUChainedStruct const * nextInChain; - WGPUInstanceBackendFlags backends; -} WGPUInstanceEnumerateAdapterOptions; - -typedef struct WGPUBindGroupEntryExtras { +typedef struct WGPUSurfaceConfigurationExtrasWGPU { WGPUChainedStruct chain; - WGPUBuffer const * buffers; - size_t bufferCount; - WGPUSampler const * samplers; - size_t samplerCount; - WGPUTextureView const * textureViews; - size_t textureViewCount; -} WGPUBindGroupEntryExtras; + WGPUBool desiredMaximumFrameLatency; +} WGPUSurfaceConfigurationExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUBindGroupLayoutEntryExtras { +typedef struct WGPUWrappedSubmissionIndexWGPU { + WGPUQueue queue; + WGPUSubmissionIndexWGPU submissionIndex; +} WGPUWrappedSubmissionIndexWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUHubReportWGPU { + WGPURegistryReportWGPU adapters; + WGPURegistryReportWGPU devices; + WGPURegistryReportWGPU queues; + WGPURegistryReportWGPU pipelineLayouts; + WGPURegistryReportWGPU shaderModules; + WGPURegistryReportWGPU bindGroupLayouts; + WGPURegistryReportWGPU bindGroups; + WGPURegistryReportWGPU commandBuffers; + WGPURegistryReportWGPU renderBundles; + WGPURegistryReportWGPU renderPipelines; + WGPURegistryReportWGPU computePipelines; + WGPURegistryReportWGPU querySets; + WGPURegistryReportWGPU buffers; + WGPURegistryReportWGPU textures; + WGPURegistryReportWGPU textureViews; + WGPURegistryReportWGPU samplers; +} WGPUHubReportWGPU WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequiredLimitsExtrasWGPU { WGPUChainedStruct chain; - uint32_t count; -} WGPUBindGroupLayoutEntryExtras; + WGPULimitExtrasWGPU limits; +} WGPURequiredLimitsExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUQuerySetDescriptorExtras { +typedef struct WGPUShaderModuleGLSLDescriptorWGPU { WGPUChainedStruct chain; - WGPUPipelineStatisticName const * pipelineStatistics; - size_t pipelineStatisticCount; -} WGPUQuerySetDescriptorExtras WGPU_STRUCTURE_ATTRIBUTE; + WGPUShaderStageFlags stage; + char const * code; + size_t defineCount; + WGPUShaderDefineWGPU defines; +} WGPUShaderModuleGLSLDescriptorWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUSurfaceConfigurationExtras { +typedef struct WGPUSupportedLimitsExtrasWGPU { WGPUChainedStruct chain; - WGPUBool desiredMaximumFrameLatency; -} WGPUSurfaceConfigurationExtras WGPU_STRUCTURE_ATTRIBUTE; + WGPULimitExtrasWGPU limits; +} WGPUSupportedLimitsExtrasWGPU WGPU_STRUCTURE_ATTRIBUTE; -typedef void (*WGPULogCallback)(WGPULogLevel level, char const * message, void * userdata); +typedef struct WGPUGlobalReportWGPU { + WGPURegistryReportWGPU surfaces; + WGPUBackendType backendType; + WGPUHubReportWGPU vulkan; + WGPUHubReportWGPU metal; + WGPUHubReportWGPU dx12; + WGPUHubReportWGPU gl; +} WGPUGlobalReportWGPU WGPU_STRUCTURE_ATTRIBUTE; #ifdef __cplusplus extern "C" { #endif -void wgpuGenerateReport(WGPUInstance instance, WGPUGlobalReport * report); -size_t wgpuInstanceEnumerateAdapters(WGPUInstance instance, WGPU_NULLABLE WGPUInstanceEnumerateAdapterOptions const * options, WGPUAdapter * adapters); +#if !defined(WGPU_SKIP_PROCS) + +typedef void (*WGPUProcSetLogCallbackWGPU)(WGPULogCallbackWGPU callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSetLogLevelWGPU)(WGPULogLevelWGPU level) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcGetVersionWGPU)() WGPU_FUNCTION_ATTRIBUTE; +// Procs of ComputePassEncoder +typedef void (*WGPUProcComputePassEncoderBeginPipelineStatisticsQueryWGPU)(WGPUComputePassEncoderWGPU computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderEndPipelineStatisticsQueryWGPU)(WGPUComputePassEncoderWGPU computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Device +typedef WGPUBool (*WGPUProcDevicePollWGPU)(WGPUDeviceWGPU device, WGPUBool wait, WGPUWrappedSubmissionIndexWGPU const * wrappedSubmissionIndex) WGPU_FUNCTION_ATTRIBUTE; -WGPUSubmissionIndex wgpuQueueSubmitForIndex(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands); +// Procs of Instance +typedef void (*WGPUProcInstanceEnumerateAdaptersWGPU)(WGPUInstanceWGPU instance, WGPUBackendsFlagsWGPU backends, WGPUInstanceEnumerateAdaptersResultWGPU result) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceGenerateReportWGPU)(WGPUInstanceWGPU instance, WGPUGlobalReportWGPU * report) WGPU_FUNCTION_ATTRIBUTE; -// Returns true if the queue is empty, or false if there are more queue submissions still in flight. -WGPUBool wgpuDevicePoll(WGPUDevice device, WGPUBool wait, WGPU_NULLABLE WGPUWrappedSubmissionIndex const * wrappedSubmissionIndex); +// Procs of InstanceEnumerateAdaptersResult +typedef void (*WGPUProcInstanceEnumerateAdaptersResultFreeMembersWGPU)(WGPUInstanceEnumerateAdaptersResultWGPU instanceEnumerateAdaptersResult) WGPU_FUNCTION_ATTRIBUTE; -void wgpuSetLogCallback(WGPULogCallback callback, void * userdata); +// Procs of Queue +typedef uint64_t (*WGPUProcQueueSubmitForIndexWGPU)(WGPUQueueWGPU queue, size_t commandCount, WGPUCommandBuffer commands) WGPU_FUNCTION_ATTRIBUTE; -void wgpuSetLogLevel(WGPULogLevel level); +// Procs of RenderPassEncoder +typedef void (*WGPUProcRenderPassEncoderBeginPipelineStatisticsQueryWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderEndPipelineStatisticsQueryWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderMultiDrawIndexedIndirectWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint32_t indirectOffset, size_t count) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderMultiDrawIndexedIndirectCountWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, WGPUBuffer countBuffer, uint64_t countOffset, uint32_t maxCount) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderMultiDrawIndirectWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint32_t indirectOffset, size_t count) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderMultiDrawIndirectCountWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, WGPUBuffer countBuffer, uint64_t countOffset, uint32_t maxCount) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetPushConstantsWGPU)(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUShaderStageFlags stages, uint32_t offset, size_t size, void const * data) WGPU_FUNCTION_ATTRIBUTE; -uint32_t wgpuGetVersion(void); +#endif // !defined(WGPU_SKIP_PROCS) -void wgpuRenderPassEncoderSetPushConstants(WGPURenderPassEncoder encoder, WGPUShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const * data); +#if !defined(WGPU_SKIP_DECLARATIONS) -void wgpuRenderPassEncoderMultiDrawIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); -void wgpuRenderPassEncoderMultiDrawIndexedIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); +WGPU_EXPORT void wgpuSetLogCallbackWGPU(WGPULogCallbackWGPU callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSetLogLevelWGPU(WGPULogLevelWGPU level) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuGetVersionWGPU() WGPU_FUNCTION_ATTRIBUTE; +// Methods of ComputePassEncoder +WGPU_EXPORT void wgpuComputePassEncoderBeginPipelineStatisticsQueryWGPU(WGPUComputePassEncoderWGPU computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderEndPipelineStatisticsQueryWGPU(WGPUComputePassEncoderWGPU computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -void wgpuRenderPassEncoderMultiDrawIndirectCount(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, WGPUBuffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); -void wgpuRenderPassEncoderMultiDrawIndexedIndirectCount(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, WGPUBuffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); +// Methods of Device +WGPU_EXPORT WGPUBool wgpuDevicePollWGPU(WGPUDeviceWGPU device, WGPUBool wait, WGPUWrappedSubmissionIndexWGPU const * wrappedSubmissionIndex) WGPU_FUNCTION_ATTRIBUTE; -void wgpuComputePassEncoderBeginPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -void wgpuComputePassEncoderEndPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder); -void wgpuRenderPassEncoderBeginPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder); +// Methods of Instance +WGPU_EXPORT void wgpuInstanceEnumerateAdaptersWGPU(WGPUInstanceWGPU instance, WGPUBackendsFlagsWGPU backends, WGPUInstanceEnumerateAdaptersResultWGPU result) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceGenerateReportWGPU(WGPUInstanceWGPU instance, WGPUGlobalReportWGPU * report) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of InstanceEnumerateAdaptersResult +WGPU_EXPORT void wgpuInstanceEnumerateAdaptersResultFreeMembersWGPU(WGPUInstanceEnumerateAdaptersResultWGPU instanceEnumerateAdaptersResult) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Queue +WGPU_EXPORT uint64_t wgpuQueueSubmitForIndexWGPU(WGPUQueueWGPU queue, size_t commandCount, WGPUCommandBuffer commands) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of RenderPassEncoder +WGPU_EXPORT void wgpuRenderPassEncoderBeginPipelineStatisticsQueryWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderEndPipelineStatisticsQueryWGPU(WGPURenderPassEncoderWGPU renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndexedIndirectWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint32_t indirectOffset, size_t count) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndexedIndirectCountWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, WGPUBuffer countBuffer, uint64_t countOffset, uint32_t maxCount) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndirectWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint32_t indirectOffset, size_t count) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderMultiDrawIndirectCountWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset, WGPUBuffer countBuffer, uint64_t countOffset, uint32_t maxCount) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetPushConstantsWGPU(WGPURenderPassEncoderWGPU renderPassEncoder, WGPUShaderStageFlags stages, uint32_t offset, size_t size, void const * data) WGPU_FUNCTION_ATTRIBUTE; + +#endif // !defined(WGPU_SKIP_DECLARATIONS) #ifdef __cplusplus } // extern "C" #endif -#endif +#endif // WGPU_H_ diff --git a/ffi/wgpu.yml b/ffi/wgpu.yml new file mode 100644 index 00000000..cb213a43 --- /dev/null +++ b/ffi/wgpu.yml @@ -0,0 +1,835 @@ +copyright: | + Copyright 2021 The gfx-rs developers + + SPDX-License-Identifier: Apache-2.0 OR MIT + +name: wgpu +enum_prefix: "0x0003" + +constants: [] + +typedefs: + - name: submission_index + doc: | + TODO + type: uint64 + +enums: + - name: s_type + doc: | + TODO + extended: true + entries: + - name: device_extras + doc: | + TODO + - name: required_limits_extras + doc: | + TODO + - name: pipeline_layout_extras + doc: | + TODO + - name: shader_module_GLSL_descriptor + doc: | + TODO + - name: supported_limits_extras + doc: | + TODO + - name: instance_extras + doc: | + TODO + - name: bind_group_entry_extras + doc: | + TODO + - name: bind_group_layout_entry_extras + doc: | + TODO + - name: query_set_descriptor_extras + doc: | + TODO + - name: surface_configuration_extras + doc: | + TODO + + - name: feature_name + doc: | + TODO + extended: true + entries: + - name: push_constants + doc: | + TODO + - name: texture_adapter_specific_format_features + doc: | + TODO + - name: multi_draw_indirect + doc: | + TODO + - name: multi_draw_indirect_count + doc: | + TODO + - name: vertex_writable_storage + doc: | + TODO + - name: texture_binding_array + doc: | + TODO + - name: sampled_texture_and_storage_buffer_array_non_uniform_indexing + doc: | + TODO + - name: pipeline_statistics_query + doc: | + TODO + + - name: log_level + doc: | + TODO + entries: + - name: off + doc: | + TODO + - name: error + doc: | + TODO + - name: warn + doc: | + TODO + - name: info + doc: | + TODO + - name: debug + doc: | + TODO + - name: trace + doc: | + TODO + + - name: dx12_compiler + doc: | + TODO + entries: + - name: undefined + doc: | + TODO + - name: fxc + doc: | + TODO + - name: dxc + doc: | + TODO + + - name: gles3_minor_version + doc: | + TODO + entries: + - name: automatic + doc: | + TODO + - name: version0 + doc: | + TODO + - name: version1 + doc: | + TODO + - name: version2 + doc: | + TODO + + - name: pipeline_statistics_name + doc: | + TODO + entries: + - name: vertex_shader_invocations + doc: | + TODO + - name: clipper_invocations + doc: | + TODO + - name: clipper_primitives_out + doc: | + TODO + - name: fragment_shader_invocations + doc: | + TODO + - name: compute_shader_invocations + doc: | + TODO + + - name: query_type + doc: | + TODO + extended: true + entries: + - name: pipeline_statistics + doc: | + TODO + +bitflags: + - name: backends + doc: | + TODO + entries: + - name: vulkan + doc: | + TODO + - name: GL + doc: | + TODO + - name: metal + doc: | + TODO + - name: DX12 + doc: | + TODO + - name: browser_WebGPU + doc: | + TODO + - name: primary + doc: | + TODO + value_combination: + - vulkan + - metal + - DX12 + - browser_WebGPU + - name: secondary + doc: | + TODO + value_combination: + - GL + + - name: instance_flags + doc: | + TODO + entries: + - name: debug + doc: | + TODO + - name: validation + doc: | + TODO + - name: discard_hal_labels + doc: | + TODO + - name: allow_underlying_noncompliant_adapter + doc: | + TODO + +function_types: + - name: log_callback + doc: | + TODO + args: + - name: level + doc: | + TODO + type: enum.log_level + - name: message + doc: | + TODO + type: string + +structs: + - name: instance_extras + doc: | + TODO + type: extension_in + extends: + - instance_descriptor + members: + - name: backends + doc: | + TODO + type: bitflag.backends + - name: flags + doc: | + TODO + type: bitflag.instance_flags + - name: dx12_shader_compiler + doc: | + TODO + type: enum.dx12_compiler + - name: gles3_minor_version + doc: | + TODO + type: enum.gles3_minor_version + - name: dxil_path + doc: | + TODO + type: string + - name: dxc_path + doc: | + TODO + type: string + + - name: device_extras + doc: | + TODO + type: extension_in + extends: + - device_descriptor + members: + - name: trace_path + doc: | + TODO + type: string + + - name: limit_extras + doc: | + TODO + type: standalone + members: + - name: max_push_constant_size + doc: | + TODO + type: uint32 + - name: max_non_sampler_bindings + doc: | + TODO + type: uint32 + + - name: required_limits_extras + doc: | + TODO + type: extension_in + extends: + - required_limits + members: + - name: limits + doc: | + TODO + type: struct.limit_extras + + - name: supported_limits_extras + doc: | + TODO + type: extension_in + extends: + - supported_limits + members: + - name: limits + doc: | + TODO + type: struct.limit_extras + + - name: push_constant_range + doc: | + TODO + type: standalone + members: + - name: stages + doc: | + TODO + namespace: webgpu + type: bitflag.shader_stage + - name: start + doc: | + TODO + type: uint32 + - name: end + doc: | + TODO + type: uint32 + + - name: wrapped_submission_index + doc: | + TODO + type: standalone + members: + - name: queue + doc: | + TODO + namespace: webgpu + type: object.queue + - name: submission_index + doc: | + TODO + type: typedef.submission_index + + - name: shader_define + doc: | + TODO + type: standalone + members: + - name: name + doc: | + TODO + type: string + - name: value + doc: | + TODO + type: string + + - name: shader_module_GLSL_descriptor + doc: | + TODO + type: extension_in + extends: + - shader_module_descriptor + members: + - name: stage + doc: | + TODO + namespace: webgpu + type: bitflag.shader_stage + - name: code + doc: | + TODO + type: string + - name: defines + doc: | + TODO + type: array + + - name: registry_report + doc: | + TODO + type: standalone + members: + - name: num_allocated + doc: | + TODO + type: usize + - name: num_kept_from_user + doc: | + TODO + type: usize + - name: num_released_from_user + doc: | + TODO + type: usize + - name: num_error + doc: | + TODO + type: usize + - name: element_size + doc: | + TODO + type: usize + + - name: hub_report + doc: | + TODO + type: standalone + members: + - name: adapters + doc: | + TODO + type: struct.registry_report + - name: devices + doc: | + TODO + type: struct.registry_report + - name: queues + doc: | + TODO + type: struct.registry_report + - name: pipeline_layouts + doc: | + TODO + type: struct.registry_report + - name: shader_modules + doc: | + TODO + type: struct.registry_report + - name: bind_group_layouts + doc: | + TODO + type: struct.registry_report + - name: bind_groups + doc: | + TODO + type: struct.registry_report + - name: command_buffers + doc: | + TODO + type: struct.registry_report + - name: render_bundles + doc: | + TODO + type: struct.registry_report + - name: render_pipelines + doc: | + TODO + type: struct.registry_report + - name: compute_pipelines + doc: | + TODO + type: struct.registry_report + - name: query_sets + doc: | + TODO + type: struct.registry_report + - name: buffers + doc: | + TODO + type: struct.registry_report + - name: textures + doc: | + TODO + type: struct.registry_report + - name: texture_views + doc: | + TODO + type: struct.registry_report + - name: samplers + doc: | + TODO + type: struct.registry_report + + - name: global_report + doc: | + TODO + type: standalone + members: + - name: surfaces + doc: | + TODO + type: struct.registry_report + - name: backend_type + doc: | + TODO + namespace: webgpu + type: struct.backend_type + - name: vulkan + doc: | + TODO + type: struct.hub_report + - name: metal + doc: | + TODO + type: struct.hub_report + - name: dx12 + doc: | + TODO + type: struct.hub_report + - name: gl + doc: | + TODO + type: struct.hub_report + + - name: bind_group_entry_extras + doc: | + TODO + type: extension_in + members: + - name: buffers + doc: | + TODO + namespace: webgpu + type: array + - name: samplers + doc: | + TODO + namespace: webgpu + type: array + - name: texture_views + doc: | + TODO + namespace: webgpu + type: array + + - name: bind_group_layout_entry_extras + doc: | + TODO + type: extension_in + members: + - name: count + doc: | + TODO + type: uint32 + + - name: query_set_descriptor_extras + doc: | + TODO + type: extension_in + members: + - name: pipeline_statistics + doc: | + TODO + type: array + + - name: surface_configuration_extras + doc: | + TODO + type: extension_in + members: + - name: desired_maximum_frame_latency + doc: | + TODO + type: bool + + - name: instance_enumerate_adapters_result + doc: | + TODO + type: standalone + free_members: true + members: + - name: adapters + doc: | + TODO + namespace: webgpu + type: array + +functions: + - name: set_log_callback + doc: | + TODO + args: + - name: callback + doc: | + TODO + type: function_type.log_callback + - name: userdata + doc: | + TODO + type: c_void + pointer: mutable + + - name: set_log_level + doc: | + TODO + args: + - name: level + doc: | + TODO + type: enum.log_level + + - name: get_version + doc: | + TODO + returns: + doc: | + TODO + type: uint32 + +objects: + - name: instance + doc: | + TODO + extended: true + methods: + - name: generate_report + doc: | + TODO + args: + - name: report + doc: | + TODO + type: struct.global_report + pointer: mutable + + - name: enumerate_adapters + doc: | + TODO + args: + - name: backends + doc: | + TODO + type: bitflag.backends + - name: result + doc: | + TODO + type: struct.instance_enumerate_adapters_result + + - name: queue + doc: | + TODO + extended: true + methods: + - name: submit_for_index + doc: | + TODO + returns: + doc: | + TODO + type: uint64 + args: + - name: commands + doc: | + TODO + namespace: webgpu + type: array + + - name: device + doc: | + TODO + extended: true + methods: + - name: poll + doc: | + TODO + returns: + doc: | + TODO + type: bool + args: + - name: wait + doc: | + TODO + type: bool + - name: wrapped_submission_index + doc: | + TODO + type: struct.wrapped_submission_index + pointer: immutable + + - name: render_pass_encoder + doc: | + TODO + extended: true + methods: + - name: set_push_constants + doc: | + TODO + args: + - name: stages + doc: | + TODO + namespace: webgpu + type: bitflag.shader_stage + - name: offset + doc: | + TODO + type: uint32 + - name: size + doc: | + TODO + type: usize + - name: data + doc: | + TODO + pointer: immutable + type: c_void + + - name: multi_draw_indirect + doc: | + TODO + args: + - name: indirect_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: indirect_offset + doc: | + TODO + type: uint32 + - name: count + doc: | + TODO + type: usize + + - name: multi_draw_indexed_indirect + doc: | + TODO + args: + - name: indirect_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: indirect_offset + doc: | + TODO + type: uint32 + - name: count + doc: | + TODO + type: usize + + - name: multi_draw_indirect_count + doc: | + TODO + args: + - name: indirect_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: indirect_offset + doc: | + TODO + type: uint64 + - name: count_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: count_offset + doc: | + TODO + type: uint64 + - name: max_count + doc: | + TODO + type: uint32 + + - name: multi_draw_indexed_indirect_count + doc: | + TODO + args: + - name: indirect_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: indirect_offset + doc: | + TODO + type: uint64 + - name: count_buffer + doc: | + TODO + namespace: webgpu + type: object.buffer + - name: count_offset + doc: | + TODO + type: uint64 + - name: max_count + doc: | + TODO + type: uint32 + + - name: begin_pipeline_statistics_query + doc: | + TODO + args: + - name: query_set + doc: | + TODO + namespace: webgpu + type: object.query_set + - name: query_index + doc: | + TODO + type: uint32 + + - name: end_pipeline_statistics_query + doc: | + TODO + + - name: compute_pass_encoder + doc: | + TODO + extended: true + methods: + - name: begin_pipeline_statistics_query + doc: | + TODO + args: + - name: query_set + doc: | + TODO + namespace: webgpu + type: object.query_set + - name: query_index + doc: | + TODO + type: uint32 + + - name: end_pipeline_statistics_query + doc: | + TODO +