-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - get proper texture format after the renderer is initialized, fix #3897 #5413
Conversation
44b9ac1
to
5b6acfa
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.
We need to think about the consequences of adding and exposing the Adapter
.
This is a good change that needs to happen.
I think further than this, probably bevy_default should be removed and replaced when the tonemapping PR lands. @cart
b9a7032
to
06166d3
Compare
@superdump Thanks for your kind reply! Now I have removed the unused |
Oops... It fails on x11 now. I will push more fixes. |
06166d3
to
9088038
Compare
I think this PR could pass all checks now and with this, there won't be any "no available texture formats" error anymore. But the design still needs discussion. For example, should I expose |
d0709dc
to
728e885
Compare
728e885
to
d0a17ea
Compare
d0a17ea
to
19af01d
Compare
19af01d
to
faea439
Compare
I've just run into the issue that this PR addresses. Any plans on getting it merged? |
@superdump @alice-i-cecile hi, what do you think about this PR? What should I do to get this merged? |
@@ -79,10 +87,57 @@ impl FromWorld for SpritePipeline { | |||
], | |||
label: Some("sprite_material_layout"), | |||
}); | |||
let dummy_white_gpu_image = { |
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.
The code duplication of this section strikes me as a bit suspicious. Is there a good way to refactor this to avoid needing to remember to add this to each pipeline?
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.
First round of feedback left :) This is definitely a real issue, and the fix makes sense.
I'm not familiar enough with the details of the rendering machinery here to suggest exactly how you might fix that code duplication issue, but the current strategy makes me suspect that any custom implementations will run into the same problem.
I’ll give this another look over soon. I would like to have reviewed this and other things already but life is what it is. I appreciate your patience. |
faea439
to
36f6dfb
Compare
@alice-i-cecile @devil-ira Hi! Following your kind reviews, I have updated this PR. All the problems you proposed should be resolved. Please let me know if there is anything that should be improved, thanks! |
There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix bevyengine#3897 ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed bevyengine#3897
e145114
to
f32e152
Compare
The latest force push makes |
@devil-ira This works as expected. The texture format in your image should be |
Correction: Bevy also needs wgpu v0.14.0(https://github.com/gfx-rs/wgpu/releases/tag/v0.14.0) to have the |
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.
Not a complete fix, but a necessary one.
bors r+
#5413) # Objective There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix #3897. ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed #3897.
Pull request successfully merged into main. Build succeeded: |
…engine#3897 (bevyengine#5413) # Objective There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix bevyengine#3897. ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed bevyengine#3897.
…engine#3897 (bevyengine#5413) # Objective There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix bevyengine#3897. ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed bevyengine#3897.
…engine#3897 (bevyengine#5413) # Objective There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix bevyengine#3897. ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed bevyengine#3897.
…engine#3897 (bevyengine#5413) # Objective There is no Srgb support on some GPU and display protocols with `winit` (for example, Nvidia's GPUs with Wayland). Thus `TextureFormat::bevy_default()` which returns `Rgba8UnormSrgb` or `Bgra8UnormSrgb` will cause panics on such platforms. This patch will resolve this problem. Fix bevyengine#3897. ## Solution Make `initialize_renderer` expose `wgpu::Adapter` and `first_available_texture_format`, use the `first_available_texture_format` by default. ## Changelog * Fixed bevyengine#3897.
Objective
There is no Srgb support on some GPU and display protocols with
winit
(for example, Nvidia's GPUs with Wayland). ThusTextureFormat::bevy_default()
which returnsRgba8UnormSrgb
orBgra8UnormSrgb
will cause panics on such platforms. This patch will resolve this problem. Fix #3897.Solution
Make
initialize_renderer
exposewgpu::Adapter
andfirst_available_texture_format
, use thefirst_available_texture_format
by default.Changelog