mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-11-30 16:48:41 +01:00
webgpu: Restore reverted code from cdf5299706.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user