Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpu: Make LightTexture::update_scatter() work in chunks instead of single texels. #564

Merged
merged 5 commits into from
Dec 28, 2024

Conversation

kpreid
Copy link
Owner

@kpreid kpreid commented Dec 28, 2024

This is a workaround for gfx-rs/wgpu#6827. However, it should significantly improve throughput too; copying single texels at a time is quite expensive relative to the cost of copying additional texels. I have not tuned the chunk size.

Also tidy the code and add throughput configuration.
This will be useful for upcoming changes to the light rendering, so we
don't have to precisely check the precondition. (Arguably it should
return `Option` instead, but this makes sense because, in general,
fetching the wrong position *inside* the space is likely going to return
`UNINITIALIZED_AND_BLACK` too.)
* Expose the `Texture` and not only the `TextureView`.
* Allow adding more `TextureUsages`.
Changed deps to require newer `tokio`. The `tokio::test` macro changed
behavior in a way that apparently matters when combining it with `rstest`.
…single texels.

This is a workaround for <gfx-rs/wgpu#6827>.
However, it should significantly improve throughput too; copying single
texels at a time seems to be quite expensive relative to the cost of
copying additional texels.
@kpreid kpreid merged commit d385217 into main Dec 28, 2024
18 checks passed
@kpreid kpreid deleted the light-fix branch December 28, 2024 21:09
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