Merge pull request 'perf(webgpu): range-flush only live TLAS metadata slots (#130)' (#149) from claude/issue-130 into master
This commit is contained in:
commit
77bc6f7aec
1 changed files with 5 additions and 1 deletions
|
|
@ -159,7 +159,11 @@ void RenderingElement3D::BuildTLASUpload(WebGPUCommandEncoderRef /*cmd*/, std::u
|
||||||
runOwned = currOwned;
|
runOwned = currOwned;
|
||||||
}
|
}
|
||||||
|
|
||||||
tlas.metadataBuffer.FlushDevice();
|
// Only primitiveCount slots are live; the buffer is padded to kNPadded
|
||||||
|
// (65536). Flushing the whole thing wgpuWriteBuffers all 256 KB through
|
||||||
|
// the WASM->JS staging path every frame — ~100-250x waste for a
|
||||||
|
// few-hundred-instance scene. Range-flush just the live entries.
|
||||||
|
tlas.metadataBuffer.FlushDeviceRange(0, 0, primitiveCount * sizeof(std::uint32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingElement3D::BuildTLASBuild(WebGPUCommandEncoderRef /*cmd*/, std::uint32_t index) {
|
void RenderingElement3D::BuildTLASBuild(WebGPUCommandEncoderRef /*cmd*/, std::uint32_t index) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue