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

OpenGL: Efficiency improvements for stencil commands #17478

Merged
merged 3 commits into from
May 23, 2023

Conversation

hrydgard
Copy link
Owner

Merges the two stencil-state-setting commands, and dirty-tracks the individual parts.

While not big, compounds with the other recent OpenGL optimizations.

For merge after 1.15.x is done.

@hrydgard hrydgard added this to the v1.16.0 milestone May 17, 2023
@hrydgard hrydgard marked this pull request as ready for review May 23, 2023 06:48
@hrydgard hrydgard force-pushed the opengl-stencil-improvements branch from 1181798 to 3b81b3c Compare May 23, 2023 07:14
@hrydgard hrydgard merged commit ca62a53 into master May 23, 2023
@hrydgard hrydgard deleted the opengl-stencil-improvements branch May 23, 2023 07:43
@@ -302,6 +302,7 @@ void DrawEngineGLES::ApplyDrawState(int prim) {
void DrawEngineGLES::ApplyDrawStateLate(bool setStencilValue, int stencilValue) {
if (setStencilValue) {
render_->SetStencilFunc(GL_TRUE, GL_ALWAYS, stencilValue, 255);
render_->SetStencilOp(0xFF, GL_REPLACE, GL_REPLACE, GL_REPLACE);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is actually partially wrong. When in clear mode, the stencil write mask is still applied (previously set by renderManager->SetStencilOp(stencilState.writeMask, GL_REPLACE, GL_REPLACE, GL_REPLACE);) Now it's no longer applied.

It'd be reasonable to apply it here though, not saying it doesn't make sense to do these together.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

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

darn, yeah you're right - should have figured that this will change behavior, of course.

I'll fix it up.

hrydgard added a commit that referenced this pull request Jun 12, 2023
Also renames vpAndScissor to vpAndScissor_ for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants