-
Notifications
You must be signed in to change notification settings - Fork 965
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
Work Around Fastclear Bug for Web and Native GL #1717
Conversation
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.
Some comments, but in general looks good
7fb4f78
to
ca705d4
Compare
I think we don't actually need to track the GL state here. Correct me if that's wrong. The reason why I don't think it's needed is because the clears are only done at the beginning of a render pass. This is where all the state is reset from WebGPU point of view, so the GL backend doesn't need to worry about restoring any states if it does the draw. |
4ba001c
to
3523c45
Compare
OK, I think I addressed all of the review points with the latest push. |
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.
A few more minor things, but this looks good.
There you go! I went with the most specific |
Oh, wait! The shadow example is only clearing half the screen for some reason. Got to check that out. |
OK, fixed it, had to set the viewport and scissor before clearing. |
wgpu-hal/src/gles/adapter.rs
Outdated
}; | ||
#[cfg(target_arch = "wasm32")] | ||
let (vendor, renderer) = { | ||
let vendor_const = if extensions.contains("WEBGL_debug_renderer_info") { |
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.
can we combine these two? i.e. let (vendor_const, renderer_const) = ...;
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.
I think what he meant was
let (vendor, renderer) = if extensions.contains("WEBGL_debug_renderer_info") {
(GL_UNMASKED_VENDOR_WEBGL, GL_UNMASKED_RENDERER_WEBGL)
else {
(glow::VENDOR, glow::RENDERER)
}
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.
Ah, that makes more sense. :) Pushed an update.
Pushed another update. 👍 |
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.
This has had a lot of iterations, thanks for sticking with us! We're getting close.
wgpu-hal/src/gles/mod.rs
Outdated
// This comment | ||
// (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4972/diffs?diff_id=75888#22f5d1004713c9bbf857988c7efb81631ab88f99_323_327) | ||
// seems to indicate all skylake models are effected. | ||
const WORKAROUND_MESA_I915_SRGB_SHADER_CLEAR = 1 << 0; |
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.
Now that this is in a workarounds struct, the individual const shouldn't be prefixed with WORKAROUND
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.
That makes sense. Fixed!
d6bc195
to
e0762d3
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.
Looks good from my end. Just want kvark to take one last look. Does this make all the GL tests pass on your machine?
One of the skybox tests is the only failing one, and that one fails on master so I think it's unrelated. |
Alright, sounds fine. |
bors r=cwfitzgerald,kvark |
Build succeeded: |
Connections
Resolves #1627
Description
Works around Mesa fastclear bug by doing a manual shader clear on effected platforms
Testing
Tested on Mesa Intel(R) UHD Graphics (CML GT2) (Gl)