Repository navigation
LR-VIEW-ZOOM: zoom windows reach the screen as GPU textures, no CPU readback (#1228) #1240
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
Open
mattsivak
wants to merge
13
commits into
storytold:main
Choose a base branch
from
mattsivak:gpu-no-readback-1228
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3f18ff4
LR-VIEW-ZOOM: renders on the window's device come back as textures, n…
mattsivak c7df7fd
Fix macOS build: menu-bar Quit no longer calls eframe's on_exit (from…
mattsivak 77a33c7
LR-VIEW-ZOOM: zoom windows reach the screen as GPU textures, no readb…
mattsivak b76e507
LR-VIEW-ZOOM: window textures are opt-in (LIGHTCRAFT_GPU_TEXTURES=1):…
mattsivak f6074ca
LR-VIEW-ZOOM: the window device keeps egui's limits unless renders sh…
mattsivak d86abeb
LR-VIEW-ZOOM: the lost-device dialog is translated in every language …
mattsivak 404f957
LR-VIEW-ZOOM: the web build compiles again (`RenderResult::texture`, …
mattsivak 57dbdef
LR-VIEW-ZOOM: the lost-device dialog keeps the UI language (#1228)
mattsivak 1c9ff11
LR-VIEW-ZOOM: the lost-window-device test skips software adapters (Fr…
mattsivak 0175050
LR-VIEW-ZOOM: the lost-window-device test also skips wgpu's GL backend
mattsivak ed2b1d1
LR-VIEW-ZOOM: a lost graphics device never quits with edits that coul…
mattsivak df572f8
LR-VIEW-ZOOM: a device lost mid-frame starts the app again (unless ed…
mattsivak e26d371
LR-VIEW-ZOOM: GPU tests never share a GL instance; the unsaved count …
mattsivak 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -363,6 +363,7 @@ impl TitleCompose { | |
| quick: None, | ||
| display: None, | ||
| gpu_fallback: None, | ||
| texture: None, | ||
| } | ||
| } | ||
| } | ||
|
|
||
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
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.
Gpu::read_texturepolls the device directly. Use the guardedGpu::poll.Gpu::polldocuments that once a device is lost, wgpu 30 panics inDevice::pollinstead of returning an error.Gpu::pollexists to turn that panic into anErr, andfinish_and_readalready uses it.read_texturecallsself.device.poll(...)directly. It does not checkDEVICE_LOSTfirst.Renderer::cpu_texturesreaches it for headless screenshots withkeep_pixels. If a screenshot is taken after the shared window device is lost, the poll can panic on Vulkan and DX12 instead of returning "the device is lost". That conflicts with the never-crash rule.Use the guarded poll:
🛡️ Proposed fix
As per coding guidelines: "Non-test code never panics … Return the crate's error type through
Result" and "Don't cascade".Committable suggestion
Source: Coding guidelines