Allow copying from depth textures#901
Merged
kvark merged 3 commits intogfx-rs:masterfrom Aug 28, 2020
Merged
Conversation
Member
Since this PR is breaking, it should definitely be targeted at |
8d0b264 to
7186e82
Compare
kvark
reviewed
Aug 27, 2020
wgpu-core/src/command/transfer.rs
Outdated
| )?; | ||
|
|
||
| let (block_width, _) = conv::texture_block_size(dst_texture.format); | ||
| if dst_texture.format.is_depth_format() { |
Member
There was a problem hiding this comment.
can we call this is_depth() to avoid repeating ourselves?
kvark
reviewed
Aug 28, 2020
malu
added a commit
to malu/wgpu
that referenced
this pull request
Aug 28, 2020
bors bot
added a commit
that referenced
this pull request
Aug 28, 2020
904: [0.6] Allow copying from Depth32Float formatted textures r=kvark a=malu **Connections** Backport of #901 **Description** Copying from textures with format `Depth32Float` was reaching an `unreachable` and hence was impossible while copying from such textures should be well-defined and safe. Co-authored-by: Maximilian Lupke <maxlupke@gmail.com>
EriKWDev
pushed a commit
to bitwise-git/wgpu
that referenced
this pull request
May 14, 2024
This was previously added in gfx-rs#2230 but I don't think it was necessary. gfx-rs#901 already implemented the buffer <-> texture validation for those formats. It's also not a requirement in the spec.
jimblandy
pushed a commit
to jimblandy/wgpu
that referenced
this pull request
May 23, 2024
This was previously added in gfx-rs#2230 but I don't think it was necessary. gfx-rs#901 already implemented the buffer <-> texture validation for those formats. It's also not a requirement in the spec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connections
Fixes #900
Description
Copying from depth textures failed with
unexpected depth formatbefore. Fix the cause inconv::texture_block_size. Add checks around the place where it would have (rightfully) failed before.Seeing as this adds another variant to
TransferError, this is not backwards compatible. The compatible alternative would bepanicing (which is what currently happens viaunreachable!).Also, I could understand if you think
TextureFormat::is_depth_formatisn't worth it to have as public api. We could pull it intowgpu-corein that case. It would need a doc comment in case we want to keep it there.Should this instead be based on master instead of v0.6? Just let me know and I can rebase.