libretro / desmume

DeSmuME is a Nintendo DS emulator
http://desmume.org
GNU General Public License v2.0
35 stars 33 forks source link

OpenGL: Shaders are broken, Black screenshots. #2

Closed bearoso closed 6 years ago

bearoso commented 6 years ago

Probably has to do with OpenGL state from the core changing Retroarch's expectations.

inactive123 commented 6 years ago

That's odd, shaders seem to work fine for me on Windows 10.

bearoso commented 6 years ago

I think I fixed the shader issue. Screenshots still broken in OpenGL mode. (On Windows)

Tatsuya79 commented 6 years ago

Screenshots are working for me with GL rasterizer, 576p multisample, smoothing with a Lanczo shader pass+ DS colours on top. win7 x64 nvidia 770

bearoso commented 6 years ago

Screenshots only work when "Enable Hardware Shared Context" is enabled. Or basically when we're not concerned with OpenGL state between desmume and retroarch.

Some shaders are also broken without a separate context, for example try nedi/nedi.glslp.

I need to identify the state that's changing during desmume's possession of the context.

EDIT: I noticed, for example, that it's the last pass of the nedi preset that breaks rendering, but can't see what's so special about it, unless we're clobbering the uniforms somehow.

It’s not the last pass, it’s 4 passes that breaks something. 3 is fine.

bearoso commented 6 years ago

I'm forcing the separate context now, which in OpenGL circles is considered the correct solution anyway, so this is "fixed." I don't believe there's any extra copying going on, so it shouldn't be any slower. If it is, feel free to reopen and we'll track down the clobbered state.