From d6e25875f06e8db41856c4020ab9762157a24b40 Mon Sep 17 00:00:00 2001 From: RDW Date: Sun, 1 Jun 2025 02:42:14 +0200 Subject: [PATCH 01/29] Deps: Update wgpu-native to the latest HEAD --- deps/gfx-rs/wgpu-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/gfx-rs/wgpu-native b/deps/gfx-rs/wgpu-native index 506751845..af9074edf 160000 --- a/deps/gfx-rs/wgpu-native +++ b/deps/gfx-rs/wgpu-native @@ -1 +1 @@ -Subproject commit 506751845a486094089b927de57f2877f786beab +Subproject commit af9074edf144efe4f1432b2e42c477429c4964c1 From 166a11d52c25111d0ec1a062320fd1ace69c2802 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:02:09 +0200 Subject: [PATCH 02/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 4d23e02a2..7b5e53fb3 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1421,10 +1421,9 @@ typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView); typedef enum WGPUNativeSType { // Start at 0003 since that's allocated range for wgpu-native WGPUSType_DeviceExtras = 0x00030001, - WGPUSType_RequiredLimitsExtras = 0x00030002, + WGPUSType_NativeLimits = 0x00030002, WGPUSType_PipelineLayoutExtras = 0x00030003, WGPUSType_ShaderModuleGLSLDescriptor = 0x00030004, - WGPUSType_SupportedLimitsExtras = 0x00030005, WGPUSType_InstanceExtras = 0x00030006, WGPUSType_BindGroupEntryExtras = 0x00030007, WGPUSType_BindGroupLayoutEntryExtras = 0x00030008, From 4f2b49595f58eebe5a97c9e6cceb756dc56d6c14 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:02:14 +0200 Subject: [PATCH 03/29] Update wgpu-library.spec.lua --- Tests/BDD/wgpu-library.spec.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/BDD/wgpu-library.spec.lua b/Tests/BDD/wgpu-library.spec.lua index 0cebc15fa..b66465dfc 100644 --- a/Tests/BDD/wgpu-library.spec.lua +++ b/Tests/BDD/wgpu-library.spec.lua @@ -14,10 +14,9 @@ describe("wgpu", function() it("should export native wgpu extension enums", function() -- WGPUNativeSType assertNumber(ffi.C.WGPUSType_DeviceExtras) - assertNumber(ffi.C.WGPUSType_RequiredLimitsExtras) + assertNumber(ffi.C.WGPUSType_NativeLimits) assertNumber(ffi.C.WGPUSType_PipelineLayoutExtras) assertNumber(ffi.C.WGPUSType_ShaderModuleGLSLDescriptor) - assertNumber(ffi.C.WGPUSType_SupportedLimitsExtras) assertNumber(ffi.C.WGPUSType_InstanceExtras) assertNumber(ffi.C.WGPUSType_BindGroupEntryExtras) assertNumber(ffi.C.WGPUSType_BindGroupLayoutEntryExtras) From de16ba735c81ce07b83625af4c3d123a0abc294c Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:11:05 +0200 Subject: [PATCH 04/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 7b5e53fb3..6c573569d 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1495,7 +1495,6 @@ typedef enum WGPUInstanceBackend { WGPUInstanceBackend_Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11, WGPUInstanceBackend_Force32 = 0x7FFFFFFF } WGPUInstanceBackend; -typedef WGPUFlags WGPUInstanceBackendFlags; typedef enum WGPUInstanceFlag { WGPUInstanceFlag_Default = 0x00000000, @@ -1504,7 +1503,6 @@ typedef enum WGPUInstanceFlag { WGPUInstanceFlag_DiscardHalLabels = 1 << 2, WGPUInstanceFlag_Force32 = 0x7FFFFFFF } WGPUInstanceFlag; -typedef WGPUFlags WGPUInstanceFlags; typedef enum WGPUDx12Compiler { WGPUDx12Compiler_Undefined = 0x00000000, @@ -1537,17 +1535,17 @@ typedef enum WGPUNativeQueryType { typedef struct WGPUInstanceExtras { WGPUChainedStruct chain; - WGPUInstanceBackendFlags backends; - WGPUInstanceFlags flags; + WGPUInstanceBackend backends; + WGPUInstanceFlag flags; WGPUDx12Compiler dx12ShaderCompiler; WGPUGles3MinorVersion gles3MinorVersion; - const char* dxilPath; - const char* dxcPath; + WGPUStringView dxilPath; + WGPUStringView dxcPath; } WGPUInstanceExtras; typedef struct WGPUDeviceExtras { WGPUChainedStruct chain; - const char* tracePath; + WGPUStringView tracePath; } WGPUDeviceExtras; typedef struct WGPUNativeLimits { @@ -1641,7 +1639,7 @@ typedef struct WGPUGlobalReport { typedef struct WGPUInstanceEnumerateAdapterOptions { WGPUChainedStruct const* nextInChain; - WGPUInstanceBackendFlags backends; + WGPUInstanceBackend backends; } WGPUInstanceEnumerateAdapterOptions; typedef struct WGPUBindGroupEntryExtras { From 92bf76cd8719c862703f46ce94a85b9c359fd9a3 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:14:15 +0200 Subject: [PATCH 05/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 6c573569d..b343fa673 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -574,7 +574,7 @@ typedef enum WGPUShaderStage { WGPUShaderStage_Compute = 0x00000004, WGPUShaderStage_Force32 = 0x7FFFFFFF } WGPUShaderStage; -typedef WGPUFlags WGPUShaderStageFlags; +typedef WGPUFlags WGPUShaderStage; typedef enum WGPUTextureUsage { WGPUTextureUsage_None = 0x00000000, @@ -1004,7 +1004,7 @@ typedef struct WGPUBindGroupDescriptor { typedef struct WGPUBindGroupLayoutEntry { WGPUChainedStruct const* nextInChain; uint32_t binding; - WGPUShaderStageFlags visibility; + WGPUShaderStage visibility; WGPUBufferBindingLayout buffer; WGPUSamplerBindingLayout sampler; WGPUTextureBindingLayout texture; @@ -1549,22 +1549,13 @@ typedef struct WGPUDeviceExtras { } WGPUDeviceExtras; typedef struct WGPUNativeLimits { + WGPUChainedStructOut chain; uint32_t maxPushConstantSize; uint32_t maxNonSamplerBindings; } WGPUNativeLimits; -typedef struct WGPURequiredLimitsExtras { - WGPUChainedStruct chain; - WGPUNativeLimits limits; -} WGPURequiredLimitsExtras; - -typedef struct WGPUSupportedLimitsExtras { - WGPUChainedStructOut chain; - WGPUNativeLimits limits; -} WGPUSupportedLimitsExtras; - typedef struct WGPUPushConstantRange { - WGPUShaderStageFlags stages; + WGPUShaderStage stages; uint32_t start; uint32_t end; } WGPUPushConstantRange; From 7a56ab244a7e74d2e63d22cc30c8a1cb7b538465 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:14:24 +0200 Subject: [PATCH 06/29] Update wgpu_exports.h --- Runtime/Bindings/FFI/wgpu/wgpu_exports.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h index c511a27d9..551173565 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h @@ -251,8 +251,8 @@ struct static_wgpu_exports_table { uint32_t (*wgpu_get_version)(void); void (*wgpu_compute_pass_encoder_set_push_constants)(WGPUComputePassEncoder encoder, uint32_t offset, uint32_t sizeBytes, void const* data); - void (*wgpu_render_pass_encoder_set_push_constants)(WGPURenderPassEncoder encoder, WGPUShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const* data); - void (*wgpu_render_bundle_encoder_set_push_constants)(WGPURenderBundleEncoder encoder, WGPUShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const* data); + void (*wgpu_render_pass_encoder_set_push_constants)(WGPURenderPassEncoder encoder, WGPUShaderStage stages, uint32_t offset, uint32_t sizeBytes, void const* data); + void (*wgpu_render_bundle_encoder_set_push_constants)(WGPURenderBundleEncoder encoder, WGPUShaderStage stages, uint32_t offset, uint32_t sizeBytes, void const* data); void (*wgpu_render_pass_encoder_multi_draw_indirect)(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); void (*wgpu_render_pass_encoder_multi_draw_indexed_indirect)(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); From 060beed0e9693d9c546c1dee059e7fae3e896231 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:14:29 +0200 Subject: [PATCH 07/29] Update wgpu-library.spec.lua --- Tests/BDD/wgpu-library.spec.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/BDD/wgpu-library.spec.lua b/Tests/BDD/wgpu-library.spec.lua index b66465dfc..0ac006dbc 100644 --- a/Tests/BDD/wgpu-library.spec.lua +++ b/Tests/BDD/wgpu-library.spec.lua @@ -96,8 +96,6 @@ describe("wgpu", function() assertStruct(new("WGPUInstanceExtras")) assertStruct(new("WGPUDeviceExtras")) assertStruct(new("WGPUNativeLimits")) - assertStruct(new("WGPURequiredLimitsExtras")) - assertStruct(new("WGPUSupportedLimitsExtras")) assertStruct(new("WGPUPushConstantRange")) assertStruct(new("WGPUPipelineLayoutExtras")) assertStruct(new("WGPUSubmissionIndex")) From c7dd922f32275f0fedabc25db34fc98ce4c3c61f Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:16:40 +0200 Subject: [PATCH 08/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index b343fa673..84af2f7fe 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1568,26 +1568,21 @@ typedef struct WGPUPipelineLayoutExtras { typedef uint64_t WGPUSubmissionIndex; -typedef struct WGPUWrappedSubmissionIndex { - WGPUQueue queue; - WGPUSubmissionIndex submissionIndex; -} WGPUWrappedSubmissionIndex; - typedef struct WGPUShaderDefine { - char const* name; - char const* value; + WGPUStringView name; + WGPUStringView value; } WGPUShaderDefine; typedef struct WGPUShaderModuleGLSLDescriptor { WGPUChainedStruct chain; WGPUShaderStage stage; - char const* code; + WGPUStringView code; uint32_t defineCount; WGPUShaderDefine* defines; } WGPUShaderModuleGLSLDescriptor; typedef struct WGPUShaderModuleDescriptorSpirV { - char const* label; + WGPUStringView label; uint32_t sourceSize; uint32_t const* source; } WGPUShaderModuleDescriptorSpirV; @@ -1596,7 +1591,6 @@ typedef struct WGPURegistryReport { size_t numAllocated; size_t numKeptFromUser; size_t numReleasedFromUser; - size_t numError; size_t elementSize; } WGPURegistryReport; @@ -1612,6 +1606,7 @@ typedef struct WGPUHubReport { WGPURegistryReport renderBundles; WGPURegistryReport renderPipelines; WGPURegistryReport computePipelines; + WGPURegistryReport pipelineCaches; WGPURegistryReport querySets; WGPURegistryReport buffers; WGPURegistryReport textures; From a206cbd03ad11dbcb0c91a5c0debd62c87242ce8 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:20:34 +0200 Subject: [PATCH 09/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 84af2f7fe..66f632599 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1616,11 +1616,7 @@ typedef struct WGPUHubReport { typedef struct WGPUGlobalReport { WGPURegistryReport surfaces; - WGPUBackendType backendType; - WGPUHubReport vulkan; - WGPUHubReport metal; - WGPUHubReport dx12; - WGPUHubReport gl; + WGPUHubReport hub; } WGPUGlobalReport; typedef struct WGPUInstanceEnumerateAdapterOptions { @@ -1654,7 +1650,7 @@ typedef struct WGPUSurfaceConfigurationExtras { uint32_t desiredMaximumFrameLatency; } WGPUSurfaceConfigurationExtras; -typedef void (*WGPULogCallback)(WGPULogLevel level, char const* message, void* userdata); +typedef void (*WGPULogCallback)(WGPULogLevel level, WGPUStringView message, void* userdata); typedef enum WGPUNativeTextureFormat { // From Features::TEXTURE_FORMAT_16BIT_NORM From f3d59b9083224f8f2c4f4956ba99351a7deb9559 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:20:41 +0200 Subject: [PATCH 10/29] Update wgpu_exports.h --- Runtime/Bindings/FFI/wgpu/wgpu_exports.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h index 551173565..9b02a7a90 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h @@ -242,7 +242,7 @@ struct static_wgpu_exports_table { WGPUSubmissionIndex (*wgpu_queue_submit_for_index)(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const* commands); WGPUShaderModule (*wgpu_device_create_shader_module_spirv)(WGPUDevice device, WGPUShaderModuleDescriptorSpirV const* descriptor); - WGPUBool (*wgpu_device_poll)(WGPUDevice device, WGPUBool wait, WGPUWrappedSubmissionIndex const* wrappedSubmissionIndex); + WGPUBool (*wgpu_device_poll)(WGPUDevice device, WGPUBool wait, WGPUSubmissionIndex const* wrappedSubmissionIndex); void (*wgpu_set_log_callback)(WGPULogCallback callback, void* userdata); From 4073e8ee21c91389c221145791a46f3041dc9e5c Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:35:09 +0200 Subject: [PATCH 11/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 66f632599..fd047a19f 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1,5 +1,5 @@ // WebGPU API (from webgpu.h) -typedef uint32_t WGPUFlags; +typedef uint64_t WGPUFlags; typedef uint32_t WGPUBool; typedef struct WGPUAdapterImpl* WGPUAdapter; @@ -25,6 +25,26 @@ typedef struct WGPUSurfaceImpl* WGPUSurface; typedef struct WGPUTextureImpl* WGPUTexture; typedef struct WGPUTextureViewImpl* WGPUTextureView; +// Questionable translation from #defines (this could certainly be improved) +typedef enum WGPUSharedConstants { + uint32_t WGPU_ARRAY_LAYER_COUNT_UNDEFINED = UINT32_MAX; + uint32_t WGPU_COPY_STRIDE_UNDEFINED = UINT32_MAX; + uint32_t WGPU_DEPTH_SLICE_UNDEFINED = UINT32_MAX; + uint32_t WGPU_LIMIT_U32_UNDEFINED = UINT32_MAX; + uint64_t WGPU_LIMIT_U64_UNDEFINED = UINT64_MAX; + uint32_t WGPU_MIP_LEVEL_COUNT_UNDEFINED = UINT32_MAX; + uint32_t WGPU_QUERY_SET_INDEX_UNDEFINED = UINT32_MAX; + size_t WGPU_WHOLE_MAP_SIZE = SIZE_MAX; + uint64_t WGPU_WHOLE_SIZE = UINT64_MAX; + + size_t WGPU_STRLEN SIZE_MAX; +} WGPUSharedConstants; + +typedef struct WGPUStringView { + char const * data; + size_t length; +} WGPUStringView; + typedef enum WGPUAdapterType { WGPUAdapterType_DiscreteGPU = 0x00000000, WGPUAdapterType_IntegratedGPU = 0x00000001, @@ -1662,4 +1682,4 @@ typedef enum WGPUNativeTextureFormat { WGPUNativeTextureFormat_Rgba16Snorm = 0x00030006, // From Features::TEXTURE_FORMAT_NV12 WGPUNativeTextureFormat_NV12 = 0x00030007, -} WGPUNativeTextureFormat; \ No newline at end of file +} WGPUNativeTextureFormat; From 4216348e48c6d405777cc85f391205d5a07f47a6 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:36:34 +0200 Subject: [PATCH 12/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index fd047a19f..693efdd3d 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -36,7 +36,7 @@ typedef enum WGPUSharedConstants { uint32_t WGPU_QUERY_SET_INDEX_UNDEFINED = UINT32_MAX; size_t WGPU_WHOLE_MAP_SIZE = SIZE_MAX; uint64_t WGPU_WHOLE_SIZE = UINT64_MAX; - + // WGPUStringView size_t WGPU_STRLEN SIZE_MAX; } WGPUSharedConstants; From 5f4f6e9affdbdf30799e199a5c0640cefcb6950a Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:45:57 +0200 Subject: [PATCH 13/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 158 ++++++++++++----------- 1 file changed, 84 insertions(+), 74 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 693efdd3d..ceaf50b3e 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -46,17 +46,18 @@ typedef struct WGPUStringView { } WGPUStringView; typedef enum WGPUAdapterType { - WGPUAdapterType_DiscreteGPU = 0x00000000, - WGPUAdapterType_IntegratedGPU = 0x00000001, - WGPUAdapterType_CPU = 0x00000002, - WGPUAdapterType_Unknown = 0x00000003, + WGPUAdapterType_DiscreteGPU = 0x00000001, + WGPUAdapterType_IntegratedGPU = 0x00000002, + WGPUAdapterType_CPU = 0x00000003, + WGPUAdapterType_Unknown = 0x00000004, WGPUAdapterType_Force32 = 0x7FFFFFFF } WGPUAdapterType; typedef enum WGPUAddressMode { - WGPUAddressMode_Repeat = 0x00000000, - WGPUAddressMode_MirrorRepeat = 0x00000001, - WGPUAddressMode_ClampToEdge = 0x00000002, + WGPUAddressMode_Undefined = 0x00000000, + WGPUAddressMode_ClampToEdge = 0x00000001, + WGPUAddressMode_Repeat = 0x00000002, + WGPUAddressMode_MirrorRepeat = 0x00000003, WGPUAddressMode_Force32 = 0x7FFFFFFF } WGPUAddressMode; @@ -74,84 +75,86 @@ typedef enum WGPUBackendType { } WGPUBackendType; typedef enum WGPUBlendFactor { - WGPUBlendFactor_Zero = 0x00000000, - WGPUBlendFactor_One = 0x00000001, - WGPUBlendFactor_Src = 0x00000002, - WGPUBlendFactor_OneMinusSrc = 0x00000003, - WGPUBlendFactor_SrcAlpha = 0x00000004, - WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005, - WGPUBlendFactor_Dst = 0x00000006, - WGPUBlendFactor_OneMinusDst = 0x00000007, - WGPUBlendFactor_DstAlpha = 0x00000008, - WGPUBlendFactor_OneMinusDstAlpha = 0x00000009, - WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A, - WGPUBlendFactor_Constant = 0x0000000B, - WGPUBlendFactor_OneMinusConstant = 0x0000000C, + WGPUBlendFactor_Undefined = 0x00000000, + WGPUBlendFactor_Zero = 0x00000001, + WGPUBlendFactor_One = 0x00000002, + WGPUBlendFactor_Src = 0x00000003, + WGPUBlendFactor_OneMinusSrc = 0x00000004, + WGPUBlendFactor_SrcAlpha = 0x00000005, + WGPUBlendFactor_OneMinusSrcAlpha = 0x00000006, + WGPUBlendFactor_Dst = 0x00000007, + WGPUBlendFactor_OneMinusDst = 0x00000008, + WGPUBlendFactor_DstAlpha = 0x00000009, + WGPUBlendFactor_OneMinusDstAlpha = 0x0000000A, + WGPUBlendFactor_SrcAlphaSaturated = 0x0000000B, + WGPUBlendFactor_Constant = 0x0000000C, + WGPUBlendFactor_OneMinusConstant = 0x0000000D, + WGPUBlendFactor_Src1 = 0x0000000E, + WGPUBlendFactor_OneMinusSrc1 = 0x0000000F, + WGPUBlendFactor_Src1Alpha = 0x00000010, + WGPUBlendFactor_OneMinusSrc1Alpha = 0x00000011, WGPUBlendFactor_Force32 = 0x7FFFFFFF } WGPUBlendFactor; typedef enum WGPUBlendOperation { - WGPUBlendOperation_Add = 0x00000000, - WGPUBlendOperation_Subtract = 0x00000001, - WGPUBlendOperation_ReverseSubtract = 0x00000002, - WGPUBlendOperation_Min = 0x00000003, - WGPUBlendOperation_Max = 0x00000004, + WGPUBlendOperation_Undefined = 0x00000000, + WGPUBlendOperation_Add = 0x00000001, + WGPUBlendOperation_Subtract = 0x00000002, + WGPUBlendOperation_ReverseSubtract = 0x00000003, + WGPUBlendOperation_Min = 0x00000004, + WGPUBlendOperation_Max = 0x00000005, WGPUBlendOperation_Force32 = 0x7FFFFFFF } WGPUBlendOperation; typedef enum WGPUBufferBindingType { - WGPUBufferBindingType_Undefined = 0x00000000, - WGPUBufferBindingType_Uniform = 0x00000001, - WGPUBufferBindingType_Storage = 0x00000002, - WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, + WGPUBufferBindingType_BindingNotUsed = 0x00000000, + WGPUBufferBindingType_Undefined = 0x00000001, + WGPUBufferBindingType_Uniform = 0x00000002, + WGPUBufferBindingType_Storage = 0x00000003, + WGPUBufferBindingType_ReadOnlyStorage = 0x00000004, WGPUBufferBindingType_Force32 = 0x7FFFFFFF } WGPUBufferBindingType; -typedef enum WGPUBufferMapAsyncStatus { - WGPUBufferMapAsyncStatus_Success = 0x00000000, - WGPUBufferMapAsyncStatus_ValidationError = 0x00000001, - WGPUBufferMapAsyncStatus_Unknown = 0x00000002, - WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, - WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, - WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, - WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000006, - WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000007, - WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000008, - WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUBufferMapAsyncStatus; - typedef enum WGPUBufferMapState { - WGPUBufferMapState_Unmapped = 0x00000000, - WGPUBufferMapState_Pending = 0x00000001, - WGPUBufferMapState_Mapped = 0x00000002, + WGPUBufferMapState_Unmapped = 0x00000001, + WGPUBufferMapState_Pending = 0x00000002, + WGPUBufferMapState_Mapped = 0x00000003, WGPUBufferMapState_Force32 = 0x7FFFFFFF } WGPUBufferMapState; +typedef enum WGPUCallbackMode { + WGPUCallbackMode_WaitAnyOnly = 0x00000001, + WGPUCallbackMode_AllowProcessEvents = 0x00000002, + WGPUCallbackMode_AllowSpontaneous = 0x00000003, + WGPUCallbackMode_Force32 = 0x7FFFFFFF + } WGPUCallbackMode; + + typedef enum WGPUCompareFunction { WGPUCompareFunction_Undefined = 0x00000000, WGPUCompareFunction_Never = 0x00000001, WGPUCompareFunction_Less = 0x00000002, - WGPUCompareFunction_LessEqual = 0x00000003, - WGPUCompareFunction_Greater = 0x00000004, - WGPUCompareFunction_GreaterEqual = 0x00000005, - WGPUCompareFunction_Equal = 0x00000006, - WGPUCompareFunction_NotEqual = 0x00000007, + WGPUCompareFunction_Equal = 0x00000003, + WGPUCompareFunction_LessEqual = 0x00000004, + WGPUCompareFunction_Greater = 0x00000005, + WGPUCompareFunction_NotEqual = 0x00000006, + WGPUCompareFunction_GreaterEqual = 0x00000007, WGPUCompareFunction_Always = 0x00000008, WGPUCompareFunction_Force32 = 0x7FFFFFFF } WGPUCompareFunction; typedef enum WGPUCompilationInfoRequestStatus { - WGPUCompilationInfoRequestStatus_Success = 0x00000000, - WGPUCompilationInfoRequestStatus_Error = 0x00000001, - WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002, - WGPUCompilationInfoRequestStatus_Unknown = 0x00000003, + WGPUCompilationInfoRequestStatus_Success = 0x00000001, + WGPUCompilationInfoRequestStatus_InstanceDropped = 0x00000002, + WGPUCompilationInfoRequestStatus_Error = 0x00000003, + WGPUCompilationInfoRequestStatus_Unknown = 0x00000004, WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF } WGPUCompilationInfoRequestStatus; typedef enum WGPUCompilationMessageType { - WGPUCompilationMessageType_Error = 0x00000000, - WGPUCompilationMessageType_Warning = 0x00000001, - WGPUCompilationMessageType_Info = 0x00000002, + WGPUCompilationMessageType_Error = 0x00000001, + WGPUCompilationMessageType_Warning = 0x00000002, + WGPUCompilationMessageType_Info = 0x00000003, WGPUCompilationMessageType_Force32 = 0x7FFFFFFF } WGPUCompilationMessageType; @@ -165,45 +168,52 @@ typedef enum WGPUCompositeAlphaMode { } WGPUCompositeAlphaMode; typedef enum WGPUCreatePipelineAsyncStatus { - WGPUCreatePipelineAsyncStatus_Success = 0x00000000, - WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000001, - WGPUCreatePipelineAsyncStatus_InternalError = 0x00000002, - WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000003, - WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000004, + WGPUCreatePipelineAsyncStatus_Success = 0x00000001, + WGPUCreatePipelineAsyncStatus_InstanceDropped = 0x00000002, + WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000003, + WGPUCreatePipelineAsyncStatus_InternalError = 0x00000004, WGPUCreatePipelineAsyncStatus_Unknown = 0x00000005, WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF } WGPUCreatePipelineAsyncStatus; typedef enum WGPUCullMode { - WGPUCullMode_None = 0x00000000, - WGPUCullMode_Front = 0x00000001, - WGPUCullMode_Back = 0x00000002, + WGPUCullMode_Undefined = 0x00000000, + WGPUCullMode_None = 0x00000001, + WGPUCullMode_Front = 0x00000002, + WGPUCullMode_Back = 0x00000003, WGPUCullMode_Force32 = 0x7FFFFFFF } WGPUCullMode; typedef enum WGPUDeviceLostReason { WGPUDeviceLostReason_Unknown = 0x00000001, WGPUDeviceLostReason_Destroyed = 0x00000002, + WGPUDeviceLostReason_InstanceDropped = 0x00000003, + WGPUDeviceLostReason_FailedCreation = 0x00000004, WGPUDeviceLostReason_Force32 = 0x7FFFFFFF } WGPUDeviceLostReason; typedef enum WGPUErrorFilter { - WGPUErrorFilter_Validation = 0x00000000, - WGPUErrorFilter_OutOfMemory = 0x00000001, - WGPUErrorFilter_Internal = 0x00000002, + WGPUErrorFilter_Validation = 0x00000001, + WGPUErrorFilter_OutOfMemory = 0x00000002, + WGPUErrorFilter_Internal = 0x00000003, WGPUErrorFilter_Force32 = 0x7FFFFFFF } WGPUErrorFilter; typedef enum WGPUErrorType { - WGPUErrorType_NoError = 0x00000000, - WGPUErrorType_Validation = 0x00000001, - WGPUErrorType_OutOfMemory = 0x00000002, - WGPUErrorType_Internal = 0x00000003, - WGPUErrorType_Unknown = 0x00000004, - WGPUErrorType_DeviceLost = 0x00000005, + WGPUErrorType_NoError = 0x00000001, + WGPUErrorType_Validation = 0x00000002, + WGPUErrorType_OutOfMemory = 0x00000003, + WGPUErrorType_Internal = 0x00000004, + WGPUErrorType_Unknown = 0x00000005, WGPUErrorType_Force32 = 0x7FFFFFFF } WGPUErrorType; +typedef enum WGPUFeatureLevel { + WGPUFeatureLevel_Compatibility = 0x00000001, + WGPUFeatureLevel_Core = 0x00000002, + WGPUFeatureLevel_Force32 = 0x7FFFFFFF +} WGPUFeatureLevel; + typedef enum WGPUFeatureName { WGPUFeatureName_Undefined = 0x00000000, WGPUFeatureName_DepthClipControl = 0x00000001, From a5417c490ed341388ea84e628afbf464f5ff893f Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:52:28 +0200 Subject: [PATCH 14/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 171 ++++++++++++++--------- 1 file changed, 106 insertions(+), 65 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index ceaf50b3e..3324c1267 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -220,25 +220,32 @@ typedef enum WGPUFeatureName { WGPUFeatureName_Depth32FloatStencil8 = 0x00000002, WGPUFeatureName_TimestampQuery = 0x00000003, WGPUFeatureName_TextureCompressionBC = 0x00000004, - WGPUFeatureName_TextureCompressionETC2 = 0x00000005, - WGPUFeatureName_TextureCompressionASTC = 0x00000006, - WGPUFeatureName_IndirectFirstInstance = 0x00000007, - WGPUFeatureName_ShaderF16 = 0x00000008, - WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009, - WGPUFeatureName_BGRA8UnormStorage = 0x0000000A, - WGPUFeatureName_Float32Filterable = 0x0000000B, + WGPUFeatureName_TextureCompressionBCSliced3D = 0x00000005, + WGPUFeatureName_TextureCompressionETC2 = 0x00000006, + WGPUFeatureName_TextureCompressionASTC = 0x00000007, + WGPUFeatureName_TextureCompressionASTCSliced3D = 0x00000008, + WGPUFeatureName_IndirectFirstInstance = 0x00000009, + WGPUFeatureName_ShaderF16 = 0x0000000A, + WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000B, + WGPUFeatureName_BGRA8UnormStorage = 0x0000000C, + WGPUFeatureName_Float32Filterable = 0x0000000D, + WGPUFeatureName_Float32Blendable = 0x0000000E, + WGPUFeatureName_ClipDistances = 0x0000000F, + WGPUFeatureName_DualSourceBlending = 0x00000010, WGPUFeatureName_Force32 = 0x7FFFFFFF } WGPUFeatureName; typedef enum WGPUFilterMode { - WGPUFilterMode_Nearest = 0x00000000, - WGPUFilterMode_Linear = 0x00000001, + WGPUFilterMode_Undefined = 0x00000000, + WGPUFilterMode_Nearest = 0x00000001, + WGPUFilterMode_Linear = 0x00000002, WGPUFilterMode_Force32 = 0x7FFFFFFF } WGPUFilterMode; typedef enum WGPUFrontFace { - WGPUFrontFace_CCW = 0x00000000, - WGPUFrontFace_CW = 0x00000001, + WGPUFrontFace_Undefined = 0x00000000, + WGPUFrontFace_CCW = 0x00000001, + WGPUFrontFace_CW = 0x00000002, WGPUFrontFace_Force32 = 0x7FFFFFFF } WGPUFrontFace; @@ -251,17 +258,41 @@ typedef enum WGPUIndexFormat { typedef enum WGPULoadOp { WGPULoadOp_Undefined = 0x00000000, - WGPULoadOp_Clear = 0x00000001, - WGPULoadOp_Load = 0x00000002, + WGPULoadOp_Load = 0x00000001, + WGPULoadOp_Clear = 0x00000002, WGPULoadOp_Force32 = 0x7FFFFFFF } WGPULoadOp; +typedef enum WGPUMapAsyncStatus { + WGPUMapAsyncStatus_Success = 0x00000001, + WGPUMapAsyncStatus_InstanceDropped = 0x00000002, + WGPUMapAsyncStatus_Error = 0x00000003, + WGPUMapAsyncStatus_Aborted = 0x00000004, + WGPUMapAsyncStatus_Unknown = 0x00000005, + WGPUMapAsyncStatus_Force32 = 0x7FFFFFFF +} WGPUMapAsyncStatus; + typedef enum WGPUMipmapFilterMode { - WGPUMipmapFilterMode_Nearest = 0x00000000, - WGPUMipmapFilterMode_Linear = 0x00000001, + WGPUMipmapFilterMode_Undefined = 0x00000000, + WGPUMipmapFilterMode_Nearest = 0x00000001, + WGPUMipmapFilterMode_Linear = 0x00000002, WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF } WGPUMipmapFilterMode; +typedef enum WGPUOptionalBool { + WGPUOptionalBool_False = 0x00000000, + WGPUOptionalBool_True = 0x00000001, + WGPUOptionalBool_Undefined = 0x00000002, + WGPUOptionalBool_Force32 = 0x7FFFFFFF +} WGPUOptionalBool; + +typedef enum WGPUPopErrorScopeStatus { + WGPUPopErrorScopeStatus_Success = 0x00000001, + WGPUPopErrorScopeStatus_InstanceDropped = 0x00000002, + WGPUPopErrorScopeStatus_EmptyStack = 0x00000003, + WGPUPopErrorScopeStatus_Force32 = 0x7FFFFFFF +} WGPUPopErrorScopeStatus; + typedef enum WGPUPowerPreference { WGPUPowerPreference_Undefined = 0x00000000, WGPUPowerPreference_LowPower = 0x00000001, @@ -270,92 +301,102 @@ typedef enum WGPUPowerPreference { } WGPUPowerPreference; typedef enum WGPUPresentMode { - WGPUPresentMode_Fifo = 0x00000000, - WGPUPresentMode_FifoRelaxed = 0x00000001, - WGPUPresentMode_Immediate = 0x00000002, - WGPUPresentMode_Mailbox = 0x00000003, + WGPUPresentMode_Undefined = 0x00000000, + WGPUPresentMode_Fifo = 0x00000001, + WGPUPresentMode_FifoRelaxed = 0x00000002, + WGPUPresentMode_Immediate = 0x00000003, + WGPUPresentMode_Mailbox = 0x00000004, WGPUPresentMode_Force32 = 0x7FFFFFFF } WGPUPresentMode; typedef enum WGPUPrimitiveTopology { - WGPUPrimitiveTopology_PointList = 0x00000000, - WGPUPrimitiveTopology_LineList = 0x00000001, - WGPUPrimitiveTopology_LineStrip = 0x00000002, - WGPUPrimitiveTopology_TriangleList = 0x00000003, - WGPUPrimitiveTopology_TriangleStrip = 0x00000004, + WGPUPrimitiveTopology_Undefined = 0x00000000, + WGPUPrimitiveTopology_PointList = 0x00000001, + WGPUPrimitiveTopology_LineList = 0x00000002, + WGPUPrimitiveTopology_LineStrip = 0x00000003, + WGPUPrimitiveTopology_TriangleList = 0x00000004, + WGPUPrimitiveTopology_TriangleStrip = 0x00000005, WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF } WGPUPrimitiveTopology; typedef enum WGPUQueryType { - WGPUQueryType_Occlusion = 0x00000000, - WGPUQueryType_Timestamp = 0x00000001, + WGPUQueryType_Occlusion = 0x00000001, + WGPUQueryType_Timestamp = 0x00000002, WGPUQueryType_Force32 = 0x7FFFFFFF } WGPUQueryType; typedef enum WGPUQueueWorkDoneStatus { - WGPUQueueWorkDoneStatus_Success = 0x00000000, - WGPUQueueWorkDoneStatus_Error = 0x00000001, - WGPUQueueWorkDoneStatus_Unknown = 0x00000002, - WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003, + WGPUQueueWorkDoneStatus_Success = 0x00000001, + WGPUQueueWorkDoneStatus_InstanceDropped = 0x00000002, + WGPUQueueWorkDoneStatus_Error = 0x00000003, + WGPUQueueWorkDoneStatus_Unknown = 0x00000004, WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF } WGPUQueueWorkDoneStatus; typedef enum WGPURequestAdapterStatus { - WGPURequestAdapterStatus_Success = 0x00000000, - WGPURequestAdapterStatus_Unavailable = 0x00000001, - WGPURequestAdapterStatus_Error = 0x00000002, - WGPURequestAdapterStatus_Unknown = 0x00000003, + WGPURequestAdapterStatus_Success = 0x00000001, + WGPURequestAdapterStatus_InstanceDropped = 0x00000002, + WGPURequestAdapterStatus_Unavailable = 0x00000003, + WGPURequestAdapterStatus_Error = 0x00000004, + WGPURequestAdapterStatus_Unknown = 0x00000005, WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF } WGPURequestAdapterStatus; typedef enum WGPURequestDeviceStatus { - WGPURequestDeviceStatus_Success = 0x00000000, - WGPURequestDeviceStatus_Error = 0x00000001, - WGPURequestDeviceStatus_Unknown = 0x00000002, + WGPURequestDeviceStatus_Success = 0x00000001, + WGPURequestDeviceStatus_InstanceDropped = 0x00000002, + WGPURequestDeviceStatus_Error = 0x00000003, + WGPURequestDeviceStatus_Unknown = 0x00000004, WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF } WGPURequestDeviceStatus; typedef enum WGPUSType { - WGPUSType_Invalid = 0x00000000, - WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001, - WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002, - WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003, - WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, - WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, - WGPUSType_PrimitiveDepthClipControl = 0x00000007, - WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008, - WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009, - WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A, - WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, + WGPUSType_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_Force32 = 0x7FFFFFFF } WGPUSType; typedef enum WGPUSamplerBindingType { - WGPUSamplerBindingType_Undefined = 0x00000000, - WGPUSamplerBindingType_Filtering = 0x00000001, - WGPUSamplerBindingType_NonFiltering = 0x00000002, - WGPUSamplerBindingType_Comparison = 0x00000003, + WGPUSamplerBindingType_BindingNotUsed = 0x00000000, + WGPUSamplerBindingType_Undefined = 0x00000001, + WGPUSamplerBindingType_Filtering = 0x00000002, + WGPUSamplerBindingType_NonFiltering = 0x00000003, + WGPUSamplerBindingType_Comparison = 0x00000004, WGPUSamplerBindingType_Force32 = 0x7FFFFFFF } WGPUSamplerBindingType; +typedef enum WGPUStatus { + WGPUStatus_Success = 0x00000001, + WGPUStatus_Error = 0x00000002, + WGPUStatus_Force32 = 0x7FFFFFFF +} WGPUStatus; + typedef enum WGPUStencilOperation { - WGPUStencilOperation_Keep = 0x00000000, - WGPUStencilOperation_Zero = 0x00000001, - WGPUStencilOperation_Replace = 0x00000002, - WGPUStencilOperation_Invert = 0x00000003, - WGPUStencilOperation_IncrementClamp = 0x00000004, - WGPUStencilOperation_DecrementClamp = 0x00000005, - WGPUStencilOperation_IncrementWrap = 0x00000006, - WGPUStencilOperation_DecrementWrap = 0x00000007, + WGPUStencilOperation_Undefined = 0x00000000, + WGPUStencilOperation_Keep = 0x00000001, + WGPUStencilOperation_Zero = 0x00000002, + WGPUStencilOperation_Replace = 0x00000003, + WGPUStencilOperation_Invert = 0x00000004, + WGPUStencilOperation_IncrementClamp = 0x00000005, + WGPUStencilOperation_DecrementClamp = 0x00000006, + WGPUStencilOperation_IncrementWrap = 0x00000007, + WGPUStencilOperation_DecrementWrap = 0x00000008, WGPUStencilOperation_Force32 = 0x7FFFFFFF } WGPUStencilOperation; typedef enum WGPUStorageTextureAccess { - WGPUStorageTextureAccess_Undefined = 0x00000000, - WGPUStorageTextureAccess_WriteOnly = 0x00000001, - WGPUStorageTextureAccess_ReadOnly = 0x00000002, - WGPUStorageTextureAccess_ReadWrite = 0x00000003, + WGPUStorageTextureAccess_BindingNotUsed = 0x00000000, + WGPUStorageTextureAccess_Undefined = 0x00000001, + WGPUStorageTextureAccess_WriteOnly = 0x00000002, + WGPUStorageTextureAccess_ReadOnly = 0x00000003, + WGPUStorageTextureAccess_ReadWrite = 0x00000004,, WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF } WGPUStorageTextureAccess; From b2c3b645305cd887cf54aa238a388404d8d5a6c7 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:53:32 +0200 Subject: [PATCH 15/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 3324c1267..b79ce2447 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -408,12 +408,14 @@ typedef enum WGPUStoreOp { } WGPUStoreOp; typedef enum WGPUSurfaceGetCurrentTextureStatus { - WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000, - WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001, - WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002, - WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003, - WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004, - WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005, + WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal = 0x00000001, + WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal = 0x00000002, + WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000003, + WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000004, + WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000005, + WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000006, + WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000007, + WGPUSurfaceGetCurrentTextureStatus_Error = 0x00000008, WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF } WGPUSurfaceGetCurrentTextureStatus; From fd963cf1e0c9cce54403bab8a67675fb9400dbed Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 02:57:02 +0200 Subject: [PATCH 16/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 130 +++++++++++++---------- 1 file changed, 76 insertions(+), 54 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index b79ce2447..75e539ec7 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -420,16 +420,18 @@ typedef enum WGPUSurfaceGetCurrentTextureStatus { } WGPUSurfaceGetCurrentTextureStatus; typedef enum WGPUTextureAspect { - WGPUTextureAspect_All = 0x00000000, - WGPUTextureAspect_StencilOnly = 0x00000001, - WGPUTextureAspect_DepthOnly = 0x00000002, + WGPUTextureAspect_Undefined = 0x00000000, + WGPUTextureAspect_All = 0x00000001, + WGPUTextureAspect_StencilOnly = 0x00000002, + WGPUTextureAspect_DepthOnly = 0x00000003 WGPUTextureAspect_Force32 = 0x7FFFFFFF } WGPUTextureAspect; typedef enum WGPUTextureDimension { - WGPUTextureDimension_1D = 0x00000000, - WGPUTextureDimension_2D = 0x00000001, - WGPUTextureDimension_3D = 0x00000002, + WGPUTextureDimension_Undefined = 0x00000000, + WGPUTextureDimension_1D = 0x00000001, + WGPUTextureDimension_2D = 0x00000002, + WGPUTextureDimension_3D = 0x00000003, WGPUTextureDimension_Force32 = 0x7FFFFFFF } WGPUTextureDimension; @@ -534,12 +536,13 @@ typedef enum WGPUTextureFormat { } WGPUTextureFormat; typedef enum WGPUTextureSampleType { - WGPUTextureSampleType_Undefined = 0x00000000, - WGPUTextureSampleType_Float = 0x00000001, - WGPUTextureSampleType_UnfilterableFloat = 0x00000002, - WGPUTextureSampleType_Depth = 0x00000003, - WGPUTextureSampleType_Sint = 0x00000004, - WGPUTextureSampleType_Uint = 0x00000005, + 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; @@ -555,55 +558,74 @@ typedef enum WGPUTextureViewDimension { } WGPUTextureViewDimension; typedef enum WGPUVertexFormat { - WGPUVertexFormat_Undefined = 0x00000000, - WGPUVertexFormat_Uint8x2 = 0x00000001, - WGPUVertexFormat_Uint8x4 = 0x00000002, - WGPUVertexFormat_Sint8x2 = 0x00000003, - WGPUVertexFormat_Sint8x4 = 0x00000004, - WGPUVertexFormat_Unorm8x2 = 0x00000005, - WGPUVertexFormat_Unorm8x4 = 0x00000006, - WGPUVertexFormat_Snorm8x2 = 0x00000007, - WGPUVertexFormat_Snorm8x4 = 0x00000008, - WGPUVertexFormat_Uint16x2 = 0x00000009, - WGPUVertexFormat_Uint16x4 = 0x0000000A, - WGPUVertexFormat_Sint16x2 = 0x0000000B, - WGPUVertexFormat_Sint16x4 = 0x0000000C, - WGPUVertexFormat_Unorm16x2 = 0x0000000D, - WGPUVertexFormat_Unorm16x4 = 0x0000000E, - WGPUVertexFormat_Snorm16x2 = 0x0000000F, - WGPUVertexFormat_Snorm16x4 = 0x00000010, - WGPUVertexFormat_Float16x2 = 0x00000011, - WGPUVertexFormat_Float16x4 = 0x00000012, - WGPUVertexFormat_Float32 = 0x00000013, - WGPUVertexFormat_Float32x2 = 0x00000014, - WGPUVertexFormat_Float32x3 = 0x00000015, - WGPUVertexFormat_Float32x4 = 0x00000016, - WGPUVertexFormat_Uint32 = 0x00000017, - WGPUVertexFormat_Uint32x2 = 0x00000018, - WGPUVertexFormat_Uint32x3 = 0x00000019, - WGPUVertexFormat_Uint32x4 = 0x0000001A, - WGPUVertexFormat_Sint32 = 0x0000001B, - WGPUVertexFormat_Sint32x2 = 0x0000001C, - WGPUVertexFormat_Sint32x3 = 0x0000001D, - WGPUVertexFormat_Sint32x4 = 0x0000001E, + WGPUVertexFormat_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; typedef enum WGPUVertexStepMode { - WGPUVertexStepMode_Vertex = 0x00000000, - WGPUVertexStepMode_Instance = 0x00000001, - WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002, + WGPUVertexStepMode_VertexBufferNotUsed = 0x00000000, + WGPUVertexStepMode_Undefined = 0x00000001, + WGPUVertexStepMode_Vertex = 0x00000002, + WGPUVertexStepMode_Instance = 0x00000003, WGPUVertexStepMode_Force32 = 0x7FFFFFFF } WGPUVertexStepMode; -typedef enum WGPUWGSLFeatureName { - WGPUWGSLFeatureName_Undefined = 0x00000000, - WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, - WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002, - WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003, - WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004, - WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF -} WGPUWGSLFeatureName; +typedef enum WGPUWGSLLanguageFeatureName { + WGPUWGSLLanguageFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, + WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct = 0x00000002, + WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters = 0x00000003, + WGPUWGSLLanguageFeatureName_PointerCompositeAccess = 0x00000004, + WGPUWGSLLanguageFeatureName_Force32 = 0x7FFFFFFF +} WGPUWGSLLanguageFeatureName; + +typedef enum WGPUWaitStatus { + WGPUWaitStatus_Success = 0x00000001, + WGPUWaitStatus_TimedOut = 0x00000002, + WGPUWaitStatus_UnsupportedTimeout = 0x00000003, + WGPUWaitStatus_UnsupportedCount = 0x00000004, + WGPUWaitStatus_UnsupportedMixedSources = 0x00000005, + WGPUWaitStatus_Force32 = 0x7FFFFFFF +} WGPUWaitStatus; typedef enum WGPUBufferUsage { WGPUBufferUsage_None = 0x00000000, From bad8f0f3b8f139a9f7ce5dd36a308bb3072acf1c Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:01:54 +0200 Subject: [PATCH 17/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 73 +++++++++++++++++++++--- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 75e539ec7..34a61d0c4 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -683,15 +683,70 @@ typedef enum WGPUTextureUsage { typedef WGPUFlags WGPUTextureUsageFlags; typedef void (*WGPUProc)(void); -typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const* message, void* userdata); -typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const* message, void* userdata); -typedef void (*WGPUAdapterRequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const* message, void* userdata); -typedef void (*WGPUBufferMapAsyncCallback)(WGPUBufferMapAsyncStatus status, void* userdata); -typedef void (*WGPUDeviceCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const* message, void* userdata); -typedef void (*WGPUDeviceCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const* message, void* userdata); -typedef void (*WGPUInstanceRequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const* message, void* userdata); -typedef void (*WGPUQueueOnSubmittedWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void* userdata); -typedef void (*WGPUShaderModuleGetCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const* compilationInfo, void* userdata); +typedef void (*WGPUBufferMapCallback)(WGPUMapAsyncStatus status, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param compilationInfo + * This parameter is @ref PassedWithoutOwnership. + */ +typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param pipeline + * This parameter is @ref PassedWithOwnership. + */ +typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param pipeline + * This parameter is @ref PassedWithOwnership. + */ +typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param device + * Reference to the device which was lost. If, and only if, the `reason` is @ref WGPUDeviceLostReason_FailedCreation, this is a non-null pointer to a null @ref WGPUDevice. + * This parameter is @ref PassedWithoutOwnership. + * + * @param message + * This parameter is @ref PassedWithoutOwnership. + */ +typedef void (*WGPUDeviceLostCallback)(WGPUDevice const * device, WGPUDeviceLostReason reason, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param status + * See @ref WGPUPopErrorScopeStatus. + * + * @param type + * The type of the error caught by the scope, or @ref WGPUErrorType_NoError if there was none. + * If the `status` is not @ref WGPUPopErrorScopeStatus_Success, this is @ref WGPUErrorType_NoError. + * + * @param message + * If the `type` is not @ref WGPUErrorType_NoError, this is a non-empty @ref LocalizableHumanReadableMessageString; + * otherwise, this is an empty string. + * This parameter is @ref PassedWithoutOwnership. + */ +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, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param adapter + * This parameter is @ref PassedWithOwnership. + * + * @param message + * This parameter is @ref PassedWithoutOwnership. + */ +typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param device + * This parameter is @ref PassedWithOwnership. + * + * @param message + * This parameter is @ref PassedWithoutOwnership. + */ +typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; +/** + * @param device + * This parameter is @ref PassedWithoutOwnership. + * + * @param message + * This parameter is @ref PassedWithoutOwnership. + */ +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 const* next; From 50a0fe535806c4bc782a26372c3180e53f03fff9 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:02:56 +0200 Subject: [PATCH 18/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 79 ++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 34a61d0c4..47f83bc51 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -758,6 +758,85 @@ typedef struct WGPUChainedStructOut { WGPUSType sType; } WGPUChainedStructOut; +typedef struct WGPUBufferMapCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUBufferMapCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUBufferMapCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCompilationInfoCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCompilationInfoCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUCompilationInfoCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCreateComputePipelineAsyncCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCreateComputePipelineAsyncCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUCreateComputePipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCreateRenderPipelineAsyncCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUCreateRenderPipelineAsyncCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUCreateRenderPipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUDeviceLostCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUDeviceLostCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUDeviceLostCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPopErrorScopeCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUPopErrorScopeCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUPopErrorScopeCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUQueueWorkDoneCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPUQueueWorkDoneCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUQueueWorkDoneCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequestAdapterCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPURequestAdapterCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPURequestAdapterCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequestDeviceCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUCallbackMode mode; + WGPURequestDeviceCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPURequestDeviceCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUUncapturedErrorCallbackInfo { + WGPUChainedStruct const * nextInChain; + WGPUUncapturedErrorCallback callback; + WGPU_NULLABLE void* userdata1; + WGPU_NULLABLE void* userdata2; +} WGPUUncapturedErrorCallbackInfo WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUAdapterInfo { WGPUChainedStructOut* nextInChain; char const* vendor; From 22ae86feee9bde372b93b129f17a9be3036e7494 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:04:15 +0200 Subject: [PATCH 19/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 124 +++++++++++------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 47f83bc51..4b557fffe 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -839,10 +839,10 @@ typedef struct WGPUUncapturedErrorCallbackInfo { typedef struct WGPUAdapterInfo { WGPUChainedStructOut* nextInChain; - char const* vendor; - char const* architecture; - char const* device; - char const* description; + WGPUStringView vendor; + WGPUStringView architecture; + WGPUStringView device; + WGPUStringView description; WGPUBackendType backendType; WGPUAdapterType adapterType; uint32_t vendorID; @@ -874,7 +874,7 @@ typedef struct WGPUBufferBindingLayout { typedef struct WGPUBufferDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUBufferUsageFlags usage; uint64_t size; WGPUBool mappedAtCreation; @@ -889,17 +889,17 @@ typedef struct WGPUColor { typedef struct WGPUCommandBufferDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; } WGPUCommandBufferDescriptor; typedef struct WGPUCommandEncoderDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; } WGPUCommandEncoderDescriptor; typedef struct WGPUCompilationMessage { WGPUChainedStruct const* nextInChain; - char const* message; + WGPUStringView message; WGPUCompilationMessageType type; uint64_t lineNum; uint64_t linePos; @@ -918,7 +918,7 @@ typedef struct WGPUComputePassTimestampWrites { typedef struct WGPUConstantEntry { WGPUChainedStruct const* nextInChain; - char const* key; + WGPUStringView key; double value; } WGPUConstantEntry; @@ -982,7 +982,7 @@ typedef struct WGPUOrigin3D { typedef struct WGPUPipelineLayoutDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t bindGroupLayoutCount; WGPUBindGroupLayout const* bindGroupLayouts; } WGPUPipelineLayoutDescriptor; @@ -1002,24 +1002,24 @@ typedef struct WGPUPrimitiveState { typedef struct WGPUQuerySetDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUQueryType type; uint32_t count; } WGPUQuerySetDescriptor; typedef struct WGPUQueueDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; } WGPUQueueDescriptor; typedef struct WGPURenderBundleDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; } WGPURenderBundleDescriptor; typedef struct WGPURenderBundleEncoderDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t colorFormatCount; WGPUTextureFormat const* colorFormats; WGPUTextureFormat depthStencilFormat; @@ -1066,7 +1066,7 @@ typedef struct WGPUSamplerBindingLayout { typedef struct WGPUSamplerDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUAddressMode addressModeU; WGPUAddressMode addressModeV; WGPUAddressMode addressModeW; @@ -1081,7 +1081,7 @@ typedef struct WGPUSamplerDescriptor { typedef struct WGPUShaderModuleCompilationHint { WGPUChainedStruct const* nextInChain; - char const* entryPoint; + WGPUStringView entryPoint; WGPUPipelineLayout layout; } WGPUShaderModuleCompilationHint; @@ -1093,7 +1093,7 @@ typedef struct WGPUShaderModuleSPIRVDescriptor { typedef struct WGPUShaderModuleWGSLDescriptor { WGPUChainedStruct chain; - char const* code; + WGPUStringView code; } WGPUShaderModuleWGSLDescriptor; typedef struct WGPUStencilFaceState { @@ -1136,7 +1136,7 @@ typedef struct WGPUSurfaceConfiguration { typedef struct WGPUSurfaceDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; } WGPUSurfaceDescriptor; typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { @@ -1146,7 +1146,7 @@ typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { WGPUChainedStruct chain; - char const* selector; + WGPUStringView selector; } WGPUSurfaceDescriptorFromCanvasHTMLSelector; typedef struct WGPUSurfaceDescriptorFromMetalLayer { @@ -1200,7 +1200,7 @@ typedef struct WGPUTextureDataLayout { typedef struct WGPUTextureViewDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUTextureFormat format; WGPUTextureViewDimension dimension; uint32_t baseMipLevel; @@ -1224,7 +1224,7 @@ typedef struct WGPUVertexAttribute { typedef struct WGPUBindGroupDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUBindGroupLayout layout; size_t entryCount; WGPUBindGroupEntry const* entries; @@ -1253,7 +1253,7 @@ typedef struct WGPUCompilationInfo { typedef struct WGPUComputePassDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUComputePassTimestampWrites const* timestampWrites; } WGPUComputePassDescriptor; @@ -1288,7 +1288,7 @@ typedef struct WGPUImageCopyTexture { typedef struct WGPUProgrammableStageDescriptor { WGPUChainedStruct const* nextInChain; WGPUShaderModule module; - char const* entryPoint; + WGPUStringView entryPoint; size_t constantCount; WGPUConstantEntry const* constants; } WGPUProgrammableStageDescriptor; @@ -1310,7 +1310,7 @@ typedef struct WGPURequiredLimits { typedef struct WGPUShaderModuleDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t hintCount; WGPUShaderModuleCompilationHint const* hints; } WGPUShaderModuleDescriptor; @@ -1322,7 +1322,7 @@ typedef struct WGPUSupportedLimits { typedef struct WGPUTextureDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUTextureUsageFlags usage; WGPUTextureDimension dimension; WGPUExtent3D size; @@ -1342,7 +1342,7 @@ typedef struct WGPUVertexBufferLayout { typedef struct WGPUBindGroupLayoutDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t entryCount; WGPUBindGroupLayoutEntry const* entries; } WGPUBindGroupLayoutDescriptor; @@ -1356,14 +1356,14 @@ typedef struct WGPUColorTargetState { typedef struct WGPUComputePipelineDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUPipelineLayout layout; WGPUProgrammableStageDescriptor compute; } WGPUComputePipelineDescriptor; typedef struct WGPUDeviceDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t requiredFeatureCount; WGPUFeatureName const* requiredFeatures; WGPURequiredLimits const* requiredLimits; @@ -1375,7 +1375,7 @@ typedef struct WGPUDeviceDescriptor { typedef struct WGPURenderPassDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; size_t colorAttachmentCount; WGPURenderPassColorAttachment const* colorAttachments; WGPURenderPassDepthStencilAttachment const* depthStencilAttachment; @@ -1386,7 +1386,7 @@ typedef struct WGPURenderPassDescriptor { typedef struct WGPUVertexState { WGPUChainedStruct const* nextInChain; WGPUShaderModule module; - char const* entryPoint; + WGPUStringView entryPoint; size_t constantCount; WGPUConstantEntry const* constants; size_t bufferCount; @@ -1396,7 +1396,7 @@ typedef struct WGPUVertexState { typedef struct WGPUFragmentState { WGPUChainedStruct const* nextInChain; WGPUShaderModule module; - char const* entryPoint; + WGPUStringView entryPoint; size_t constantCount; WGPUConstantEntry const* constants; size_t targetCount; @@ -1405,7 +1405,7 @@ typedef struct WGPUFragmentState { typedef struct WGPURenderPipelineDescriptor { WGPUChainedStruct const* nextInChain; - char const* label; + WGPUStringView label; WGPUPipelineLayout layout; WGPUVertexState vertex; WGPUPrimitiveState primitive; @@ -1415,7 +1415,7 @@ typedef struct WGPURenderPipelineDescriptor { } WGPURenderPipelineDescriptor; typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const* descriptor); -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const* procName); +typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, WGPUStringView procName); // Procs of Adapter typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName* features); @@ -1430,12 +1430,12 @@ typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter); typedef void (*WGPUProcAdapterInfoFreeMembers)(WGPUAdapterInfo adapterInfo); // Procs of BindGroup -typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, char const* label); +typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label); typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup); typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup); // Procs of BindGroupLayout -typedef void (*WGPUProcBindGroupLayoutSetLabel)(WGPUBindGroupLayout bindGroupLayout, char const* label); +typedef void (*WGPUProcBindGroupLayoutSetLabel)(WGPUBindGroupLayout bindGroupLayout, WGPUStringView label); typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout); typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout); @@ -1447,13 +1447,13 @@ typedef void* (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer); typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer); typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapAsyncCallback callback, void* userdata); -typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, char const* label); +typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, WGPUStringView label); typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer); typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer); typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer); // Procs of CommandBuffer -typedef void (*WGPUProcCommandBufferSetLabel)(WGPUCommandBuffer commandBuffer, char const* label); +typedef void (*WGPUProcCommandBufferSetLabel)(WGPUCommandBuffer commandBuffer, WGPUStringView label); typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer); typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer); @@ -1466,11 +1466,11 @@ typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder com typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const* source, WGPUImageCopyBuffer const* destination, WGPUExtent3D const* copySize); typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const* source, WGPUImageCopyTexture const* destination, WGPUExtent3D const* copySize); typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const* descriptor); -typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const* markerLabel); +typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, WGPUStringView markerLabel); typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder); -typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const* groupLabel); +typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, WGPUStringView groupLabel); typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); -typedef void (*WGPUProcCommandEncoderSetLabel)(WGPUCommandEncoder commandEncoder, char const* label); +typedef void (*WGPUProcCommandEncoderSetLabel)(WGPUCommandEncoder commandEncoder, WGPUStringView label); typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder); typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder); @@ -1479,18 +1479,18 @@ typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder) typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const* markerLabel); +typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, WGPUStringView markerLabel); typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const* groupLabel); +typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, WGPUStringView groupLabel); typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const* dynamicOffsets); -typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, char const* label); +typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, WGPUStringView label); typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder); typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder); // Procs of ComputePipeline typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex); -typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, char const* label); +typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, WGPUStringView label); typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline); typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline); @@ -1516,7 +1516,7 @@ typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device); typedef WGPUBool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature); typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void* userdata); typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter); -typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const* label); +typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, WGPUStringView label); typedef void (*WGPUProcDeviceReference)(WGPUDevice device); typedef void (*WGPUProcDeviceRelease)(WGPUDevice device); @@ -1529,7 +1529,7 @@ typedef void (*WGPUProcInstanceReference)(WGPUInstance instance); typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance); // Procs of PipelineLayout -typedef void (*WGPUProcPipelineLayoutSetLabel)(WGPUPipelineLayout pipelineLayout, char const* label); +typedef void (*WGPUProcPipelineLayoutSetLabel)(WGPUPipelineLayout pipelineLayout, WGPUStringView label); typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout); typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout); @@ -1537,13 +1537,13 @@ typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout) typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet); typedef uint32_t (*WGPUProcQuerySetGetCount)(WGPUQuerySet querySet); typedef WGPUQueryType (*WGPUProcQuerySetGetType)(WGPUQuerySet querySet); -typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, char const* label); +typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, WGPUStringView label); typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet); typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet); // Procs of Queue typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueOnSubmittedWorkDoneCallback callback, void* userdata); -typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const* label); +typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, WGPUStringView label); typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const* commands); typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const* data, size_t size); typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUImageCopyTexture const* destination, void const* data, size_t dataSize, WGPUTextureDataLayout const* dataLayout, WGPUExtent3D const* writeSize); @@ -1551,7 +1551,7 @@ typedef void (*WGPUProcQueueReference)(WGPUQueue queue); typedef void (*WGPUProcQueueRelease)(WGPUQueue queue); // Procs of RenderBundle -typedef void (*WGPUProcRenderBundleSetLabel)(WGPURenderBundle renderBundle, char const* label); +typedef void (*WGPUProcRenderBundleSetLabel)(WGPURenderBundle renderBundle, WGPUStringView label); typedef void (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle); typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle); @@ -1561,12 +1561,12 @@ typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder r typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const* descriptor); -typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const* markerLabel); +typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView markerLabel); typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder); -typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const* groupLabel); +typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView groupLabel); typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const* dynamicOffsets); typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderSetLabel)(WGPURenderBundleEncoder renderBundleEncoder, char const* label); +typedef void (*WGPUProcRenderBundleEncoderSetLabel)(WGPURenderBundleEncoder renderBundleEncoder, WGPUStringView label); typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder); @@ -1581,13 +1581,13 @@ typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder rend typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder); typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder); typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const* bundles); -typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const* markerLabel); +typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, WGPUStringView markerLabel); typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const* groupLabel); +typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, WGPUStringView groupLabel); typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const* dynamicOffsets); typedef void (*WGPUProcRenderPassEncoderSetBlendConstant)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const* color); typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, char const* label); +typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, WGPUStringView label); typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); @@ -1598,18 +1598,18 @@ typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPas // Procs of RenderPipeline typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex); -typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, char const* label); +typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, WGPUStringView label); typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline); typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline); // Procs of Sampler -typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, char const* label); +typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, WGPUStringView label); typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler); typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler); // Procs of ShaderModule typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUShaderModuleGetCompilationInfoCallback callback, void* userdata); -typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, char const* label); +typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, WGPUStringView label); typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule); typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule); @@ -1618,7 +1618,7 @@ typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfigu typedef void (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities* surfaceCapabilities); typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture* surfaceTexture); typedef void (*WGPUProcSurfacePresent)(WGPUSurface surface); -typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, char const* label); +typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, WGPUStringView label); typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface); typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface); typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface); @@ -1637,16 +1637,16 @@ typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture); typedef WGPUTextureUsageFlags (*WGPUProcTextureGetUsage)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture); -typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, char const* label); +typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, WGPUStringView label); typedef void (*WGPUProcTextureReference)(WGPUTexture texture); typedef void (*WGPUProcTextureRelease)(WGPUTexture texture); // Procs of TextureView -typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, char const* label); +typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, WGPUStringView label); typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView); typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView); -// Native wgpu extension types (from wgpu.h) +// Native wgpu extension types (from wgpu.h) [TODO: Review these] typedef enum WGPUNativeSType { // Start at 0003 since that's allocated range for wgpu-native WGPUSType_DeviceExtras = 0x00030001, From 6f6d896abecc2b29da10cb303d02b63e29e07a46 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:07:50 +0200 Subject: [PATCH 20/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 42 ++++++++++++++---------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 4b557fffe..a7d9fd9dc 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -641,7 +641,6 @@ typedef enum WGPUBufferUsage { WGPUBufferUsage_QueryResolve = 0x00000200, WGPUBufferUsage_Force32 = 0x7FFFFFFF } WGPUBufferUsage; -typedef WGPUFlags WGPUBufferUsageFlags; typedef enum WGPUColorWriteMask { WGPUColorWriteMask_None = 0x00000000, @@ -875,7 +874,7 @@ typedef struct WGPUBufferBindingLayout { typedef struct WGPUBufferDescriptor { WGPUChainedStruct const* nextInChain; WGPUStringView label; - WGPUBufferUsageFlags usage; + WGPUBufferUsage usage; uint64_t size; WGPUBool mappedAtCreation; } WGPUBufferDescriptor; @@ -905,9 +904,6 @@ typedef struct WGPUCompilationMessage { uint64_t linePos; uint64_t offset; uint64_t length; - uint64_t utf16LinePos; - uint64_t utf16Offset; - uint64_t utf16Length; } WGPUCompilationMessage; typedef struct WGPUComputePassTimestampWrites { @@ -928,11 +924,28 @@ typedef struct WGPUExtent3D { uint32_t depthOrArrayLayers; } WGPUExtent3D; -typedef struct WGPUInstanceDescriptor { - WGPUChainedStruct const* nextInChain; -} WGPUInstanceDescriptor; +typedef struct WGPUFuture { + /** + * Opaque id of the @ref WGPUFuture + */ + uint64_t id; +} WGPUFuture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUInstanceCapabilities { + /** This struct chain is used as mutable in some places and immutable in others. */ + WGPUChainedStructOut * nextInChain; + /** + * Enable use of ::wgpuInstanceWaitAny with `timeoutNS > 0`. + */ + WGPUBool timedWaitAnyEnable; + /** + * The maximum number @ref WGPUFutureWaitInfo supported in a call to ::wgpuInstanceWaitAny with `timeoutNS > 0`. + */ + size_t timedWaitAnyMaxCount; +} WGPUInstanceCapabilities WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPULimits { + WGPUChainedStructOut * nextInChain; uint32_t maxTextureDimension1D; uint32_t maxTextureDimension2D; uint32_t maxTextureDimension3D; @@ -955,7 +968,6 @@ typedef struct WGPULimits { uint64_t maxBufferSize; uint32_t maxVertexAttributes; uint32_t maxVertexBufferArrayStride; - uint32_t maxInterStageShaderComponents; uint32_t maxInterStageShaderVariables; uint32_t maxColorAttachments; uint32_t maxColorAttachmentBytesPerSample; @@ -987,17 +999,13 @@ typedef struct WGPUPipelineLayoutDescriptor { WGPUBindGroupLayout const* bindGroupLayouts; } WGPUPipelineLayoutDescriptor; -typedef struct WGPUPrimitiveDepthClipControl { - WGPUChainedStruct chain; - WGPUBool unclippedDepth; -} WGPUPrimitiveDepthClipControl; - typedef struct WGPUPrimitiveState { WGPUChainedStruct const* nextInChain; WGPUPrimitiveTopology topology; WGPUIndexFormat stripIndexFormat; WGPUFrontFace frontFace; WGPUCullMode cullMode; + WGPUBool unclippedDepth; } WGPUPrimitiveState; typedef struct WGPUQuerySetDescriptor { @@ -1040,10 +1048,10 @@ typedef struct WGPURenderPassDepthStencilAttachment { WGPUBool stencilReadOnly; } WGPURenderPassDepthStencilAttachment; -typedef struct WGPURenderPassDescriptorMaxDrawCount { +typedef struct WGPURenderPassMaxDrawCount { WGPUChainedStruct chain; uint64_t maxDrawCount; -} WGPURenderPassDescriptorMaxDrawCount; +} WGPURenderPassMaxDrawCount; typedef struct WGPURenderPassTimestampWrites { WGPUQuerySet querySet; @@ -1445,7 +1453,7 @@ typedef void const* (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer); typedef void* (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size); typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer); -typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer); +typedef WGPUBufferUsage (*WGPUProcBufferGetUsage)(WGPUBuffer buffer); typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapAsyncCallback callback, void* userdata); typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, WGPUStringView label); typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer); From aca02b34df961fe7dbce6f710b0a6b665eea25d1 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:07:57 +0200 Subject: [PATCH 21/29] Update wgpu_exports.h --- Runtime/Bindings/FFI/wgpu/wgpu_exports.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h index 9b02a7a90..bac59e03e 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h @@ -35,7 +35,7 @@ struct static_wgpu_exports_table { WGPUBufferMapState (*wgpu_buffer_get_map_state)(WGPUBuffer buffer); void* (*wgpu_buffer_get_mapped_range)(WGPUBuffer buffer, size_t offset, size_t size); uint64_t (*wgpu_buffer_get_size)(WGPUBuffer buffer); - WGPUBufferUsageFlags (*wgpu_buffer_get_usage)(WGPUBuffer buffer); + WGPUBufferUsage (*wgpu_buffer_get_usage)(WGPUBuffer buffer); void (*wgpu_buffer_map_async)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapAsyncCallback callback, void* userdata); void (*wgpu_buffer_set_label)(WGPUBuffer buffer, char const* label); void (*wgpu_buffer_unmap)(WGPUBuffer buffer); From a12f29ed818618743e8a811b2af32ce3da4daf00 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:09:11 +0200 Subject: [PATCH 22/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index a7d9fd9dc..123cdd98b 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1061,10 +1061,11 @@ typedef struct WGPURenderPassTimestampWrites { typedef struct WGPURequestAdapterOptions { WGPUChainedStruct const* nextInChain; - WGPUSurface compatibleSurface; + WGPUFeatureLevel featureLevel; WGPUPowerPreference powerPreference; - WGPUBackendType backendType; WGPUBool forceFallbackAdapter; + WGPUBackendType backendType; + WGPU_NULLABLE WGPUSurface compatibleSurface; } WGPURequestAdapterOptions; typedef struct WGPUSamplerBindingLayout { From 295a9dad251132757ad1c58d747926d7c169a5fa Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:16:43 +0200 Subject: [PATCH 23/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 67 +++++++++++++----------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 123cdd98b..ac20aabc8 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -679,7 +679,6 @@ typedef enum WGPUTextureUsage { WGPUTextureUsage_RenderAttachment = 0x00000010, WGPUTextureUsage_Force32 = 0x7FFFFFFF } WGPUTextureUsage; -typedef WGPUFlags WGPUTextureUsageFlags; typedef void (*WGPUProc)(void); typedef void (*WGPUBufferMapCallback)(WGPUMapAsyncStatus status, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; @@ -1088,22 +1087,21 @@ typedef struct WGPUSamplerDescriptor { uint16_t maxAnisotropy; } WGPUSamplerDescriptor; -typedef struct WGPUShaderModuleCompilationHint { +typedef struct WGPUShaderModuleDescriptor { WGPUChainedStruct const* nextInChain; - WGPUStringView entryPoint; - WGPUPipelineLayout layout; -} WGPUShaderModuleCompilationHint; + WGPUStringView label; +} WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUShaderModuleSPIRVDescriptor { +typedef struct WGPUShaderSourceSPIRV { WGPUChainedStruct chain; uint32_t codeSize; uint32_t const* code; -} WGPUShaderModuleSPIRVDescriptor; +} WGPUShaderSourceSPIRV; -typedef struct WGPUShaderModuleWGSLDescriptor { +typedef struct WGPUShaderSourceWGSL { WGPUChainedStruct chain; WGPUStringView code; -} WGPUShaderModuleWGSLDescriptor; +} WGPUShaderSourceWGSL; typedef struct WGPUStencilFaceState { WGPUCompareFunction compare; @@ -1119,9 +1117,19 @@ typedef struct WGPUStorageTextureBindingLayout { WGPUTextureViewDimension viewDimension; } WGPUStorageTextureBindingLayout; +typedef struct WGPUSupportedFeatures { + size_t featureCount; + WGPUFeatureName const * features; +} WGPUSupportedFeatures WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSupportedWGSLLanguageFeatures { + size_t featureCount; + WGPUWGSLLanguageFeatureName const * features; +} WGPUSupportedWGSLLanguageFeatures WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUSurfaceCapabilities { WGPUChainedStructOut* nextInChain; - WGPUTextureUsageFlags usages; + WGPUTextureUsage usages; size_t formatCount; WGPUTextureFormat const* formats; size_t presentModeCount; @@ -1134,12 +1142,12 @@ typedef struct WGPUSurfaceConfiguration { WGPUChainedStruct const* nextInChain; WGPUDevice device; WGPUTextureFormat format; - WGPUTextureUsageFlags usage; + WGPUTextureUsage usage; + uint32_t width; + uint32_t height; size_t viewFormatCount; WGPUTextureFormat const* viewFormats; WGPUCompositeAlphaMode alphaMode; - uint32_t width; - uint32_t height; WGPUPresentMode presentMode; } WGPUSurfaceConfiguration; @@ -1148,44 +1156,39 @@ typedef struct WGPUSurfaceDescriptor { WGPUStringView label; } WGPUSurfaceDescriptor; -typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { +typedef struct WGPUSurfaceSourceAndroidNativeWindow { WGPUChainedStruct chain; void* window; -} WGPUSurfaceDescriptorFromAndroidNativeWindow; - -typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { - WGPUChainedStruct chain; - WGPUStringView selector; -} WGPUSurfaceDescriptorFromCanvasHTMLSelector; +} WGPUSurfaceSourceAndroidNativeWindow; -typedef struct WGPUSurfaceDescriptorFromMetalLayer { +typedef struct WGPUSurfaceSourceMetalLayer { WGPUChainedStruct chain; void* layer; -} WGPUSurfaceDescriptorFromMetalLayer; +} WGPUSurfaceSourceMetalLayer; -typedef struct WGPUSurfaceDescriptorFromWaylandSurface { +typedef struct WGPUSurfaceSourceWaylandSurface { WGPUChainedStruct chain; void* display; void* surface; -} WGPUSurfaceDescriptorFromWaylandSurface; +} WGPUSurfaceSourceWaylandSurface; -typedef struct WGPUSurfaceDescriptorFromWindowsHWND { +typedef struct WGPUSurfaceSourceWindowsHWND { WGPUChainedStruct chain; void* hinstance; void* hwnd; -} WGPUSurfaceDescriptorFromWindowsHWND; +} WGPUSurfaceSourceWindowsHWND; -typedef struct WGPUSurfaceDescriptorFromXcbWindow { +typedef struct WGPUSurfaceSourceXCBWindow { WGPUChainedStruct chain; void* connection; uint32_t window; -} WGPUSurfaceDescriptorFromXcbWindow; +} WGPUSurfaceSourceXCBWindow; -typedef struct WGPUSurfaceDescriptorFromXlibWindow { +typedef struct WGPUSurfaceSourceXlibWindow { WGPUChainedStruct chain; void* display; uint64_t window; -} WGPUSurfaceDescriptorFromXlibWindow; +} WGPUSurfaceSourceXlibWindow; typedef struct WGPUSurfaceTexture { WGPUTexture texture; @@ -1332,7 +1335,7 @@ typedef struct WGPUSupportedLimits { typedef struct WGPUTextureDescriptor { WGPUChainedStruct const* nextInChain; WGPUStringView label; - WGPUTextureUsageFlags usage; + WGPUTextureUsage usage; WGPUTextureDimension dimension; WGPUExtent3D size; WGPUTextureFormat format; @@ -1644,7 +1647,7 @@ typedef WGPUTextureFormat (*WGPUProcTextureGetFormat)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetHeight)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture); -typedef WGPUTextureUsageFlags (*WGPUProcTextureGetUsage)(WGPUTexture texture); +typedef WGPUTextureUsage (*WGPUProcTextureGetUsage)(WGPUTexture texture); typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture); typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, WGPUStringView label); typedef void (*WGPUProcTextureReference)(WGPUTexture texture); From dc485731dd264b51e940e360e9e3a0f78c96673b Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:16:48 +0200 Subject: [PATCH 24/29] Update wgpu_exports.h --- Runtime/Bindings/FFI/wgpu/wgpu_exports.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h index bac59e03e..82a0b1d1b 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_exports.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_exports.h @@ -225,7 +225,7 @@ struct static_wgpu_exports_table { uint32_t (*wgpu_texture_get_height)(WGPUTexture texture); uint32_t (*wgpu_texture_get_mip_level_count)(WGPUTexture texture); uint32_t (*wgpu_texture_get_sample_count)(WGPUTexture texture); - WGPUTextureUsageFlags (*wgpu_texture_get_usage)(WGPUTexture texture); + WGPUTextureUsage (*wgpu_texture_get_usage)(WGPUTexture texture); uint32_t (*wgpu_texture_get_width)(WGPUTexture texture); void (*wgpu_texture_set_label)(WGPUTexture texture, char const* label); void (*wgpu_texture_reference)(WGPUTexture texture); From 960b78418397b6173c3a2764c077cfec5fed751c Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:24:28 +0200 Subject: [PATCH 25/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 83 +++++++++++------------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index ac20aabc8..1a6aceefc 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -1191,11 +1191,17 @@ typedef struct WGPUSurfaceSourceXlibWindow { } WGPUSurfaceSourceXlibWindow; typedef struct WGPUSurfaceTexture { + WGPUChainedStructOut * nextInChain; WGPUTexture texture; - WGPUBool suboptimal; - WGPUSurfaceGetCurrentTextureStatus status; + WGPUSurfaceGetCurrentTextureStatus status; } WGPUSurfaceTexture; +typedef struct WGPUTexelCopyBufferLayout { + uint64_t offset; + uint32_t bytesPerRow; + uint32_t rowsPerImage; +} WGPUTexelCopyBufferLayout WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUTextureBindingLayout { WGPUChainedStruct const* nextInChain; WGPUTextureSampleType sampleType; @@ -1203,13 +1209,6 @@ typedef struct WGPUTextureBindingLayout { WGPUBool multisampled; } WGPUTextureBindingLayout; -typedef struct WGPUTextureDataLayout { - WGPUChainedStruct const* nextInChain; - uint64_t offset; - uint32_t bytesPerRow; - uint32_t rowsPerImage; -} WGPUTextureDataLayout; - typedef struct WGPUTextureViewDescriptor { WGPUChainedStruct const* nextInChain; WGPUStringView label; @@ -1220,14 +1219,9 @@ typedef struct WGPUTextureViewDescriptor { uint32_t baseArrayLayer; uint32_t arrayLayerCount; WGPUTextureAspect aspect; + WGPUTextureUsage usage; } WGPUTextureViewDescriptor; -typedef struct WGPUUncapturedErrorCallbackInfo { - WGPUChainedStruct const* nextInChain; - WGPUErrorCallback callback; - void* userdata; -} WGPUUncapturedErrorCallbackInfo; - typedef struct WGPUVertexAttribute { WGPUVertexFormat format; uint64_t offset; @@ -1272,7 +1266,7 @@ typedef struct WGPUComputePassDescriptor { typedef struct WGPUDepthStencilState { WGPUChainedStruct const* nextInChain; WGPUTextureFormat format; - WGPUBool depthWriteEnabled; + WGPUOptionalBool depthWriteEnabled; WGPUCompareFunction depthCompare; WGPUStencilFaceState stencilFront; WGPUStencilFaceState stencilBack; @@ -1283,20 +1277,6 @@ typedef struct WGPUDepthStencilState { float depthBiasClamp; } WGPUDepthStencilState; -typedef struct WGPUImageCopyBuffer { - WGPUChainedStruct const* nextInChain; - WGPUTextureDataLayout layout; - WGPUBuffer buffer; -} WGPUImageCopyBuffer; - -typedef struct WGPUImageCopyTexture { - WGPUChainedStruct const* nextInChain; - WGPUTexture texture; - uint32_t mipLevel; - WGPUOrigin3D origin; - WGPUTextureAspect aspect; -} WGPUImageCopyTexture; - typedef struct WGPUProgrammableStageDescriptor { WGPUChainedStruct const* nextInChain; WGPUShaderModule module; @@ -1315,22 +1295,17 @@ typedef struct WGPURenderPassColorAttachment { WGPUColor clearValue; } WGPURenderPassColorAttachment; -typedef struct WGPURequiredLimits { - WGPUChainedStruct const* nextInChain; - WGPULimits limits; -} WGPURequiredLimits; - -typedef struct WGPUShaderModuleDescriptor { - WGPUChainedStruct const* nextInChain; - WGPUStringView label; - size_t hintCount; - WGPUShaderModuleCompilationHint const* hints; -} WGPUShaderModuleDescriptor; +typedef struct WGPUTexelCopyBufferInfo { + WGPUTexelCopyBufferLayout layout; + WGPUBuffer buffer; +} WGPUTexelCopyBufferInfo WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUSupportedLimits { - WGPUChainedStructOut* nextInChain; - WGPULimits limits; -} WGPUSupportedLimits; +typedef struct WGPUTexelCopyTextureInfo { + WGPUTexture texture; + uint32_t mipLevel; + WGPUOrigin3D origin; + WGPUTextureAspect aspect; +} WGPUTexelCopyTextureInfo WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureDescriptor { WGPUChainedStruct const* nextInChain; @@ -1346,8 +1321,8 @@ typedef struct WGPUTextureDescriptor { } WGPUTextureDescriptor; typedef struct WGPUVertexBufferLayout { - uint64_t arrayStride; WGPUVertexStepMode stepMode; + uint64_t arrayStride; size_t attributeCount; WGPUVertexAttribute const* attributes; } WGPUVertexBufferLayout; @@ -1385,6 +1360,22 @@ typedef struct WGPUDeviceDescriptor { WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo; } WGPUDeviceDescriptor; +typedef struct WGPUFutureWaitInfo { + /** + * The future to wait on. + */ + WGPUFuture future; + /** + * Whether or not the future completed. + */ + WGPUBool completed; +} WGPUFutureWaitInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUInstanceDescriptor { + WGPUChainedStruct const * nextInChain; + WGPUInstanceCapabilities features; +} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPURenderPassDescriptor { WGPUChainedStruct const* nextInChain; WGPUStringView label; From 70267f88a0adfca6c33da09b3c0d1fd2d5a48028 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:29:27 +0200 Subject: [PATCH 26/29] Update wgpu.lua --- Runtime/Bindings/FFI/wgpu/wgpu.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu.lua b/Runtime/Bindings/FFI/wgpu/wgpu.lua index 1d1cb3ff0..8871a49c2 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu.lua +++ b/Runtime/Bindings/FFI/wgpu/wgpu.lua @@ -562,7 +562,7 @@ typedef enum WGPUColorWriteMask { WGPUColorWriteMask_All = 0x0000000F, // WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha WGPUColorWriteMask_Force32 = 0x7FFFFFFF } WGPUColorWriteMask; -typedef WGPUFlags WGPUColorWriteMaskFlags; +typedef WGPUFlags WGPUColorWriteMask; typedef enum WGPUMapMode { WGPUMapMode_None = 0x00000000, @@ -1127,7 +1127,7 @@ typedef struct WGPUColorTargetState { WGPUChainedStruct const* nextInChain; WGPUTextureFormat format; WGPUBlendState const* blend; - WGPUColorWriteMaskFlags writeMask; + WGPUColorWriteMask writeMask; } WGPUColorTargetState; typedef struct WGPUComputePipelineDescriptor { From cc821b6208df3d0f0acafbc88944f802b461cd6c Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 03:29:31 +0200 Subject: [PATCH 27/29] Update wgpu_aliases.h --- Runtime/Bindings/FFI/wgpu/wgpu_aliases.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h index 1a6aceefc..b95daab4c 100644 --- a/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h +++ b/Runtime/Bindings/FFI/wgpu/wgpu_aliases.h @@ -651,7 +651,6 @@ typedef enum WGPUColorWriteMask { WGPUColorWriteMask_All = 0x0000000F, // WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha WGPUColorWriteMask_Force32 = 0x7FFFFFFF } WGPUColorWriteMask; -typedef WGPUFlags WGPUColorWriteMaskFlags; typedef enum WGPUMapMode { WGPUMapMode_None = 0x00000000, @@ -1338,7 +1337,7 @@ typedef struct WGPUColorTargetState { WGPUChainedStruct const* nextInChain; WGPUTextureFormat format; WGPUBlendState const* blend; - WGPUColorWriteMaskFlags writeMask; + WGPUColorWriteMask writeMask; } WGPUColorTargetState; typedef struct WGPUComputePipelineDescriptor { @@ -1418,15 +1417,16 @@ typedef struct WGPURenderPipelineDescriptor { } WGPURenderPipelineDescriptor; typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const* descriptor); -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, WGPUStringView procName); +typedef WGPUStatus (*WGPUProcGetInstanceCapabilities)(WGPUInstanceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUStringView procName) WGPU_FUNCTION_ATTRIBUTE; // Procs of Adapter -typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName* features); -typedef void (*WGPUProcAdapterGetInfo)(WGPUAdapter adapter, WGPUAdapterInfo* info); -typedef WGPUBool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits* limits); +typedef void (*WGPUProcAdapterGetFeatures)(WGPUAdapter adapter, WGPUSupportedFeatures * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUStatus (*WGPUProcAdapterGetInfo)(WGPUAdapter adapter, WGPUAdapterInfo * info) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUStatus (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPULimits * limits) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature); -typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPUDeviceDescriptor const* descriptor, WGPUAdapterRequestDeviceCallback callback, void* userdata); -typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter); +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); // Procs of AdapterInfo @@ -1434,7 +1434,7 @@ typedef void (*WGPUProcAdapterInfoFreeMembers)(WGPUAdapterInfo adapterInfo); // Procs of BindGroup typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label); -typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup); +typedef void (*WGPUProcBindGroupAddRef)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup); // Procs of BindGroupLayout From 3d2009ac61277e487d1a7b11d5c766f2647f5e91 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 17:34:55 +0200 Subject: [PATCH 28/29] Create WIP.md --- Runtime/Bindings/FFI/wgpu/WIP.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Runtime/Bindings/FFI/wgpu/WIP.md diff --git a/Runtime/Bindings/FFI/wgpu/WIP.md b/Runtime/Bindings/FFI/wgpu/WIP.md new file mode 100644 index 000000000..466eba855 --- /dev/null +++ b/Runtime/Bindings/FFI/wgpu/WIP.md @@ -0,0 +1,4 @@ +https://github.com/webgpu-native/webgpu-headers/compare/043af6c77e566f707db36759d9c9f161ebb616fd...bac520839ff5ed2e2b648ed540bd9ec45edbccbc#diff-074fca0467717d8d789bdfb86bf9e2d4afec03055a2787e0b604fda4254d4ed9R2285 + +Somewhere around here: +typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; \ No newline at end of file From 793b749cf98fe0094dbb5d89745e5b20e46e94e2 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 2 Jun 2025 17:36:16 +0200 Subject: [PATCH 29/29] Update WIP.md --- Runtime/Bindings/FFI/wgpu/WIP.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Runtime/Bindings/FFI/wgpu/WIP.md b/Runtime/Bindings/FFI/wgpu/WIP.md index 466eba855..8a4951fda 100644 --- a/Runtime/Bindings/FFI/wgpu/WIP.md +++ b/Runtime/Bindings/FFI/wgpu/WIP.md @@ -1,4 +1,10 @@ https://github.com/webgpu-native/webgpu-headers/compare/043af6c77e566f707db36759d9c9f161ebb616fd...bac520839ff5ed2e2b648ed540bd9ec45edbccbc#diff-074fca0467717d8d789bdfb86bf9e2d4afec03055a2787e0b604fda4254d4ed9R2285 Somewhere around here: -typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; \ No newline at end of file +typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; + +See also the docs RE async mapping and futures, ownership changes etc (this doesn't map cleanly to the FFI?): + +https://github.com/webgpu-native/webgpu-headers/compare/043af6c77e566f707db36759d9c9f161ebb616fd...bac520839ff5ed2e2b648ed540bd9ec45edbccbc#diff-074fca0467717d8d789bdfb86bf9e2d4afec03055a2787e0b604fda4254d4ed9R2285 + +Need to test whether that's problematic and possibly change approaches here, it's not feasible to keep up with those kinds of breaking changes unless the bindings are automatically generated/wrapped in native code. \ No newline at end of file