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

Use 100% DPI for histogram calculation to avoid D2DERR_INTERMEDIATE_TOO_LARGE #49

Merged
merged 6 commits into from
Sep 15, 2022

Conversation

imbushuo
Copy link
Contributor

@imbushuo imbushuo commented Mar 16, 2022

I think it's kind of weird and fun to have this repro on screen beyond 4K, but anyway it works at higher resolution now. Is the issue possible from Direct2D itself?

Untitled

Windows AC Example has the exact same issue, and this fix can be applied there as well.

@Filoppi
Copy link

Filoppi commented Aug 7, 2022

I'm sorry for the stupid question, but how did you get to build this app? I just get libheif include errors (missing libheif/heif.h), even if I have its nuget package and even if I manually add them to the project.

@13thsymphony
Copy link
Owner

@imbushuo thanks for the PR and sorry for the radio silence!

This looks like a righteous bug and fix; I can't personally repro the bug (my GPU is too good??) but I definitely should be using 96 DPI for histogram rendering (and possibly for image rendering too). However I'd like to reasonably ensure that the histogram always returns some reasonable value, versus ignoring texture limit exceeded issues.

I made a new commit which explicitly caps the texture size:
1483b3c

If you agree, I'd like to keep your 96.0DPI change, but I don't want to ignore D2DERR_INTERMEDIATE_TOO_LARGE - with our combined changes this should once again become an exceptional situation, as the histogram texture and intermediates should never exceed 2048 pixel size.

@imbushuo
Copy link
Contributor Author

Updated commit & validated 6K images based on comment.

@13thsymphony 13thsymphony merged commit 8e566e0 into 13thsymphony:csappv2 Sep 15, 2022
@13thsymphony
Copy link
Owner

Thanks for your help! Approved and squash/merged.

@Filoppi
Copy link

Filoppi commented Oct 7, 2022

@13thsymphony Maybe I ask if you are planning on making a new Microsoft Store release of the app with this fix?

@13thsymphony 13thsymphony mentioned this pull request Dec 27, 2022
@13thsymphony
Copy link
Owner

@Filoppi @ValZapod Sorry for the delay, yes I'm working on getting an updated version to the Store soon.

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.

3 participants