diff --git a/Source/WebCore/PAL/Configurations/PAL.xcconfig b/Source/WebCore/PAL/Configurations/PAL.xcconfig index b01a9cc635e1f..e1349273880d5 100644 --- a/Source/WebCore/PAL/Configurations/PAL.xcconfig +++ b/Source/WebCore/PAL/Configurations/PAL.xcconfig @@ -24,7 +24,9 @@ #include "../../Configurations/FeatureDefines.xcconfig" #include "../../../../Configurations/Version.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(inherited); +WEBGPU_PREPROCESSOR_DEFINITIONS = WGPU_NULLABLE=_Nullable WGPU_NONNULL=_Nonnull WGPU_ASSUME_NONNULL_BEGIN="_Pragma(\"clang assume_nonnull begin\")" WGPU_ASSUME_NONNULL_END="_Pragma(\"clang assume_nonnull end\")"; + +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(WEBGPU_PREPROCESSOR_DEFINITIONS) $(inherited); FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(FRAMEWORK_SEARCH_PATHS_ios_$(CONFIGURATION)); FRAMEWORK_SEARCH_PATHS_ios_Debug = $(BUILT_PRODUCTS_DIR); diff --git a/Source/WebGPU/Configurations/Base.xcconfig b/Source/WebGPU/Configurations/Base.xcconfig index c6cd34f28d8e4..f9caff621ae42 100644 --- a/Source/WebGPU/Configurations/Base.xcconfig +++ b/Source/WebGPU/Configurations/Base.xcconfig @@ -103,7 +103,7 @@ DEAD_CODE_STRIPPING[config=Debug] = NO; DEBUG_DEFINES = NDEBUG; DEBUG_DEFINES[config=Debug] = ; -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) METALCPP_SYMBOL_VISIBILITY_HIDDEN; +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES); WK_DEFAULT_GCC_OPTIMIZATION_LEVEL = 3; WK_DEFAULT_GCC_OPTIMIZATION_LEVEL[config=Debug] = 0; diff --git a/Source/WebGPU/Configurations/WebGPU.xcconfig b/Source/WebGPU/Configurations/WebGPU.xcconfig index 585c9bec0f498..37ec00f169b1a 100644 --- a/Source/WebGPU/Configurations/WebGPU.xcconfig +++ b/Source/WebGPU/Configurations/WebGPU.xcconfig @@ -58,7 +58,7 @@ WEBGPU_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS WEBGPU_FRAMEWORKS_DIR_USE_ALTERNATE_FRAMEWORKS_DIR_NO = $(NORMAL_WEBGPU_FRAMEWORKS_DIR); WEBGPU_FRAMEWORKS_DIR_USE_ALTERNATE_FRAMEWORKS_DIR_YES = $(WK_ALTERNATE_FRAMEWORKS_DIR)/$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks; -GCC_PREPROCESSOR_DEFINITIONS = WGPU_SHARED_LIBRARY WGPU_IMPLEMENTATION $(inherited); +GCC_PREPROCESSOR_DEFINITIONS = WGPU_SHARED_LIBRARY WGPU_IMPLEMENTATION WGPU_NULLABLE=_Nullable WGPU_NONNULL=_Nonnull WGPU_ASSUME_NONNULL_BEGIN="_Pragma(\"clang assume_nonnull begin\")" WGPU_ASSUME_NONNULL_END="_Pragma(\"clang assume_nonnull end\")" $(inherited); DEFINES_MODULE = YES; MODULEMAP_FILE = WebGPU/WebGPU.modulemap; diff --git a/Source/WebGPU/WebGPU/Instance.mm b/Source/WebGPU/WebGPU/Instance.mm index 7922e242a35b0..2042e3f02339d 100644 --- a/Source/WebGPU/WebGPU/Instance.mm +++ b/Source/WebGPU/WebGPU/Instance.mm @@ -224,11 +224,12 @@ void wgpuInstanceProcessEvents(WGPUInstance instance) WebGPU::fromAPI(instance).processEvents(); } -void wgpuInstanceRequestAdapter(WGPUInstance instance, const WGPURequestAdapterOptions* options, WGPURequestAdapterCallback callback, void* userdata) +void wgpuInstanceRequestAdapter(WGPUInstance apiInstance, const WGPURequestAdapterOptions* options, WGPURequestAdapterCallback callback, void* userdata) { - WebGPU::fromAPI(instance).requestAdapter(*options, [callback, userdata](WGPURequestAdapterStatus status, Ref&& adapter, String&& message) { + auto& instance = WebGPU::fromAPI(apiInstance); + instance.requestAdapter(*options, [callback, userdata, instance = Ref { instance }](WGPURequestAdapterStatus status, Ref&& adapter, String&& message) { if (status != WGPURequestAdapterStatus_Success) { - callback(status, nullptr, message.utf8().data(), userdata); + callback(status, WebGPU::releaseToAPI(WebGPU::Adapter::createInvalid(instance)), message.utf8().data(), userdata); return; } diff --git a/Source/WebGPU/WebGPU/WebGPU.h b/Source/WebGPU/WebGPU/WebGPU.h index 14b140db1a388..4594d80dd514b 100644 --- a/Source/WebGPU/WebGPU/WebGPU.h +++ b/Source/WebGPU/WebGPU/WebGPU.h @@ -63,11 +63,22 @@ #if !defined(WGPU_NULLABLE) #define WGPU_NULLABLE #endif +#if !defined(WGPU_NONNULL) +#define WGPU_NONNULL +#endif +#if !defined(WGPU_ASSUME_NONNULL_BEGIN) +#define WGPU_ASSUME_NONNULL_BEGIN +#endif +#if !defined(WGPU_ASSUME_NONNULL_END) +#define WGPU_ASSUME_NONNULL_END +#endif #include #include #include +WGPU_ASSUME_NONNULL_BEGIN + #define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) #define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) #define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) @@ -784,7 +795,7 @@ typedef struct WGPUBufferBindingLayout { typedef struct WGPUBufferDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUBufferUsageFlags usage; uint64_t size; bool mappedAtCreation; @@ -799,17 +810,17 @@ typedef struct WGPUColor { typedef struct WGPUCommandBufferDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; } WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCommandEncoderDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; } WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUCompilationMessage { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * message; + char const * WGPU_NULLABLE message; WGPUCompilationMessageType type; uint64_t lineNum; uint64_t linePos; @@ -891,9 +902,9 @@ typedef struct WGPUOrigin3D { typedef struct WGPUPipelineLayoutDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t bindGroupLayoutCount; - WGPUBindGroupLayout const * bindGroupLayouts; + WGPUBindGroupLayout const WGPU_NONNULL * WGPU_NONNULL bindGroupLayouts; } WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUPrimitiveState @@ -912,7 +923,7 @@ typedef struct WGPUPrimitiveState { typedef struct WGPUQuerySetDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUQueryType type; uint32_t count; WGPUPipelineStatisticName const * pipelineStatistics; @@ -921,17 +932,17 @@ typedef struct WGPUQuerySetDescriptor { typedef struct WGPUQueueDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; } WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderBundleDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; } WGPURenderBundleDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderBundleEncoderDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t colorFormatsCount; WGPUTextureFormat const * colorFormats; WGPUTextureFormat depthStencilFormat; @@ -978,7 +989,7 @@ typedef struct WGPUSamplerBindingLayout { typedef struct WGPUSamplerDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUAddressMode addressModeU; WGPUAddressMode addressModeV; WGPUAddressMode addressModeW; @@ -1026,7 +1037,7 @@ typedef struct WGPUStorageTextureBindingLayout { typedef struct WGPUSurfaceDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; } WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; // Can be chained in WGPUSurfaceDescriptor @@ -1077,7 +1088,7 @@ typedef struct WGPUSurfaceDescriptorFromXlibWindow { typedef struct WGPUSwapChainDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUTextureUsageFlags usage; WGPUTextureFormat format; uint32_t width; @@ -1101,7 +1112,7 @@ typedef struct WGPUTextureDataLayout { typedef struct WGPUTextureViewDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUTextureFormat format; WGPUTextureViewDimension dimension; uint32_t baseMipLevel; @@ -1119,7 +1130,7 @@ typedef struct WGPUVertexAttribute { typedef struct WGPUBindGroupDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUBindGroupLayout layout; uint32_t entryCount; WGPUBindGroupEntry const * entries; @@ -1148,7 +1159,7 @@ typedef struct WGPUCompilationInfo { typedef struct WGPUComputePassDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t timestampWriteCount; WGPUComputePassTimestampWrite const * timestampWrites; } WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; @@ -1204,7 +1215,7 @@ typedef struct WGPURequiredLimits { typedef struct WGPUShaderModuleDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t hintCount; WGPUShaderModuleCompilationHint const * hints; } WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; @@ -1216,7 +1227,7 @@ typedef struct WGPUSupportedLimits { typedef struct WGPUTextureDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPUTextureUsageFlags usage; WGPUTextureDimension dimension; WGPUExtent3D size; @@ -1236,7 +1247,7 @@ typedef struct WGPUVertexBufferLayout { typedef struct WGPUBindGroupLayoutDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t entryCount; WGPUBindGroupLayoutEntry const * entries; } WGPUBindGroupLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; @@ -1244,23 +1255,23 @@ typedef struct WGPUBindGroupLayoutDescriptor { typedef struct WGPUColorTargetState { WGPUChainedStruct const * nextInChain; WGPUTextureFormat format; - WGPU_NULLABLE WGPUBlendState const * blend; + WGPUBlendState const * WGPU_NULLABLE blend; WGPUColorWriteMaskFlags writeMask; } WGPUColorTargetState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUComputePipelineDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPU_NULLABLE WGPUPipelineLayout layout; WGPUProgrammableStageDescriptor compute; } WGPUComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUDeviceDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t requiredFeaturesCount; WGPUFeatureName const * requiredFeatures; - WGPU_NULLABLE WGPURequiredLimits const * requiredLimits; + WGPURequiredLimits const * WGPU_NULLABLE requiredLimits; WGPUQueueDescriptor defaultQueue; WGPUDeviceLostCallback deviceLostCallback; void * deviceLostUserdata; @@ -1268,11 +1279,11 @@ typedef struct WGPUDeviceDescriptor { typedef struct WGPURenderPassDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; uint32_t colorAttachmentCount; WGPURenderPassColorAttachment const * colorAttachments; - WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; - WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; + WGPURenderPassDepthStencilAttachment const * WGPU_NULLABLE depthStencilAttachment; + WGPUQuerySet WGPU_NULLABLE occlusionQuerySet; uint32_t timestampWriteCount; WGPURenderPassTimestampWrite const * timestampWrites; } WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; @@ -1299,13 +1310,13 @@ typedef struct WGPUFragmentState { typedef struct WGPURenderPipelineDescriptor { WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; + char const * WGPU_NULLABLE label; WGPU_NULLABLE WGPUPipelineLayout layout; WGPUVertexState vertex; WGPUPrimitiveState primitive; - WGPU_NULLABLE WGPUDepthStencilState const * depthStencil; + WGPUDepthStencilState const * WGPU_NULLABLE depthStencil; WGPUMultisampleState multisample; - WGPU_NULLABLE WGPUFragmentState const * fragment; + WGPUFragmentState const * WGPU_NULLABLE fragment; } WGPURenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; #ifdef __cplusplus @@ -1314,15 +1325,15 @@ extern "C" { #if !defined(WGPU_SKIP_PROCS) -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUInstance WGPU_NULLABLE (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUProc WGPU_NULLABLE (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; // Procs of Adapter -typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * WGPU_NULLABLE features) WGPU_FUNCTION_ATTRIBUTE; typedef bool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; typedef bool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPUDeviceDescriptor const * WGPU_NULLABLE descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; @@ -1338,9 +1349,9 @@ typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayo // Procs of Buffer typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void const * WGPU_NULLABLE (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void * WGPU_NULLABLE (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUBufferUsage (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; @@ -1355,14 +1366,14 @@ typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer) 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 WGPUComputePassEncoder WGPU_NONNULL (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderPassEncoder WGPU_NONNULL (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderClearBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUCommandBuffer WGPU_NONNULL (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1388,31 +1399,31 @@ typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder compu typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Procs of ComputePipeline -typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroupLayout WGPU_NONNULL (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; // Procs of Device -typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroup WGPU_NONNULL (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroupLayout WGPU_NONNULL (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBuffer WGPU_NONNULL (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUCommandEncoder WGPU_NONNULL (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPUCommandEncoderDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUComputePipeline WGPU_NONNULL (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef 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 WGPUPipelineLayout WGPU_NONNULL (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQuerySet WGPU_NONNULL (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderBundleEncoder WGPU_NONNULL (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderPipeline WGPU_NONNULL (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSampler WGPU_NONNULL (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPUSamplerDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUShaderModule WGPU_NONNULL (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSwapChain WGPU_NONNULL (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTexture WGPU_NONNULL (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * WGPU_NULLABLE features) WGPU_FUNCTION_ATTRIBUTE; typedef bool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQueue WGPU_NONNULL (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; typedef bool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; @@ -1422,9 +1433,9 @@ typedef void (*WGPUProcDeviceReference)(WGPUDevice device) WGPU_FUNCTION_ATTRIBU typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; // Procs of Instance -typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSurface WGPU_NONNULL (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPURequestAdapterOptions const * WGPU_NULLABLE options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceReference)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; @@ -1444,7 +1455,7 @@ typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet) WGPU_FUNCTION_ATT // Procs of Queue typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const WGPU_NONNULL * WGPU_NONNULL commands) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueReference)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; @@ -1459,7 +1470,7 @@ typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBu 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 WGPURenderBundle WGPU_NONNULL (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1481,7 +1492,7 @@ typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder rend typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderEndPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const WGPU_NONNULL * WGPU_NONNULL bundles) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1498,7 +1509,7 @@ typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderP typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; // Procs of RenderPipeline -typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroupLayout WGPU_NONNULL (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; @@ -1520,13 +1531,13 @@ typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTR typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; // Procs of SwapChain -typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureView WGPU_NONNULL (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; // Procs of Texture -typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureView WGPU_NONNULL (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPUTextureViewDescriptor const * WGPU_NULLABLE 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; @@ -1553,11 +1564,11 @@ WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descr WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; // Methods of Adapter -WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * WGPU_NULLABLE features) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * WGPU_NULLABLE descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; @@ -1590,14 +1601,14 @@ WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) WGP 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 WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1632,7 +1643,7 @@ WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPUCommandEncoderDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; @@ -1640,12 +1651,12 @@ WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySe WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * WGPU_NULLABLE features) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT bool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT bool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; @@ -1659,7 +1670,7 @@ WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; // Methods of Instance WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions const * WGPU_NULLABLE options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; @@ -1679,7 +1690,7 @@ WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIB // Methods of Queue WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const WGPU_NONNULL * WGPU_NONNULL commands) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; @@ -1694,7 +1705,7 @@ WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundl 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 WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * WGPU_NULLABLE descriptor) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1716,7 +1727,7 @@ WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderP WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundleCount, WGPURenderBundle const WGPU_NONNULL * WGPU_NONNULL bundles) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1761,7 +1772,7 @@ WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain) WGPU_FUNCTION_A WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; // Methods of Texture -WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * WGPU_NULLABLE 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; @@ -1786,4 +1797,6 @@ WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTI } // extern "C" #endif +WGPU_ASSUME_NONNULL_END + #endif // WEBGPU_H_