-
Notifications
You must be signed in to change notification settings - Fork 926
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
[spv-in] sampling from depth textures returns a scalar and is splatted #6384
Merged
teoxoy
merged 7 commits into
gfx-rs:trunk
from
schell:fix/spv-in-sampling-result-for-depth-texture-is-scalar
Oct 11, 2024
Merged
[spv-in] sampling from depth textures returns a scalar and is splatted #6384
teoxoy
merged 7 commits into
gfx-rs:trunk
from
schell:fix/spv-in-sampling-result-for-depth-texture-is-scalar
Oct 11, 2024
Conversation
This file contains 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
… to a vector for SPIR-V compatibility, fixes gfx-rs#4551
schell
force-pushed
the
fix/spv-in-sampling-result-for-depth-texture-is-scalar
branch
from
October 8, 2024 23:34
38bf9b1
to
3711eed
Compare
@jimblandy @cwfitzgerald @teoxoy @Wumpf - I just want to put this on your radar :) |
teoxoy
requested changes
Oct 10, 2024
Besides the comment I left the changes look correct but could you also add a snapshot test for this? |
teoxoy
reviewed
Oct 11, 2024
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
Ok, g2g @teoxoy :) |
teoxoy
approved these changes
Oct 11, 2024
schell
deleted the
fix/spv-in-sampling-result-for-depth-texture-is-scalar
branch
October 11, 2024 18:43
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.
This wraps the image expression in a splat expression when the texture being sampled/loaded is a depth texture.
Connections
This fixes #4551.
Description
Sampling from a depth texture fails because SPIR-V expects the result of sampling to be a vector, whereas WGSL expects it to be a scalar.
Testing
I ran this on some input shaders.
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.