Skip to content

Commit 3d6e51c

Browse files
Bump dawn to use subgroupSize == 32 on macos
1 parent 22692e2 commit 3d6e51c

File tree

3 files changed

+99
-20
lines changed

3 files changed

+99
-20
lines changed

cmake/dawn.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ if(NOT DAWN_BUILD_FOUND)
168168

169169
# Ensure source present on required commit (idempotent remote setup)
170170
if(NOT DEFINED DAWN_COMMIT OR DAWN_COMMIT STREQUAL "")
171-
set(DAWN_COMMIT "e1d6e12337080cf9f6d8726209e86df449bc6e9a" CACHE STRING "Dawn commit to checkout" FORCE)
171+
set(DAWN_COMMIT "3f79f3aefe0b0a498002564fcfb13eb21ab6c047" CACHE STRING "Dawn commit to checkout" FORCE)
172172
endif()
173173
file(MAKE_DIRECTORY ${DAWN_DIR})
174174
execute_process(COMMAND git init WORKING_DIRECTORY "${DAWN_DIR}")

gpu.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,7 @@ inline void bufferMapCallback(WGPUMapAsyncStatus status, WGPUStringView message,
15801580
* and a promise to signal completion.
15811581
* @param userdata2 Unused.
15821582
*/
1583-
inline void queueWorkDoneCallback(WGPUQueueWorkDoneStatus status,
1584-
WGPUStringView message,
1583+
inline void queueWorkDoneCallback(WGPUQueueWorkDoneStatus status, WGPUStringView message,
15851584
void *userdata1, void * /*userdata2*/) {
15861585
const CallbackData *cbData = static_cast<CallbackData *>(userdata1);
15871586
// Ensure the queue work finished successfully.
@@ -2824,8 +2823,7 @@ Kernel createKernel(Context &ctx, const KernelCode &code,
28242823
* when the work is done.
28252824
* @param userdata2 Unused.
28262825
*/
2827-
inline void dispatchKernelCallback(WGPUQueueWorkDoneStatus status,
2828-
WGPUStringView message,
2826+
inline void dispatchKernelCallback(WGPUQueueWorkDoneStatus status, WGPUStringView message,
28292827
void *userdata1, void * /*userdata2*/) {
28302828
// Cast the userdata pointer back to our heap‑allocated promise.
28312829
auto *p = reinterpret_cast<std::promise<void> *>(userdata1);

third_party/headers/webgpu/webgpu.h

Lines changed: 96 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE;
149149
// Structure forward declarations
150150
struct WGPUAdapterPropertiesD3D;
151151
struct WGPUAdapterPropertiesVk;
152+
struct WGPUAdapterPropertiesWGPU;
152153
struct WGPUBindGroupDynamicBindingArray;
153154
struct WGPUBlendComponent;
154155
struct WGPUBufferBindingLayout;
@@ -257,6 +258,8 @@ struct WGPUSurfaceSourceWindowsHWND;
257258
struct WGPUSurfaceSourceXCBWindow;
258259
struct WGPUSurfaceSourceXlibWindow;
259260
struct WGPUSurfaceTexture;
261+
struct WGPUTexelBufferBindingEntry;
262+
struct WGPUTexelBufferBindingLayout;
260263
struct WGPUTexelBufferViewDescriptor;
261264
struct WGPUTexelCopyBufferLayout;
262265
struct WGPUTextureBindingLayout;
@@ -294,7 +297,7 @@ struct WGPUSharedFenceExportInfo;
294297
struct WGPUSharedTextureMemoryAHardwareBufferProperties;
295298
struct WGPUSharedTextureMemoryBeginAccessDescriptor;
296299
struct WGPUSharedTextureMemoryDmaBufDescriptor;
297-
struct WGPUSharedTextureMemoryEndAccessState;
300+
struct WGPUSharedTextureMemoryMetalEndAccessState;
298301
struct WGPUSurfaceDescriptor;
299302
struct WGPUTexelCopyBufferInfo;
300303
struct WGPUTexelCopyTextureInfo;
@@ -312,6 +315,7 @@ struct WGPUDeviceDescriptor;
312315
struct WGPUPipelineLayoutDescriptor;
313316
struct WGPURenderPassPixelLocalStorage;
314317
struct WGPUSharedTextureMemoryDescriptor;
318+
struct WGPUSharedTextureMemoryEndAccessState;
315319
struct WGPUSharedTextureMemoryProperties;
316320
struct WGPUTextureViewDescriptor;
317321
struct WGPUVertexState;
@@ -610,8 +614,8 @@ typedef enum WGPUFeatureName {
610614
WGPUFeatureName_SharedFenceEGLSync = 0x00050038,
611615
WGPUFeatureName_DawnDeviceAllocatorControl = 0x00050039,
612616
WGPUFeatureName_TextureComponentSwizzle = 0x0005003A,
613-
WGPUFeatureName_ChromiumExperimentalPrimitiveId = 0x0005003B,
614617
WGPUFeatureName_ChromiumExperimentalBindless = 0x0005003C,
618+
WGPUFeatureName_AdapterPropertiesWGPU = 0x0005003D,
615619
WGPUFeatureName_Force32 = 0x7FFFFFFF
616620
} WGPUFeatureName WGPU_ENUM_ATTRIBUTE;
617621

@@ -893,6 +897,10 @@ typedef enum WGPUSType {
893897
WGPUSType_BindGroupLayoutDynamicBindingArray = 0x0005004A,
894898
WGPUSType_DynamicBindingArrayLimits = 0x0005004B,
895899
WGPUSType_BindGroupDynamicBindingArray = 0x0005004C,
900+
WGPUSType_TexelBufferBindingEntry = 0x0005004D,
901+
WGPUSType_TexelBufferBindingLayout = 0x0005004E,
902+
WGPUSType_SharedTextureMemoryMetalEndAccessState = 0x0005004F,
903+
WGPUSType_AdapterPropertiesWGPU = 0x00050050,
896904
WGPUSType_Force32 = 0x7FFFFFFF
897905
} WGPUSType WGPU_ENUM_ATTRIBUTE;
898906

@@ -916,6 +924,13 @@ typedef enum WGPUSurfaceGetCurrentTextureStatus {
916924
WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF
917925
} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE;
918926

927+
typedef enum WGPUTexelBufferAccess {
928+
WGPUTexelBufferAccess_Undefined = 0x00000000,
929+
WGPUTexelBufferAccess_ReadOnly = 0x00000001,
930+
WGPUTexelBufferAccess_ReadWrite = 0x00000002,
931+
WGPUTexelBufferAccess_Force32 = 0x7FFFFFFF
932+
} WGPUTexelBufferAccess WGPU_ENUM_ATTRIBUTE;
933+
919934
typedef enum WGPUTextureAspect {
920935
WGPUTextureAspect_Undefined = 0x00000000,
921936
WGPUTextureAspect_All = 0x00000001,
@@ -1436,6 +1451,20 @@ typedef struct WGPUAdapterPropertiesVk {
14361451
/*.driverVersion=*/0 _wgpu_COMMA \
14371452
})
14381453

1454+
// Can be chained in WGPUAdapterInfo
1455+
typedef struct WGPUAdapterPropertiesWGPU {
1456+
WGPUChainedStruct chain;
1457+
WGPUBackendType backendType;
1458+
} WGPUAdapterPropertiesWGPU WGPU_STRUCTURE_ATTRIBUTE;
1459+
1460+
#define WGPU_ADAPTER_PROPERTIES_WGPU_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesWGPU, { \
1461+
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
1462+
/*.next=*/NULL _wgpu_COMMA \
1463+
/*.sType=*/WGPUSType_AdapterPropertiesWGPU _wgpu_COMMA \
1464+
}) _wgpu_COMMA \
1465+
/*.backendType=*/WGPUBackendType_Undefined _wgpu_COMMA \
1466+
})
1467+
14391468
// Can be chained in WGPUBindGroupDescriptor
14401469
typedef struct WGPUBindGroupDynamicBindingArray {
14411470
WGPUChainedStruct chain;
@@ -3007,6 +3036,36 @@ typedef struct WGPUSurfaceTexture {
30073036
/*.status=*/_wgpu_ENUM_ZERO_INIT(WGPUSurfaceGetCurrentTextureStatus) _wgpu_COMMA \
30083037
})
30093038

3039+
// Can be chained in WGPUBindGroupEntry
3040+
typedef struct WGPUTexelBufferBindingEntry {
3041+
WGPUChainedStruct chain;
3042+
WGPUTexelBufferView texelBufferView;
3043+
} WGPUTexelBufferBindingEntry WGPU_STRUCTURE_ATTRIBUTE;
3044+
3045+
#define WGPU_TEXEL_BUFFER_BINDING_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelBufferBindingEntry, { \
3046+
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
3047+
/*.next=*/NULL _wgpu_COMMA \
3048+
/*.sType=*/WGPUSType_TexelBufferBindingEntry _wgpu_COMMA \
3049+
}) _wgpu_COMMA \
3050+
/*.texelBufferView=*/NULL _wgpu_COMMA \
3051+
})
3052+
3053+
// Can be chained in WGPUBindGroupLayoutEntry
3054+
typedef struct WGPUTexelBufferBindingLayout {
3055+
WGPUChainedStruct chain;
3056+
WGPUTexelBufferAccess access;
3057+
WGPUTextureFormat format;
3058+
} WGPUTexelBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
3059+
3060+
#define WGPU_TEXEL_BUFFER_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTexelBufferBindingLayout, { \
3061+
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
3062+
/*.next=*/NULL _wgpu_COMMA \
3063+
/*.sType=*/WGPUSType_TexelBufferBindingLayout _wgpu_COMMA \
3064+
}) _wgpu_COMMA \
3065+
/*.access=*/WGPUTexelBufferAccess_Undefined _wgpu_COMMA \
3066+
/*.format=*/WGPUTextureFormat_Undefined _wgpu_COMMA \
3067+
})
3068+
30103069
typedef struct WGPUTexelBufferViewDescriptor {
30113070
WGPUChainedStruct * nextInChain;
30123071
WGPUStringView label;
@@ -3684,20 +3743,18 @@ typedef struct WGPUSharedTextureMemoryDmaBufDescriptor {
36843743
/*.planes=*/NULL _wgpu_COMMA \
36853744
})
36863745

