Skip to content
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

Fix Color and Clear Problems on OpenGL Backend #1628

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,14 @@ impl crate::Instance<super::Api> for Instance {
egl::SINGLE_BUFFER as usize
},
];
if inner.version >= (1, 5) {
// Always enable sRGB in EGL 1.5
attributes.push(egl::GL_COLORSPACE as usize);
attributes.push(egl::GL_COLORSPACE_SRGB as usize);
}
// sRGB caused color problems, making the render lighter colored than the vulkan version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just remove this code entirely

// so we comment this out for now.
//
// if inner.version >= (1, 5) {
// // Always enable sRGB in EGL 1.5
// attributes.push(egl::GL_COLORSPACE as usize);
// attributes.push(egl::GL_COLORSPACE_SRGB as usize);
// }
attributes.push(egl::ATTRIB_NONE);

let raw = if let Some(egl) = inner.egl.upcast::<egl::EGL1_5>() {
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/gles/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl super::Queue {
0,
);
}
gl.color_mask(true, true, true, true);
gl.color_mask(true, true, true, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this is certainly not the fix we want.
Isn't the shadow example outputting all alpha = 1 anyway?

This sounds like one of the following possibilities:

  • alpha compositing mode is messed up, and we produce alpha that isn't 1.0
  • driver bug

gl.depth_mask(true);
gl.stencil_mask(!0);
gl.disable(glow::DEPTH_TEST);
Expand Down