Native MRT framebuffer creation ignores generateMipMaps: false

Đang mở
#2,027 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, javascript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
C++
Star
931
Fork
169
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của BabylonJS/BabylonNative

Tất cả issue của BabylonJS/BabylonNative

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.