-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Description
The current tutorial code for requesting adapters and devices is missing the mode field in the callback info structs, which causes WGPURequestAdapterStatus_InstanceDropped.
Affected Code
- Adapter request callbacks (
WGPURequestAdapterCallbackInfo) - Device request callbacks (
WGPURequestDeviceCallbackInfo)
This issue shouldn't be affecting anything beyond chapter 1 as you switch to the C++ wrapper and it does contain the mode specifier.
Problem
Without explicitly setting the callback mode, the callbacks use a default mode that prevents them from being invoked spontaneously often causing the WGPURequestAdapterStatus_InstanceDropped error.
Solution
Add WGPUCallbackMode_AllowSpontaneous to all callback info structs:
/* Either WGPURequestAdapterCallbackInfo or WGPURequestDeviceCallbackInfo **/ callbackInfo = {
.mode = WGPUCallbackMode_AllowSpontaneous, // Add this line
.callback = onAdapterRequestEnded,
.userdata1 = (void*)&userData,
.userdata2 = nullptr,
};Metadata
Metadata
Assignees
Labels
No labels