webgpu improvements

This commit is contained in:
Jorijn van der Graaf 2026-05-24 13:32:08 +02:00
commit 8347467e1e
18 changed files with 1932 additions and 153 deletions

View file

@ -165,6 +165,18 @@ export namespace Crafter {
std::array<float,4> clipRectPx = {0.0f, 0.0f, 1e9f, 1e9f});
void DispatchImages(GraphicsCommandBuffer cmd, std::uint32_t bufferSlot, std::uint32_t itemCount,
std::array<float,4> clipRectPx = {0.0f, 0.0f, 1e9f, 1e9f});
#ifdef CRAFTER_GRAPHICS_WINDOW_DOM
// WebGPU-only overload. WebGPU bind groups can only carry one
// texture/sampler per dispatch, so all items in `bufferSlot`
// share the same texture (`imageSlot`) and sampler (`samplerSlot`).
// The per-item `slots` field in ImageItem is ignored on this
// backend. On Vulkan the bindless heap resolves per-item slots,
// so the cross-backend path is to call the 4-arg overload above
// on native and this 6-arg overload on DOM.
void DispatchImages(GraphicsCommandBuffer cmd, std::uint32_t bufferSlot, std::uint32_t itemCount,
std::uint16_t imageSlot, std::uint16_t samplerSlot,
std::array<float,4> clipRectPx = {0.0f, 0.0f, 1e9f, 1e9f});
#endif
void DispatchText(GraphicsCommandBuffer cmd, std::uint32_t bufferSlot, std::uint32_t itemCount,
std::array<float,4> clipRectPx = {0.0f, 0.0f, 1e9f, 1e9f});