gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
770 stars 177 forks source link

Segfault when calling glTexImage2DMultisample using EGL and GLES2 #2624

Open mrfixit2001 opened 2 years ago

mrfixit2001 commented 2 years ago

Everything works fine with multisampling disabled, but with it enabled a segfault occurs.

GDB trace: https://dpaste.com/6ZZR7ANSL

I can confirm removing this line fixes the segfault, of course then the graphics are screwed up haha https://github.com/gonetz/GLideN64/blob/master/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp#L72

Possibly some functions got missed in initGLFunctions for EGL? I tried adding the TexImage2DMultisample call in for EGL but it did not resolve the issue.

fzurita commented 2 years ago

If I remember correctly, you need GLES 3.0 minimum for multi sampling.

fzurita commented 2 years ago

Yeah, according to this: https://khronos.org/registry/OpenGL-Refpages/es3.1/html/glTexStorage2DMultisample.xhtml

glTexStorage2DMultisample only became part of the base GLES API on GLES 3.1. Older versions may support it through extensions.

mrfixit2001 commented 2 years ago

I do see the gles2 ext header including these options: glTexStorageMem2DMultisampleEXT glTextureStorageMem2DMultisampleEXT Pretty sure those are essentially the same, but their parameters are slightly different than glTexImage2DMultisample - which would make implementing them more complicated.

More importantly, multisampling gles2 is currently working on both the Gles2n64 and rice cores. So it’s definitely implementable. At a glance I don’t see either core calling any of these functions, just setting the core setting. Hmm

Sent from my iPhone

On Dec 18, 2021, at 7:15 AM, Francisco Zurita @.***> wrote:

 Yeah, according to this: https://khronos.org/registry/OpenGL-Refpages/es3.1/html/glTexStorage2DMultisample.xhtml

glTexStorage2DMultisample only became part of the base GLES API on GLES 3.1. Older versions may support it through extensions.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.