Skip to content

Conversation

PurSnake
Copy link
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
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
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
@ender69is4real
Copy link

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

PurSnake and others added 3 commits October 9, 2025 00:47
allowGPU -> allowUncompressedTextures + new argument for funkin.Assets.getBitmapData func

Co-Authored-By: Mihai Alexandru <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: linux Specific to Linux Desktop platforms. platform: macos Specific to MacOS Desktop platforms. platform: windows Specific to Windows Desktop platforms. pr: haxe PR modifies game code. size: medium A medium pull request with 100 or fewer changes. status: pending triage Awaiting review. type: enhancement Involves an enhancement or new feature.
Development

Successfully merging this pull request may close these issues.

4 participants