Native MRT framebuffer creation ignores generateMipMaps: false

Abierto
#2,027 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, javascript
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
C++
Estrellas
931
Forks
169
Merge medio
2 d 17 h
PR fusionados (30 d)
66

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BabylonJS/BabylonNative

Todos los issues de BabylonJS/BabylonNative

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.