webgpu: Restore reverted code from cdf5299706.

This commit is contained in:
Ryan C. Gordon
2026-11-29 20:21:27 -05:00
parent a19af5051c
commit f9d0f07eca
+15
View File
@@ -17,6 +17,10 @@
#ifdef SDL_GPU_WEBGPU
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
#include "../SDL_sysgpu.h"
#include "webgpu.h"
@@ -5931,6 +5935,17 @@ static SDL_GPUDevice *WEBGPU_CreateDevice(bool debugMode, bool preferLowPower, S
WebGPURenderer *renderer;
SDL_GPUDevice *result;
#ifdef __EMSCRIPTEN__
if (!emscripten_has_asyncify()) {
if (debugMode) {
SDL_assert_release(!"SDL was not linked with Asyncify! The SDLGPU WebGPU backend requires Asyncify.");
}
SDL_SetError("SDL was not linked with Asyncify! The SDLGPU WebGPU backend requires Asyncify.");
return NULL;
}
#endif
Sint64 bindGroupsExpireAfter = SDL_GetNumberProperty(props, SDL_PROP_GPU_DEVICE_CREATE_WEBGPU_BINDGROUP_EXPIRE_AFTER_N_SUBMITS, DEFAULT_BINDGROUP_EXPIRY);
Sint64 pseudoMapThreshold = SDL_GetNumberProperty(props, SDL_PROP_GPU_DEVICE_CREATE_WEBGPU_PSEUDOMAP_BUFFERS_SMALLER_THAN, DEFAULT_PSEUDOMAP_SIZE_THRESHOLD);