Crafter.Graphics/implementations
catbot 1e749818ef fix(webgpu): reshape wavefront TRACE/SHADE to 2-D to survive >4.19M rays
A 1-D indirect dispatch of ceil(W*H/64) workgroups for the wavefront
TRACE/SHADE stages overflows maxComputeWorkgroupsPerDimension (65535 on
Dawn/Firefox) once the surface exceeds ~4.19M rays (~2560x1640). Per the
WebGPU spec such a dispatch is silently dropped — no validation error —
so at 4K the world is never traced and the accumulator stays black while
non-RT passes survive.

_wfPrep now spreads the workgroups across a 2-D grid (x clamped to 65535,
y = ceil(wg/65535)), and the wfTrace/wfShade entry points rebuild the
linear ray index from (global_invocation_id, num_workgroups). The existing
`i >= _wfCurCount()` guard absorbs the grid overshoot. GENERATE/RESOLVE
already use a 2-D tile dispatch and are unchanged.

Verified in Firefox/WebGPU with RTStress at a 3449x1739 surface (5.99M
rays, 93716 workgroups — well over the 65535 cap): renders the full cube
grid where master shows a black screen.

Resolves #11

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:09:15 +00:00
..
Crafter.Graphics-Clipboard.cpp clipboard 2026-05-19 00:45:22 +02:00
Crafter.Graphics-ComputeShader.cpp UI rewrite 3rd attempt 2026-05-02 21:08:20 +02:00
Crafter.Graphics-Device.cpp fix(vulkan): clear startup validation errors on native triangle 2026-05-31 20:59:10 +00:00
Crafter.Graphics-Dom.cpp browser DOM support 2026-05-18 02:07:48 +02:00
Crafter.Graphics-Font.cpp new UI system 2026-05-01 23:35:37 +02:00
Crafter.Graphics-FontAtlas.cpp webgpu support 2026-05-18 04:58:52 +02:00
Crafter.Graphics-Gamepad.cpp browser DOM support 2026-05-18 02:07:48 +02:00
Crafter.Graphics-Input.cpp new input system 2026-05-12 00:24:48 +02:00
Crafter.Graphics-InputField.cpp new input system 2026-05-12 00:24:48 +02:00
Crafter.Graphics-Mesh-WebGPU.cpp webgpu improvements 2026-05-24 13:32:08 +02:00
Crafter.Graphics-Mesh.cpp new input system 2026-05-12 00:24:48 +02:00
Crafter.Graphics-PipelineRTWebGPU.cpp fix(webgpu): reshape wavefront TRACE/SHADE to 2-D to survive >4.19M rays 2026-06-01 11:09:15 +00:00
Crafter.Graphics-RenderingElement3D-WebGPU.cpp webgpu improvements 2026-05-24 13:32:08 +02:00
Crafter.Graphics-RenderingElement3D.cpp update 2026-05-05 23:49:29 +02:00
Crafter.Graphics-Router.cpp browser DOM support 2026-05-18 02:07:48 +02:00
Crafter.Graphics-ShaderBindingTableWebGPU.cpp webgpu triangle 2026-05-18 18:43:30 +02:00
Crafter.Graphics-UI-Shared.cpp webgpu support 2026-05-18 04:58:52 +02:00
Crafter.Graphics-UI-WebGPU.cpp webgpu improvements 2026-05-24 13:32:08 +02:00
Crafter.Graphics-UI.cpp custom shader webgpu 2026-05-18 05:39:17 +02:00
Crafter.Graphics-UIComponents.cpp update 2026-05-03 02:45:38 +02:00
Crafter.Graphics-WebGPUComputeShader.cpp webgpu triangle 2026-05-18 18:43:30 +02:00
Crafter.Graphics-Window.cpp fix(vulkan): clear startup validation errors on native triangle 2026-05-31 20:59:10 +00:00