Leak#5151
Merged
Merged
Conversation
Converts the decoded gainmap from QuadRenderer to a standalone DataTexture using `result.toDataTexture()`. This allows the intermediate WebGLRenderTarget instances and their underlying WebGL framebuffers/textures to be completely disposed of immediately via `result.dispose(true)`. Includes a try-catch fallback to return the raw render target texture via `result.dispose(false)` if the environment does not support the conversion. This resolves iOS-specific WebGL context loss crashes and browser tab reloads occurring when decoding multiple UltraHDR / Gainmap environments in the "Lighting & Skybox" section.
…ap to DataTexture Converts the decoded gainmap from QuadRenderer to a standalone DataTexture using `result.toDataTexture()`. This allows the intermediate WebGLRenderTarget instances and their underlying WebGL framebuffers/textures to be completely disposed of immediately via `result.dispose(true)`. Includes a try-catch fallback to return the raw render target texture via `result.dispose(false)` if the environment does not support the conversion. This resolves iOS-specific WebGL context loss crashes and browser tab reloads occurring when decoding multiple UltraHDR / Gainmap environments in the "Lighting & Skybox" section. Also adds: - A regression unit test in `TextureUtils-spec.ts` validating proper disposal of intermediate WebGLRenderTargets during gainmap decoding.
…map loading Converts the decoded gainmap from QuadRenderer to a standalone DataTexture using `result.toDataTexture()`, explicitly setting `needsUpdate = true` to trigger GPU WebGL texture upload of the pixel buffer. This allows the intermediate WebGLRenderTarget framebuffers and render buffers to be completely disposed of immediately via `result.dispose(true)`. This resolves a critical iOS-specific WebGL context loss crash loop when scrolling through galleries with multiple environment maps (the "Lighting & Skybox" examples). Implements a robust verification blank-check fallback: - Dynamically inspects the decoded DataTexture pixel buffer on the CPU. - Transparently falls back to the original render target texture if the converted DataTexture is completely black (frequent in headless testing environments with GPU-less software rendering). - Prevents overriding of the colorSpace to SRGBColorSpace on half-float decoded textures, which is invalid under standard WebGL. Also adds a regression unit test in `TextureUtils-spec.ts` to verify proper disposal of intermediate WebGLRenderTargets during gainmap decoding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts the decoded gainmap from QuadRenderer to a standalone DataTexture
using
result.toDataTexture(). This allows the intermediate WebGLRenderTargetinstances and their underlying WebGL framebuffers/textures to be completely
disposed of immediately via
result.dispose(true).Includes a try-catch fallback to return the raw render target texture via
result.dispose(false)if the environment does not support the conversion.This resolves iOS-specific WebGL context loss crashes and browser tab
reloads occurring when decoding multiple UltraHDR / Gainmap environments
in the "Lighting & Skybox" section.
Also adds:
TextureUtils-spec.tsvalidating proper disposal of intermediate WebGLRenderTargets during gainmap decoding.