-
Notifications
You must be signed in to change notification settings - Fork 984
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
Add multiple render targets example (v2) #5313
Merged
cwfitzgerald
merged 25 commits into
gfx-rs:trunk
from
kaphula:multiple_render_targets_example
Dec 18, 2024
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ac4a804
Add the initial files of multiple render targets exmaple.
kaphula 16970ca
Fix Present
cwfitzgerald a0382d7
Merge branch 'fix-presentation' into multiple_render_targets_example
kaphula 205e22a
Add requested PR review changes.
kaphula ceb5e4a
Fix cargo clippy warnings.
kaphula 7e994b0
Remove screenshot.
kaphula d29fa6e
Update CHANGELOG.md
kaphula 74328eb
Add empty line to shader.
kaphula df5aa53
Fix resize crash by storing screen dimensions on resize.
kaphula 4568912
Make imports to be direct.
kaphula edc97c0
Add cosmetic code style changes.
kaphula 2d08936
Rename a/b to left/right.
kaphula 359b01b
Make all imports direct.
kaphula 9c3cf48
Merge branch 'trunk' into multiple_render_targets_example
cwfitzgerald a56355a
Merge branch 'refs/heads/trunk' into multiple_render_targets_example_…
kaphula 1ba3592
Update to wgpu 0.20.0
kaphula 63547f0
Merge branch 'trunk' into multiple_render_targets_example
cwfitzgerald fbc49b0
Compile Errors + Screenshots
cwfitzgerald c9f3fe9
Adjust Bound
cwfitzgerald 7cd60a5
Add more consistent names for color targets.
kaphula e9bf491
Simplify fragment state target initialization.
kaphula cb7d2e2
Fix CI
cwfitzgerald 5839ac9
Fix CI Better
cwfitzgerald 1f681d1
Fix changelog for next release.
kaphula 023e56f
Merge remote-tracking branch 'origin_kaphula/multiple_render_targets_…
kaphula File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# multiple_render_targets | ||
|
||
This example demonstrates how to use fragment shader to output to two color attachments of a renderpass simultaneously. | ||
|
||
The program generates a black and white ball-shaped texture from scratch and uses the fragment shader to draw it to two | ||
separate texture targets. The first texture target receives a red version of the texture and the second target receives | ||
a green version. | ||
|
||
Once the colored shapes have been drawn to two separate textures, they | ||
will be displayed on the screen by rendering each one of them to their own viewports that split the screen in half. | ||
|
||
|
||
## To Run | ||
|
||
``` | ||
cargo run --bin wgpu-examples multiple_render_targets | ||
``` | ||
|
||
## Screenshots | ||
|
||
![Multi render target](./screenshot.png) | ||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Did you run the tests locally with
cargo xtask test
? The screenshot was never generatedThere 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.
The screenshot gets generated just fine for me, although bunch of tests fail on my machine overall. Do you want the generated screenshot to be part of the repository?
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.
Yeah - the fact that the screenshot is generated is how we ensure the screenshot stays up to date with the example