Crafter.Graphics/implementations
catbot d8bc8a4e45 perf(rt): allocate TLAS instance buffer in BAR/VRAM, not system RAM (#65)
The TLAS instance buffer is rebuilt/refit every frame and is co-written by
both the CPU (host-authored fields) and the GPU (the compute shader writes
the transform field in place for transformOwnedByGpu elements). Allocated
HOST_VISIBLE | HOST_COHERENT (system RAM), both GPU accesses crossed PCIe:
the compute write of the transform, and the AS build's read of the instances.

Upgrade the request to HOST_VISIBLE with a best-effort DEVICE_LOCAL preference
(BAR/VRAM), keeping the single shared, persistently-mapped buffer — no staging,
no copy, no extra barrier. A whole-buffer staging copy was rejected: it would
clobber the GPU-written transforms in this in-place co-write design. Now the
compute write and AS build stay in local VRAM; the CPU's write-only,
sequential, never-read-back field writes are the ideal write-combined BAR load.

Correctness:
- DEVICE_LOCAL is a preference only (depends on #59): GetMemoryType falls back
  to plain HOST_VISIBLE (the previous behaviour) on GPUs without resizable BAR.
- HOST_COHERENT is dropped from the required set — the combined type may not be
  coherent. The existing FlushDevice(cmd, ...) already establishes host->build
  visibility and gates its flush-skip on the *chosen* type's flags (#60), so a
  non-coherent BAR type still flushes correctly. The barrier is never removed.

metadataBuffer gets the same upgrade separately (#75).

Extends the TLASHighWaterMark hardware test to assert the chosen memory type
matches the HOST_VISIBLE | prefer-DEVICE_LOCAL request and lands on a
DEVICE_LOCAL type where one is reachable; the existing zero-validation-errors
check covers the dropped HOST_COHERENT path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 17:37:39 +00:00
..
Crafter.Graphics-Clipboard.cpp clipboard 2026-05-19 00:45:22 +02:00
Crafter.Graphics-ComputeShader.cpp perf(pipeline): shared, disk-persisted VkPipelineCache (#69) 2026-06-16 18:23:25 +00:00
Crafter.Graphics-Device.cpp fix(device): fence-keyed deferred resource-deletion queue (#101) 2026-06-17 13:21:12 +00:00
Crafter.Graphics-Dom.cpp browser DOM support 2026-05-18 02:07:48 +02:00
Crafter.Graphics-Font.cpp Merge remote-tracking branch 'origin/master' into claude/issue-57 2026-06-16 17:02:48 +00:00
Crafter.Graphics-FontAtlas.cpp fix(image): scope sampled-image upload barriers to the real consumer stage (#54) 2026-06-16 16:01:23 +00:00
Crafter.Graphics-Gamepad.cpp browser DOM support 2026-05-18 02:07:48 +02:00
Crafter.Graphics-Input.cpp feat(input): wire native mouse-wheel scroll on Wayland + Win32, normalize all backends to ±1/detent (#32) 2026-06-12 15:02:28 +00:00
Crafter.Graphics-InputField.cpp perf(input-field): O(n) cursor hit test via Font::NearestCursorByte (#56) 2026-06-16 16:55:03 +00:00
Crafter.Graphics-Mesh-WebGPU.cpp feat(rt): BuildProcedural/RefitProcedural from a device AABB buffer (#37) 2026-06-16 14:12:04 +00:00
Crafter.Graphics-Mesh.cpp feat(rt): BuildProcedural/RefitProcedural from a device AABB buffer (#37) 2026-06-16 14:12:04 +00:00
Crafter.Graphics-PipelineRTWebGPU.cpp feat(webgpu-rt): atomic pixel accumulator + raysPerPixel for >1 ray/pixel/bounce (#30) 2026-06-09 22:45:25 +00:00
Crafter.Graphics-RenderingElement3D-WebGPU.cpp tlas build options 2026-06-16 15:49:17 +02:00
Crafter.Graphics-RenderingElement3D.cpp perf(rt): allocate TLAS instance buffer in BAR/VRAM, not system RAM (#65) 2026-06-17 17:37:39 +00: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 perf(ui): gate per-pixel clip compares behind a flags bit (#50) 2026-06-16 16:57:07 +00:00
Crafter.Graphics-UI-WebGPU.cpp perf(ui): add additive DispatchFused to collapse consecutive UI passes (#47) 2026-06-16 17:03:24 +00:00
Crafter.Graphics-UI.cpp perf(ui): flush only the written descriptor range, not the whole heap (#61) 2026-06-16 18:29:24 +00:00
Crafter.Graphics-UIComponents.cpp perf(text): cache shaped runs in ShapeText (#52) 2026-06-16 15:40:52 +00:00
Crafter.Graphics-WebGPUComputeShader.cpp webgpu triangle 2026-05-18 18:43:30 +02:00
Crafter.Graphics-Window.cpp fix(device): fence-keyed deferred resource-deletion queue (#101) 2026-06-17 13:21:12 +00:00