3687-
typedef struct WGPUSharedTextureMemoryEndAccessState {
3688-
WGPUChainedStruct * nextInChain;
3689-
WGPUBool initialized;
3690-
size_t fenceCount;
3691-
WGPUSharedFence const * fences;
3692-
uint64_t const * signaledValues;
3693-
} WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
3746+
// Can be chained in WGPUSharedTextureMemoryEndAccessState
3747+
typedef struct WGPUSharedTextureMemoryMetalEndAccessState {
3748+
WGPUChainedStruct chain;
3749+
WGPUFuture commandsScheduledFuture;
3750+
} WGPUSharedTextureMemoryMetalEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
36943751

3695-
#define WGPU_SHARED_TEXTURE_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEndAccessState, { \
3696-
/*.nextInChain=*/NULL _wgpu_COMMA \
3697-
/*.initialized=*/WGPU_FALSE _wgpu_COMMA \
3698-
/*.fenceCount=*/0 _wgpu_COMMA \
3699-
/*.fences=*/NULL _wgpu_COMMA \
3700-
/*.signaledValues=*/NULL _wgpu_COMMA \
3752+
#define WGPU_SHARED_TEXTURE_MEMORY_METAL_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryMetalEndAccessState, { \
3753+
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
3754+
/*.next=*/NULL _wgpu_COMMA \
3755+
/*.sType=*/WGPUSType_SharedTextureMemoryMetalEndAccessState _wgpu_COMMA \
3756+
}) _wgpu_COMMA \
3757+
/*.commandsScheduledFuture=*/WGPU_FUTURE_INIT _wgpu_COMMA \
37013758
})
37023759

