playcanvas / playcanvas/engine
Texture API issues
Open
@slimbuck is already working on this.
Since May 31, 2022.
area: graphics
enhancement
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Some observations of the current texture API:
setSourceonly works with 'browser interface' objects (not arrays of data) and the function correctly tracks which mipmap levels are dirty using_levelsUpdated.getSourcewill return browser interface objects and also arrays of data which it strictly probably shouldn't (since it is matched withsetSource).lockandunlockwork with arrays data and the entire texture is always re-uploaded if any mipmap level is locked, whether for read or write.
Ideally we'd have an API that:
- has a single way of updating both types of texture data
- tracks which face/mipmap levels have been updated and only upload those to GPU
- makes it simple to get, set and dirtify individual faces/levels
Also, the current API assumes textures have CPU-side data which is uploaded to GPU. However we often have GPU-side texture data which we want to copy back to CPU.
@mvaligursky are there any additional restrictions or requirements imposed by webgpu on texture handling?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.