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

[gles] enable/disable blending per attachment only when available (on ES 3.2 or higher) #4234

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Oct 12, 2023

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
fixes #2987

Description

Testing
CI & @Zoxc could you try this patch? (I don't have a device with ES 3.1 or lower)

… ES 3.2 or higher)

- remove `PrivateCapabilities::CAN_DISABLE_DRAW_BUFFER` as it's equivalent to `DownlevelFlags::INDEPENDENT_BLEND`
- fix order of args given to `enable_draw_buffer` & `disable_draw_buffer` (grovesNL/glow#10)
@teoxoy teoxoy requested a review from a team as a code owner October 12, 2023 18:43
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

I don't quite get how this works in the es 3.0/1 case where the disabling can just be removed. If we can just remove it, why do it at all

wgpu-hal/src/gles/queue.rs Show resolved Hide resolved
@teoxoy
Copy link
Member Author

teoxoy commented Oct 12, 2023

I don't quite get how this works in the es 3.0/1 case where the disabling can just be removed. If we can just remove it, why do it at all

It took me a while to see that all functions ending in draw_buffer have to be gated behind the DownlevelFlags::INDEPENDENT_BLEND and most were already. Those that were not, I removed since I think they were not necessary in the first place.

There was a call to disable blending for all targets in perform_shader_clear already, there should be no need to do it again for each individually.

As for SetDrawColorBuffers(count), we were disabling blending on each target individually if not targeting wasm (note the check should have been es 3.2 not wasm) but didn't have fallback for wasm where we would disable blending on all targets via gl.disable(glow::BLEND). I think this was unnecessary since we enable/disable blending later anyway.

@cwfitzgerald cwfitzgerald merged commit 6c8ccde into gfx-rs:trunk Oct 13, 2023
23 checks passed
@teoxoy teoxoy deleted the gles-blend branch October 13, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with egui on Nexus 10 / Android 5.1.1
2 participants