igl | opengl | Add IContext::readBuffer()#398
Closed
vinsentli wants to merge 1 commit into
Closed
Conversation
corporateshark
approved these changes
Jun 12, 2026
Contributor
|
@corporateshark has imported this pull request. If you are a Meta employee, you can view this in D108393540. |
Contributor
|
@corporateshark merged this pull request in 098e2b7. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Jun 14, 2026
Summary: This PR dependents on PR:#398 Pull Request resolved: #399 Test Plan: Added a unit test `MSAATextureAttachmentOGLTest.ResolveMSAAWithMRT` in `xplat/graphics/igl/public/src/igl/tests/ogl/MSAATextureAttachment.cpp` that exercises the new multiple-render-target resolve path in `RenderCommandEncoder::endEncoding()`. The test builds a framebuffer with two color attachments, each backed by an MSAA texture and paired with its own resolve texture, records an empty render pass (clear + `MsaaResolve` store action on both attachments), and calls `endEncoding()` followed by `submit()`. This drives `endEncoding()` through: - the regular blit of color attachment 0, - the `hasMRT` detection loop, - the per-attachment `readBuffer()` / `drawBuffers()` selection + `blitFramebuffer()` loop for attachment 1, and - the `readBuffer()` / `drawBuffers()` restore loop. The test asserts `context_->checkForErrors() == GL_NO_ERROR` afterwards, verifying the MRT resolve issues no invalid GL operations. It is guarded on the `MultiSample`, `ReadWriteFramebuffer`, and `MultipleRenderTargets` device features (the read/draw framebuffer split and `drawBuffers()` the path relies on). ``` buck2 test fbsource//xplat/graphics/igl/public/src/igl:iglOpenGLTestsFbcode -- --regex 'MSAATextureAttachmentOGLTest' ``` Result: `MSAATextureAttachmentOGLTest.ResolveMSAAWithMRT` runs and passes (no GL errors); the pre-existing `CreateMSAARenderbuffer` still passes and `ResolveMSAA` is skipped as before (the OpenGL backend does not advertise the `MultiSampleResolve` feature). Also verified the library still compiles on all OpenGL flavors: ``` buck2 build fbsource//xplat/graphics/igl/public/src/igl/opengl:openglFbcode buck2 build fbsource//xplat/graphics/igl/public/src/igl/opengl:openglAndroid buck2 build fbsource//xplat/graphics/igl/public/src/igl/opengl:openglAppleMac ``` Reviewed By: rudybear Differential Revision: D108481125 Pulled By: corporateshark fbshipit-source-id: d371651283d3520f40029de217410e347a58554e
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.