Skip to content

render: Handle uploading to Bc3RgbaUnorm and Rgba16Float textures #22700

Draft
SuchAFuriousDeath wants to merge 2 commits intoruffle-rs:masterfrom
SuchAFuriousDeath:texture-upload-compression
Lines changed: 1071 additions & 28 deletions
Draft

render: Handle uploading to Bc3RgbaUnorm and Rgba16Float textures #22700
SuchAFuriousDeath wants to merge 2 commits intoruffle-rs:masterfrom
SuchAFuriousDeath:texture-upload-compression

Conversation

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator

@SuchAFuriousDeath SuchAFuriousDeath commented Jan 6, 2026

Fixes #22214 (tested)
Fixes #22099 (tested)
Fixes #22552 (tested)
Fixes #21581 (no swf provided, but based on the panic message, probably fixes it as well, although we can't be 100% sure).
Fixes #23331 (tested by @kjarosh).

The output is taken from Ruffle itself, not by screenshotting Flash. But it seems indistinguishable from Flash and I consider the tests to mainly as assurance that Ruffle does not panic anymore.

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator Author

SuchAFuriousDeath commented Jan 6, 2026

Oopsie, forgot to run tests with --all-features, looks like sometimes the data can already be pre-compressed sometimes.

@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from aa2e7aa to 985bd00 Compare January 6, 2026 10:50
@kjarosh kjarosh added A-rendering Area: Rendering & Graphics T-fix Type: Bug fix (in something that's supposed to work already) labels Jan 6, 2026
@kjarosh kjarosh added the waiting-on-author Waiting on the PR author to make the requested changes label Jan 6, 2026
@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as draft January 22, 2026 21:31
@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from 985bd00 to 82c4e8c Compare February 13, 2026 00:33
@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from 82c4e8c to 6a1ddbf Compare February 13, 2026 00:38
@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator Author

@kjarosh You can review the code here, I'm having some trouble capturing Flash output for the test. Hopefully I can get it working.

@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from 6a1ddbf to 81ad254 Compare February 14, 2026 01:42
@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from 81ad254 to 43cab4c Compare February 14, 2026 01:51
@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as ready for review February 17, 2026 01:20
@SuchAFuriousDeath SuchAFuriousDeath force-pushed the texture-upload-compression branch from 43cab4c to f6e8a1d Compare February 17, 2026 01:25
@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as draft February 17, 2026 01:25
@@ -0,0 +1,4 @@
num_frames = 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's an expected image, but no image checks.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah Context3d is still failing for me, that's why this is still in draft. You can look at #20875 in the meantime.

@kjarosh kjarosh added the context3d Context3D is low-level, hardware-accelerated graphics context for rendering 2D and 3D on the GPU. label Apr 4, 2026
@kjarosh
Copy link
Copy Markdown
Member

kjarosh commented Apr 4, 2026

This also fixes #23331. As a bonus find, it looks like we allow uploading a smaller bitmap to a larger texture, but it would result in a crash similar to the one in #23331, but this PR doesn't fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rendering Area: Rendering & Graphics context3d Context3D is low-level, hardware-accelerated graphics context for rendering 2D and 3D on the GPU. T-fix Type: Bug fix (in something that's supposed to work already) waiting-on-author Waiting on the PR author to make the requested changes

Projects

None yet

2 participants