Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for EGL_EXT_gl_colorspace_bt2020_pq #18
base: master
Are you sure you want to change the base?
Add support for EGL_EXT_gl_colorspace_bt2020_pq #18
Changes from 4 commits
1a36e40
684d67b
f0fe6f8
c5334b4
f5d8be7
4f44fe1
c9b9642
b9a86f9
3503d77
247bf59
075dbc4
7a8cd44
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Using
16
causesFailed to call eglChooseConfig()
exception. I think it is probably unnecessary since we are setting the metal pixel format and color space correctly.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.
For a new config to be accepted (such as RGBA 16 bits), it must be added to the supported list inside
DisplayMtl::generateConfigs()
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.
Oh okay, I see. That function is a bit confusing to me, but I will try to figure out how to add the 16bit formats in there.
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 was able to make this work. But I still don't understand what effect this has, as opposed to fbo format and texture formats used.
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.
Currently SurfaceMtl assumes users always create a window surface with 8 bits format (this is actually guaranteed by
DisplayMtl::generateConfigs()
). Hence in this code, there wasn't any color channels' configured bits size's verification, thus it always choosesMTLPixelFormatBGRA8Unorm
metal format for default colorspace:metalangle/src/libANGLE/renderer/metal/SurfaceMtl.mm
Line 219 in 78017f0
If you add a new 16 bits config with default colorspace, the code should examine the color channels's configured bits size inside
egl::SurfaceState
parameter and choose appropriate metal format such asMTLPixelFormatBGRA8Unorm
orMTLPixelFormatRGBA16Float
similar to how depth & stencil bits configuration is handled:metalangle/src/libANGLE/renderer/metal/SurfaceMtl.mm
Line 228 in 78017f0
metalangle/src/libANGLE/renderer/metal/SurfaceMtl.mm
Line 232 in 78017f0
However, I just realized you have no use for RGBA16 with default color space, maybe we can just omit
MGLDrawableColorFormatRGBA16
and only keep its BT.2020 variant. Thus further hassles would be avoided.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.
Thanks! I will reduce scope to BT2020 variant only as you suggested.
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 was using
mColorFormat
to hold the CGColorRef between theSurfaceMtl()
andSurfaceMtl::initialize()
methods. Should I add another variable in the class instead?Also here I'm forcing RGBA16 just when the
EGL_GL_COLORSPACE
is set, which doesn't seem exactly right but I wasn't sure what is better.