-
Notifications
You must be signed in to change notification settings - Fork 173
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
Closed
vinsentli
wants to merge
9
commits into
facebook:main
from
vinsentli:igl_nanovg_part1_mac_add_stencil_buffer
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9e3c99d
shell | mac | add stencil buffer
vinsentli 3ed058e
fix compile error
vinsentli 41fab96
make mac opengl stencil size configurable.
vinsentli 5c7225c
Merge branch 'main' into igl_nanovg_part1_mac_add_stencil_buffer
vinsentli d861110
const
vinsentli a80976c
set depth texture format in RenderSession internal.
vinsentli 6d42667
Fix iOS compile error.
vinsentli df01ffb
Revert "set depth texture format in RenderSession internal."
vinsentli 4188a2c
Revert "iOS : set depth texture format in RenderSession internal."
vinsentli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,10 @@ - (void)loadView { | |
|
||
#if IGL_BACKEND_OPENGL | ||
case igl::BackendFlavor::OpenGL: { | ||
const bool enableStencilBuffer = config_.depthTextureFormat == igl::TextureFormat::S8_UInt_Z24_UNorm || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you extract all these changes in |
||
config_.depthTextureFormat == igl::TextureFormat::S_UInt8; | ||
const NSOpenGLPixelFormatAttribute stencilSize = enableStencilBuffer ? 8 : 0; | ||
|
||
NSOpenGLPixelFormat* pixelFormat; | ||
if (config_.backendVersion.majorVersion == 4 && config_.backendVersion.minorVersion == 1) { | ||
static NSOpenGLPixelFormatAttribute attributes[] = { | ||
|
@@ -211,6 +215,8 @@ - (void)loadView { | |
32, | ||
NSOpenGLPFADepthSize, | ||
24, | ||
NSOpenGLPFAStencilSize, | ||
stencilSize, | ||
NSOpenGLPFAOpenGLProfile, | ||
NSOpenGLProfileVersion4_1Core, | ||
0, | ||
|
@@ -232,6 +238,8 @@ - (void)loadView { | |
32, | ||
NSOpenGLPFADepthSize, | ||
24, | ||
NSOpenGLPFAStencilSize, | ||
stencilSize, | ||
NSOpenGLPFAOpenGLProfile, | ||
NSOpenGLProfileVersion3_2Core, | ||
0, | ||
|
@@ -252,6 +260,8 @@ - (void)loadView { | |
32, | ||
NSOpenGLPFADepthSize, | ||
24, | ||
NSOpenGLPFAStencilSize, | ||
stencilSize, | ||
NSOpenGLPFAOpenGLProfile, | ||
NSOpenGLProfileVersionLegacy, | ||
0, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 line still stands. We should not enable the stencil buffer unconditionally for all apps.