webgpu sponza

This commit is contained in:
Jorijn van der Graaf 2026-05-19 00:27:09 +02:00
commit b5d0f52da0
21 changed files with 1426 additions and 58 deletions

View file

@ -181,5 +181,15 @@ export namespace Crafter {
}
return *this;
}
// Convenience: create the "standard" linear-filter clamp-to-edge sampler,
// allocate a slot for it, and return the slot. The wgpu* bridge call is
// intentionally kept inside the library — example code shouldn't need to
// reach into Crafter::WebGPU directly.
inline SamplerSlot AllocateLinearClampSampler(DescriptorHeapWebGPU& heap) {
DescriptorRange r = heap.AllocateSamplerSlots(1);
heap.samplerTable[r.firstElement] = WebGPU::wgpuCreateLinearClampSampler();
return SamplerSlot(&heap, r.firstElement);
}
}
#endif // CRAFTER_GRAPHICS_WINDOW_DOM