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

【igl nanovg part-1】shell | mac | add stencil buffer #216

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vinsentli
Copy link
Contributor

This is a prerequisite pull request for igl nanovg(#213).

@vinsentli vinsentli changed the title shell | mac | add stencil buffer 【igl nanovg part-1】shell | mac | add stencil buffer Nov 26, 2024
Copy link
Contributor

@corporateshark corporateshark left a comment

Choose a reason for hiding this comment

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

Please make it configurable, with the default setting matching the previous behavior. No stencil buffer should be enabled by default unless requested explicitly.

@vinsentli
Copy link
Contributor Author

Please make it configurable, with the default setting matching the previous behavior. No stencil buffer should be enabled by default unless requested explicitly.

done

@@ -196,6 +196,10 @@ - (void)loadView {

#if IGL_BACKEND_OPENGL
case igl::BackendFlavor::OpenGL: {
bool enableStencilBuffer = config_.depthTextureFormat == igl::TextureFormat::S8_UInt_Z24_UNorm ||
Copy link
Contributor

Choose a reason for hiding this comment

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

const

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

Copy link
Contributor

@corporateshark corporateshark left a comment

Choose a reason for hiding this comment

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

The default behavior should be to keep the stencil buffer disabled.

@@ -109,6 +109,7 @@ - (void)setupViewController {
.majorVersion = 3,
.minorVersion = 0},
.swapchainColorTextureFormat = kColorFramebufferFormat,
.depthTextureFormat = igl::TextureFormat::S8_UInt_Z24_UNorm,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not ne changed for all apps. Only apps using NanoVG would want to enable the stencil buffer.

@vinsentli
Copy link
Contributor Author

I have moved the depth texture format configuration into RenderSession.
And iOS has create a new PR #221 base on this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants