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

More fixes #169

Merged
merged 6 commits into from
Feb 13, 2025
Merged

More fixes #169

merged 6 commits into from
Feb 13, 2025

Conversation

pattakosn
Copy link
Contributor

@pattakosn pattakosn commented Feb 7, 2025

Some more changes i did while compiling on linux.

It is not ready to be merged but i do not want to delay merging staff because then i never finish them, so i prepared the commits and i will also add some more for these two remaining issues i 'll include later today:

  • There is a commit that is probably wrong so i want to look into a little bit more
  • I will make a pass to make sure that _MSC_VER / _WIN32 are correctly used where appropriate

@PanosK92
Copy link
Owner

PanosK92 commented Feb 7, 2025

Excellent! As always, I'm available on Discord if you need anything.

@pattakosn
Copy link
Contributor Author

ok, this is where i got today, please check "display retrieves gamma value on linux" .
On my system it prints 2, if you can test it on windows as well and it works, it should be a cross platform solution

@pattakosn
Copy link
Contributor Author

I just added a commit which tries to detect HDR on linux. i couldn't test if it works now, but if it does, it should work on windows as well and maybe it can replace the platform specific code

@pattakosn
Copy link
Contributor Author

pattakosn commented Feb 9, 2025

i just built on windows, the gamma detection code seems to work so i added a commit to use it on both windows and linux.

the HDR algo seems to work on linux but not on windows. On windows it seems that RHI_Context::device_physical is not yet initialized in Display::Initialization() so it crashes. I will check it again on linux (why is it initialized there? is it correct? )

@PanosK92
Copy link
Owner

PanosK92 commented Feb 9, 2025

Changes look good.

Regarding get_hdr_capabilities(), ideally, Vulkan and DirectX should be wrapped under the RHI (Rendering Hardware Interface), allowing for a unified approach.

However, I was planning to update SDL 2 to SDL 3 (which just came out). SDL 3 introduces SDL_GetDisplayHDRProperties(), meaning get_hdr_capabilities() can be removed in the future.

Therefore, for now,, I suggest that if there's no API-specific easy way to retrieve HDR properties, simply set HDR to false, with a max luminance of 1000 and a min luminance of 0. You could also log a warning using SP_LOG_WARNING("Implement me") to ensure it’s not forgotten.

Hope this helps!

@pattakosn
Copy link
Contributor Author

i deleted the hdr related commit, noted the values proposed to use locally(or for a future PR). The rest should be OK now.

@PanosK92 PanosK92 merged commit 2bbb038 into PanosK92:master Feb 13, 2025
4 checks passed
@pattakosn pattakosn deleted the more-fixes branch February 17, 2025 20:12
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