From 60f9cf88ae2e197231b08f6283e304b950465e8d Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Mon, 1 Apr 2024 02:27:46 +0200 Subject: [PATCH 1/3] aquabsd/black/wgpu: Update headers --- src/aquabsd/black/wgpu.h | 522 +++++++++++++++++---------------- src/aquabsd/black/wgpu_types.h | 459 +++++++++++++++-------------- 2 files changed, 506 insertions(+), 475 deletions(-) diff --git a/src/aquabsd/black/wgpu.h b/src/aquabsd/black/wgpu.h index ddb9f5f..08c05dc 100644 --- a/src/aquabsd/black/wgpu.h +++ b/src/aquabsd/black/wgpu.h @@ -38,9 +38,23 @@ AQUA_C_FN WGPUSurface wgpu_surface_from_win(WGPUInstance instance, win_t* win) { return (WGPUSurface) send_device(wgpu_device, 0x0000, (void*) &args); } -AQUA_C_FN WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor) { +#if defined(AQUABSD_BLACK_WM) +AQUA_C_FN WGPUSurface wgpu_surface_from_wm(WGPUInstance instance, wm_t* wm) { struct { - WGPUInstanceDescriptor const * descriptor; + WGPUInstance instance; + void* wm; + } __attribute__((packed)) const args = { + .instance = instance, + .wm = (void*) wm->internal_wm, + }; + + return (WGPUSurface) send_device(wgpu_device, 0x0001, (void*) &args); +} +#endif + +AQUA_C_FN WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) { + struct { + WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor; } __attribute__((packed)) const args = { .descriptor = descriptor, }; @@ -72,7 +86,7 @@ AQUA_C_FN size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureNa return (size_t) send_device(wgpu_device, 0x1002, (void*) &args); } -AQUA_C_FN bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) { +AQUA_C_FN WGPUBool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) { struct { WGPUAdapter adapter; WGPUSupportedLimits * limits; @@ -81,7 +95,7 @@ AQUA_C_FN bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * l .limits = limits, }; - return (bool) send_device(wgpu_device, 0x1003, (void*) &args); + return (WGPUBool) send_device(wgpu_device, 0x1003, (void*) &args); } AQUA_C_FN void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties) { @@ -96,7 +110,7 @@ AQUA_C_FN void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperti send_device(wgpu_device, 0x1004, (void*) &args); } -AQUA_C_FN bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) { +AQUA_C_FN WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) { struct { WGPUAdapter adapter; WGPUFeatureName feature; @@ -105,15 +119,29 @@ AQUA_C_FN bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName featur .feature = feature, }; - return (bool) send_device(wgpu_device, 0x1005, (void*) &args); + return (WGPUBool) send_device(wgpu_device, 0x1005, (void*) &args); +} + +AQUA_C_FN void wgpuAdapterRequestAdapterInfo(WGPUAdapter adapter, WGPUAdapterRequestAdapterInfoCallback callback, WGPU_NULLABLE void * userdata) { + struct { + WGPUAdapter adapter; + WGPUAdapterRequestAdapterInfoCallback callback; + WGPU_NULLABLE void * userdata; + } __attribute__((packed)) const args = { + .adapter = adapter, + .callback = callback, + .userdata = userdata, + }; + + send_device(wgpu_device, 0x1006, (void*) &args); } -AQUA_C_FN void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) { +AQUA_C_FN void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPUAdapterRequestDeviceCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUAdapter adapter; WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor; - WGPURequestDeviceCallback callback; - void * userdata; + WGPUAdapterRequestDeviceCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .adapter = adapter, .descriptor = descriptor, @@ -121,7 +149,7 @@ AQUA_C_FN void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUD .userdata = userdata, }; - send_device(wgpu_device, 0x1006, (void*) &args); + send_device(wgpu_device, 0x1007, (void*) &args); } AQUA_C_FN void wgpuAdapterReference(WGPUAdapter adapter) { @@ -131,7 +159,7 @@ AQUA_C_FN void wgpuAdapterReference(WGPUAdapter adapter) { .adapter = adapter, }; - send_device(wgpu_device, 0x1007, (void*) &args); + send_device(wgpu_device, 0x1008, (void*) &args); } AQUA_C_FN void wgpuAdapterRelease(WGPUAdapter adapter) { @@ -141,7 +169,7 @@ AQUA_C_FN void wgpuAdapterRelease(WGPUAdapter adapter) { .adapter = adapter, }; - send_device(wgpu_device, 0x1008, (void*) &args); + send_device(wgpu_device, 0x1009, (void*) &args); } AQUA_C_FN void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label) { @@ -153,7 +181,7 @@ AQUA_C_FN void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label .label = label, }; - send_device(wgpu_device, 0x1009, (void*) &args); + send_device(wgpu_device, 0x100a, (void*) &args); } AQUA_C_FN void wgpuBindGroupReference(WGPUBindGroup bindGroup) { @@ -163,7 +191,7 @@ AQUA_C_FN void wgpuBindGroupReference(WGPUBindGroup bindGroup) { .bindGroup = bindGroup, }; - send_device(wgpu_device, 0x100a, (void*) &args); + send_device(wgpu_device, 0x100b, (void*) &args); } AQUA_C_FN void wgpuBindGroupRelease(WGPUBindGroup bindGroup) { @@ -173,7 +201,7 @@ AQUA_C_FN void wgpuBindGroupRelease(WGPUBindGroup bindGroup) { .bindGroup = bindGroup, }; - send_device(wgpu_device, 0x100b, (void*) &args); + send_device(wgpu_device, 0x100c, (void*) &args); } AQUA_C_FN void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label) { @@ -185,7 +213,7 @@ AQUA_C_FN void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, .label = label, }; - send_device(wgpu_device, 0x100c, (void*) &args); + send_device(wgpu_device, 0x100d, (void*) &args); } AQUA_C_FN void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout) { @@ -195,7 +223,7 @@ AQUA_C_FN void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout) .bindGroupLayout = bindGroupLayout, }; - send_device(wgpu_device, 0x100d, (void*) &args); + send_device(wgpu_device, 0x100e, (void*) &args); } AQUA_C_FN void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) { @@ -205,7 +233,7 @@ AQUA_C_FN void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) { .bindGroupLayout = bindGroupLayout, }; - send_device(wgpu_device, 0x100e, (void*) &args); + send_device(wgpu_device, 0x100f, (void*) &args); } AQUA_C_FN void wgpuBufferDestroy(WGPUBuffer buffer) { @@ -215,7 +243,7 @@ AQUA_C_FN void wgpuBufferDestroy(WGPUBuffer buffer) { .buffer = buffer, }; - send_device(wgpu_device, 0x100f, (void*) &args); + send_device(wgpu_device, 0x1010, (void*) &args); } AQUA_C_FN void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) { @@ -229,7 +257,7 @@ AQUA_C_FN void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t o .size = size, }; - return (void const *) send_device(wgpu_device, 0x1010, (void*) &args); + return (void const *) send_device(wgpu_device, 0x1011, (void*) &args); } AQUA_C_FN WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) { @@ -239,7 +267,7 @@ AQUA_C_FN WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) { .buffer = buffer, }; - return (WGPUBufferMapState) send_device(wgpu_device, 0x1011, (void*) &args); + return (WGPUBufferMapState) send_device(wgpu_device, 0x1012, (void*) &args); } AQUA_C_FN void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) { @@ -253,7 +281,7 @@ AQUA_C_FN void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size .size = size, }; - return (void *) send_device(wgpu_device, 0x1012, (void*) &args); + return (void *) send_device(wgpu_device, 0x1013, (void*) &args); } AQUA_C_FN uint64_t wgpuBufferGetSize(WGPUBuffer buffer) { @@ -263,7 +291,7 @@ AQUA_C_FN uint64_t wgpuBufferGetSize(WGPUBuffer buffer) { .buffer = buffer, }; - return (uint64_t) send_device(wgpu_device, 0x1013, (void*) &args); + return (uint64_t) send_device(wgpu_device, 0x1014, (void*) &args); } AQUA_C_FN WGPUBufferUsageFlags wgpuBufferGetUsage(WGPUBuffer buffer) { @@ -273,17 +301,17 @@ AQUA_C_FN WGPUBufferUsageFlags wgpuBufferGetUsage(WGPUBuffer buffer) { .buffer = buffer, }; - return (WGPUBufferUsageFlags) send_device(wgpu_device, 0x1014, (void*) &args); + return (WGPUBufferUsageFlags) send_device(wgpu_device, 0x1015, (void*) &args); } -AQUA_C_FN void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) { +AQUA_C_FN void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapAsyncCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUBuffer buffer; WGPUMapModeFlags mode; size_t offset; size_t size; - WGPUBufferMapCallback callback; - void * userdata; + WGPUBufferMapAsyncCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .buffer = buffer, .mode = mode, @@ -293,7 +321,7 @@ AQUA_C_FN void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size .userdata = userdata, }; - send_device(wgpu_device, 0x1015, (void*) &args); + send_device(wgpu_device, 0x1016, (void*) &args); } AQUA_C_FN void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label) { @@ -305,7 +333,7 @@ AQUA_C_FN void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label) { .label = label, }; - send_device(wgpu_device, 0x1016, (void*) &args); + send_device(wgpu_device, 0x1017, (void*) &args); } AQUA_C_FN void wgpuBufferUnmap(WGPUBuffer buffer) { @@ -315,7 +343,7 @@ AQUA_C_FN void wgpuBufferUnmap(WGPUBuffer buffer) { .buffer = buffer, }; - send_device(wgpu_device, 0x1017, (void*) &args); + send_device(wgpu_device, 0x1018, (void*) &args); } AQUA_C_FN void wgpuBufferReference(WGPUBuffer buffer) { @@ -325,7 +353,7 @@ AQUA_C_FN void wgpuBufferReference(WGPUBuffer buffer) { .buffer = buffer, }; - send_device(wgpu_device, 0x1018, (void*) &args); + send_device(wgpu_device, 0x1019, (void*) &args); } AQUA_C_FN void wgpuBufferRelease(WGPUBuffer buffer) { @@ -335,7 +363,7 @@ AQUA_C_FN void wgpuBufferRelease(WGPUBuffer buffer) { .buffer = buffer, }; - send_device(wgpu_device, 0x1019, (void*) &args); + send_device(wgpu_device, 0x101a, (void*) &args); } AQUA_C_FN void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label) { @@ -347,7 +375,7 @@ AQUA_C_FN void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char c .label = label, }; - send_device(wgpu_device, 0x101a, (void*) &args); + send_device(wgpu_device, 0x101b, (void*) &args); } AQUA_C_FN void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) { @@ -357,7 +385,7 @@ AQUA_C_FN void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) { .commandBuffer = commandBuffer, }; - send_device(wgpu_device, 0x101b, (void*) &args); + send_device(wgpu_device, 0x101c, (void*) &args); } AQUA_C_FN void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) { @@ -367,7 +395,7 @@ AQUA_C_FN void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) { .commandBuffer = commandBuffer, }; - send_device(wgpu_device, 0x101c, (void*) &args); + send_device(wgpu_device, 0x101d, (void*) &args); } AQUA_C_FN WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) { @@ -379,7 +407,7 @@ AQUA_C_FN WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandE .descriptor = descriptor, }; - return (WGPUComputePassEncoder) send_device(wgpu_device, 0x101d, (void*) &args); + return (WGPUComputePassEncoder) send_device(wgpu_device, 0x101e, (void*) &args); } AQUA_C_FN WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) { @@ -391,7 +419,7 @@ AQUA_C_FN WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEnc .descriptor = descriptor, }; - return (WGPURenderPassEncoder) send_device(wgpu_device, 0x101e, (void*) &args); + return (WGPURenderPassEncoder) send_device(wgpu_device, 0x101f, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) { @@ -407,7 +435,7 @@ AQUA_C_FN void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, .size = size, }; - send_device(wgpu_device, 0x101f, (void*) &args); + send_device(wgpu_device, 0x1020, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) { @@ -427,7 +455,7 @@ AQUA_C_FN void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEn .size = size, }; - send_device(wgpu_device, 0x1020, (void*) &args); + send_device(wgpu_device, 0x1021, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) { @@ -443,7 +471,7 @@ AQUA_C_FN void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandE .copySize = copySize, }; - send_device(wgpu_device, 0x1021, (void*) &args); + send_device(wgpu_device, 0x1022, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) { @@ -459,7 +487,7 @@ AQUA_C_FN void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandE .copySize = copySize, }; - send_device(wgpu_device, 0x1022, (void*) &args); + send_device(wgpu_device, 0x1023, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) { @@ -475,7 +503,7 @@ AQUA_C_FN void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder command .copySize = copySize, }; - send_device(wgpu_device, 0x1023, (void*) &args); + send_device(wgpu_device, 0x1024, (void*) &args); } AQUA_C_FN WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) { @@ -487,7 +515,7 @@ AQUA_C_FN WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandE .descriptor = descriptor, }; - return (WGPUCommandBuffer) send_device(wgpu_device, 0x1024, (void*) &args); + return (WGPUCommandBuffer) send_device(wgpu_device, 0x1025, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel) { @@ -499,7 +527,7 @@ AQUA_C_FN void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEnc .markerLabel = markerLabel, }; - send_device(wgpu_device, 0x1025, (void*) &args); + send_device(wgpu_device, 0x1026, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) { @@ -509,7 +537,7 @@ AQUA_C_FN void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder .commandEncoder = commandEncoder, }; - send_device(wgpu_device, 0x1026, (void*) &args); + send_device(wgpu_device, 0x1027, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel) { @@ -521,7 +549,7 @@ AQUA_C_FN void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncode .groupLabel = groupLabel, }; - send_device(wgpu_device, 0x1027, (void*) &args); + send_device(wgpu_device, 0x1028, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) { @@ -541,7 +569,7 @@ AQUA_C_FN void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncod .destinationOffset = destinationOffset, }; - send_device(wgpu_device, 0x1028, (void*) &args); + send_device(wgpu_device, 0x1029, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label) { @@ -553,7 +581,7 @@ AQUA_C_FN void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, cha .label = label, }; - send_device(wgpu_device, 0x1029, (void*) &args); + send_device(wgpu_device, 0x102a, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) { @@ -567,7 +595,7 @@ AQUA_C_FN void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncode .queryIndex = queryIndex, }; - send_device(wgpu_device, 0x102a, (void*) &args); + send_device(wgpu_device, 0x102b, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder) { @@ -577,7 +605,7 @@ AQUA_C_FN void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder) { .commandEncoder = commandEncoder, }; - send_device(wgpu_device, 0x102b, (void*) &args); + send_device(wgpu_device, 0x102c, (void*) &args); } AQUA_C_FN void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) { @@ -587,20 +615,6 @@ AQUA_C_FN void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) { .commandEncoder = commandEncoder, }; - send_device(wgpu_device, 0x102c, (void*) &args); -} - -AQUA_C_FN void wgpuComputePassEncoderBeginPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) { - struct { - WGPUComputePassEncoder computePassEncoder; - WGPUQuerySet querySet; - uint32_t queryIndex; - } __attribute__((packed)) const args = { - .computePassEncoder = computePassEncoder, - .querySet = querySet, - .queryIndex = queryIndex, - }; - send_device(wgpu_device, 0x102d, (void*) &args); } @@ -644,16 +658,6 @@ AQUA_C_FN void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncod send_device(wgpu_device, 0x1030, (void*) &args); } -AQUA_C_FN void wgpuComputePassEncoderEndPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder) { - struct { - WGPUComputePassEncoder computePassEncoder; - } __attribute__((packed)) const args = { - .computePassEncoder = computePassEncoder, - }; - - send_device(wgpu_device, 0x1031, (void*) &args); -} - AQUA_C_FN void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) { struct { WGPUComputePassEncoder computePassEncoder; @@ -663,7 +667,7 @@ AQUA_C_FN void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder co .markerLabel = markerLabel, }; - send_device(wgpu_device, 0x1032, (void*) &args); + send_device(wgpu_device, 0x1031, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) { @@ -673,7 +677,7 @@ AQUA_C_FN void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder comput .computePassEncoder = computePassEncoder, }; - send_device(wgpu_device, 0x1033, (void*) &args); + send_device(wgpu_device, 0x1032, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) { @@ -685,7 +689,7 @@ AQUA_C_FN void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder compu .groupLabel = groupLabel, }; - send_device(wgpu_device, 0x1034, (void*) &args); + send_device(wgpu_device, 0x1033, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { @@ -703,7 +707,7 @@ AQUA_C_FN void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder compute .dynamicOffsets = dynamicOffsets, }; - send_device(wgpu_device, 0x1035, (void*) &args); + send_device(wgpu_device, 0x1034, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label) { @@ -715,7 +719,7 @@ AQUA_C_FN void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePass .label = label, }; - send_device(wgpu_device, 0x1036, (void*) &args); + send_device(wgpu_device, 0x1035, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) { @@ -727,7 +731,7 @@ AQUA_C_FN void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computeP .pipeline = pipeline, }; - send_device(wgpu_device, 0x1037, (void*) &args); + send_device(wgpu_device, 0x1036, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder) { @@ -737,7 +741,7 @@ AQUA_C_FN void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePas .computePassEncoder = computePassEncoder, }; - send_device(wgpu_device, 0x1038, (void*) &args); + send_device(wgpu_device, 0x1037, (void*) &args); } AQUA_C_FN void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) { @@ -747,7 +751,7 @@ AQUA_C_FN void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassE .computePassEncoder = computePassEncoder, }; - send_device(wgpu_device, 0x1039, (void*) &args); + send_device(wgpu_device, 0x1038, (void*) &args); } AQUA_C_FN WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) { @@ -759,7 +763,7 @@ AQUA_C_FN WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputeP .groupIndex = groupIndex, }; - return (WGPUBindGroupLayout) send_device(wgpu_device, 0x103a, (void*) &args); + return (WGPUBindGroupLayout) send_device(wgpu_device, 0x1039, (void*) &args); } AQUA_C_FN void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label) { @@ -771,7 +775,7 @@ AQUA_C_FN void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, .label = label, }; - send_device(wgpu_device, 0x103b, (void*) &args); + send_device(wgpu_device, 0x103a, (void*) &args); } AQUA_C_FN void wgpuComputePipelineReference(WGPUComputePipeline computePipeline) { @@ -781,7 +785,7 @@ AQUA_C_FN void wgpuComputePipelineReference(WGPUComputePipeline computePipeline) .computePipeline = computePipeline, }; - send_device(wgpu_device, 0x103c, (void*) &args); + send_device(wgpu_device, 0x103b, (void*) &args); } AQUA_C_FN void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) { @@ -791,7 +795,7 @@ AQUA_C_FN void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) { .computePipeline = computePipeline, }; - send_device(wgpu_device, 0x103d, (void*) &args); + send_device(wgpu_device, 0x103c, (void*) &args); } AQUA_C_FN WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) { @@ -803,7 +807,7 @@ AQUA_C_FN WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGro .descriptor = descriptor, }; - return (WGPUBindGroup) send_device(wgpu_device, 0x103e, (void*) &args); + return (WGPUBindGroup) send_device(wgpu_device, 0x103d, (void*) &args); } AQUA_C_FN WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) { @@ -815,7 +819,7 @@ AQUA_C_FN WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, .descriptor = descriptor, }; - return (WGPUBindGroupLayout) send_device(wgpu_device, 0x103f, (void*) &args); + return (WGPUBindGroupLayout) send_device(wgpu_device, 0x103e, (void*) &args); } AQUA_C_FN WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) { @@ -827,7 +831,7 @@ AQUA_C_FN WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescrip .descriptor = descriptor, }; - return (WGPUBuffer) send_device(wgpu_device, 0x1040, (void*) &args); + return (WGPUBuffer) send_device(wgpu_device, 0x103f, (void*) &args); } AQUA_C_FN WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) { @@ -839,7 +843,7 @@ AQUA_C_FN WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, W .descriptor = descriptor, }; - return (WGPUCommandEncoder) send_device(wgpu_device, 0x1041, (void*) &args); + return (WGPUCommandEncoder) send_device(wgpu_device, 0x1040, (void*) &args); } AQUA_C_FN WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) { @@ -851,15 +855,15 @@ AQUA_C_FN WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, .descriptor = descriptor, }; - return (WGPUComputePipeline) send_device(wgpu_device, 0x1042, (void*) &args); + return (WGPUComputePipeline) send_device(wgpu_device, 0x1041, (void*) &args); } -AQUA_C_FN void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) { +AQUA_C_FN void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUDeviceCreateComputePipelineAsyncCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUDevice device; WGPUComputePipelineDescriptor const * descriptor; - WGPUCreateComputePipelineAsyncCallback callback; - void * userdata; + WGPUDeviceCreateComputePipelineAsyncCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .device = device, .descriptor = descriptor, @@ -867,7 +871,7 @@ AQUA_C_FN void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUCompu .userdata = userdata, }; - send_device(wgpu_device, 0x1043, (void*) &args); + send_device(wgpu_device, 0x1042, (void*) &args); } AQUA_C_FN WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) { @@ -879,7 +883,7 @@ AQUA_C_FN WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, W .descriptor = descriptor, }; - return (WGPUPipelineLayout) send_device(wgpu_device, 0x1044, (void*) &args); + return (WGPUPipelineLayout) send_device(wgpu_device, 0x1043, (void*) &args); } AQUA_C_FN WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) { @@ -891,7 +895,7 @@ AQUA_C_FN WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetD .descriptor = descriptor, }; - return (WGPUQuerySet) send_device(wgpu_device, 0x1045, (void*) &args); + return (WGPUQuerySet) send_device(wgpu_device, 0x1044, (void*) &args); } AQUA_C_FN WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) { @@ -903,7 +907,7 @@ AQUA_C_FN WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice .descriptor = descriptor, }; - return (WGPURenderBundleEncoder) send_device(wgpu_device, 0x1046, (void*) &args); + return (WGPURenderBundleEncoder) send_device(wgpu_device, 0x1045, (void*) &args); } AQUA_C_FN WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) { @@ -915,15 +919,15 @@ AQUA_C_FN WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, W .descriptor = descriptor, }; - return (WGPURenderPipeline) send_device(wgpu_device, 0x1047, (void*) &args); + return (WGPURenderPipeline) send_device(wgpu_device, 0x1046, (void*) &args); } -AQUA_C_FN void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) { +AQUA_C_FN void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUDeviceCreateRenderPipelineAsyncCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUDevice device; WGPURenderPipelineDescriptor const * descriptor; - WGPUCreateRenderPipelineAsyncCallback callback; - void * userdata; + WGPUDeviceCreateRenderPipelineAsyncCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .device = device, .descriptor = descriptor, @@ -931,7 +935,7 @@ AQUA_C_FN void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURender .userdata = userdata, }; - send_device(wgpu_device, 0x1048, (void*) &args); + send_device(wgpu_device, 0x1047, (void*) &args); } AQUA_C_FN WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) { @@ -943,7 +947,7 @@ AQUA_C_FN WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE W .descriptor = descriptor, }; - return (WGPUSampler) send_device(wgpu_device, 0x1049, (void*) &args); + return (WGPUSampler) send_device(wgpu_device, 0x1048, (void*) &args); } AQUA_C_FN WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) { @@ -955,21 +959,7 @@ AQUA_C_FN WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUS .descriptor = descriptor, }; - return (WGPUShaderModule) send_device(wgpu_device, 0x104a, (void*) &args); -} - -AQUA_C_FN WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) { - struct { - WGPUDevice device; - WGPUSurface surface; - WGPUSwapChainDescriptor const * descriptor; - } __attribute__((packed)) const args = { - .device = device, - .surface = surface, - .descriptor = descriptor, - }; - - return (WGPUSwapChain) send_device(wgpu_device, 0x104b, (void*) &args); + return (WGPUShaderModule) send_device(wgpu_device, 0x1049, (void*) &args); } AQUA_C_FN WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) { @@ -981,7 +971,7 @@ AQUA_C_FN WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDesc .descriptor = descriptor, }; - return (WGPUTexture) send_device(wgpu_device, 0x104c, (void*) &args); + return (WGPUTexture) send_device(wgpu_device, 0x104a, (void*) &args); } AQUA_C_FN void wgpuDeviceDestroy(WGPUDevice device) { @@ -991,7 +981,7 @@ AQUA_C_FN void wgpuDeviceDestroy(WGPUDevice device) { .device = device, }; - send_device(wgpu_device, 0x104d, (void*) &args); + send_device(wgpu_device, 0x104b, (void*) &args); } AQUA_C_FN size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features) { @@ -1003,10 +993,10 @@ AQUA_C_FN size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName .features = features, }; - return (size_t) send_device(wgpu_device, 0x104e, (void*) &args); + return (size_t) send_device(wgpu_device, 0x104c, (void*) &args); } -AQUA_C_FN bool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits) { +AQUA_C_FN WGPUBool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits) { struct { WGPUDevice device; WGPUSupportedLimits * limits; @@ -1015,7 +1005,7 @@ AQUA_C_FN bool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limi .limits = limits, }; - return (bool) send_device(wgpu_device, 0x104f, (void*) &args); + return (WGPUBool) send_device(wgpu_device, 0x104d, (void*) &args); } AQUA_C_FN WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) { @@ -1025,10 +1015,10 @@ AQUA_C_FN WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) { .device = device, }; - return (WGPUQueue) send_device(wgpu_device, 0x1050, (void*) &args); + return (WGPUQueue) send_device(wgpu_device, 0x104e, (void*) &args); } -AQUA_C_FN bool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) { +AQUA_C_FN WGPUBool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) { struct { WGPUDevice device; WGPUFeatureName feature; @@ -1037,7 +1027,7 @@ AQUA_C_FN bool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) .feature = feature, }; - return (bool) send_device(wgpu_device, 0x1051, (void*) &args); + return (WGPUBool) send_device(wgpu_device, 0x104f, (void*) &args); } AQUA_C_FN void wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata) { @@ -1051,7 +1041,7 @@ AQUA_C_FN void wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback call .userdata = userdata, }; - send_device(wgpu_device, 0x1052, (void*) &args); + send_device(wgpu_device, 0x1050, (void*) &args); } AQUA_C_FN void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) { @@ -1063,7 +1053,7 @@ AQUA_C_FN void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filte .filter = filter, }; - send_device(wgpu_device, 0x1053, (void*) &args); + send_device(wgpu_device, 0x1051, (void*) &args); } AQUA_C_FN void wgpuDeviceSetLabel(WGPUDevice device, char const * label) { @@ -1075,7 +1065,7 @@ AQUA_C_FN void wgpuDeviceSetLabel(WGPUDevice device, char const * label) { .label = label, }; - send_device(wgpu_device, 0x1054, (void*) &args); + send_device(wgpu_device, 0x1052, (void*) &args); } AQUA_C_FN void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata) { @@ -1089,7 +1079,7 @@ AQUA_C_FN void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUError .userdata = userdata, }; - send_device(wgpu_device, 0x1055, (void*) &args); + send_device(wgpu_device, 0x1053, (void*) &args); } AQUA_C_FN void wgpuDeviceReference(WGPUDevice device) { @@ -1099,7 +1089,7 @@ AQUA_C_FN void wgpuDeviceReference(WGPUDevice device) { .device = device, }; - send_device(wgpu_device, 0x1056, (void*) &args); + send_device(wgpu_device, 0x1054, (void*) &args); } AQUA_C_FN void wgpuDeviceRelease(WGPUDevice device) { @@ -1109,7 +1099,7 @@ AQUA_C_FN void wgpuDeviceRelease(WGPUDevice device) { .device = device, }; - send_device(wgpu_device, 0x1057, (void*) &args); + send_device(wgpu_device, 0x1055, (void*) &args); } AQUA_C_FN WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) { @@ -1121,7 +1111,19 @@ AQUA_C_FN WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfa .descriptor = descriptor, }; - return (WGPUSurface) send_device(wgpu_device, 0x1058, (void*) &args); + return (WGPUSurface) send_device(wgpu_device, 0x1056, (void*) &args); +} + +AQUA_C_FN WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLFeatureName feature) { + struct { + WGPUInstance instance; + WGPUWGSLFeatureName feature; + } __attribute__((packed)) const args = { + .instance = instance, + .feature = feature, + }; + + return (WGPUBool) send_device(wgpu_device, 0x1057, (void*) &args); } AQUA_C_FN void wgpuInstanceProcessEvents(WGPUInstance instance) { @@ -1131,15 +1133,15 @@ AQUA_C_FN void wgpuInstanceProcessEvents(WGPUInstance instance) { .instance = instance, }; - send_device(wgpu_device, 0x1059, (void*) &args); + send_device(wgpu_device, 0x1058, (void*) &args); } -AQUA_C_FN void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) { +AQUA_C_FN void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPUInstanceRequestAdapterCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUInstance instance; WGPU_NULLABLE WGPURequestAdapterOptions const * options; - WGPURequestAdapterCallback callback; - void * userdata; + WGPUInstanceRequestAdapterCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .instance = instance, .options = options, @@ -1147,7 +1149,7 @@ AQUA_C_FN void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE W .userdata = userdata, }; - send_device(wgpu_device, 0x105a, (void*) &args); + send_device(wgpu_device, 0x1059, (void*) &args); } AQUA_C_FN void wgpuInstanceReference(WGPUInstance instance) { @@ -1157,7 +1159,7 @@ AQUA_C_FN void wgpuInstanceReference(WGPUInstance instance) { .instance = instance, }; - send_device(wgpu_device, 0x105b, (void*) &args); + send_device(wgpu_device, 0x105a, (void*) &args); } AQUA_C_FN void wgpuInstanceRelease(WGPUInstance instance) { @@ -1167,7 +1169,7 @@ AQUA_C_FN void wgpuInstanceRelease(WGPUInstance instance) { .instance = instance, }; - send_device(wgpu_device, 0x105c, (void*) &args); + send_device(wgpu_device, 0x105b, (void*) &args); } AQUA_C_FN void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label) { @@ -1179,7 +1181,7 @@ AQUA_C_FN void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, cha .label = label, }; - send_device(wgpu_device, 0x105d, (void*) &args); + send_device(wgpu_device, 0x105c, (void*) &args); } AQUA_C_FN void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout) { @@ -1189,7 +1191,7 @@ AQUA_C_FN void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout) { .pipelineLayout = pipelineLayout, }; - send_device(wgpu_device, 0x105e, (void*) &args); + send_device(wgpu_device, 0x105d, (void*) &args); } AQUA_C_FN void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) { @@ -1199,7 +1201,7 @@ AQUA_C_FN void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) { .pipelineLayout = pipelineLayout, }; - send_device(wgpu_device, 0x105f, (void*) &args); + send_device(wgpu_device, 0x105e, (void*) &args); } AQUA_C_FN void wgpuQuerySetDestroy(WGPUQuerySet querySet) { @@ -1209,7 +1211,7 @@ AQUA_C_FN void wgpuQuerySetDestroy(WGPUQuerySet querySet) { .querySet = querySet, }; - send_device(wgpu_device, 0x1060, (void*) &args); + send_device(wgpu_device, 0x105f, (void*) &args); } AQUA_C_FN uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) { @@ -1219,7 +1221,7 @@ AQUA_C_FN uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) { .querySet = querySet, }; - return (uint32_t) send_device(wgpu_device, 0x1061, (void*) &args); + return (uint32_t) send_device(wgpu_device, 0x1060, (void*) &args); } AQUA_C_FN WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) { @@ -1229,7 +1231,7 @@ AQUA_C_FN WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) { .querySet = querySet, }; - return (WGPUQueryType) send_device(wgpu_device, 0x1062, (void*) &args); + return (WGPUQueryType) send_device(wgpu_device, 0x1061, (void*) &args); } AQUA_C_FN void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label) { @@ -1241,7 +1243,7 @@ AQUA_C_FN void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label) { .label = label, }; - send_device(wgpu_device, 0x1063, (void*) &args); + send_device(wgpu_device, 0x1062, (void*) &args); } AQUA_C_FN void wgpuQuerySetReference(WGPUQuerySet querySet) { @@ -1251,7 +1253,7 @@ AQUA_C_FN void wgpuQuerySetReference(WGPUQuerySet querySet) { .querySet = querySet, }; - send_device(wgpu_device, 0x1064, (void*) &args); + send_device(wgpu_device, 0x1063, (void*) &args); } AQUA_C_FN void wgpuQuerySetRelease(WGPUQuerySet querySet) { @@ -1261,21 +1263,21 @@ AQUA_C_FN void wgpuQuerySetRelease(WGPUQuerySet querySet) { .querySet = querySet, }; - send_device(wgpu_device, 0x1065, (void*) &args); + send_device(wgpu_device, 0x1064, (void*) &args); } -AQUA_C_FN void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) { +AQUA_C_FN void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueOnSubmittedWorkDoneCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUQueue queue; - WGPUQueueWorkDoneCallback callback; - void * userdata; + WGPUQueueOnSubmittedWorkDoneCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .queue = queue, .callback = callback, .userdata = userdata, }; - send_device(wgpu_device, 0x1066, (void*) &args); + send_device(wgpu_device, 0x1065, (void*) &args); } AQUA_C_FN void wgpuQueueSetLabel(WGPUQueue queue, char const * label) { @@ -1287,7 +1289,7 @@ AQUA_C_FN void wgpuQueueSetLabel(WGPUQueue queue, char const * label) { .label = label, }; - send_device(wgpu_device, 0x1067, (void*) &args); + send_device(wgpu_device, 0x1066, (void*) &args); } AQUA_C_FN void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) { @@ -1301,7 +1303,7 @@ AQUA_C_FN void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommand .commands = commands, }; - send_device(wgpu_device, 0x1068, (void*) &args); + send_device(wgpu_device, 0x1067, (void*) &args); } AQUA_C_FN void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) { @@ -1319,7 +1321,7 @@ AQUA_C_FN void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t .size = size, }; - send_device(wgpu_device, 0x1069, (void*) &args); + send_device(wgpu_device, 0x1068, (void*) &args); } AQUA_C_FN void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) { @@ -1339,7 +1341,7 @@ AQUA_C_FN void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const .writeSize = writeSize, }; - send_device(wgpu_device, 0x106a, (void*) &args); + send_device(wgpu_device, 0x1069, (void*) &args); } AQUA_C_FN void wgpuQueueReference(WGPUQueue queue) { @@ -1349,7 +1351,7 @@ AQUA_C_FN void wgpuQueueReference(WGPUQueue queue) { .queue = queue, }; - send_device(wgpu_device, 0x106b, (void*) &args); + send_device(wgpu_device, 0x106a, (void*) &args); } AQUA_C_FN void wgpuQueueRelease(WGPUQueue queue) { @@ -1359,7 +1361,7 @@ AQUA_C_FN void wgpuQueueRelease(WGPUQueue queue) { .queue = queue, }; - send_device(wgpu_device, 0x106c, (void*) &args); + send_device(wgpu_device, 0x106b, (void*) &args); } AQUA_C_FN void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, char const * label) { @@ -1371,7 +1373,7 @@ AQUA_C_FN void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, char cons .label = label, }; - send_device(wgpu_device, 0x106d, (void*) &args); + send_device(wgpu_device, 0x106c, (void*) &args); } AQUA_C_FN void wgpuRenderBundleReference(WGPURenderBundle renderBundle) { @@ -1381,7 +1383,7 @@ AQUA_C_FN void wgpuRenderBundleReference(WGPURenderBundle renderBundle) { .renderBundle = renderBundle, }; - send_device(wgpu_device, 0x106e, (void*) &args); + send_device(wgpu_device, 0x106d, (void*) &args); } AQUA_C_FN void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) { @@ -1391,7 +1393,7 @@ AQUA_C_FN void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) { .renderBundle = renderBundle, }; - send_device(wgpu_device, 0x106f, (void*) &args); + send_device(wgpu_device, 0x106e, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) { @@ -1409,7 +1411,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleE .firstInstance = firstInstance, }; - send_device(wgpu_device, 0x1070, (void*) &args); + send_device(wgpu_device, 0x106f, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) { @@ -1429,7 +1431,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder render .firstInstance = firstInstance, }; - send_device(wgpu_device, 0x1071, (void*) &args); + send_device(wgpu_device, 0x1070, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) { @@ -1443,7 +1445,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncode .indirectOffset = indirectOffset, }; - send_device(wgpu_device, 0x1072, (void*) &args); + send_device(wgpu_device, 0x1071, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) { @@ -1457,7 +1459,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder rende .indirectOffset = indirectOffset, }; - send_device(wgpu_device, 0x1073, (void*) &args); + send_device(wgpu_device, 0x1072, (void*) &args); } AQUA_C_FN WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) { @@ -1469,7 +1471,7 @@ AQUA_C_FN WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder .descriptor = descriptor, }; - return (WGPURenderBundle) send_device(wgpu_device, 0x1074, (void*) &args); + return (WGPURenderBundle) send_device(wgpu_device, 0x1073, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) { @@ -1481,7 +1483,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder .markerLabel = markerLabel, }; - send_device(wgpu_device, 0x1075, (void*) &args); + send_device(wgpu_device, 0x1074, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) { @@ -1491,7 +1493,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder rend .renderBundleEncoder = renderBundleEncoder, }; - send_device(wgpu_device, 0x1076, (void*) &args); + send_device(wgpu_device, 0x1075, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) { @@ -1503,7 +1505,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder ren .groupLabel = groupLabel, }; - send_device(wgpu_device, 0x1077, (void*) &args); + send_device(wgpu_device, 0x1076, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { @@ -1521,7 +1523,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder rende .dynamicOffsets = dynamicOffsets, }; - send_device(wgpu_device, 0x1078, (void*) &args); + send_device(wgpu_device, 0x1077, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) { @@ -1539,7 +1541,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder ren .size = size, }; - send_device(wgpu_device, 0x1079, (void*) &args); + send_device(wgpu_device, 0x1078, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label) { @@ -1551,7 +1553,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBun .label = label, }; - send_device(wgpu_device, 0x107a, (void*) &args); + send_device(wgpu_device, 0x1079, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) { @@ -1563,7 +1565,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder render .pipeline = pipeline, }; - send_device(wgpu_device, 0x107b, (void*) &args); + send_device(wgpu_device, 0x107a, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) { @@ -1581,7 +1583,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder re .size = size, }; - send_device(wgpu_device, 0x107c, (void*) &args); + send_device(wgpu_device, 0x107b, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder) { @@ -1591,7 +1593,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBu .renderBundleEncoder = renderBundleEncoder, }; - send_device(wgpu_device, 0x107d, (void*) &args); + send_device(wgpu_device, 0x107c, (void*) &args); } AQUA_C_FN void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) { @@ -1601,7 +1603,7 @@ AQUA_C_FN void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBund .renderBundleEncoder = renderBundleEncoder, }; - send_device(wgpu_device, 0x107e, (void*) &args); + send_device(wgpu_device, 0x107d, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) { @@ -1613,21 +1615,7 @@ AQUA_C_FN void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder re .queryIndex = queryIndex, }; - send_device(wgpu_device, 0x107f, (void*) &args); -} - -AQUA_C_FN void wgpuRenderPassEncoderBeginPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) { - struct { - WGPURenderPassEncoder renderPassEncoder; - WGPUQuerySet querySet; - uint32_t queryIndex; - } __attribute__((packed)) const args = { - .renderPassEncoder = renderPassEncoder, - .querySet = querySet, - .queryIndex = queryIndex, - }; - - send_device(wgpu_device, 0x1080, (void*) &args); + send_device(wgpu_device, 0x107e, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) { @@ -1645,7 +1633,7 @@ AQUA_C_FN void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder .firstInstance = firstInstance, }; - send_device(wgpu_device, 0x1081, (void*) &args); + send_device(wgpu_device, 0x107f, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) { @@ -1665,7 +1653,7 @@ AQUA_C_FN void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPass .firstInstance = firstInstance, }; - send_device(wgpu_device, 0x1082, (void*) &args); + send_device(wgpu_device, 0x1080, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) { @@ -1679,7 +1667,7 @@ AQUA_C_FN void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder re .indirectOffset = indirectOffset, }; - send_device(wgpu_device, 0x1083, (void*) &args); + send_device(wgpu_device, 0x1081, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) { @@ -1693,7 +1681,7 @@ AQUA_C_FN void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPas .indirectOffset = indirectOffset, }; - send_device(wgpu_device, 0x1084, (void*) &args); + send_device(wgpu_device, 0x1082, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) { @@ -1703,7 +1691,7 @@ AQUA_C_FN void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) .renderPassEncoder = renderPassEncoder, }; - send_device(wgpu_device, 0x1085, (void*) &args); + send_device(wgpu_device, 0x1083, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) { @@ -1713,17 +1701,7 @@ AQUA_C_FN void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder rend .renderPassEncoder = renderPassEncoder, }; - send_device(wgpu_device, 0x1086, (void*) &args); -} - -AQUA_C_FN void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder) { - struct { - WGPURenderPassEncoder renderPassEncoder; - } __attribute__((packed)) const args = { - .renderPassEncoder = renderPassEncoder, - }; - - send_device(wgpu_device, 0x1087, (void*) &args); + send_device(wgpu_device, 0x1084, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) { @@ -1737,7 +1715,7 @@ AQUA_C_FN void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderP .bundles = bundles, }; - send_device(wgpu_device, 0x1088, (void*) &args); + send_device(wgpu_device, 0x1085, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) { @@ -1749,7 +1727,7 @@ AQUA_C_FN void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder rend .markerLabel = markerLabel, }; - send_device(wgpu_device, 0x1089, (void*) &args); + send_device(wgpu_device, 0x1086, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) { @@ -1759,7 +1737,7 @@ AQUA_C_FN void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPa .renderPassEncoder = renderPassEncoder, }; - send_device(wgpu_device, 0x108a, (void*) &args); + send_device(wgpu_device, 0x1087, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) { @@ -1771,7 +1749,7 @@ AQUA_C_FN void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderP .groupLabel = groupLabel, }; - send_device(wgpu_device, 0x108b, (void*) &args); + send_device(wgpu_device, 0x1088, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) { @@ -1789,7 +1767,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPas .dynamicOffsets = dynamicOffsets, }; - send_device(wgpu_device, 0x108c, (void*) &args); + send_device(wgpu_device, 0x1089, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) { @@ -1801,7 +1779,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder rende .color = color, }; - send_device(wgpu_device, 0x108d, (void*) &args); + send_device(wgpu_device, 0x108a, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) { @@ -1819,7 +1797,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderP .size = size, }; - send_device(wgpu_device, 0x108e, (void*) &args); + send_device(wgpu_device, 0x108b, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label) { @@ -1831,7 +1809,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEnc .label = label, }; - send_device(wgpu_device, 0x108f, (void*) &args); + send_device(wgpu_device, 0x108c, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) { @@ -1843,7 +1821,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPass .pipeline = pipeline, }; - send_device(wgpu_device, 0x1090, (void*) &args); + send_device(wgpu_device, 0x108d, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { @@ -1861,7 +1839,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderP .height = height, }; - send_device(wgpu_device, 0x1091, (void*) &args); + send_device(wgpu_device, 0x108e, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) { @@ -1873,7 +1851,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder re .reference = reference, }; - send_device(wgpu_device, 0x1092, (void*) &args); + send_device(wgpu_device, 0x108f, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) { @@ -1891,7 +1869,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder render .size = size, }; - send_device(wgpu_device, 0x1093, (void*) &args); + send_device(wgpu_device, 0x1090, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) { @@ -1913,7 +1891,7 @@ AQUA_C_FN void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPass .maxDepth = maxDepth, }; - send_device(wgpu_device, 0x1094, (void*) &args); + send_device(wgpu_device, 0x1091, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder) { @@ -1923,7 +1901,7 @@ AQUA_C_FN void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEn .renderPassEncoder = renderPassEncoder, }; - send_device(wgpu_device, 0x1095, (void*) &args); + send_device(wgpu_device, 0x1092, (void*) &args); } AQUA_C_FN void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) { @@ -1933,7 +1911,7 @@ AQUA_C_FN void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEnco .renderPassEncoder = renderPassEncoder, }; - send_device(wgpu_device, 0x1096, (void*) &args); + send_device(wgpu_device, 0x1093, (void*) &args); } AQUA_C_FN WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) { @@ -1945,7 +1923,7 @@ AQUA_C_FN WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPip .groupIndex = groupIndex, }; - return (WGPUBindGroupLayout) send_device(wgpu_device, 0x1097, (void*) &args); + return (WGPUBindGroupLayout) send_device(wgpu_device, 0x1094, (void*) &args); } AQUA_C_FN void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label) { @@ -1957,7 +1935,7 @@ AQUA_C_FN void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, cha .label = label, }; - send_device(wgpu_device, 0x1098, (void*) &args); + send_device(wgpu_device, 0x1095, (void*) &args); } AQUA_C_FN void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline) { @@ -1967,7 +1945,7 @@ AQUA_C_FN void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline) { .renderPipeline = renderPipeline, }; - send_device(wgpu_device, 0x1099, (void*) &args); + send_device(wgpu_device, 0x1096, (void*) &args); } AQUA_C_FN void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) { @@ -1977,7 +1955,7 @@ AQUA_C_FN void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) { .renderPipeline = renderPipeline, }; - send_device(wgpu_device, 0x109a, (void*) &args); + send_device(wgpu_device, 0x1097, (void*) &args); } AQUA_C_FN void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label) { @@ -1989,7 +1967,7 @@ AQUA_C_FN void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label) { .label = label, }; - send_device(wgpu_device, 0x109b, (void*) &args); + send_device(wgpu_device, 0x1098, (void*) &args); } AQUA_C_FN void wgpuSamplerReference(WGPUSampler sampler) { @@ -1999,7 +1977,7 @@ AQUA_C_FN void wgpuSamplerReference(WGPUSampler sampler) { .sampler = sampler, }; - send_device(wgpu_device, 0x109c, (void*) &args); + send_device(wgpu_device, 0x1099, (void*) &args); } AQUA_C_FN void wgpuSamplerRelease(WGPUSampler sampler) { @@ -2009,21 +1987,21 @@ AQUA_C_FN void wgpuSamplerRelease(WGPUSampler sampler) { .sampler = sampler, }; - send_device(wgpu_device, 0x109d, (void*) &args); + send_device(wgpu_device, 0x109a, (void*) &args); } -AQUA_C_FN void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) { +AQUA_C_FN void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUShaderModuleGetCompilationInfoCallback callback, WGPU_NULLABLE void * userdata) { struct { WGPUShaderModule shaderModule; - WGPUCompilationInfoCallback callback; - void * userdata; + WGPUShaderModuleGetCompilationInfoCallback callback; + WGPU_NULLABLE void * userdata; } __attribute__((packed)) const args = { .shaderModule = shaderModule, .callback = callback, .userdata = userdata, }; - send_device(wgpu_device, 0x109e, (void*) &args); + send_device(wgpu_device, 0x109b, (void*) &args); } AQUA_C_FN void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label) { @@ -2035,7 +2013,7 @@ AQUA_C_FN void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char cons .label = label, }; - send_device(wgpu_device, 0x109f, (void*) &args); + send_device(wgpu_device, 0x109c, (void*) &args); } AQUA_C_FN void wgpuShaderModuleReference(WGPUShaderModule shaderModule) { @@ -2045,7 +2023,7 @@ AQUA_C_FN void wgpuShaderModuleReference(WGPUShaderModule shaderModule) { .shaderModule = shaderModule, }; - send_device(wgpu_device, 0x10a0, (void*) &args); + send_device(wgpu_device, 0x109d, (void*) &args); } AQUA_C_FN void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) { @@ -2055,6 +2033,44 @@ AQUA_C_FN void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) { .shaderModule = shaderModule, }; + send_device(wgpu_device, 0x109e, (void*) &args); +} + +AQUA_C_FN void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) { + struct { + WGPUSurface surface; + WGPUSurfaceConfiguration const * config; + } __attribute__((packed)) const args = { + .surface = surface, + .config = config, + }; + + send_device(wgpu_device, 0x109f, (void*) &args); +} + +AQUA_C_FN void wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) { + struct { + WGPUSurface surface; + WGPUAdapter adapter; + WGPUSurfaceCapabilities * capabilities; + } __attribute__((packed)) const args = { + .surface = surface, + .adapter = adapter, + .capabilities = capabilities, + }; + + send_device(wgpu_device, 0x10a0, (void*) &args); +} + +AQUA_C_FN void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) { + struct { + WGPUSurface surface; + WGPUSurfaceTexture * surfaceTexture; + } __attribute__((packed)) const args = { + .surface = surface, + .surfaceTexture = surfaceTexture, + }; + send_device(wgpu_device, 0x10a1, (void*) &args); } @@ -2070,7 +2086,7 @@ AQUA_C_FN WGPUTextureFormat wgpuSurfaceGetPreferredFormat(WGPUSurface surface, W return (WGPUTextureFormat) send_device(wgpu_device, 0x10a2, (void*) &args); } -AQUA_C_FN void wgpuSurfaceReference(WGPUSurface surface) { +AQUA_C_FN void wgpuSurfacePresent(WGPUSurface surface) { struct { WGPUSurface surface; } __attribute__((packed)) const args = { @@ -2080,51 +2096,53 @@ AQUA_C_FN void wgpuSurfaceReference(WGPUSurface surface) { send_device(wgpu_device, 0x10a3, (void*) &args); } -AQUA_C_FN void wgpuSurfaceRelease(WGPUSurface surface) { +AQUA_C_FN void wgpuSurfaceSetLabel(WGPUSurface surface, char const * label) { struct { WGPUSurface surface; + char const * label; } __attribute__((packed)) const args = { .surface = surface, + .label = label, }; send_device(wgpu_device, 0x10a4, (void*) &args); } -AQUA_C_FN WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain) { +AQUA_C_FN void wgpuSurfaceUnconfigure(WGPUSurface surface) { struct { - WGPUSwapChain swapChain; + WGPUSurface surface; } __attribute__((packed)) const args = { - .swapChain = swapChain, + .surface = surface, }; - return (WGPUTextureView) send_device(wgpu_device, 0x10a5, (void*) &args); + send_device(wgpu_device, 0x10a5, (void*) &args); } -AQUA_C_FN void wgpuSwapChainPresent(WGPUSwapChain swapChain) { +AQUA_C_FN void wgpuSurfaceReference(WGPUSurface surface) { struct { - WGPUSwapChain swapChain; + WGPUSurface surface; } __attribute__((packed)) const args = { - .swapChain = swapChain, + .surface = surface, }; send_device(wgpu_device, 0x10a6, (void*) &args); } -AQUA_C_FN void wgpuSwapChainReference(WGPUSwapChain swapChain) { +AQUA_C_FN void wgpuSurfaceRelease(WGPUSurface surface) { struct { - WGPUSwapChain swapChain; + WGPUSurface surface; } __attribute__((packed)) const args = { - .swapChain = swapChain, + .surface = surface, }; send_device(wgpu_device, 0x10a7, (void*) &args); } -AQUA_C_FN void wgpuSwapChainRelease(WGPUSwapChain swapChain) { +AQUA_C_FN void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities) { struct { - WGPUSwapChain swapChain; + WGPUSurfaceCapabilities surfaceCapabilities; } __attribute__((packed)) const args = { - .swapChain = swapChain, + .surfaceCapabilities = surfaceCapabilities, }; send_device(wgpu_device, 0x10a8, (void*) &args); diff --git a/src/aquabsd/black/wgpu_types.h b/src/aquabsd/black/wgpu_types.h index 14ff31f..8d9af03 100644 --- a/src/aquabsd/black/wgpu_types.h +++ b/src/aquabsd/black/wgpu_types.h @@ -1,32 +1,9 @@ -// BSD 3-Clause License -// -// Copyright (c) 2019, "WebGPU native" developers -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * Copyright 2019-2023 WebGPU-Native developers + * + * SPDX-License-Identifier: BSD-3-Clause + */ + #ifndef WEBGPU_H_ #define WEBGPU_H_ @@ -66,17 +43,19 @@ #include #include -#include #define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) #define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) +#define WGPU_DEPTH_SLICE_UNDEFINED (0xffffffffUL) #define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) #define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) #define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_WHOLE_MAP_SIZE SIZE_MAX +#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL) +#define WGPU_WHOLE_MAP_SIZE (SIZE_MAX) #define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) typedef uint32_t WGPUFlags; +typedef uint32_t WGPUBool; typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE; @@ -98,11 +77,11 @@ typedef struct WGPURenderPipelineImpl* WGPURenderPipeline WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUSamplerImpl* WGPUSampler WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUShaderModuleImpl* WGPUShaderModule WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUSurfaceImpl* WGPUSurface WGPU_OBJECT_ATTRIBUTE; -typedef struct WGPUSwapChainImpl* WGPUSwapChain WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; // Structure forward declarations +struct WGPUAdapterInfo; struct WGPUAdapterProperties; struct WGPUBindGroupEntry; struct WGPUBlendComponent; @@ -112,7 +91,7 @@ struct WGPUColor; struct WGPUCommandBufferDescriptor; struct WGPUCommandEncoderDescriptor; struct WGPUCompilationMessage; -struct WGPUComputePassTimestampWrite; +struct WGPUComputePassTimestampWrites; struct WGPUConstantEntry; struct WGPUExtent3D; struct WGPUInstanceDescriptor; @@ -128,7 +107,7 @@ struct WGPURenderBundleDescriptor; struct WGPURenderBundleEncoderDescriptor; struct WGPURenderPassDepthStencilAttachment; struct WGPURenderPassDescriptorMaxDrawCount; -struct WGPURenderPassTimestampWrite; +struct WGPURenderPassTimestampWrites; struct WGPURequestAdapterOptions; struct WGPUSamplerBindingLayout; struct WGPUSamplerDescriptor; @@ -137,15 +116,18 @@ struct WGPUShaderModuleSPIRVDescriptor; struct WGPUShaderModuleWGSLDescriptor; struct WGPUStencilFaceState; struct WGPUStorageTextureBindingLayout; +struct WGPUSurfaceCapabilities; +struct WGPUSurfaceConfiguration; struct WGPUSurfaceDescriptor; struct WGPUSurfaceDescriptorFromAndroidNativeWindow; struct WGPUSurfaceDescriptorFromCanvasHTMLSelector; +struct WGPUSurfaceDescriptorFromDrmFd; struct WGPUSurfaceDescriptorFromMetalLayer; struct WGPUSurfaceDescriptorFromWaylandSurface; struct WGPUSurfaceDescriptorFromWindowsHWND; struct WGPUSurfaceDescriptorFromXcbWindow; struct WGPUSurfaceDescriptorFromXlibWindow; -struct WGPUSwapChainDescriptor; +struct WGPUSurfaceTexture; struct WGPUTextureBindingLayout; struct WGPUTextureDataLayout; struct WGPUTextureViewDescriptor; @@ -284,11 +266,14 @@ typedef enum WGPUCompilationMessageType { WGPUCompilationMessageType_Force32 = 0x7FFFFFFF } WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE; -typedef enum WGPUComputePassTimestampLocation { - WGPUComputePassTimestampLocation_Beginning = 0x00000000, - WGPUComputePassTimestampLocation_End = 0x00000001, - WGPUComputePassTimestampLocation_Force32 = 0x7FFFFFFF -} WGPUComputePassTimestampLocation WGPU_ENUM_ATTRIBUTE; +typedef enum WGPUCompositeAlphaMode { + WGPUCompositeAlphaMode_Auto = 0x00000000, + WGPUCompositeAlphaMode_Opaque = 0x00000001, + WGPUCompositeAlphaMode_Premultiplied = 0x00000002, + WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003, + WGPUCompositeAlphaMode_Inherit = 0x00000004, + WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF +} WGPUCompositeAlphaMode WGPU_ENUM_ATTRIBUTE; typedef enum WGPUCreatePipelineAsyncStatus { WGPUCreatePipelineAsyncStatus_Success = 0x00000000, @@ -335,15 +320,14 @@ typedef enum WGPUFeatureName { WGPUFeatureName_DepthClipControl = 0x00000001, WGPUFeatureName_Depth32FloatStencil8 = 0x00000002, WGPUFeatureName_TimestampQuery = 0x00000003, - WGPUFeatureName_PipelineStatisticsQuery = 0x00000004, - WGPUFeatureName_TextureCompressionBC = 0x00000005, - WGPUFeatureName_TextureCompressionETC2 = 0x00000006, - WGPUFeatureName_TextureCompressionASTC = 0x00000007, - WGPUFeatureName_IndirectFirstInstance = 0x00000008, - WGPUFeatureName_ShaderF16 = 0x00000009, - WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000A, - WGPUFeatureName_BGRA8UnormStorage = 0x0000000B, - WGPUFeatureName_Float32Filterable = 0x0000000C, + 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_Force32 = 0x7FFFFFFF } WGPUFeatureName WGPU_ENUM_ATTRIBUTE; @@ -379,15 +363,6 @@ typedef enum WGPUMipmapFilterMode { WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF } WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE; -typedef enum WGPUPipelineStatisticName { - WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000, - WGPUPipelineStatisticName_ClipperInvocations = 0x00000001, - WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002, - WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003, - WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004, - WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF -} WGPUPipelineStatisticName WGPU_ENUM_ATTRIBUTE; - typedef enum WGPUPowerPreference { WGPUPowerPreference_Undefined = 0x00000000, WGPUPowerPreference_LowPower = 0x00000001, @@ -396,9 +371,10 @@ typedef enum WGPUPowerPreference { } WGPUPowerPreference WGPU_ENUM_ATTRIBUTE; typedef enum WGPUPresentMode { - WGPUPresentMode_Immediate = 0x00000000, - WGPUPresentMode_Mailbox = 0x00000001, - WGPUPresentMode_Fifo = 0x00000002, + WGPUPresentMode_Fifo = 0x00000000, + WGPUPresentMode_FifoRelaxed = 0x00000001, + WGPUPresentMode_Immediate = 0x00000002, + WGPUPresentMode_Mailbox = 0x00000003, WGPUPresentMode_Force32 = 0x7FFFFFFF } WGPUPresentMode WGPU_ENUM_ATTRIBUTE; @@ -413,8 +389,7 @@ typedef enum WGPUPrimitiveTopology { typedef enum WGPUQueryType { WGPUQueryType_Occlusion = 0x00000000, - WGPUQueryType_PipelineStatistics = 0x00000001, - WGPUQueryType_Timestamp = 0x00000002, + WGPUQueryType_Timestamp = 0x00000001, WGPUQueryType_Force32 = 0x7FFFFFFF } WGPUQueryType WGPU_ENUM_ATTRIBUTE; @@ -426,12 +401,6 @@ typedef enum WGPUQueueWorkDoneStatus { WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF } WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE; -typedef enum WGPURenderPassTimestampLocation { - WGPURenderPassTimestampLocation_Beginning = 0x00000000, - WGPURenderPassTimestampLocation_End = 0x00000001, - WGPURenderPassTimestampLocation_Force32 = 0x7FFFFFFF -} WGPURenderPassTimestampLocation WGPU_ENUM_ATTRIBUTE; - typedef enum WGPURequestAdapterStatus { WGPURequestAdapterStatus_Success = 0x00000000, WGPURequestAdapterStatus_Unavailable = 0x00000001, @@ -459,6 +428,7 @@ typedef enum WGPUSType { WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008, WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009, WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A, + WGPUSType_SurfaceDescriptorFromDrmFd = 0x0000000B, WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, WGPUSType_Force32 = 0x7FFFFFFF } WGPUSType WGPU_ENUM_ATTRIBUTE; @@ -486,6 +456,8 @@ typedef enum WGPUStencilOperation { typedef enum WGPUStorageTextureAccess { WGPUStorageTextureAccess_Undefined = 0x00000000, WGPUStorageTextureAccess_WriteOnly = 0x00000001, + WGPUStorageTextureAccess_ReadOnly = 0x00000002, + WGPUStorageTextureAccess_ReadWrite = 0x00000003, WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF } WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE; @@ -496,6 +468,16 @@ typedef enum WGPUStoreOp { WGPUStoreOp_Force32 = 0x7FFFFFFF } WGPUStoreOp WGPU_ENUM_ATTRIBUTE; +typedef enum WGPUSurfaceGetCurrentTextureStatus { + WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000, + WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001, + WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002, + WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003, + WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004, + WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005, + WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF +} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE; + typedef enum WGPUTextureAspect { WGPUTextureAspect_All = 0x00000000, WGPUTextureAspect_StencilOnly = 0x00000001, @@ -536,76 +518,77 @@ typedef enum WGPUTextureFormat { WGPUTextureFormat_RGBA8Sint = 0x00000016, WGPUTextureFormat_BGRA8Unorm = 0x00000017, WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018, - WGPUTextureFormat_RGB10A2Unorm = 0x00000019, - WGPUTextureFormat_RG11B10Ufloat = 0x0000001A, - WGPUTextureFormat_RGB9E5Ufloat = 0x0000001B, - WGPUTextureFormat_RG32Float = 0x0000001C, - WGPUTextureFormat_RG32Uint = 0x0000001D, - WGPUTextureFormat_RG32Sint = 0x0000001E, - WGPUTextureFormat_RGBA16Uint = 0x0000001F, - WGPUTextureFormat_RGBA16Sint = 0x00000020, - WGPUTextureFormat_RGBA16Float = 0x00000021, - WGPUTextureFormat_RGBA32Float = 0x00000022, - WGPUTextureFormat_RGBA32Uint = 0x00000023, - WGPUTextureFormat_RGBA32Sint = 0x00000024, - WGPUTextureFormat_Stencil8 = 0x00000025, - WGPUTextureFormat_Depth16Unorm = 0x00000026, - WGPUTextureFormat_Depth24Plus = 0x00000027, - WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028, - WGPUTextureFormat_Depth32Float = 0x00000029, - WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002A, - WGPUTextureFormat_BC1RGBAUnorm = 0x0000002B, - WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002C, - WGPUTextureFormat_BC2RGBAUnorm = 0x0000002D, - WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002E, - WGPUTextureFormat_BC3RGBAUnorm = 0x0000002F, - WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000030, - WGPUTextureFormat_BC4RUnorm = 0x00000031, - WGPUTextureFormat_BC4RSnorm = 0x00000032, - WGPUTextureFormat_BC5RGUnorm = 0x00000033, - WGPUTextureFormat_BC5RGSnorm = 0x00000034, - WGPUTextureFormat_BC6HRGBUfloat = 0x00000035, - WGPUTextureFormat_BC6HRGBFloat = 0x00000036, - WGPUTextureFormat_BC7RGBAUnorm = 0x00000037, - WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000038, - WGPUTextureFormat_ETC2RGB8Unorm = 0x00000039, - WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003A, - WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003B, - WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003C, - WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003D, - WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003E, - WGPUTextureFormat_EACR11Unorm = 0x0000003F, - WGPUTextureFormat_EACR11Snorm = 0x00000040, - WGPUTextureFormat_EACRG11Unorm = 0x00000041, - WGPUTextureFormat_EACRG11Snorm = 0x00000042, - WGPUTextureFormat_ASTC4x4Unorm = 0x00000043, - WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000044, - WGPUTextureFormat_ASTC5x4Unorm = 0x00000045, - WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000046, - WGPUTextureFormat_ASTC5x5Unorm = 0x00000047, - WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000048, - WGPUTextureFormat_ASTC6x5Unorm = 0x00000049, - WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004A, - WGPUTextureFormat_ASTC6x6Unorm = 0x0000004B, - WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004C, - WGPUTextureFormat_ASTC8x5Unorm = 0x0000004D, - WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004E, - WGPUTextureFormat_ASTC8x6Unorm = 0x0000004F, - WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000050, - WGPUTextureFormat_ASTC8x8Unorm = 0x00000051, - WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000052, - WGPUTextureFormat_ASTC10x5Unorm = 0x00000053, - WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000054, - WGPUTextureFormat_ASTC10x6Unorm = 0x00000055, - WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000056, - WGPUTextureFormat_ASTC10x8Unorm = 0x00000057, - WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000058, - WGPUTextureFormat_ASTC10x10Unorm = 0x00000059, - WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005A, - WGPUTextureFormat_ASTC12x10Unorm = 0x0000005B, - WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005C, - WGPUTextureFormat_ASTC12x12Unorm = 0x0000005D, - WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005E, + WGPUTextureFormat_RGB10A2Uint = 0x00000019, + WGPUTextureFormat_RGB10A2Unorm = 0x0000001A, + WGPUTextureFormat_RG11B10Ufloat = 0x0000001B, + WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C, + WGPUTextureFormat_RG32Float = 0x0000001D, + WGPUTextureFormat_RG32Uint = 0x0000001E, + WGPUTextureFormat_RG32Sint = 0x0000001F, + WGPUTextureFormat_RGBA16Uint = 0x00000020, + WGPUTextureFormat_RGBA16Sint = 0x00000021, + WGPUTextureFormat_RGBA16Float = 0x00000022, + WGPUTextureFormat_RGBA32Float = 0x00000023, + WGPUTextureFormat_RGBA32Uint = 0x00000024, + WGPUTextureFormat_RGBA32Sint = 0x00000025, + WGPUTextureFormat_Stencil8 = 0x00000026, + WGPUTextureFormat_Depth16Unorm = 0x00000027, + WGPUTextureFormat_Depth24Plus = 0x00000028, + WGPUTextureFormat_Depth24PlusStencil8 = 0x00000029, + WGPUTextureFormat_Depth32Float = 0x0000002A, + WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B, + WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C, + WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D, + WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E, + WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F, + WGPUTextureFormat_BC3RGBAUnorm = 0x00000030, + WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031, + WGPUTextureFormat_BC4RUnorm = 0x00000032, + WGPUTextureFormat_BC4RSnorm = 0x00000033, + WGPUTextureFormat_BC5RGUnorm = 0x00000034, + WGPUTextureFormat_BC5RGSnorm = 0x00000035, + WGPUTextureFormat_BC6HRGBUfloat = 0x00000036, + WGPUTextureFormat_BC6HRGBFloat = 0x00000037, + WGPUTextureFormat_BC7RGBAUnorm = 0x00000038, + WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039, + WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A, + WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B, + WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C, + WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D, + WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E, + WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F, + WGPUTextureFormat_EACR11Unorm = 0x00000040, + WGPUTextureFormat_EACR11Snorm = 0x00000041, + WGPUTextureFormat_EACRG11Unorm = 0x00000042, + WGPUTextureFormat_EACRG11Snorm = 0x00000043, + WGPUTextureFormat_ASTC4x4Unorm = 0x00000044, + WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045, + WGPUTextureFormat_ASTC5x4Unorm = 0x00000046, + WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047, + WGPUTextureFormat_ASTC5x5Unorm = 0x00000048, + WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049, + WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A, + WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B, + WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C, + WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D, + WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E, + WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F, + WGPUTextureFormat_ASTC8x6Unorm = 0x00000050, + WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051, + WGPUTextureFormat_ASTC8x8Unorm = 0x00000052, + WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053, + WGPUTextureFormat_ASTC10x5Unorm = 0x00000054, + WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055, + WGPUTextureFormat_ASTC10x6Unorm = 0x00000056, + WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057, + WGPUTextureFormat_ASTC10x8Unorm = 0x00000058, + WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059, + WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A, + WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B, + WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C, + WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D, + WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E, + WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F, WGPUTextureFormat_Force32 = 0x7FFFFFFF } WGPUTextureFormat WGPU_ENUM_ATTRIBUTE; @@ -672,6 +655,15 @@ typedef enum WGPUVertexStepMode { WGPUVertexStepMode_Force32 = 0x7FFFFFFF } WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; +typedef enum WGPUWGSLFeatureName { + WGPUWGSLFeatureName_Undefined = 0x00000000, + WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001, + WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002, + WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003, + WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004, + WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF +} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE; + typedef enum WGPUBufferUsage { WGPUBufferUsage_None = 0x00000000, WGPUBufferUsage_MapRead = 0x00000001, @@ -694,7 +686,7 @@ typedef enum WGPUColorWriteMask { WGPUColorWriteMask_Green = 0x00000002, WGPUColorWriteMask_Blue = 0x00000004, WGPUColorWriteMask_Alpha = 0x00000008, - WGPUColorWriteMask_All = 0x0000000F, + WGPUColorWriteMask_All = WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha, WGPUColorWriteMask_Force32 = 0x7FFFFFFF } WGPUColorWriteMask WGPU_ENUM_ATTRIBUTE; typedef WGPUFlags WGPUColorWriteMaskFlags WGPU_ENUM_ATTRIBUTE; @@ -727,16 +719,19 @@ typedef enum WGPUTextureUsage { } WGPUTextureUsage WGPU_ENUM_ATTRIBUTE; typedef WGPUFlags WGPUTextureUsageFlags WGPU_ENUM_ATTRIBUTE; -typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; + typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; + +typedef void (*WGPUAdapterRequestAdapterInfoCallback)(struct WGPUAdapterInfo adapterInfo, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUAdapterRequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUBufferMapAsyncCallback)(WGPUBufferMapAsyncStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUInstanceRequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUQueueOnSubmittedWorkDoneCallback)(WGPUQueueWorkDoneStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUShaderModuleGetCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef struct WGPUChainedStruct { struct WGPUChainedStruct const * next; @@ -748,6 +743,13 @@ typedef struct WGPUChainedStructOut { WGPUSType sType; } WGPUChainedStructOut WGPU_STRUCTURE_ATTRIBUTE; +typedef struct WGPUAdapterInfo { + char const * vendor; + char const * architecture; + char const * device; + char const * description; +} WGPUAdapterInfo WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUAdapterProperties { WGPUChainedStructOut * nextInChain; uint32_t vendorID; @@ -779,7 +781,7 @@ typedef struct WGPUBlendComponent { typedef struct WGPUBufferBindingLayout { WGPUChainedStruct const * nextInChain; WGPUBufferBindingType type; - bool hasDynamicOffset; + WGPUBool hasDynamicOffset; uint64_t minBindingSize; } WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; @@ -788,7 +790,7 @@ typedef struct WGPUBufferDescriptor { WGPU_NULLABLE char const * label; WGPUBufferUsageFlags usage; uint64_t size; - bool mappedAtCreation; + WGPUBool mappedAtCreation; } WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUColor { @@ -821,11 +823,11 @@ typedef struct WGPUCompilationMessage { uint64_t utf16Length; } WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUComputePassTimestampWrite { +typedef struct WGPUComputePassTimestampWrites { WGPUQuerySet querySet; - uint32_t queryIndex; - WGPUComputePassTimestampLocation location; -} WGPUComputePassTimestampWrite WGPU_STRUCTURE_ATTRIBUTE; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPUComputePassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUConstantEntry { WGPUChainedStruct const * nextInChain; @@ -849,6 +851,7 @@ typedef struct WGPULimits { uint32_t maxTextureDimension3D; uint32_t maxTextureArrayLayers; uint32_t maxBindGroups; + uint32_t maxBindGroupsPlusVertexBuffers; uint32_t maxBindingsPerBindGroup; uint32_t maxDynamicUniformBuffersPerPipelineLayout; uint32_t maxDynamicStorageBuffersPerPipelineLayout; @@ -881,7 +884,7 @@ typedef struct WGPUMultisampleState { WGPUChainedStruct const * nextInChain; uint32_t count; uint32_t mask; - bool alphaToCoverageEnabled; + WGPUBool alphaToCoverageEnabled; } WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUOrigin3D { @@ -897,10 +900,9 @@ typedef struct WGPUPipelineLayoutDescriptor { WGPUBindGroupLayout const * bindGroupLayouts; } WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUPrimitiveState typedef struct WGPUPrimitiveDepthClipControl { WGPUChainedStruct chain; - bool unclippedDepth; + WGPUBool unclippedDepth; } WGPUPrimitiveDepthClipControl WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUPrimitiveState { @@ -916,8 +918,6 @@ typedef struct WGPUQuerySetDescriptor { WGPU_NULLABLE char const * label; WGPUQueryType type; uint32_t count; - WGPUPipelineStatisticName const * pipelineStatistics; - size_t pipelineStatisticsCount; } WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUQueueDescriptor { @@ -933,12 +933,12 @@ typedef struct WGPURenderBundleDescriptor { typedef struct WGPURenderBundleEncoderDescriptor { WGPUChainedStruct const * nextInChain; WGPU_NULLABLE char const * label; - size_t colorFormatsCount; + size_t colorFormatCount; WGPUTextureFormat const * colorFormats; WGPUTextureFormat depthStencilFormat; uint32_t sampleCount; - bool depthReadOnly; - bool stencilReadOnly; + WGPUBool depthReadOnly; + WGPUBool stencilReadOnly; } WGPURenderBundleEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPassDepthStencilAttachment { @@ -946,31 +946,30 @@ typedef struct WGPURenderPassDepthStencilAttachment { WGPULoadOp depthLoadOp; WGPUStoreOp depthStoreOp; float depthClearValue; - bool depthReadOnly; + WGPUBool depthReadOnly; WGPULoadOp stencilLoadOp; WGPUStoreOp stencilStoreOp; uint32_t stencilClearValue; - bool stencilReadOnly; + WGPUBool stencilReadOnly; } WGPURenderPassDepthStencilAttachment WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPURenderPassDescriptor typedef struct WGPURenderPassDescriptorMaxDrawCount { WGPUChainedStruct chain; uint64_t maxDrawCount; } WGPURenderPassDescriptorMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPURenderPassTimestampWrite { +typedef struct WGPURenderPassTimestampWrites { WGPUQuerySet querySet; - uint32_t queryIndex; - WGPURenderPassTimestampLocation location; -} WGPURenderPassTimestampWrite WGPU_STRUCTURE_ATTRIBUTE; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPURenderPassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURequestAdapterOptions { WGPUChainedStruct const * nextInChain; WGPU_NULLABLE WGPUSurface compatibleSurface; WGPUPowerPreference powerPreference; WGPUBackendType backendType; - bool forceFallbackAdapter; + WGPUBool forceFallbackAdapter; } WGPURequestAdapterOptions WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUSamplerBindingLayout { @@ -999,14 +998,12 @@ typedef struct WGPUShaderModuleCompilationHint { WGPUPipelineLayout layout; } WGPUShaderModuleCompilationHint WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUShaderModuleDescriptor typedef struct WGPUShaderModuleSPIRVDescriptor { WGPUChainedStruct chain; uint32_t codeSize; uint32_t const * code; } WGPUShaderModuleSPIRVDescriptor WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUShaderModuleDescriptor typedef struct WGPUShaderModuleWGSLDescriptor { WGPUChainedStruct chain; char const * code; @@ -1026,72 +1023,89 @@ typedef struct WGPUStorageTextureBindingLayout { WGPUTextureViewDimension viewDimension; } WGPUStorageTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; +typedef struct WGPUSurfaceCapabilities { + WGPUChainedStructOut * nextInChain; + size_t formatCount; + WGPUTextureFormat const * formats; + size_t presentModeCount; + WGPUPresentMode const * presentModes; + size_t alphaModeCount; + WGPUCompositeAlphaMode const * alphaModes; +} WGPUSurfaceCapabilities WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceConfiguration { + WGPUChainedStruct const * nextInChain; + WGPUDevice device; + WGPUTextureFormat format; + WGPUTextureUsageFlags usage; + size_t viewFormatCount; + WGPUTextureFormat const * viewFormats; + WGPUCompositeAlphaMode alphaMode; + uint32_t width; + uint32_t height; + WGPUPresentMode presentMode; +} WGPUSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUSurfaceDescriptor { WGPUChainedStruct const * nextInChain; WGPU_NULLABLE char const * label; } WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { WGPUChainedStruct chain; void * window; } WGPUSurfaceDescriptorFromAndroidNativeWindow WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { WGPUChainedStruct chain; char const * selector; } WGPUSurfaceDescriptorFromCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromDrmFd { + WGPUChainedStruct chain; + int32_t fd; +} WGPUSurfaceDescriptorFromDrmFd WGPU_STRUCTURE_ATTRIBUTE; + typedef struct WGPUSurfaceDescriptorFromMetalLayer { WGPUChainedStruct chain; void * layer; } WGPUSurfaceDescriptorFromMetalLayer WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromWaylandSurface { WGPUChainedStruct chain; void * display; void * surface; } WGPUSurfaceDescriptorFromWaylandSurface WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromWindowsHWND { WGPUChainedStruct chain; void * hinstance; void * hwnd; } WGPUSurfaceDescriptorFromWindowsHWND WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromXcbWindow { WGPUChainedStruct chain; void * connection; uint32_t window; } WGPUSurfaceDescriptorFromXcbWindow WGPU_STRUCTURE_ATTRIBUTE; -// Can be chained in WGPUSurfaceDescriptor typedef struct WGPUSurfaceDescriptorFromXlibWindow { WGPUChainedStruct chain; void * display; - uint32_t window; + uint64_t window; } WGPUSurfaceDescriptorFromXlibWindow WGPU_STRUCTURE_ATTRIBUTE; -typedef struct WGPUSwapChainDescriptor { - WGPUChainedStruct const * nextInChain; - WGPU_NULLABLE char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureFormat format; - uint32_t width; - uint32_t height; - WGPUPresentMode presentMode; -} WGPUSwapChainDescriptor WGPU_STRUCTURE_ATTRIBUTE; +typedef struct WGPUSurfaceTexture { + WGPUTexture texture; + WGPUBool suboptimal; + WGPUSurfaceGetCurrentTextureStatus status; +} WGPUSurfaceTexture WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureBindingLayout { WGPUChainedStruct const * nextInChain; WGPUTextureSampleType sampleType; WGPUTextureViewDimension viewDimension; - bool multisampled; + WGPUBool multisampled; } WGPUTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUTextureDataLayout { @@ -1151,14 +1165,13 @@ typedef struct WGPUCompilationInfo { typedef struct WGPUComputePassDescriptor { WGPUChainedStruct const * nextInChain; WGPU_NULLABLE char const * label; - size_t timestampWriteCount; - WGPUComputePassTimestampWrite const * timestampWrites; + WGPU_NULLABLE WGPUComputePassTimestampWrites const * timestampWrites; } WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUDepthStencilState { WGPUChainedStruct const * nextInChain; WGPUTextureFormat format; - bool depthWriteEnabled; + WGPUBool depthWriteEnabled; WGPUCompareFunction depthCompare; WGPUStencilFaceState stencilFront; WGPUStencilFaceState stencilBack; @@ -1186,13 +1199,15 @@ typedef struct WGPUImageCopyTexture { typedef struct WGPUProgrammableStageDescriptor { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; + WGPU_NULLABLE char const * entryPoint; size_t constantCount; WGPUConstantEntry const * constants; } WGPUProgrammableStageDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPURenderPassColorAttachment { + WGPUChainedStruct const * nextInChain; WGPU_NULLABLE WGPUTextureView view; + uint32_t depthSlice; WGPU_NULLABLE WGPUTextureView resolveTarget; WGPULoadOp loadOp; WGPUStoreOp storeOp; @@ -1260,7 +1275,7 @@ typedef struct WGPUComputePipelineDescriptor { typedef struct WGPUDeviceDescriptor { WGPUChainedStruct const * nextInChain; WGPU_NULLABLE char const * label; - size_t requiredFeaturesCount; + size_t requiredFeatureCount; WGPUFeatureName const * requiredFeatures; WGPU_NULLABLE WGPURequiredLimits const * requiredLimits; WGPUQueueDescriptor defaultQueue; @@ -1275,14 +1290,13 @@ typedef struct WGPURenderPassDescriptor { WGPURenderPassColorAttachment const * colorAttachments; WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; - size_t timestampWriteCount; - WGPURenderPassTimestampWrite const * timestampWrites; + WGPU_NULLABLE WGPURenderPassTimestampWrites const * timestampWrites; } WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; typedef struct WGPUVertexState { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; + WGPU_NULLABLE char const * entryPoint; size_t constantCount; WGPUConstantEntry const * constants; size_t bufferCount; @@ -1292,7 +1306,7 @@ typedef struct WGPUVertexState { typedef struct WGPUFragmentState { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; - char const * entryPoint; + WGPU_NULLABLE char const * entryPoint; size_t constantCount; WGPUConstantEntry const * constants; size_t targetCount; @@ -1316,15 +1330,16 @@ extern "C" { #if !defined(WGPU_SKIP_PROCS) -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUInstance (*WGPUProcCreateInstance)(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; // Procs of Adapter typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -typedef bool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; -typedef bool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestAdapterInfo)(WGPUAdapter adapter, WGPUAdapterRequestAdapterInfoCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPUAdapterRequestDeviceCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; @@ -1345,7 +1360,7 @@ typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_ typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapAsyncCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; @@ -1375,11 +1390,9 @@ typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncode typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; // Procs of ComputePassEncoder -typedef void (*WGPUProcComputePassEncoderBeginPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcComputePassEncoderEndPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; @@ -1401,21 +1414,20 @@ typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice de typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUDeviceCreateComputePipelineAsyncCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUDeviceCreateRenderPipelineAsyncCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; -typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; -typedef bool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; -typedef bool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; @@ -1425,8 +1437,9 @@ typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE // Procs of Instance typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcInstanceHasWGSLLanguageFeature)(WGPUInstance instance, WGPUWGSLFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPUInstanceRequestAdapterCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceReference)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; @@ -1444,7 +1457,7 @@ typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet) WGPU_FUNCTION_A typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; // Procs of Queue -typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueOnSubmittedWorkDoneCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; @@ -1476,14 +1489,12 @@ typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder rende // Procs of RenderPassEncoder typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderBeginPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcRenderPassEncoderEndPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; @@ -1512,21 +1523,24 @@ typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler) WGPU_FUNCTION_ATTR typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; // Procs of ShaderModule -typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUShaderModuleGetCompilationInfoCallback callback, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; // Procs of Surface +typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; typedef WGPUTextureFormat (*WGPUProcSurfaceGetPreferredFormat)(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceSetLabel)(WGPUSurface surface, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; -// Procs of SwapChain -typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; -typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain) WGPU_FUNCTION_ATTRIBUTE; +// Procs of SurfaceCapabilities +typedef void (*WGPUProcSurfaceCapabilitiesFreeMembers)(WGPUSurfaceCapabilities surfaceCapabilities) WGPU_FUNCTION_ATTRIBUTE; // Procs of Texture typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; @@ -1593,7 +1607,7 @@ typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUN // Methods of Surface -// Methods of SwapChain +// Methods of SurfaceCapabilities // Methods of Texture @@ -1606,4 +1620,3 @@ typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUN #endif #endif // WEBGPU_H_ - From 09fd8d5d8bacc316dc537d3665b39dca3c191d24 Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Mon, 1 Apr 2024 02:29:12 +0200 Subject: [PATCH 2/3] aquabsd/black/win: `type` -> `kind` --- src/aquabsd/black/win.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aquabsd/black/win.h b/src/aquabsd/black/win.h index 4e7bea0..013407d 100644 --- a/src/aquabsd/black/win.h +++ b/src/aquabsd/black/win.h @@ -56,8 +56,8 @@ AQUA_C_FN void win_destroy(win_t* win) { SEND_DEVICE(win->device, WIN_CMD_DESTROY, win->internal_win); } -AQUA_C_FN err_t win_register_cb(win_t* win, win_cb_kind_t type, int (*cb) (uint64_t _, uint64_t param), void* param) { - if (SEND_DEVICE(win->device, WIN_CMD_REGISTER_CB, win->internal_win, type, (uint64_t) cb, (uint64_t) param) == INTERNAL_ERROR) { +AQUA_C_FN err_t win_register_cb(win_t* win, win_cb_kind_t kind, int (*cb) (uint64_t _, uint64_t param), void* param) { + if (SEND_DEVICE(win->device, WIN_CMD_REGISTER_CB, win->internal_win, kind, (uint64_t) cb, (uint64_t) param) == INTERNAL_ERROR) { return ERR_INTERNAL; } From 21b6d9144e8fc491f41c77a11e15bdd07510bf4a Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Mon, 1 Apr 2024 02:29:31 +0200 Subject: [PATCH 3/3] aquabsd/black/wm: Initial WM command wrappers --- src/aquabsd/black/wm.h | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/aquabsd/black/wm.h diff --git a/src/aquabsd/black/wm.h b/src/aquabsd/black/wm.h new file mode 100644 index 0000000..4b50ad2 --- /dev/null +++ b/src/aquabsd/black/wm.h @@ -0,0 +1,66 @@ +// This Source Form is subject to the terms of the AQUA Software License, v. 1.0. +// Copyright (c) 2024 Aymeric Wibo + +#pragma once +#define AQUABSD_BLACK_WM + +#include + +#include + +typedef struct { + device_t device; + uint64_t internal_wm; +} wm_t; + +typedef enum { + WM_CMD_CREATE = 0x6377, + WM_CMD_DESTROY = 0x6463, + WM_CMD_REGISTER_CB = 0x7263, + WM_CMD_LOOP = 0x6C6F, +} win_cmd_t; + +typedef enum { + TODO // TODO +} win_cb_kind_t; + +typedef enum { + WM_FLAG_NONE = 0, + WM_FLAG_POPULATE_DRM_FD = 1 << 0, +} wm_flag_t; + +AQUA_C_FN err_t wm_create(wm_t* wm, wm_flag_t flags) { + wm->device = query_device("aquabsd.black.wm"); + + if (wm->device == NO_DEVICE) { + return ERR_NO_DEVICE; + } + + wm->internal_wm = SEND_DEVICE(wm->device, WM_CMD_CREATE, flags); + + if (!wm->internal_wm || wm->internal_wm == INTERNAL_ERROR) { + return ERR_INTERNAL; + } + + return SUCCESS; +} + +AQUA_C_FN void win_destroy(wm_t* win) { + SEND_DEVICE(win->device, WM_CMD_DESTROY, win->internal_wm); +} + +AQUA_C_FN err_t win_register_cb(wm_t* wm, win_cb_kind_t kind, int (*cb) (uint64_t _, uint64_t param), void* param) { + if (SEND_DEVICE(wm->device, WM_CMD_REGISTER_CB, wm->internal_wm, kind, (uint64_t) cb, (uint64_t) param) == INTERNAL_ERROR) { + return ERR_INTERNAL; + } + + return SUCCESS; +} + +AQUA_C_FN err_t win_loop(wm_t* wm) { + if (SEND_DEVICE(wm->device, WM_CMD_LOOP, wm->internal_wm) == INTERNAL_ERROR) { + return ERR_INTERNAL; + } + + return SUCCESS; +}