-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Move clear_texture impl from wgpu-hal to wgpu-core #2046
Conversation
7267512
to
a28319b
Compare
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.
Looks great! Just a few notes
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.
Needs to be addressed before we merge
…mip size for texture clear
@kvark good to go now I believe |
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.
I'm sorry, it looks like one of my comments didn't show up, and still needs to be addressed.
bytes_per_row
has to be aligned. See
wgpu/wgpu-core/src/device/queue.rs
Line 405 in 1759722
let bytes_per_row_alignment = get_lowest_common_denom( |
ohh another good catch. Makes me very happy we have to implement this monster only once now. Fixed! |
CI is unhappy. Otherwise, good to go! |
Connections
Another small steps towards #1688 (texture zero init)
Description
Moves clear_texture implementation from wgpu-hal to wgpu-core.
Previously, the only backend profiting from this was Vulkan and it still limited what we could use it on, notably compressed textures did not work. The new impl is almost identical to the Metal & DX12 implementation previously -> less code to maintain.
collect_zero_buffer_copies_for_clear_texture
may look awkwardly separated out, but is very useful in this form for my texture init wip branch where I can use this to bundle up operations that are then sent off a single wgpu-hal callTesting
New test going through all texture formats and kinds and clearing them. No reading back yet, but verifies at least that backend impls are happy and nothing crashes. List of formats put in there should be useful for other upcoming "try this with all formats" tests.