Skip to content

Commit

Permalink
Merge branch 'main' into rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
klukaszek authored Sep 28, 2024
2 parents 0de0ac2 + 9b0fcfd commit 7c5d624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/gpu/SDL_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ static void SDL_GPU_FillProperties(
bool debug_mode,
const char *name)
{

SDL_GPUDevice *result;
#ifdef __EMSCRIPTEN__
SDL_SetHint(SDL_HINT_GPU_DRIVER, "webgpu");
#endif
SDL_PropertiesID props = SDL_CreateProperties();

if (formatFlags & SDL_GPU_SHADERFORMAT_PRIVATE) {
SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL, true);
}
Expand Down Expand Up @@ -603,6 +610,7 @@ bool SDL_GPUSupportsShaderFormats(
SDL_GPU_FillProperties(props, formatFlags, false, name);
result = SDL_GPUSupportsProperties(props);
SDL_DestroyProperties(props);
SDL_Log("SDL_CreateGPUDevice: %s", result ? "success" : "failure");
return result;
#else
SDL_SetError("SDL not built with GPU support");
Expand Down
3 changes: 1 addition & 2 deletions src/gpu/webgpu/SDL_gpu_webgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,6 @@ static SDL_GPUGraphicsPipeline *WebGPU_CreateGraphicsPipeline(
wgpuDevicePopErrorScope(renderer->device, WebGPU_ErrorCallback, renderer);

SDL_Log("Graphics Pipeline Created Successfully");

return (SDL_GPUGraphicsPipeline *)pipeline;
}

Expand Down Expand Up @@ -2122,7 +2121,7 @@ static SDL_GPUDevice *WebGPU_CreateDevice(bool debug, bool preferLowPower, SDL_P
result->AcquireCommandBuffer = WebGPU_AcquireCommandBuffer;
result->AcquireSwapchainTexture = WebGPU_AcquireSwapchainTexture;
result->GetSwapchainTextureFormat = WebGPU_GetSwapchainTextureFormat;

result->CreateShader = WebGPU_CreateShader;
result->ReleaseShader = WebGPU_ReleaseShader;

Expand Down

0 comments on commit 7c5d624

Please sign in to comment.