Skip to content

Address cube, validation, and Meshopt review follow-ups - #1910

Open
bkaradzic-microsoft wants to merge 2 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/review-followups
Open

bkaradzic-microsoft wants to merge 2 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/review-followups

Conversation

@bkaradzic-microsoft

Copy link
Copy Markdown
Member

Summary

Follow-up for review comments on #1885, #1890, and #1897.

  • Reject multisampled cube render targets in texture initialization and framebuffer creation instead of producing silently wrong pixels. Zero-fill every cube render-target face, matching WebGL texImage2D(..., null), and read all six faces before any clear.
  • Replace the 240-callback validation cap with a 60-second elapsed deadline. Inspect every render pass the next frame can use, including outputRenderTarget.renderPassId, rig cameras, and scheduled custom targets. Enroll only utility layers that render automatically, and re-check shouldRender so enable/disable takes effect. Poll every associated scene before combining readiness.
  • Describe _native.decodeMeshopt as a compatibility export. Pinned Babylon.js 9.21.2 and the current public MeshoptCompression implementation 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.

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
Copilot AI balanced review requested due to automatic review settings October 2, 2026 00:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 4 Medium severity

Open (6)
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.decodeMeshopt as 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.

Comment thread Apps/UnitTests/Source/Tests.NativeEngine.CubeRenderTargets.cpp
Comment thread Plugins/NativeEngine/Source/NativeEngine.cpp
Comment thread Apps/Playground/Scripts/validation_native.js Outdated
Comment thread Apps/Playground/Scripts/validation_native.js
Comment thread Apps/Playground/Scripts/validation_native.js
Comment thread Apps/Playground/Scripts/validation_native.js Outdated
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
@bkaradzic-microsoft
bkaradzic-microsoft requested a balanced review from Copilot October 2, 2026 01:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Apps/Playground/Scripts/validation_native.js
Comment thread Plugins/NativeEngine/Source/NativeEngine.cpp
Comment thread Plugins/NativeEngine/Source/NativeEngine.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants