floooh / sokol-tools

Command line tools for use with sokol headers
MIT License
229 stars 57 forks source link

StorageBuffer::Num shold match SG_MAX_SHADERSTAGE_STORAGE_BUFFERS #129

Closed jdah closed 5 months ago

jdah commented 5 months ago

This bit me today while doing some experiments with the new storage buffer support :D

StorageBuffer::Num == 4 while SG_MAX_SHADERSTAGE_STORAGE_BUFFERS == 8, causing the sg_shader_desc to not mark storage buffers 4..8 as used (and sokol_gfx.h to give a validation error) even when they compile just fine and are enumerated by the *_storagebuffer_slot reflection function. oops!

floooh commented 5 months ago

Oops good catch, sorry that was an oversight on my side. At first I had restricted the number of storage buffers to 4 per stage in sokol_gfx.h, but then bumped that number to 8 (since that's the 'minspec' in WebGPU and also in OpenGL the total number of storage buffers seems to be 16 across all shader stages).

I'll merge the PR and then kick off a CI pipeline which will update the binaries in sokol-tools-bin.

floooh commented 5 months ago

...link to CI pipeline: https://github.com/floooh/sokol-tools/actions/runs/9130637428

When this goes green the binaries in sokol-tools-bin will be uptodate.

Thanks for the PR!