Skip to content

core/render: avoid copying pixels on bitmap CPU -> GPU syncs #20957

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

Merged
merged 3 commits into from
Jul 20, 2025

Conversation

moulins
Copy link
Contributor

@moulins moulins commented Jul 10, 2025

This is done by making render::Bitmap capable of holding borrowed pixel data, and by changing core::bitmap::Color's internal representation to be compatible with what the render backend expects.

Slightly pessimizes setPixel & friends, as they now need to convert the ActionScript color representation (BGRA) into RGBA; this could be fixed by switching renderers to use BGRA internally, but I'm not sure how much work this represents or if it is even possible.

@moulins moulins added A-rendering Area: Rendering & Graphics T-perf Type: Performance Improvements A-core Area: Core player, where no other category fits labels Jul 10, 2025
@moulins moulins force-pushed the render-bitmap-cow branch 3 times, most recently from af00120 to f0d1e30 Compare July 11, 2025 01:22
@moulins moulins marked this pull request as ready for review July 11, 2025 01:39
@moulins moulins force-pushed the render-bitmap-cow branch 2 times, most recently from f0d1c06 to c02852b Compare July 19, 2025 21:24
moulins added 3 commits July 20, 2025 17:29
…der backend

This avoids needing to copy `BitmapData` pixels into a temporary Vec during
`update_dirty_texture`, at the cost of extra byteswapping when interacting with
the ActionScript bitmap APIs.
@moulins moulins force-pushed the render-bitmap-cow branch from c02852b to 362ee88 Compare July 20, 2025 15:29
@moulins moulins merged commit 40c21eb into ruffle-rs:master Jul 20, 2025
24 checks passed
@moulins moulins deleted the render-bitmap-cow branch July 20, 2025 16:50
Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request Jul 21, 2025
-----------------------------------------------------------------------------------
cemu.mk 1ec8c713b45f5e4e88a1e6a65c59a2ec1e42afe6 # Version: Commits on Jul 20, 2025
-----------------------------------------------------------------------------------
CI: Fix deploy workflow for multiarch macos (#1642),

------------------------------------------------------------------------------------------
dolphin-emu.mk c39c8277b7fd570a4101bc621a9179f3ece10e6b # Version: Commits on Jul 20, 2025
------------------------------------------------------------------------------------------
Merge pull request #13674 from JosJuice/android-visualize-input

Android: Show input indicators in controller settings,

---------------------------------------------------
pcsx2.mk v2.5.75 # Version: Commits on Jul 20, 2025
---------------------------------------------------
- [GS/GL/MTL: Misc fixes.](PCSX2/pcsx2#13048)

,

---------------------------------------------------------
python-pyxel.mk v2.4.8 # Version: Commits on Jul 21, 2025
---------------------------------------------------------
Updated the WASM wheel to version 2.4.8,

---------------------------------------------------------------
ruffle.mk nightly-2025-07-21 # Version: Commits on Jul 21, 2025
---------------------------------------------------------------
## What's Changed

* core/render: avoid copying pixels on bitmap CPU -> GPU syncs by @moulins in ruffle-rs/ruffle#20957

* chore: Update translations by @RuffleBuild in ruffle-rs/ruffle#21048

* pixelbender: Remove Result usage, minor code improvements by @SuchAFuriousDeath in ruffle-rs/ruffle#21047

* avm2: Reduce `TObject` boilerplate by @moulins in ruffle-rs/ruffle#21052

* avm2: Fix Array.some signature by @Lord-McSweeney in ruffle-rs/ruffle#21049

**Full Changelog**: ruffle-rs/ruffle@nightly-2025-07-20...nightly-2025-07-21,

--------------------------------------------------------------------------------------
shadps4.mk 95a386308a8d93b0a5a40584126fa859a4fe89e9 # Version: Commits on Jul 20, 2025
--------------------------------------------------------------------------------------
Implement sceKernelError (#3282)

* Implement sceKernelError

* Oh come on,

---------------------------------------------------------------------------------------
thextech.mk edd69ecf4c205fd06919509ec1447b3341405f3e # Version: Commits on Jul 20, 2025
---------------------------------------------------------------------------------------
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (393 of 393 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 80.6% (546 of 677 strings)

Co-authored-by: CalebeGamesRomSM64 <[email protected]>

Translate-URL: https://hosted.weblate.org/projects/thextech/engine-assets-specific/pt_BR/

Translate-URL: https://hosted.weblate.org/projects/thextech/engine-general/pt_BR/

Translation: TheXTech Engine/Engine Assets-specific

Translation: TheXTech Engine/Engine General,

-------------------------------------------------------------------------------------------
xenia-native.mk 01d46c20ff0efd44b6e7f5fb8e73c774e608d5e0 # Version: Commits on Jun 26, 2025
-------------------------------------------------------------------------------------------
[XAM] Cleanup XamUserAreUsersFriends,

-----------------------------------------------------------------------------------
ymir.mk 2dc586b3130c042dac0d15679e1af437b98468a0 # Version: Commits on Jul 21, 2025
-----------------------------------------------------------------------------------
chore(app): Make \Welcome to Ymir!\ text a little larger,

---------------------------------------------------------------------------------------------
deskpipro-case.mk e7f337360c3e177ce2c027c7d5dcd40ba5d3f3c8 # Version: Commits on Jul 21, 2025
---------------------------------------------------------------------------------------------
Merge pull request #199 from DeskPi-Team/yoyojacky-patch-11

Update README.md,

---------------------------------------------------------------------------------------
alephone.mk 67f9c8bf87a8f5ee48541c3d1cc662ca835eca8c # Version: Commits on Jul 21, 2025
---------------------------------------------------------------------------------------
Update vcpkg.json baseline and adapt Aleph One code

Co-authored-by: treellama <[email protected]>,

------------------------------------------------------------------------------------
box64.mk 8271d37539068bb5fd9ab5b32d4aee2c0b52aae8 # Version: Commits on Jul 21, 2025
------------------------------------------------------------------------------------
[DYNACACHE]LA64] Enabled dynacache for LA64 (#2836)

* [DYNACACHE]LA64] Enabled dynacache for LA64

* review,

------------------------------------------------------------------------------------------
devilutionx.mk 7b2de562c2d9a580ff1fddbcf3c8d45edcb05b06 # Version: Commits on Jul 20, 2025
------------------------------------------------------------------------------------------
Extract more Hellfire into data,

----------------------------------------------------------------------------------------
openjkdf2.mk f61d35fa6903259b704f76580befb7d6c8b63d35 # Version: Commits on Jul 21, 2025
----------------------------------------------------------------------------------------
oops, that was load-bearing, fix the sky and zfar vertices, also add an icon,

----------------------------------------------------------------------------------------
openmohaa.mk 95a7169d211dbd695128acb51b8c997699acda75 # Version: Commits on Jul 20, 2025
----------------------------------------------------------------------------------------
Fix HUD being shown during briefings (single-player) (#769),

-------------------------------------------------------------------------------------
gzdoom.mk da13a7e839e75f31e2e1a948681f379cf67ac08d # Version: Commits on Jul 21, 2025
-------------------------------------------------------------------------------------
Stencil broke stacked sectors. Fixing.,

-----------------------------------------------------------------------------------
tr1x.mk 7648d8574f3c90f1cd040a5288cfdb624a97b659 # Version: Commits on Jul 20, 2025
-----------------------------------------------------------------------------------
input+enum-map: do not hardcode enum names,

-----------------------------------------------------------------------------------
tr2x.mk 7648d8574f3c90f1cd040a5288cfdb624a97b659 # Version: Commits on Jul 20, 2025
-----------------------------------------------------------------------------------
input+enum-map: do not hardcode enum names,

------------------------------------------------------------------------------------------------
libretro-ep128emu.mk edc6da073ec4e6120edfe6d063e49415f21bbdf4 # Version: Commits on Jul 20, 2025
------------------------------------------------------------------------------------------------
Quick patch: allow mouse buttons 2 and 3.,

------------------------------------------------------------------------------------------------
libretro-nestopia.mk 0e82a1642d4acafab4da9ce937954b85d846952b # Version: Commits on Jul 21, 2025
------------------------------------------------------------------------------------------------
NstDatabase: Add entry for Kid Dracula (World) (Castlevania Anniversary Collection),

------------------------------------------------------------------------------------------------
libretro-panda3ds.mk 1e7e41187d3bffa7f4778a80709071ed2a7895e6 # Version: Commits on Jul 21, 2025
------------------------------------------------------------------------------------------------
Very important work (#783),

-----------------------------------------------------------------------------------------------
libretro-sameboy.mk 1dfcdffa712a9be821d084bd63a96e9d5e2fdd12 # Version: Commits on Jul 20, 2025
-----------------------------------------------------------------------------------------------
Properly handled Inbox and Boot ROMs in GBROMManager,

---------------------------------------------------------------------------------------------
libretro-vba-m.mk c98263603d8a11abe04d4e8fe99dce2331a36c4b # Version: Commits on Jul 20, 2025
---------------------------------------------------------------------------------------------
build: fix Mac build

Followup on 9d46f8e6 (build: fix Mac builder regression, 2025-07-20) to

add this `DIST_FLAGS` flag for bison as well, because it also uses this

header file.

Signed-off-by: Rafael Kitover <[email protected]>,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core player, where no other category fits A-rendering Area: Rendering & Graphics T-perf Type: Performance Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants