Skip to content

Conversation

z3moon
Copy link
Contributor

@z3moon z3moon commented Sep 19, 2025

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.

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.
@z3moon z3moon added the internal Issue/PR does not affect clients label Sep 19, 2025
@z3moon z3moon enabled auto-merge (squash) September 19, 2025 19:00
Copy link
Collaborator

@pixelflinger pixelflinger left a 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.

Copy link
Collaborator

@pixelflinger pixelflinger left a comment

Choose a reason for hiding this comment

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

see comments

Comment on lines 500 to 502
// Other sample counts are not cached, retrieve it.
LOG(INFO) << "MSAA sample count " << samples << " is queried, consider caching it.";
return checkIfMSAASwapChainSupported(samples);
Copy link
Collaborator

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.

Copy link
Contributor Author

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);
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@z3moon z3moon force-pushed the zm/msaa-support-cached branch from 3da59dd to 8fe8f82 Compare September 19, 2025 23:44
@z3moon z3moon requested a review from pixelflinger September 19, 2025 23:45
@pixelflinger pixelflinger merged commit 8fda296 into main Sep 22, 2025
16 checks passed
@pixelflinger pixelflinger deleted the zm/msaa-support-cached branch September 22, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants