Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: Reload with canvas when webglcontextlost and 8+ instances exist #19822

Conversation

danielhjacobs
Copy link
Contributor

@danielhjacobs danielhjacobs commented Mar 15, 2025

Intended to fix this comment in #1905 (comment)

@danielhjacobs danielhjacobs added A-web Area: Web & Extensions A-rendering Area: Rendering & Graphics render-webgl Issues relating to the WebGL renderer render-wgpu Issues relating to the wgpu renderer T-compat Type: Compatibility with Flash Player labels Mar 15, 2025
@danielhjacobs danielhjacobs requested a review from adrian17 March 15, 2025 01:47
@danielhjacobs danielhjacobs added the waiting-on-review Waiting on review from a Ruffle team member label Mar 15, 2025
@danielhjacobs
Copy link
Contributor Author

danielhjacobs commented Mar 15, 2025

I suppose technically, if the situation exists where the browser supports the webgl renderer but not the canvas renderer, this may infinitely loop in a way. Since preferredRenderer doesn't force the renderer so the load may fallback to webgl.

Not sure how to address that, as forcedRenderer was not added (#10835) and neither was enableFallbackRenderers (#10900).

That said, I may be inventing a situation that will never occur. I can't think of why canvas would fail while webgl succeeds.

@kjarosh kjarosh removed the A-rendering Area: Rendering & Graphics label Mar 15, 2025
@danielhjacobs
Copy link
Contributor Author

Addressed my comment by making is so calling reloadWithCanvasRenderer() when the preferredRenderer is already "canvas" will panic. I also made that function protected, since it shouldn't be used by end-users (the renderers are subject to change, and an end-user can just call load with a different preferredRenderer in their own config).

@adrian17 adrian17 force-pushed the reload-with-canvas-when-webgl-context-lost branch from ba677e0 to 5404abe Compare March 20, 2025 19:02
@danielhjacobs danielhjacobs merged commit d917fb1 into ruffle-rs:master Mar 20, 2025
22 checks passed
@danielhjacobs danielhjacobs deleted the reload-with-canvas-when-webgl-context-lost branch March 20, 2025 20:10
@danielhjacobs danielhjacobs removed the waiting-on-review Waiting on review from a Ruffle team member label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web Area: Web & Extensions render-webgl Issues relating to the WebGL renderer render-wgpu Issues relating to the wgpu renderer T-compat Type: Compatibility with Flash Player
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants