floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.54k stars 469 forks source link

WebGPU samples currently broken. #1003

Closed floooh closed 4 months ago

floooh commented 4 months ago

Just noticed after merging the pass-cleanup PR:

https://floooh.github.io/sokol-webgpu/clear-sapp.html

depthSlice (0) is defined for a non-3D attachment ([TextureView of Texture "IOSurface(DisplayRead|Webgpu|WebgpuSwapChainTexture)"]).
 - While validating colorAttachments[0].
 - While encoding [CommandEncoder].BeginRenderPass([null]).

250[Invalid CommandBuffer] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer]])

clear-sapp.html:1 WebGPU: too many warnings, no more warnings will be reported to the console for this GPUDevice.

...I definitely tested this a couple of days ago though... maybe a change in Emscripten SDK or Chrome's WebGPU implementation?

floooh commented 4 months ago

The reason wasn't a regression in sokol_gfx.h, but a WebGPU-spec fix in Chrome:

WGPURenderPassColorAttachment.depthSlice must not be zero, but the magic value WGPU_DEPTH_SLICE_UNDEFINED unless the color attachment is a 3D texture.