37033760
typedef struct WGPUSurfaceDescriptor {
@@ -3962,6 +4019,22 @@ typedef struct WGPUSharedTextureMemoryDescriptor {
39624019
/*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \
39634020
})
39644021

4022+
typedef struct WGPUSharedTextureMemoryEndAccessState {
4023+
WGPUChainedStruct * nextInChain;
4024+
WGPUBool initialized;
4025+
size_t fenceCount;
4026+
WGPUSharedFence const * fences;
4027+
uint64_t const * signaledValues;
4028+
} WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
4029+
4030+
#define WGPU_SHARED_TEXTURE_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEndAccessState, { \
4031+
/*.nextInChain=*/NULL _wgpu_COMMA \
4032+
/*.initialized=*/WGPU_FALSE _wgpu_COMMA \
4033+
/*.fenceCount=*/0 _wgpu_COMMA \
4034+
/*.fences=*/NULL _wgpu_COMMA \
4035+
/*.signaledValues=*/NULL _wgpu_COMMA \
4036+
})
4037+
39654038
typedef struct WGPUSharedTextureMemoryProperties {
39664039
WGPUChainedStruct * nextInChain;
39674040
WGPUTextureUsage usage;
@@ -4158,6 +4231,7 @@ typedef void (*WGPUProcAdapterPropertiesMemoryHeapsFreeMembers)(WGPUAdapterPrope
41584231
typedef void (*WGPUProcAdapterPropertiesSubgroupMatrixConfigsFreeMembers)(WGPUAdapterPropertiesSubgroupMatrixConfigs adapterPropertiesSubgroupMatrixConfigs) WGPU_FUNCTION_ATTRIBUTE;
41594232

41604233
// Procs of BindGroup
4234+
typedef void (*WGPUProcBindGroupDestroy)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
41614235
typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
41624236
typedef void (*WGPUProcBindGroupAddRef)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
41634237
typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
@@ -4168,6 +4242,7 @@ typedef void (*WGPUProcBindGroupLayoutAddRef)(WGPUBindGroupLayout bindGroupLayou
41684242
typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE;
41694243

41704244
// Procs of Buffer
4245+
typedef WGPUTexelBufferView (*WGPUProcBufferCreateTexelView)(WGPUBuffer buffer, WGPUTexelBufferViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
41714246
typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE;
41724247
typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE;
41734248
typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE;
@@ -4455,7 +4530,9 @@ typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture) WGPU_FU
44554530
typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
44564531
typedef WGPUTextureUsage (*WGPUProcTextureGetUsage)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
44574532
typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
4533+
typedef void (*WGPUProcTexturePin)(WGPUTexture texture, WGPUTextureUsage usage) WGPU_FUNCTION_ATTRIBUTE;
44584534
typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
4535+
typedef void (*WGPUProcTextureUnpin)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
44594536
typedef void (*WGPUProcTextureAddRef)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
44604537
typedef void (*WGPUProcTextureRelease)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
44614538

@@ -4495,6 +4572,7 @@ WGPU_EXPORT void wgpuAdapterPropertiesMemoryHeapsFreeMembers(WGPUAdapterProperti
44954572
WGPU_EXPORT void wgpuAdapterPropertiesSubgroupMatrixConfigsFreeMembers(WGPUAdapterPropertiesSubgroupMatrixConfigs adapterPropertiesSubgroupMatrixConfigs) WGPU_FUNCTION_ATTRIBUTE;
44964573

44974574
// Methods of BindGroup
4575+
WGPU_EXPORT void wgpuBindGroupDestroy(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
44984576
WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
44994577
WGPU_EXPORT void wgpuBindGroupAddRef(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
45004578
WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE;
@@ -4505,6 +4583,7 @@ WGPU_EXPORT void wgpuBindGroupLayoutAddRef(WGPUBindGroupLayout bindGroupLayout)
45054583
WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE;
45064584

45074585
// Methods of Buffer
4586+
WGPU_EXPORT WGPUTexelBufferView wgpuBufferCreateTexelView(WGPUBuffer buffer, WGPUTexelBufferViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE;
45084587
WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE;
45094588
WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE;
45104589
WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE;
@@ -4792,7 +4871,9 @@ WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture) WGPU_FUNCT
47924871
WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
47934872
WGPU_EXPORT WGPUTextureUsage wgpuTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
47944873
WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
4874+
WGPU_EXPORT void wgpuTexturePin(WGPUTexture texture, WGPUTextureUsage usage) WGPU_FUNCTION_ATTRIBUTE;
47954875
WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE;
4876+
WGPU_EXPORT void wgpuTextureUnpin(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
47964877
WGPU_EXPORT void wgpuTextureAddRef(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
47974878
WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
47984879

0 commit comments

Comments
 (0)