Description
Description
In my game GnollHack, I have a specialized drawing function called DrawTileWithRadialTransparency that uses SkiaSharp to draw radial transparency for a bitmap. The function works always (on all platforms and in both Xamarin and MAUI), except for MAUI in Android in release mode when EnableLLVM is set to true and AndroidEnableProfileAot set to false, in which case it either does not draw anything or draws something in the wrong place with a wrong size. This seems to be some sort of an LLVM code generation bug, as the behavior makes otherwise little sense (it feels like the program does not do what is instructed in the code). Not sure why the problems occur just with this function, although it is a bit more complicated than the other ones. If I comment some parts of the code out (e.g. the unsafe block) or add something, the function most often still does not work as intended.
Reproduction Steps
- Clone the reproduction repository at https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild
- Open GnollHackM solution
- Build it for Android in Release configuration according to instructions in the repository
- Note that EnableLLVM is on.
- Start the app on your Android device
- Press Settings button and switch Developer Mode on in System section, then press Close
- Switch on Wizard Mode
- Press Play Game, create a character and start playing
- Press More Commands button on bottom right corner, and scroll then left to Wizard Mode Commands
- Select Genesis and type yellow light
- A yellow light monster appears, but it has no graphics
- Quit the game and exit app
- Switch EnableLLVM to off and AndroidEnableProfiledAot to true.
- Go to step 3. In step 11, note that the yellow light has now graphics.
Expected behavior
Radial transparency function works with Android Release mode with EnableLLVM = true just like in every other case.
Actual behavior
The drawn picture either is not drawn or is drawn in the wrong position with the wrong size.
Regression?
Not sure. This is an LLVM problem.
Known Workarounds
None. Cannot use LLVM if I want to use the function in question.
Configuration
.NET 9.0.3, .NET MAUI 9.0.50, SkiaSharp 3.116.1
Android 15, ARM64
Other information
No response