Support Java direct OpenGL rendering?

here’s log output from an attempt at launching:

and in terms of rendering, it uses a native cpp library under the hood, so as far as i can tell, we just pass the surface into the native library (via “newSurface”), and it takes it from there?

@simongellis maybe you could chime in, if/when you get a chance as to what the issue might be here

added some extra debug log statements in this commit:


the emulator is running, i can hear the audio and use the on-screen controls to press buttons,
i just can’t see anything! :smiley:

According to the log, there are no active InterlacedSurfaceView. That looks weird to me. Also, the log is not full. Please get the full log (from the app start to the end). And ideally as raw (unfiltered and with system logs) as possible.

1 Like

hopefully this is more helpful: Leia-Inc-LPD-20W-Android-12_2024-01-22_150027.logcat · GitHub

LeiaSurfaceView is a helper wrapper that extends InterlacedSurfaceView and is what is specified in layout fragment_emulation.xml as SurfaceEmulation

(i’ve squashed my commits for easier readability) Lp2 jan 2024 take2 by jakedowns · Pull Request #15 · jakedowns/citra · GitHub

I did not say you don’t have an InterlacedSurfaceView (ISV). I said there is no active ISV, meaning no ISV is visible and rendering.

And no the log is stripped anyway. Just send me a build please, I will get logs myself.

1 Like

(apk uploading to GDrive, get back to you soon)

more raw log in meantime: latest.log · GitHub

Updated @hshakula app-canary-relWithDebInfo.apk - Google Drive

Did renderdoc ever work for you with Citra?

i have not tried, but i can give it a shot

a follow-up question: citra supports opengl and vulkan
is it possible to pass a vulkan context to LeiaSDK? or is this getting into the realm of needing to dive into the c++ api?

i thought the vulkan stuff was more under-the-hood, and the Android app would still just be shuttling the final output to the surface via OGL, but it sounds like when that renderer is active, it’s vulkan all the way down?

fwiw, the black output surface is happening no matter which renderer i have activated in Settings > Graphics
also no matter which Stereoscopic 3D mode i select in that submenu

I’ve found the issue - apparently, SurfaceTexture needs the buffer size to be set explicitly. Quick debugging showed that here window_width/height is 1. When it’s expected to be 2560x1600. So adding surfaceTexture?.setDefaultBufferSize(2560, 1600) resolves the issue.

1 Like

oh goodness! gonna try this :crossed_fingers:

thanks for your continued support

You are passing neither OpenGL nor Vulkan stuff into LeiaSDK when rendering into a Surface. It’s totally abstracted away via the ANativeWindow interface. I just checked, Vulkan also works fine, as expected.

1 Like

it’s alive!!! and it looks glorious! thank you so so much for your patience and assistance tracking this down. i would’ve been at it for another week for sure!

beautiful, thanks so much. would you like a credit in the README? i could link to your github or something if you’d like.

time to show this build to Nima :smiley:

Why not - hshakula (George Shakula) · GitHub

What game are you using and settings? I did not manage to get proper stereo rendering

1 Like

don’t select Lume Pad as the option, select Side-By-Side
i need to remove those other two dummy options

if you do like 35-50% “depth” it’s working pretty well, but i need to add a good on-screen depth slider (which i have an old PR i need to dig up)


i’m getting 60fps with ogl and vulkan on new super mario bros 2, trying 3D world now, mario kart 7 keeps crashing with both renderers, i need to dig into why tomorrow

shovel knight is another good one that’s not very resource intensive and a good test

i should probably see about baking in some homebrew like @simongellis did with VVB so there’s at least something playable by default

1 Like

I was able to view in 3d now. But it behaves rather weirdly, it started from the default mode even though I selected stereoscopic before starting a game, only after pressing the back button it switched to stereoscopic.

1 Like

hmm… i haven’t experienced that, but i’ll keep an eye out
i’m going to update the release page today with a version that changes the defaults so, maybe that will help,
but you may have to uninstall / reinstall (and/or) delete the Citra folder that was selected when you first launched it