Skip to content

docs: give useTexture/useTextures a dedicated page - #3868

Open
RyanHang07 wants to merge 1 commit into
pmndrs:v10from
RyanHang07:docs/3838-webgpu-textures-page
Open

docs: give useTexture/useTextures a dedicated page#3868
RyanHang07 wants to merge 1 commit into
pmndrs:v10from
RyanHang07:docs/3838-webgpu-textures-page

Conversation

@RyanHang07

Copy link
Copy Markdown

Closes #3838

New page at docs/webgpu/textures.mdx. I used nav: 17 since that slot was open between Compute and Multi-Canvas. It covers useTexture and useTextures together: the cache default, refcounted dispose(), why a texture sticks around after its last consumer unmounts, and when the registry actually re-renders.

loading-textures.mdx links to it now instead of repeating it. I kept the moved prose as close to verbatim as I could so the diff reads as a move. One thing I did change: the flip-flop add() snippet now says it has to run from an event handler or effect. add() calls setState and the old version read like render-phase code.

overview.mdx gets two small edits. It was pointing at the #the-texture-registry-with-usetextures-experimental anchor that this PR deletes, and I added the new page to its Sections list.

A few things I wasn't sure about:

Placement. Both hooks live in core/hooks/ now, and webgpu/hooks/useTextures.tsx is just a back-compat re-export. overview.mdx itself calls them core hooks that work with any renderer. I put the page under docs/webgpu/ because that's what the issue asked for, but happy to move it.

preload/clear. These are useLoader aliases and don't touch the registry, so I left them off rather than sit them next to dispose() and imply they're related. ChangeTexture.tsx does use preload though, so if it should be documented somewhere, is that here or on the useLoader side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant