openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
749 stars 359 forks source link

is there a way to do this? #1808

Closed moha-compiler closed 6 days ago

moha-compiler commented 1 week ago

is there a way to use virgl or turnip instead of llvm while compiling to android cuz llvm is too slow and it s the cause of most games like haxeflixel's ones

player-03 commented 1 week ago

I'm pretty sure both of those are 3D libraries/drivers, meaning they aren't alternatives to LLVM. In fact, LLVM is required by modern versions of the Android NDK. You can use GCC instead of LLVM by switching to NDK r15c or earlier, but that isn't going to help with whatever performance issue you're experiencing.

If VirGL or Turnip replace anything, they might replace OpenGL (or act as a layer on top of it in VirGL's case). There's been talk about potentially replacing OpenGL at some nebulous time in the future, but it isn't currently in the works.

moha-compiler commented 1 week ago

I'm pretty sure both of those are 3D libraries/drivers, meaning they aren't alternatives to LLVM. In fact, LLVM is required by modern versions of the Android NDK. You can use GCC instead of LLVM by switching to NDK r15c or earlier, but that isn't going to help with whatever performance issue you're experiencing.

If VirGL or Turnip replace anything, they might replace OpenGL (or act as a layer on top of it in VirGL's case). There's been talk about potentially replacing OpenGL at some nebulous time in the future, but it isn't currently in the works.

and is there no way to fix performance issue in android?

player-03 commented 1 week ago

You'd have to provide more information about the issue. Ideally, build a minimal sample showing the slowdown.

moha-compiler commented 1 week ago

You'd have to provide more information about the issue. Ideally, build a minimal sample showing the slowdown.

idk :( in android i think the problem is about rendering cuz when i use in haxeflixel a less number of sprites it got fast but it goes slower after adding more

player-03 commented 6 days ago

Ah, this is an issue of batching. Doesn't matter whether you use OpenGL, VirGL, Turnip, or anything else. All of them would perform badly with too many unbatched sprites, and all of them can handle thousands (if not millions) of batched sprites.

To get you started, OpenFL offers Tilemap by default, for simple sprite batching. If that's too restrictive, there's also Starling, though I don't know how well Flixel works with it. Also, someone might have made a Flixel-specific solution, so ask around in the Flixel community.