Skip to content

[ENHANCEMENT] VRAM (GPU) Caching for Desktop targets#6051

Closed
PurSnake wants to merge 0 commit intoFunkinCrew:developfrom
PurSnake:vram-caching
Closed

[ENHANCEMENT] VRAM (GPU) Caching for Desktop targets#6051
PurSnake wants to merge 0 commit intoFunkinCrew:developfrom
PurSnake:vram-caching

Conversation

@PurSnake
Copy link
Copy Markdown
Contributor

@PurSnake PurSnake commented Sep 18, 2025

Linked Issues

#4030 and other, idunno

Description

Adds ability to load graphics into vram on desktop targets. (since web is funny and mobile works pretty good with compression)

Also requiers FunkinCrew/openfl#5 to be merged.

@github-actions github-actions Bot added pr: haxe PR modifies game code. size: medium A medium pull request with 100 or fewer changes. status: pending triage Awaiting review. labels Sep 18, 2025
@AbnormalPoof AbnormalPoof added type: enhancement Involves an enhancement or new feature. platform: linux Specific to Linux Desktop platforms. platform: macos Specific to MacOS Desktop platforms. platform: windows Specific to Windows Desktop platforms. labels Sep 18, 2025
@EliteMasterEric
Copy link
Copy Markdown
Member

  • Code overall looks good.
  • Good that you remembered to disable GPU caching on the bitmaps which are modified by the game (such as those altered by scalePartByWidth).
  • One known bug, there is an issue with some of the shader code the mobile team put into the fork of Flixel which causes artifacts around the transparent edges of some sprites (most noticeable as a black outline around the main menu sprites, but many other sprites were affected too). Don't remember if the mobile team made the appropriate change to fix that issue.

Otherwise, this PR is great. My internal representation required replacing every instance of Assets.getBitmapData() with a Funkin' implementation, which required major refactors to sprites across the project, but by modifying Assets.getBitmapData() to upload by default you prevented this extra work entirely! Very clever.

As mentioned on the other PR, you should definitely try to contribute this to the mainstream OpenFL. Do note however that you should probably make allowGPU false by default unless you're fine with your PR being a breaking change, since anyone blindly updating their OpenFL without knowing about the new argument on getBitmapData would find any function that tries to edit a bitmap breaking!

Copy link
Copy Markdown
Member

@EliteMasterEric EliteMasterEric left a comment

Choose a reason for hiding this comment

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

Code looks good but I do think that we should do extensive testing on this on all platforms. This will delay the feature to the Week 8 update.

@Hundrec Hundrec changed the title [ENHANCEMENT] VRAM(GPU) Caching on desktop target [ENHANCEMENT] VRAM (GPU) Caching for Desktop targets Sep 23, 2025
@ender69flock
Copy link
Copy Markdown

You can add a description that says "Not recommended for low-end graphics cards."?

@Hundrec Hundrec force-pushed the develop branch 2 times, most recently from 3829dcb to 5805c31 Compare February 1, 2026 03:24
@PurSnake PurSnake closed this Apr 27, 2026
@github-actions github-actions Bot added size: tiny A tiny pull request with 4 or fewer changes. and removed size: medium A medium pull request with 100 or fewer changes. labels Apr 27, 2026
@PurSnake
Copy link
Copy Markdown
Contributor Author

uhoh

@PurSnake
Copy link
Copy Markdown
Contributor Author

image Same with here I just lost changes

@PurSnake
Copy link
Copy Markdown
Contributor Author

Or I'll restore it myself

@Hundrec Hundrec removed type: enhancement Involves an enhancement or new feature. status: pending triage Awaiting review. pr: haxe PR modifies game code. platform: linux Specific to Linux Desktop platforms. platform: macos Specific to MacOS Desktop platforms. platform: windows Specific to Windows Desktop platforms. labels Apr 28, 2026
@Hundrec Hundrec added the status: rejected Issue did not pass review or PR cannot be approved. label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: tiny A tiny pull request with 4 or fewer changes. status: rejected Issue did not pass review or PR cannot be approved.

Development

Successfully merging this pull request may close these issues.

5 participants