-
Notifications
You must be signed in to change notification settings - Fork 1.2k
unify vk_hal::Texture::{block, external_memory} in enum TextureMemory #8521
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
base: trunk
Are you sure you want to change the base?
Conversation
|
This improves the image counter situation, but I think it's still wrong - counters are incremented both on wgpu_hal::Texture creation, as well as when they are upleveled to wgpu::Texture; but they are decremented just once in wgpu::Device::destroy_texture(). However I took a brief look at other backends and they seem to follow the same inconsistent logic so I've left it alone for now in case I'm missing something about how the uplevelling works. |
666d173 to
74c1319
Compare
|
It seems to be a bit underdocumented how Now I do agree that this is very wonky: if a user were to create a texture from the hal device via |
Wumpf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change looks nice!
As you wrote yourself let's leave the counter kerfuffle for another iteration (with the exception of not bumping in texture_from_d3d11_shared_handle, agree that that this is better than before!).
Also CI needs fixing - a doc string has trouble
Wumpf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(oops, wrong button, slight changes are needed)
74c1319 to
9591f6e
Compare
|
thanks @Wumpf, I reverted the two requested hunks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Some doc build things need attention (see ci). Otherwise good to go I think!
Instead of having two std::Option<> types that are logically mutually exclusive, this unifies them in an enum. As a result, vk::Device::texture_from_raw() becomes more generic and can be used more consistently in the wgpu-hal::vulkan implementation, which also fixes inconsistent usage of the "textures" counter.
9591f6e to
30e0083
Compare
|
Thanks for pointing that out, I'm still getting the hang of the contribution / CI flows here and the rust linting toolchain 🙂 |

Description
Instead of having two std::Option<> types that are logically mutually exclusive, this unifies them in an enum.
As a result, vk::Device::texture_from_raw() becomes more generic and can be used more consistently in the wgpu-hal::vulkan implementation, which also fixes inconsistent usage of the "textures" counter.
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.