Skip to content

Commit

Permalink
WebGPU: Remove unused signalValue argument (#21299)
Browse files Browse the repository at this point in the history
This was never implemented and was removed from Dawn and upstream webgpu.h a long time ago (and the JS API even longer ago).

(This will be a tiny breaking change for a few apps but we're not stable
and still need to do many more breaking changes.)
  • Loading branch information
kainino0x authored Feb 8, 2024
1 parent e96d976 commit 6daa18b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/library_sigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ sigs = {
wgpuQuerySetReference__sig: 'vp',
wgpuQuerySetRelease__sig: 'vp',
wgpuQuerySetSetLabel__sig: 'vpp',
wgpuQueueOnSubmittedWorkDone__sig: 'vpjpp',
wgpuQueueOnSubmittedWorkDone__sig: 'vppp',
wgpuQueueReference__sig: 'vp',
wgpuQueueRelease__sig: 'vp',
wgpuQueueSetLabel__sig: 'vpp',
Expand Down
5 changes: 1 addition & 4 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1570,11 +1570,8 @@ var LibraryWebGPU = {
},

wgpuQueueOnSubmittedWorkDone__deps: ['$callUserCallback'],
wgpuQueueOnSubmittedWorkDone: (queueId, signalValue, callback, userdata) => {
wgpuQueueOnSubmittedWorkDone: (queueId, callback, userdata) => {
var queue = WebGPU.mgrQueue.get(queueId);
#if ASSERTIONS
assert(signalValue == 0, 'signalValue not supported, must be 0');
#endif

{{{ runtimeKeepalivePush() }}}
queue["onSubmittedWorkDone"]().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions system/include/webgpu/webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,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, uint64_t signalValue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, 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;
Expand Down Expand Up @@ -1698,7 +1698,7 @@ WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet) WGPU_FUNCTION_ATTR
WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE;

// Methods of Queue
WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE;
WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE;
Expand Down
2 changes: 1 addition & 1 deletion system/include/webgpu/webgpu_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ namespace wgpu {
using ObjectBase::ObjectBase;
using ObjectBase::operator=;

void OnSubmittedWorkDone(uint64_t signalValue, QueueWorkDoneCallback callback, void * userdata) const;
void OnSubmittedWorkDone(QueueWorkDoneCallback callback, void * userdata) const;
void SetLabel(char const * label) const;
void Submit(size_t commandCount, CommandBuffer const * commands) const;
void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const;
Expand Down
4 changes: 2 additions & 2 deletions system/lib/webgpu/webgpu_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2316,8 +2316,8 @@ template <typename T>
static_assert(sizeof(Queue) == sizeof(WGPUQueue), "sizeof mismatch for Queue");
static_assert(alignof(Queue) == alignof(WGPUQueue), "alignof mismatch for Queue");

void Queue::OnSubmittedWorkDone(uint64_t signalValue, QueueWorkDoneCallback callback, void * userdata) const {
wgpuQueueOnSubmittedWorkDone(Get(), signalValue, callback, userdata);
void Queue::OnSubmittedWorkDone(QueueWorkDoneCallback callback, void * userdata) const {
wgpuQueueOnSubmittedWorkDone(Get(), callback, userdata);
}
void Queue::SetLabel(char const * label) const {
wgpuQueueSetLabel(Get(), reinterpret_cast<char const * >(label));
Expand Down

0 comments on commit 6daa18b

Please sign in to comment.