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

backend: gl: add dither #952

Merged
merged 5 commits into from
Dec 3, 2022
Merged

backend: gl: add dither #952

merged 5 commits into from
Dec 3, 2022

Conversation

yshui
Copy link
Owner

@yshui yshui commented Dec 1, 2022

Add bayer ordered dithering when presenting to screen. Reduce banding
when using a strong blur. Also use 16-bit intermediary textures to
preserve precision in the rendering pipeline.

Related: #602

Signed-off-by: Yuxuan Shui yshuiv7@gmail.com

Add bayer ordered dithering when presenting to screen. Reduce banding
when using a strong blur. Also use 16-bit intermediary textures to
preserve precision in the rendering pipeline.

Related: #602

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
See also 0a2cd0f

Related: #602

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
If a pixel is perfectly representable as an 8-bit number, don't add
dither. Reduce artifacts where dither is unnecessary.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Prefer RGB formats first, because they use less memory; but fallback to
RGBA formats, as they are formats required by OpenGL.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
@yshui yshui requested a review from tryone144 December 1, 2022 21:11
@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Merging #952 (236c822) into next (19a24ad) will increase coverage by 0.00%.
The diff coverage is 46.42%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #952   +/-   ##
=======================================
  Coverage   37.59%   37.59%           
=======================================
  Files          48       48           
  Lines       10667    10688   +21     
=======================================
+ Hits         4010     4018    +8     
- Misses       6657     6670   +13     
Impacted Files Coverage Δ
src/backend/gl/blur.c 0.00% <0.00%> (ø)
src/backend/gl/gl_common.h 30.23% <ø> (ø)
src/backend/xrender/xrender.c 0.00% <0.00%> (ø)
src/config.h 23.52% <ø> (ø)
src/options.c 19.57% <0.00%> (-0.15%) ⬇️
src/backend/gl/gl_common.c 25.57% <75.00%> (+0.54%) ⬆️
src/config_libconfig.c 57.23% <100.00%> (+0.14%) ⬆️

Copy link
Collaborator

@tryone144 tryone144 left a comment

Choose a reason for hiding this comment

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

Nice work! 👍
Using 16bit textures requires ~25MB more VRAM than 8bit ones after a short test on my nvidia card.

Are you sure you wanted to add the README changes into this PR? ;)


I'm a bit behind with my reviews on the previous PRs. Sorry for that. The changes to the masking and shadow for shaped windows were rather large and consecutive time is rather limited at the moment. 😞

src/backend/gl/gl_common.c Outdated Show resolved Hide resolved
@yshui
Copy link
Owner Author

yshui commented Dec 2, 2022

add the README changes into this PR? ;)

oh no, i meant to push that to next 🥲

'format' was pointing to an array with a shorter lifetime

suggested by @tryone144

Co-authored-by: Bernd Busse <bernd@busse-net.de>
@yshui
Copy link
Owner Author

yshui commented Dec 2, 2022

I'm a bit behind with my reviews on the previous PRs. Sorry for that.

@tryone144 Just want to say I appreciate your help! 👍 and take your time, there are long period of time where I can't put any time on this project too, so I can understand. (also the reason why i think this project needs more than just two of us).

@yshui yshui merged commit 8820250 into next Dec 3, 2022
@yshui yshui deleted the dither branch December 3, 2022 03:10
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.

2 participants