Skip to content

Conversation

SergeyLebedkin
Copy link
Member

WebGL attempt to blit from a multisampled framebuffer and the bounds or format of the color buffer don't match with the draw framebuffer.
In this case we must to pre-resolve multisampled buffer to the existing render target buffer
This workaround applies only in case of webgl (emscripten)

image

@SergeyLebedkin SergeyLebedkin requested a review from hermet October 2, 2025 11:22
@SergeyLebedkin SergeyLebedkin self-assigned this Oct 2, 2025
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 11:22
@SergeyLebedkin SergeyLebedkin added bug Something isn't working gl OpenGL/WebGL render backend labels Oct 2, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a WebGL-specific issue where attempting to blit from a multisampled framebuffer results in an invalid operation error when bounds or format don't match between source and destination framebuffers. The fix adds a pre-resolve step for multisampled buffers specifically for WebGL/Emscripten environments.

  • Adds source framebuffer target setting capability to GlSceneBlendTask
  • Implements WebGL-specific workaround with pre-resolve step before final blit operation
  • Maintains existing behavior for non-WebGL platforms

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tvgGlRenderer.cpp Sets the source target for blend tasks to enable WebGL workaround
tvgGlRenderTask.h Adds source framebuffer member and setter method to GlSceneBlendTask
tvgGlRenderTask.cpp Implements WebGL-specific two-step blit operation with pre-resolve

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SergeyLebedkin SergeyLebedkin force-pushed the sergii/webgl_fix_target_resolving_invalid-operation branch from fccaaf1 to 9c718fc Compare October 2, 2025 11:24
@hermet hermet added the portability Portability Issues among the machines label Oct 3, 2025
@SergeyLebedkin SergeyLebedkin force-pushed the sergii/webgl_fix_target_resolving_invalid-operation branch 2 times, most recently from 0d83195 to d48278d Compare October 3, 2025 05:53
WebGL attempt to blit from a multisampled framebuffer and the bounds or format of the color buffer don't match with the draw framebuffer.
In this case we must to pre-resolve multisampled buffer to the existing render target buffer
This workaround applies only in case of webgl (emscripten)

#3837
@SergeyLebedkin SergeyLebedkin force-pushed the sergii/webgl_fix_target_resolving_invalid-operation branch from d48278d to 1c8f71c Compare October 8, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gl OpenGL/WebGL render backend portability Portability Issues among the machines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants