perf(rt): place SBT in device-local memory via upload-strategy helper (#72) #107
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-72"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The shader binding table (
sbtBuffer) was allocated plainHOST_VISIBLE(system RAM). It is written once at pipeline creation and read by the GPU on everyvkCmdTraceRaysKHRfor the pipeline's lifetime — a textbook write-once/read-many buffer that was paying a PCIe read on every trace dispatch.This routes the SBT allocation through
Device::PreferDirectDeviceWrite(#89):DEVICE_LOCAL|HOST_VISIBLEtype exists (ReBAR/UMA, or a BAR window — the SBT is tiny so the window budget is never the constraint): preferDEVICE_LOCALon top of the requiredHOST_VISIBLE. GPU reads hit local VRAM; the one-timememcpygoes write-combined over PCIe (write-only, sequential — ideal WC).PreferDirectDeviceWritereturns false, the preferred hint is dropped, andGetMemoryType(#59) falls back to plainHOST_VISIBLE— current behaviour, the cheaper fallback the issue blesses while staging isn't wired here.Correctness
memcpypath is unchanged.FlushDevicegates its flush on the chosen memory type's flags (#60), so a direct-write type lackingHOST_COHERENTis still flushed correctly.Testing
crafter-build test— 19 passed (includesUploadStrategy,BLASBuildOptions,TLASHighWaterMark,MemoryTypeFallback). Backend perf change with no visible output, so no screenshot.Resolves #72