OpenGL: ExternalTexture does not support MSAA render targets
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- computer-graphics
Research direction
Start with ExternalTexture.RenderWithMsaaSamples4 and the SKIP_MULTISAMPLE_TESTS entry in Apps/UnitTests/CMakeLists.txt, then inspect TextureGL::create and createMsaaFbo in bgfx/src/renderer_gl.cpp. Check the OpenGL ES 3.0 configuration in Dependencies/CMakeLists.txt. Done means the OpenGL external-texture MSAA test is enabled and passes without affecting the existing D3D11 and Metal behavior.
Written by the indexing model from the issue text.
Description
[Filed by Copilot on behalf of @bghgary]
ExternalTexture.RenderWithMsaaSamples4 is skipped on OpenGL via SKIP_MULTISAMPLE_TESTS
(Apps/UnitTests/CMakeLists.txt). There are two independent blockers.
bgfx renders MSAA render targets into a renderbuffer it owns
TextureGL::create (bgfx/src/renderer_gl.cpp):
const bool msaaSample = 0 != (m_flags&BGFX_TEXTURE_MSAA_SAMPLE);
if (!msaaSample
&& (0 != msaaQuality || writeOnly)
&& !textureArray)
{
GL_CHECK(glGenRenderbuffers(1, &m_rbo) );
The imported texture name is never the attachment being rendered to, so an external texture
imported as an MSAA render target never receives the resolved pixels. bgfx does implement the
ES 3.0-capable EXT_multisampled_render_to_texture, but only in createMsaaFbo for its own
back buffer — never for user framebuffers.
The multisample-texture path requires ES 3.1
The alternative is BGFX_TEXTURE_MSAA_SAMPLE, which selects a real multisample texture:
GLenum target = msaaSample ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
GL_TEXTURE_2D_MULTISAMPLE is ES 3.1, and Babylon Native pins bgfx to ES 3.0
(Dependencies/CMakeLists.txt, BGFX_CONFIG_RENDERER_OPENGLES=30), so it is unreachable as
configured.
D3D11 and Metal are unaffected — the test passes there.
- Dominant language
- C++
- Stars
- 931
- Forks
- 169
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 66
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BabylonJS/BabylonNative
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BabylonJS/BabylonNative#2138 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BabylonJS/BabylonNative#2042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
BabylonJS/BabylonNative#2052 ·
Maintainers usually reply within 1 day
-
testing
Difficulty 4/5 3-5 days Newbie friendliness 45/100
BabylonJS/BabylonNative#2136 ·
Maintainers usually reply within 1 day
-
Support useNDCHalfZRange (half-range NDC depth) so Babylon.js half-range depth visual tests can runPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
BabylonJS/BabylonNative#2134 ·
Maintainers usually reply within 1 day
All issues in BabylonJS/BabylonNative
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itselfPossibly taken @fedonman claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SparseLinearAlgebra/spla#316 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days