-
Notifications
You must be signed in to change notification settings - Fork 2k
Cache isMSAASwapChainSupported() result for EGL #9235
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
Conversation
This change introduces a caching mechanism to store the results of MSAA support queries. The results are stored in a vector, indexed by the power-of-two of the sample count.
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.
This is too complicated. We don't need to handle anything else than x4 for now, until someone asks for it. x8 and x16 are very uncommon on mobile, and x2 is virtually useless.
I don't want any code in isMSAA...Supported()
this should just be a return
statement.
The check for x4 can be done once during init.
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.
see comments
aca135a
to
653f786
Compare
// Other sample counts are not cached, retrieve it. | ||
LOG(INFO) << "MSAA sample count " << samples << " is queried, consider caching it."; | ||
return checkIfMSAASwapChainSupported(samples); |
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.
just return false. I don't want anything else in this function so it can be noexcept
.
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.
done
|
||
PlatformEGL::PlatformEGL() noexcept = default; | ||
PlatformEGL::PlatformEGL() noexcept : OpenGLPlatform() { | ||
mMSAA4XSupport = checkIfMSAASwapChainSupported(4); |
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.
this needs to be called from createDriver, because at this point eglInitialize()
has not even been called.
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.
done
3da59dd
to
8fe8f82
Compare
This change introduces a caching mechanism to store the results of MSAA support queries. The results are stored in a vector, indexed by the power-of-two of the sample count.