You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing WGPUCallbackMode_AllowSpontaneous in callbacks info structs #112
The current tutorial code for requesting adapters and devices is missing the mode field in the callback info structs, which causes WGPURequestAdapterStatus_InstanceDropped.
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,
};
Activity
Fix WebGPU renderer (see eliemichel/LearnWebGPU#112)
Fix WebGPU renderer (see eliemichel/LearnWebGPU#112)