Skip to content

Commit

Permalink
【igl nanovg part-1】shell | ios | add stencil buffer (#214)
Browse files Browse the repository at this point in the history
Summary:
This is a prerequisite pull request for igl nanovg(#213).

Pull Request resolved: #214

Reviewed By: EricGriffith, syeh1

Differential Revision: D66506219

Pulled By: corporateshark

fbshipit-source-id: 6489cb7b9bf9d990fc50f575f1172c27c52e4ee9
  • Loading branch information
vinsentli authored and facebook-github-bot committed Nov 27, 2024
1 parent 5dd5465 commit 49d674c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions shell/ios/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ - (BOOL)application:(UIApplication*)application
.majorVersion = 3,
.minorVersion = 0},
.swapchainColorTextureFormat = igl::TextureFormat::BGRA_SRGB,
.depthTextureFormat = igl::TextureFormat::S8_UInt_Z32_UNorm,
},
#endif
#if IGL_BACKEND_OPENGL
Expand All @@ -52,6 +53,7 @@ - (BOOL)application:(UIApplication*)application
.majorVersion = 3,
.minorVersion = 0},
.swapchainColorTextureFormat = igl::TextureFormat::BGRA_SRGB,
.depthTextureFormat = igl::TextureFormat::S8_UInt_Z24_UNorm,
},
#endif
{
Expand All @@ -60,6 +62,7 @@ - (BOOL)application:(UIApplication*)application
.majorVersion = 2,
.minorVersion = 0},
.swapchainColorTextureFormat = igl::TextureFormat::BGRA_SRGB,
.depthTextureFormat = igl::TextureFormat::S8_UInt_Z24_UNorm,
},
#endif
// @fb-only
Expand Down
2 changes: 1 addition & 1 deletion shell/ios/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ - (void)initRenderSessionController {
IGL_DEBUG_ASSERT(platformDevice);
return igl::SurfaceTextures{
.color = platformDevice->createTextureFromNativeDrawable((CAEAGLLayer*)layer_, nullptr),
.depth = platformDevice->createTextureFromNativeDepth((CAEAGLLayer*)layer_, igl::TextureFormat::Z_UNorm16, nullptr),
.depth = platformDevice->createTextureFromNativeDepth((CAEAGLLayer*)layer_, config_.depthTextureFormat, nullptr),
};
}
#endif
Expand Down
1 change: 1 addition & 0 deletions shell/shared/renderSession/RenderSessionConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct RenderSessionConfig {
std::string displayName;
BackendVersion backendVersion;
igl::TextureFormat swapchainColorTextureFormat = igl::TextureFormat::BGRA_UNorm8;
igl::TextureFormat depthTextureFormat = igl::TextureFormat::Z_UNorm16;
igl::ColorSpace swapchainColorSpace = igl::ColorSpace::SRGB_NONLINEAR;
};

Expand Down

0 comments on commit 49d674c

Please sign in to comment.