-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix Firefox color rendering by respecting surface texture format #3910
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
02ac81b
fbbeadd
1ad5ed2
c19c6a0
dfba7f9
2d7c52c
7701283
8d0bc3d
4e39e06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,10 @@ impl WgpuExecutor { | |
| } | ||
|
|
||
| pub fn create_surface_inner(&self, surface: wgpu::Surface<'static>, window_id: SurfaceId) -> Result<SurfaceHandle<Surface>> { | ||
| let blitter = TextureBlitter::new(&self.context.device, VELLO_SURFACE_FORMAT); | ||
| // Get the surface's preferred format (Firefox WebGL may prefer Bgra8Unorm, Chrome prefers Rgba8Unorm) | ||
| let surface_caps = surface.get_capabilities(&self.context.adapter); | ||
| let surface_format = surface_caps.formats.iter().copied().find(|f| f.is_srgb()).unwrap_or(surface_caps.formats[0]); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic to determine the surface format is also present in You could add a pub struct Surface {
pub inner: wgpu::Surface<'static>,
pub target_texture: Mutex<Option<TargetTexture>>,
pub blitter: TextureBlitter,
pub format: wgpu::TextureFormat,
}Then, you can populate it in |
||
| let blitter = TextureBlitter::new(&self.context.device, surface_format); | ||
| Ok(SurfaceHandle { | ||
| window_id, | ||
| surface: Surface { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.