Native MRT framebuffer creation ignores generateMipMaps: false

オープン
#2,027 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, javascript
領域
backend

調査の方向性

Start with BabylonNative's NativeEngine::CreateMultiFrameBuffer and Babylon.js's ThinNativeEngine._createNativeMultiFrameBuffer; trace how MRT generation intent reaches framebuffer creation, including layered targets and recreation after sample-count changes. Check existing bridge argument ordering and defaults before changing them. Add regression coverage for authored mip preservation, requested automatic generation, legacy calls, and the affected framebuffer paths.

索引モデルが issue の本文から書いたものです。

説明

Context

Separate follow-up to the non-blocking review comment on PR #2025. Keep that PR unchanged; this fix requires coordinated BabylonNative and Babylon.js changes.

Problem

Multiple-render-target framebuffer creation ignores generateMipMaps: false. A target can allocate mip storage with createMipMaps: true while the caller authors each mip itself. Resolving or switching away from its base-level framebuffer can nevertheless regenerate and overwrite those authored levels.

This predates #2025. Enabling Metal automatic mip generation for R32F/RG32F also exposes the problem for those formats.

Confirmed paths

  • BabylonNative NativeEngine::CreateMultiFrameBuffer calls CreateFrameBufferImpl without specifying autoGenerateMips, so it defaults to true. The single-attachment path already accepts an optional generation flag.
  • Babylon.js ThinNativeEngine._createNativeMultiFrameBuffer does not forward the target's generation intent.
  • Existing MRT arguments include per-attachment layers and an explicit depth texture; their positions and legacy behavior must remain compatible.

Coordinated fix

  • Add backward-compatible optional MRT generation control to the Native bridge.
  • Forward the requested generation behavior from Babylon.js for normal and layered MRTs, including framebuffer recreation after sample-count changes.
  • Keep mip allocation (createMipMaps / existing storage) separate from automatic-generation intent.

Regression coverage

  • Allocate a mip chain with automatic generation disabled, populate higher mips, render the MRT base level, switch targets, and verify authored mip values remain unchanged.
  • Verify automatic generation still works when requested and that legacy calls retain their previous defaults.
  • Cover the newly affected float32 formats on a supporting Metal device and exercise relevant layered/recreated-framebuffer paths.
主要言語
C++
スター
931
フォーク
169
平均マージ
2日 17時間
マージ済み PR(30日)
66

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BabylonJS/BabylonNative のほかの issue

BabylonJS/BabylonNative の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。