Skip to content

Commit d58e191

Browse files
committed
fix linux issue with callback info
1 parent 3776dcd commit d58e191

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gpu.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <memory>
1111
#include <set>
1212
#include <string>
13+
#include <thread>
1314
#include <tuple>
1415
#include <type_traits>
1516
#include <unordered_map>
@@ -1354,11 +1355,12 @@ inline void queueWorkDoneCallback(WGPUQueueWorkDoneStatus status,
13541355
__LINE__);
13551356

13561357
// Set up the buffer mapping callback information.
1357-
WGPUBufferMapCallbackInfo mapCallbackInfo;
1358-
mapCallbackInfo.mode = WGPUCallbackMode_AllowSpontaneous;
1359-
mapCallbackInfo.callback = bufferMapCallback;
1360-
mapCallbackInfo.userdata1 = cbData;
1361-
mapCallbackInfo.userdata2 = nullptr;
1358+
WGPUBufferMapCallbackInfo mapCallbackInfo = {
1359+
.mode = WGPUCallbackMode_AllowSpontaneous,
1360+
.callback = bufferMapCallback,
1361+
.userdata1 = cbData, // Pass the callback data.
1362+
.userdata2 = nullptr // No additional user data.
1363+
};
13621364

13631365
// Begin the asynchronous mapping of the readback buffer.
13641366
wgpuBufferMapAsync(cbData->buffer, WGPUMapMode_Read, 0, cbData->bufferSize,

0 commit comments

Comments
 (0)