Skip to content

Commit 2a318a2

Browse files
authored
Update WebGPU headers 2 (#16299)
* Update WebGPU headers 2 * implement wgpuDeviceGetLimits * fix tests
1 parent db0c026 commit 2a318a2

File tree

6 files changed

+104
-38
lines changed

6 files changed

+104
-38
lines changed

src/library_webgpu.js

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ var LibraryWebGPU = {
403403
'low-power',
404404
'high-performance',
405405
],
406+
PredefinedColorSpace: [
407+
undefined,
408+
'srgb',
409+
],
406410
PrimitiveTopology: [
407411
'point-list',
408412
'line-list',
@@ -436,6 +440,7 @@ var LibraryWebGPU = {
436440
'write-only',
437441
],
438442
StoreOp: [
443+
undefined,
439444
'store',
440445
'discard',
441446
],
@@ -650,9 +655,45 @@ var LibraryWebGPU = {
650655
wgpuDeviceDestroy: function(deviceId) { WebGPU.mgrDevice.get(deviceId)["destroy"](); },
651656

652657
wgpuDeviceGetLimits: function(deviceId, limitsOutPtr) {
653-
#if ASSERTIONS
654-
abort('TODO: wgpuDeviceGetLimits unimplemented');
655-
#endif
658+
var device = WebGPU.mgrDevice.objects[deviceId].object;
659+
var limitsPtr = {{{ C_STRUCTS.WGPUSupportedLimits.limits }}};
660+
function setLimitValueU32(name, limitOffset) {
661+
var limitValue = device.limits[name];
662+
{{{ makeSetValue('limitsOutPtr', 'limitsPtr + limitOffset', 'limitValue', 'i32') }}};
663+
}
664+
function setLimitValueU64(name, limitOffset) {
665+
var limitValue = device.limits[name];
666+
{{{ makeSetValue('limitsOutPtr', 'limitsPtr + limitOffset', 'limitValue', 'i64') }}};
667+
}
668+
669+
setLimitValueU32('maxTextureDimension1D', {{{ C_STRUCTS.WGPULimits.maxTextureDimension1D }}});
670+
setLimitValueU32('maxTextureDimension2D', {{{ C_STRUCTS.WGPULimits.maxTextureDimension2D }}});
671+
setLimitValueU32('maxTextureDimension3D', {{{ C_STRUCTS.WGPULimits.maxTextureDimension3D }}});
672+
setLimitValueU32('maxTextureArrayLayers', {{{ C_STRUCTS.WGPULimits.maxTextureArrayLayers }}});
673+
setLimitValueU32('maxBindGroups', {{{ C_STRUCTS.WGPULimits.maxBindGroups }}});
674+
setLimitValueU32('maxDynamicUniformBuffersPerPipelineLayout', {{{ C_STRUCTS.WGPULimits.maxDynamicUniformBuffersPerPipelineLayout }}});
675+
setLimitValueU32('maxDynamicStorageBuffersPerPipelineLayout', {{{ C_STRUCTS.WGPULimits.maxDynamicStorageBuffersPerPipelineLayout }}});
676+
setLimitValueU32('maxSampledTexturesPerShaderStage', {{{ C_STRUCTS.WGPULimits.maxSampledTexturesPerShaderStage }}});
677+
setLimitValueU32('maxSamplersPerShaderStage', {{{ C_STRUCTS.WGPULimits.maxSamplersPerShaderStage }}});
678+
setLimitValueU32('maxStorageBuffersPerShaderStage', {{{ C_STRUCTS.WGPULimits.maxStorageBuffersPerShaderStage }}});
679+
setLimitValueU32('maxStorageTexturesPerShaderStage', {{{ C_STRUCTS.WGPULimits.maxStorageTexturesPerShaderStage }}});
680+
setLimitValueU32('maxUniformBuffersPerShaderStage', {{{ C_STRUCTS.WGPULimits.maxUniformBuffersPerShaderStage }}});
681+
setLimitValueU32('minUniformBufferOffsetAlignment', {{{ C_STRUCTS.WGPULimits.minUniformBufferOffsetAlignment }}});
682+
setLimitValueU32('minStorageBufferOffsetAlignment', {{{ C_STRUCTS.WGPULimits.minStorageBufferOffsetAlignment }}});
683+
684+
setLimitValueU64('maxUniformBufferBindingSize', {{{ C_STRUCTS.WGPULimits.maxUniformBufferBindingSize }}});
685+
setLimitValueU64('maxStorageBufferBindingSize', {{{ C_STRUCTS.WGPULimits.maxStorageBufferBindingSize }}});
686+
687+
setLimitValueU32('maxVertexBuffers', {{{ C_STRUCTS.WGPULimits.maxVertexBuffers }}});
688+
setLimitValueU32('maxVertexAttributes', {{{ C_STRUCTS.WGPULimits.maxVertexAttributes }}});
689+
setLimitValueU32('maxVertexBufferArrayStride', {{{ C_STRUCTS.WGPULimits.maxVertexBufferArrayStride }}});
690+
setLimitValueU32('maxInterStageShaderComponents', {{{ C_STRUCTS.WGPULimits.maxInterStageShaderComponents }}});
691+
setLimitValueU32('maxComputeWorkgroupStorageSize', {{{ C_STRUCTS.WGPULimits.maxComputeWorkgroupStorageSize }}});
692+
setLimitValueU32('maxComputeInvocationsPerWorkgroup', {{{ C_STRUCTS.WGPULimits.maxComputeInvocationsPerWorkgroup }}});
693+
setLimitValueU32('maxComputeWorkgroupSizeX', {{{ C_STRUCTS.WGPULimits.maxComputeWorkgroupSizeX }}});
694+
setLimitValueU32('maxComputeWorkgroupSizeY', {{{ C_STRUCTS.WGPULimits.maxComputeWorkgroupSizeY }}});
695+
setLimitValueU32('maxComputeWorkgroupSizeZ', {{{ C_STRUCTS.WGPULimits.maxComputeWorkgroupSizeZ }}});
696+
setLimitValueU32('maxComputeWorkgroupsPerDimension', {{{ C_STRUCTS.WGPULimits.maxComputeWorkgroupsPerDimension }}});
656697
},
657698

658699
wgpuDeviceGetQueue: function(deviceId) {
@@ -1847,9 +1888,9 @@ var LibraryWebGPU = {
18471888
encoder["insertDebugMarker"](UTF8ToString(markerLabelPtr));
18481889
},
18491890

1850-
wgpuComputePassEncoderEndPass: function(passId) {
1891+
wgpuComputePassEncoderEnd: function(passId) {
18511892
var pass = WebGPU.mgrComputePassEncoder.get(passId);
1852-
pass["endPass"]();
1893+
pass["end"]();
18531894
},
18541895

18551896
// wgpuRenderPass
@@ -1981,9 +2022,9 @@ var LibraryWebGPU = {
19812022
encoder["insertDebugMarker"](UTF8ToString(markerLabelPtr));
19822023
},
19832024

1984-
wgpuRenderPassEncoderEndPass: function(passId) {
2025+
wgpuRenderPassEncoderEnd: function(passId) {
19852026
var pass = WebGPU.mgrRenderPassEncoder.get(passId);
1986-
pass["endPass"]();
2027+
pass["end"]();
19872028
},
19882029

19892030
// Render bundle encoder

system/include/webgpu/webgpu.h

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ typedef enum WGPUIndexFormat {
257257
} WGPUIndexFormat;
258258

259259
typedef enum WGPULoadOp {
260-
WGPULoadOp_Clear = 0x00000000,
261-
WGPULoadOp_Load = 0x00000001,
260+
WGPULoadOp_Undefined = 0x00000000,
261+
WGPULoadOp_Clear = 0x00000001,
262+
WGPULoadOp_Load = 0x00000002,
262263
WGPULoadOp_Force32 = 0x7FFFFFFF
263264
} WGPULoadOp;
264265

@@ -278,6 +279,12 @@ typedef enum WGPUPowerPreference {
278279
WGPUPowerPreference_Force32 = 0x7FFFFFFF
279280
} WGPUPowerPreference;
280281

282+
typedef enum WGPUPredefinedColorSpace {
283+
WGPUPredefinedColorSpace_Undefined = 0x00000000,
284+
WGPUPredefinedColorSpace_Srgb = 0x00000001,
285+
WGPUPredefinedColorSpace_Force32 = 0x7FFFFFFF
286+
} WGPUPredefinedColorSpace;
287+
281288
typedef enum WGPUPresentMode {
282289
WGPUPresentMode_Immediate = 0x00000000,
283290
WGPUPresentMode_Mailbox = 0x00000001,
@@ -361,8 +368,9 @@ typedef enum WGPUStorageTextureAccess {
361368
} WGPUStorageTextureAccess;
362369

363370
typedef enum WGPUStoreOp {
364-
WGPUStoreOp_Store = 0x00000000,
365-
WGPUStoreOp_Discard = 0x00000001,
371+
WGPUStoreOp_Undefined = 0x00000000,
372+
WGPUStoreOp_Store = 0x00000001,
373+
WGPUStoreOp_Discard = 0x00000002,
366374
WGPUStoreOp_Force32 = 0x7FFFFFFF
367375
} WGPUStoreOp;
368376

@@ -1155,9 +1163,9 @@ typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder)
11551163

11561164
// Procs of ComputePassEncoder
11571165
typedef void (*WGPUProcComputePassEncoderBeginPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
1158-
typedef void (*WGPUProcComputePassEncoderDispatch)(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z);
1166+
typedef void (*WGPUProcComputePassEncoderDispatch)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ);
11591167
typedef void (*WGPUProcComputePassEncoderDispatchIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
1160-
typedef void (*WGPUProcComputePassEncoderEndPass)(WGPUComputePassEncoder computePassEncoder);
1168+
typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder);
11611169
typedef void (*WGPUProcComputePassEncoderEndPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder);
11621170
typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel);
11631171
typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder);
@@ -1251,8 +1259,8 @@ typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEn
12511259
typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
12521260
typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
12531261
typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
1262+
typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder);
12541263
typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder);
1255-
typedef void (*WGPUProcRenderPassEncoderEndPass)(WGPURenderPassEncoder renderPassEncoder);
12561264
typedef void (*WGPUProcRenderPassEncoderEndPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder);
12571265
typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles);
12581266
typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel);
@@ -1362,9 +1370,9 @@ WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder);
13621370

