Address cube, validation, and Meshopt review follow-ups - #1910
bkaradzic-microsoft wants to merge 2 commits into
Conversation
Reject multisampled cube render targets instead of creating framebuffers that read back as zeros. Zero-fill cube render-target faces to match WebGL texImage2D(null), and read them before any clear. Bound validation convergence by elapsed time, inspect every render pass the next frame can use, and enroll only utility layers that render automatically. Poll every associated scene before combining readiness. Describe decodeMeshopt as a compatibility export that pinned Babylon.js 9.21.2 and current MeshoptCompression do not consume. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e6c3c123-c355-4790-a3d4-94337ed6e052
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 2
Open (6)
This loop has no overall timeout, so if the promise is never fulfilled (e.g., readback callback not… · New This multisampled-cube rejection only inspectscolorTextures. Ifsamples > 1and… · New Using a plain object as a set (seen[id]) can collide with inherited keys (e.g.,__proto__) and… · New The self-check runs unconditionally at script load and throws on failure, which can abort the… · New The self-check runs unconditionally at script load and throws on failure, which can abort the… · New The self-check runs unconditionally at script load and throws on failure, which can abort the… · New
What changed in this PR
Follow-up changes addressing prior review feedback around cube render targets, native validation readiness/convergence logic, and Meshopt export documentation.
Changes:
- Reject multisampled cube render targets and ensure cube render-target faces are zero-initialized.
- Make native validation convergence time-based (60s) and broaden readiness checks across render passes / cameras / utility layers.
- Clarify
_native.decodeMeshoptas a compatibility export in code comments/docs.
| File | Description |
|---|---|
| Plugins/NativeMeshopt/Source/NativeMeshopt.cpp | Updates comments clarifying decodeMeshopt as a compatibility export. |
| Plugins/NativeMeshopt/README.md | Updates documentation of the compatibility entry point behavior/usage. |
| Plugins/NativeMeshopt/Include/Babylon/Plugins/NativeMeshopt.h | Updates header comments to match current Babylon.js Meshopt behavior. |
| Plugins/NativeEngine/Source/NativeEngine.cpp | Adds explicit rejection of multisampled cube render targets during init and framebuffer creation. |
| Documentation/AddingNewValidationTests.md | Updates guidance to reflect new convergence and render-pass readiness behavior. |
| Core/Graphics/Source/Texture.cpp | Zero-fills cube RT memory on creation to match WebGL semantics. |
| Apps/UnitTests/Source/Tests.NativeEngine.CubeRenderTargets.cpp | Adds a unit test for multisample rejection + zero-fill behavior. |
| Apps/Playground/Scripts/validation_native.js | Reworks convergence logic and render-pass enumeration; adds scheduling self-check. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fail the cube readback test if the promise is not fulfilled within 30 seconds. Reject a multisampled cube used as the depth attachment as well as a color attachment. Deduplicate render passes with a Set, and report scheduling self-check failures without aborting the validation suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e6c3c123-c355-4790-a3d4-94337ed6e052
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 2
Open (3)
hasPassIdcurrently treats any non-null/undefined value (includingNaN, objects, and strings)… · New The new multisample rejection for a cubedepthStencilTextureattachment is not covered by the… · New The same error string is duplicated in multiple places in this file for the same condition. To… · New
Resolved since last review (6)
This multisampled-cube rejection only inspectscolorTextures. Ifsamples > 1and… This loop has no overall timeout, so if the promise is never fulfilled (e.g., readback callback not… The self-check runs unconditionally at script load and throws on failure, which can abort the… The self-check runs unconditionally at script load and throws on failure, which can abort the… The self-check runs unconditionally at script load and throws on failure, which can abort the… Using a plain object as a set (seen[id]) can collide with inherited keys (e.g.,__proto__) and…



Summary
Follow-up for review comments on #1885, #1890, and #1897.
texImage2D(..., null), and read all six faces before any clear.outputRenderTarget.renderPassId, rig cameras, and scheduled custom targets. Enroll only utility layers that render automatically, and re-checkshouldRenderso enable/disable takes effect. Poll every associated scene before combining readiness._native.decodeMeshoptas a compatibility export. Pinned Babylon.js 9.21.2 and the current publicMeshoptCompressionimplementation do not reference it.Validation
node --check Apps/Playground/Scripts/validation_native.js, plus an in-process run of the scheduling self-check (output-target pass, rig cameras, dynamic utility-layer enable/disable, and non-short-circuiting scene polling).The cube readback test is
NativeEngineCubeRenderTargets.RejectsMultisamplingAndZeroFillsFacesBeforeClear. It was not executed in this environment.