-
Notifications
You must be signed in to change notification settings - Fork 172
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
base: main
Are you sure you want to change the base?
【igl nanovg part-1】shell | mac | add stencil buffer #216
Conversation
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.
Please make it configurable, with the default setting matching the previous behavior. No stencil buffer should be enabled by default unless requested explicitly.
done |
shell/mac/ViewController.mm
Outdated
@@ -196,6 +196,10 @@ - (void)loadView { | |||
|
|||
#if IGL_BACKEND_OPENGL | |||
case igl::BackendFlavor::OpenGL: { | |||
bool enableStencilBuffer = config_.depthTextureFormat == igl::TextureFormat::S8_UInt_Z24_UNorm || |
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.
const
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
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.
The default behavior should be to keep the stencil buffer disabled.
shell/mac/AppDelegate.mm
Outdated
@@ -109,6 +109,7 @@ - (void)setupViewController { | |||
.majorVersion = 3, | |||
.minorVersion = 0}, | |||
.swapchainColorTextureFormat = kColorFramebufferFormat, | |||
.depthTextureFormat = igl::TextureFormat::S8_UInt_Z24_UNorm, |
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 should not ne changed for all apps. Only apps using NanoVG would want to enable the stencil buffer.
I have moved the depth texture format configuration into RenderSession. |
This is a prerequisite pull request for igl nanovg(#213).