huggingface / huggingface/gsplat.js
Question about redundant bufferData call
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 109
- Avg merge
- 16m
- Merged PRs (30d)
- 1
Description
Im working on a PR with a little cleanup, and there are a few redundant gl calls. Particularly expensive is populating depthIndex. Is there any reason to do it twice in RenderProgram? Everythink works fine if we keep only one call with buffer data. And there is realy no need to write depthIndex with every _render cycle - we should be doing it only if there is a new one.
1. on message from sortWorker: https://github.com/huggingface/gsplat.js/blob/9080a5a97140d842fbc4d85ee42987dd53de38e0/src/renderers/webgl/programs/RenderProgram.ts#L207
2. in render method: https://github.com/huggingface/gsplat.js/blob/9080a5a97140d842fbc4d85ee42987dd53de38e0/src/renderers/webgl/programs/RenderProgram.ts#L405
@dylanebert So, the question is: Is it done on purpose?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading src/renderers/webgl/programs/RenderProgram.ts at the linked locations around lines 207 and 405, then trace how depthIndex is populated from sortWorker and used during render. Confirm whether both bufferData calls are required and what condition identifies a new depthIndex; done means the redundant update is removed without changing rendering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100