13631371
// Methods of ComputePassEncoder
13641372
WGPU_EXPORT void wgpuComputePassEncoderBeginPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
1365-
WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z);
1373+
WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ);
13661374
WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
1367-
WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder);
1375+
WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder);
13681376
WGPU_EXPORT void wgpuComputePassEncoderEndPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder);
13691377
WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel);
13701378
WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder);
@@ -1458,8 +1466,8 @@ WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncod
14581466
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
14591467
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
14601468
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
1469+
WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder);
14611470
WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder);
1462-
WGPU_EXPORT void wgpuRenderPassEncoderEndPass(WGPURenderPassEncoder renderPassEncoder);
14631471
WGPU_EXPORT void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder);
14641472
WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles);
14651473
WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel);

system/include/webgpu/webgpu_cpp.h

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ namespace wgpu {
287287
};
288288

289289
enum class LoadOp : uint32_t {
290-
Clear = 0x00000000,
291-
Load = 0x00000001,
290+
Undefined = 0x00000000,
291+
Clear = 0x00000001,
292+
Load = 0x00000002,
292293
};
293294

294295
enum class PipelineStatisticName : uint32_t {
@@ -305,6 +306,11 @@ namespace wgpu {
305306
HighPerformance = 0x00000002,
306307
};
307308

309+
enum class PredefinedColorSpace : uint32_t {
310+
Undefined = 0x00000000,
311+
Srgb = 0x00000001,
312+
};
313+
308314
enum class PresentMode : uint32_t {
309315
Immediate = 0x00000000,
310316
Mailbox = 0x00000001,
@@ -378,8 +384,9 @@ namespace wgpu {
378384
};
379385

380386
enum class StoreOp : uint32_t {
381-
Store = 0x00000000,
382-
Discard = 0x00000001,
387+
Undefined = 0x00000000,
388+
Store = 0x00000001,
389+
Discard = 0x00000002,
383390
};
384391

385392
enum class TextureAspect : uint32_t {
@@ -878,9 +885,9 @@ namespace wgpu {
878885
using ObjectBase::operator=;
879886

880887
void BeginPipelineStatisticsQuery(QuerySet const& querySet, uint32_t queryIndex) const;
881-
void Dispatch(uint32_t x, uint32_t y = 1, uint32_t z = 1) const;
888+
void Dispatch(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, uint32_t workgroupCountZ = 1) const;
882889
void DispatchIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const;
883-
void EndPass() const;
890+
void End() const;
884891
void EndPipelineStatisticsQuery() const;
885892
void InsertDebugMarker(char const * markerLabel) const;
886893
void PopDebugGroup() const;
@@ -1046,8 +1053,8 @@ namespace wgpu {
10461053
void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const;
10471054
void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const;
10481055
void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const;
1056+
void End() const;
10491057
void EndOcclusionQuery() const;
1050-
void EndPass() const;
10511058
void EndPipelineStatisticsQuery() const;
10521059
void ExecuteBundles(uint32_t bundlesCount, RenderBundle const * bundles) const;
10531060
void InsertDebugMarker(char const * markerLabel) const;
@@ -1363,12 +1370,12 @@ namespace wgpu {
13631370

13641371
struct RenderPassDepthStencilAttachment {
13651372
TextureView view;
1366-
LoadOp depthLoadOp;
1367-
StoreOp depthStoreOp;
1368-
float clearDepth;
1373+
LoadOp depthLoadOp = LoadOp::Undefined;
1374+
StoreOp depthStoreOp = StoreOp::Undefined;
1375+
float clearDepth = 0;
13691376
bool depthReadOnly = false;
1370-
LoadOp stencilLoadOp;
1371-
StoreOp stencilStoreOp;
1377+
LoadOp stencilLoadOp = LoadOp::Undefined;
1378+
StoreOp stencilStoreOp = StoreOp::Undefined;
13721379
uint32_t clearStencil = 0;
13731380
bool stencilReadOnly = false;
13741381
};

system/lib/webgpu/webgpu_cpp.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ namespace wgpu {
215215
static_assert(sizeof(LoadOp) == sizeof(WGPULoadOp), "sizeof mismatch for LoadOp");
216216
static_assert(alignof(LoadOp) == alignof(WGPULoadOp), "alignof mismatch for LoadOp");
217217

218+
static_assert(static_cast<uint32_t>(LoadOp::Undefined) == WGPULoadOp_Undefined, "value mismatch for LoadOp::Undefined");
218219
static_assert(static_cast<uint32_t>(LoadOp::Clear) == WGPULoadOp_Clear, "value mismatch for LoadOp::Clear");
219220
static_assert(static_cast<uint32_t>(LoadOp::Load) == WGPULoadOp_Load, "value mismatch for LoadOp::Load");
220221

@@ -238,6 +239,14 @@ namespace wgpu {
238239
static_assert(static_cast<uint32_t>(PowerPreference::LowPower) == WGPUPowerPreference_LowPower, "value mismatch for PowerPreference::LowPower");
239240
static_assert(static_cast<uint32_t>(PowerPreference::HighPerformance) == WGPUPowerPreference_HighPerformance, "value mismatch for PowerPreference::HighPerformance");
240241

242+
// PredefinedColorSpace
243+
244+
static_assert(sizeof(PredefinedColorSpace) == sizeof(WGPUPredefinedColorSpace), "sizeof mismatch for PredefinedColorSpace");
245+
static_assert(alignof(PredefinedColorSpace) == alignof(WGPUPredefinedColorSpace), "alignof mismatch for PredefinedColorSpace");
246+
247+
static_assert(static_cast<uint32_t>(PredefinedColorSpace::Undefined) == WGPUPredefinedColorSpace_Undefined, "value mismatch for PredefinedColorSpace::Undefined");
248+
static_assert(static_cast<uint32_t>(PredefinedColorSpace::Srgb) == WGPUPredefinedColorSpace_Srgb, "value mismatch for PredefinedColorSpace::Srgb");
249+
241250
// PresentMode
242251

243252
static_assert(sizeof(PresentMode) == sizeof(WGPUPresentMode), "sizeof mismatch for PresentMode");
@@ -345,6 +354,7 @@ namespace wgpu {
345354
static_assert(sizeof(StoreOp) == sizeof(WGPUStoreOp), "sizeof mismatch for StoreOp");
346355
static_assert(alignof(StoreOp) == alignof(WGPUStoreOp), "alignof mismatch for StoreOp");
347356

357+
static_assert(static_cast<uint32_t>(StoreOp::Undefined) == WGPUStoreOp_Undefined, "value mismatch for StoreOp::Undefined");
348358
static_assert(static_cast<uint32_t>(StoreOp::Store) == WGPUStoreOp_Store, "value mismatch for StoreOp::Store");
349359
static_assert(static_cast<uint32_t>(StoreOp::Discard) == WGPUStoreOp_Discard, "value mismatch for StoreOp::Discard");
350360

@@ -1730,14 +1740,14 @@ namespace wgpu {
17301740
void ComputePassEncoder::BeginPipelineStatisticsQuery(QuerySet const& querySet, uint32_t queryIndex) const {
17311741
wgpuComputePassEncoderBeginPipelineStatisticsQuery(Get(), querySet.Get(), queryIndex);
17321742
}
1733-
void ComputePassEncoder::Dispatch(uint32_t x, uint32_t y, uint32_t z) const {
1734-
wgpuComputePassEncoderDispatch(Get(), x, y, z);
1743+
void ComputePassEncoder::Dispatch(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) const {
1744+
wgpuComputePassEncoderDispatch(Get(), workgroupCountX, workgroupCountY, workgroupCountZ);
17351745
}
17361746
void ComputePassEncoder::DispatchIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const {
17371747
wgpuComputePassEncoderDispatchIndirect(Get(), indirectBuffer.Get(), indirectOffset);
17381748
}
1739-
void ComputePassEncoder::EndPass() const {
1740-
wgpuComputePassEncoderEndPass(Get());
1749+
void ComputePassEncoder::End() const {
1750+
wgpuComputePassEncoderEnd(Get());
17411751
}
17421752
void ComputePassEncoder::EndPipelineStatisticsQuery() const {
17431753
wgpuComputePassEncoderEndPipelineStatisticsQuery(Get());
@@ -2073,12 +2083,12 @@ namespace wgpu {
20732083
void RenderPassEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const {
20742084
wgpuRenderPassEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset);
20752085
}
2086+
void RenderPassEncoder::End() const {
2087+
wgpuRenderPassEncoderEnd(Get());
2088+
}
20762089
void RenderPassEncoder::EndOcclusionQuery() const {
20772090
wgpuRenderPassEncoderEndOcclusionQuery(Get());
20782091
}
2079-
void RenderPassEncoder::EndPass() const {
2080-
wgpuRenderPassEncoderEndPass(Get());
2081-
}
20822092
void RenderPassEncoder::EndPipelineStatisticsQuery() const {
20832093
wgpuRenderPassEncoderEndPipelineStatisticsQuery(Get());
20842094
}

tests/third_party/sokol/sokol_gfx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11352,7 +11352,7 @@ _SOKOL_PRIVATE void _sg_wgpu_end_pass(void) {
1135211352
SOKOL_ASSERT(_sg.wgpu.in_pass);
1135311353
SOKOL_ASSERT(_sg.wgpu.pass_enc);
1135411354
_sg.wgpu.in_pass = false;
11355-
wgpuRenderPassEncoderEndPass(_sg.wgpu.pass_enc);
11355+
wgpuRenderPassEncoderEnd(_sg.wgpu.pass_enc);
1135611356
wgpuRenderPassEncoderRelease(_sg.wgpu.pass_enc);
1135711357
_sg.wgpu.pass_enc = 0;
1135811358
}

tests/webgpu_basic_rendering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void render(wgpu::TextureView view) {
134134
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderpass);
135135
pass.SetPipeline(pipeline);
136136
pass.Draw(3);
137-
pass.EndPass();
137+
pass.End();
138138
}
139139
commands = encoder.Finish();
140140
}

0 commit comments

Comments
 (0)