Skip to content

Commit d21f106

Browse files
committed
sokol_gfx.h wgpu: fix webgpu backend for latest breaking webgpu.h changes
1 parent 047ded9 commit d21f106

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Updates
22

3+
### 15-Aug-2025
4+
5+
The sokol_gfx.h WebGPU backend has been fixed for the latest breaking changes in
6+
webgpu.h (`WGPUShaderModuleWGSLDescriptor` has been renamed to `WGPUShaderSourceWGSL`).
7+
38
### 03-Aug-2025
49

510
sokol_app.h: character input on Windows now transparently supports surrogate pairs,

sokol_gfx.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16904,14 +16904,14 @@ _SOKOL_PRIVATE _sg_wgpu_shader_func_t _sg_wgpu_create_shader_func(const sg_shade
1690416904
_sg_clear(&res, sizeof(res));
1690516905
_sg_strcpy(&res.entry, func->entry);
1690616906

16907-
WGPUShaderModuleWGSLDescriptor wgpu_shdmod_wgsl_desc;
16908-
_sg_clear(&wgpu_shdmod_wgsl_desc, sizeof(wgpu_shdmod_wgsl_desc));
16909-
wgpu_shdmod_wgsl_desc.chain.sType = WGPUSType_ShaderSourceWGSL;
16910-
wgpu_shdmod_wgsl_desc.code = _sg_wgpu_stringview(func->source);
16907+
WGPUShaderSourceWGSL wgpu_shdsrc_wgsl;
16908+
_sg_clear(&wgpu_shdsrc_wgsl, sizeof(wgpu_shdsrc_wgsl));
16909+
wgpu_shdsrc_wgsl.chain.sType = WGPUSType_ShaderSourceWGSL;
16910+
wgpu_shdsrc_wgsl.code = _sg_wgpu_stringview(func->source);
1691116911

1691216912
WGPUShaderModuleDescriptor wgpu_shdmod_desc;
1691316913
_sg_clear(&wgpu_shdmod_desc, sizeof(wgpu_shdmod_desc));
16914-
wgpu_shdmod_desc.nextInChain = &wgpu_shdmod_wgsl_desc.chain;
16914+
wgpu_shdmod_desc.nextInChain = &wgpu_shdsrc_wgsl.chain;
1691516915
wgpu_shdmod_desc.label = _sg_wgpu_stringview(label);
1691616916

1691716917
// NOTE: if compilation fails we won't actually find out in this call since

0 commit comments

Comments
 (0)