Examples: GLFW/SDL2/SDL3+WebGPU: fixed running with wgpu-native missing wgpuInstanceWaitAny(). (#9377)

This commit is contained in:
ocornut 2026-08-31 12:30:37 +02:00
parent 35a13e9948
commit 7e0de0e411
4 changed files with 20 additions and 1 deletions

View File

@ -74,7 +74,8 @@ Other Changes:
when when `FramebufferScale` is >1.0f. (#9515, #8628) [@WayU]
- WebGPU: update to build with wgpu-native 29.0+. (#9377, #9532, #9530) [@lucascompython, @ivan-enzhaev]
- Examples:
- SDL2+Metal: create Metal context without using a SDL_Renderer.
- GLFW/SDL2/SDL3+WebGPU: fixed running with wgpu-native missing `wgpuInstanceWaitAny()`. (#9377)
- SDL2+Metal: create Metal context without using a `SDL_Renderer`.
- QNX+OpenGL3, QNX+Vulkan: added QNX Screen examples. (#9492) [@mgorchak-blackberry]
- OSX+OpenGL3: added example_apple_opengl3/ (OSX/Cocoa + OpenGL 3.2 Core profile).

View File

@ -376,8 +376,10 @@ static WGPUAdapter RequestAdapter(WGPUInstance& instance)
adapterCallbackInfo.userdata1 = &local_adapter;
WGPUFuture future = wgpuInstanceRequestAdapter(instance, &adapter_options, adapterCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#endif
IM_ASSERT(local_adapter && "Error on Adapter request");
return local_adapter;
}
@ -391,8 +393,12 @@ static WGPUDevice RequestDevice(WGPUInstance& instance, WGPUAdapter& adapter)
deviceCallbackInfo.userdata1 = &local_device;
WGPUFuture future = wgpuAdapterRequestDevice(adapter, nullptr, deviceCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#else
IM_UNUSED(instance);
#endif
IM_ASSERT(local_device && "Error on Device request");
return local_device;
}

View File

@ -362,8 +362,10 @@ static WGPUAdapter RequestAdapter(WGPUInstance& instance)
adapterCallbackInfo.userdata1 = &local_adapter;
WGPUFuture future = wgpuInstanceRequestAdapter(instance, &adapter_options, adapterCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#endif
IM_ASSERT(local_adapter && "Error on Adapter request");
return local_adapter;
}
@ -377,8 +379,12 @@ static WGPUDevice RequestDevice(WGPUInstance& instance, WGPUAdapter& adapter)
deviceCallbackInfo.userdata1 = &local_device;
WGPUFuture future = wgpuAdapterRequestDevice(adapter, nullptr, deviceCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#else
IM_UNUSED(instance);
#endif
IM_ASSERT(local_device && "Error on Device request");
return local_device;
}

View File

@ -373,8 +373,10 @@ static WGPUAdapter RequestAdapter(WGPUInstance& instance)
adapterCallbackInfo.userdata1 = &local_adapter;
WGPUFuture future = wgpuInstanceRequestAdapter(instance, &adapter_options, adapterCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#endif
IM_ASSERT(local_adapter && "Error on Adapter request");
return local_adapter;
}
@ -388,8 +390,12 @@ static WGPUDevice RequestDevice(WGPUInstance& instance, WGPUAdapter& adapter)
deviceCallbackInfo.userdata1 = &local_device;
WGPUFuture future = wgpuAdapterRequestDevice(adapter, nullptr, deviceCallbackInfo);
#if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
WGPUFutureWaitInfo waitInfo = { future, false };
wgpuInstanceWaitAny(instance, 1, &waitInfo, ~0ull);
#else
IM_UNUSED(instance);
#endif
IM_ASSERT(local_device && "Error on Device request");
return local_device;
}