Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(SDL) Invisible window with EGL and OpenGL #11637

Closed
orbea opened this issue Dec 4, 2018 · 17 comments
Closed

(SDL) Invisible window with EGL and OpenGL #11637

orbea opened this issue Dec 4, 2018 · 17 comments

Comments

@orbea
Copy link
Contributor

orbea commented Dec 4, 2018

What happens?

When using the SDL2 frontend with -DUSING_EGL=ON and OpenGL or OpenGL ES ppsspp will immediately open an invisible window which only shows a static image of the desktop (i.e. the terminal used to open ppsspp). I am not sure if its frozen or only not rendering correctly and it can be closed normally with a kill -3 (SIGQUIT).

This is not a problem when using the SDL2 frontend with vulkan and its not a problem when using the Qt frontend.

ppsspp + EGL + OpenGL / OpenGL ES
1

I built with debugging symbols and used gdb where I pressed ctrl+c while it was open, I am not sure which thread is the useful one if any?

Reading symbols from ./PPSSPPSDL...done.
(gdb) r
Starting program: /media/gittings/forks/ppsspp/build/PPSSPPSDL 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff0cb8700 (LWP 7454)]
[Thread 0x7ffff0cb8700 (LWP 7454) exited]
[New Thread 0x7ffff0cb8700 (LWP 7455)]
[New Thread 0x7fffea839700 (LWP 7456)]
[New Thread 0x7fffea038700 (LWP 7457)]
[New Thread 0x7fffe9837700 (LWP 7458)]
[New Thread 0x7fffe9036700 (LWP 7459)]
[New Thread 0x7fffe8835700 (LWP 7460)]
[New Thread 0x7fffd3fff700 (LWP 7461)]
[New Thread 0x7fffcbfff700 (LWP 7462)]
[New Thread 0x7fffd37fe700 (LWP 7463)]
[New Thread 0x7fffd2bfd700 (LWP 7464)]
[Thread 0x7fffd2bfd700 (LWP 7464) exited]
[New Thread 0x7fffd2bfd700 (LWP 7465)]
[Thread 0x7fffd2bfd700 (LWP 7465) exited]
[New Thread 0x7fffd2bfd700 (LWP 7466)]
41:33:281 Core/Config.cpp:1089 I[LOADER]: Loading controller config: /home/orbea/.config/ppsspp/PSP/SYSTEM/controls.ini
41:33:305 UI/NativeApp.cpp:357 W[LOADER]: Not checking for failed graphics backends in debug mode
[New Thread 0x7fffd21d8700 (LWP 7467)]
[Thread 0x7fffd21d8700 (LWP 7467) exited]
[New Thread 0x7fffd21d8700 (LWP 7468)]
[Thread 0x7fffd21d8700 (LWP 7468) exited]
[New Thread 0x7fffd21d8700 (LWP 7469)]
[New Thread 0x7fffd19d7700 (LWP 7470)]
[New Thread 0x7fffd0fc3700 (LWP 7471)]
I: VulkanLoader.cpp:290: Vulkan test instance created successfully.
I: VulkanLoader.cpp:326: Found working Vulkan API!
Vulkan might be available.
D: zip_read.cpp:267: D: Registered VFS for prefix : /media/gittings/forks/ppsspp/build/assets/
D: zip_read.cpp:267: D: Registered VFS for prefix : /media/gittings/forks/ppsspp/build/
D: zip_read.cpp:267: D: Registered VFS for prefix : /usr/share/ppsspp/assets/
D: zip_read.cpp:267: D: Registered VFS for prefix : assets/
D: zip_read.cpp:267: D: Registered VFS for prefix : /home/orbea/
I: Config.cpp:490: Longest display side: -1 pixels. Choosing scale 1
Pixels: 960 x 544
Virtual pixels: 960 x 544
ERROR: EGL Error detected in file /home/orbea/gittings/forks/ppsspp/SDL/SDLGLGraphicsContext.cpp at line 187: EGL_BAD_ALLOC (0x3003)
EGL ERROR: Unable to create EGL surface!
OpenGL 2.0 or higher.
I: gpu_features.cpp:181: GPU Vendor : X.Org ; renderer: Radeon RX Vega (VEGA10, DRM 3.27.0, 4.19.5, LLVM 7.0.0) version str: 4.5 (Core Profile) Mesa 19.0.0-devel (git-94bfb8bf38) ; GLSL version str: 4.50
D: gpu_features.cpp:99: D: Checking for GL driver bugs... vendor=0 model='Radeon RX Vega (VEGA10, DRM 3.27.0, 4.19.5, LLVM 7.0.0)'
D: thin3d_gl.cpp:235: D: Shader module created (0x202a030)
D: thin3d_gl.cpp:235: D: Shader module created (0x20147f0)
D: thin3d_gl.cpp:235: D: Shader module created (0x2013030)
D: thin3d_gl.cpp:235: D: Shader module created (0x2003f00)
E: SDLMain.cpp:575: Output audio samples: 940 (requested: 2048)
loading control pad mappings from gamecontrollerdb.txt: SUCCESS!
found control pad: Sony PLAYSTATION(R)3 Controller, loading mapping: SUCCESS, mapping is:
030000004c0500006802000011810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
pad 1 has been assigned to control pad: Sony PLAYSTATION(R)3 Controller
[New Thread 0x7fffcb7fe700 (LWP 7472)]
[New Thread 0x7fffcaffd700 (LWP 7473)]
41:33:356 UI/DiscordIntegration.cpp:55 I[SYSTEM]: Discord connection initialized
[New Thread 0x7fffca7fc700 (LWP 7474)]
I: NativeApp.cpp:758: NativeInitGraphics
I: NativeApp.cpp:835: NativeInitGraphics completed
found control pad: Sony PLAYSTATION(R)3 Controller, loading mapping: SUCCESS, mapping is:
030000004c0500006802000011810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
41:33:531 Core/Config.cpp:1175 I[LOADER]: Config saved: '/home/orbea/.config/ppsspp/PSP/SYSTEM/ppsspp.ini'
41:33:531 Core/Config.cpp:1188 I[LOADER]: Controller config saved: /home/orbea/.config/ppsspp/PSP/SYSTEM/controls.ini

Thread 1 "PPSSPPSDL" received signal SIGINT, Interrupt.
0x00007ffff6c99f90 in nanosleep () from /lib64/libc.so.6
(gdb) thread apply all bt

Thread 22 (Thread 0x7fffca7fc700 (LWP 7474)):
#0  0x00007ffff7f81817 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00000000004f6c5a in __gthread_cond_timedwait (__cond=0x7fffb0000fd0, 
    __mutex=0x7fffb0000fa8, __abs_timeout=0x7fffca7fb890)
    at /usr/include/c++/8.2.0/x86_64-slackware-linux/bits/gthr-default.h:871
#2  0x00000000004f833b in std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > > (this=0x7fffb0000fd0, __lock=..., 
    __atime=...) at /usr/include/c++/8.2.0/condition_variable:178
#3  0x00000000004f7921 in std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > > (this=0x7fffb0000fd0, __lock=..., 
    __atime=...) at /usr/include/c++/8.2.0/condition_variable:106
#4  0x00000000004f7252 in std::condition_variable::wait_for<long, std::ratio<1l, 1000l> > (this=0x7fffb0000fd0, __lock=..., __rtime=...)
    at /usr/include/c++/8.2.0/condition_variable:143
#5  0x0000000000f6262a in IoThreadHolder::Start()::{lambda()#1}::operator()() const (__closure=0x7fffb0000e78)
    at /home/orbea/gittings/forks/ppsspp/ext/discord-rpc/src/discord_rpc.cpp:95
#6  0x0000000000f63ab3 in std::__invoke_impl<void, IoThreadHolder::Start()::{lambda()#1}>(std::__invoke_other, IoThreadHolder::Start()::{lambda()#1}&&) (__f=...)
    at /usr/include/c++/8.2.0/bits/invoke.h:60
#7  0x0000000000f62e04 in std::__invoke<IoThreadHolder::Start()::{lambda()#1}>(std::__invoke_result&&, (IoThreadHolder::Start()::{lambda()#1}&&)...) (__fn=...)
    at /usr/include/c++/8.2.0/bits/invoke.h:95
#8  0x0000000000f64576 in std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x7fffb0000e78)
    at /usr/include/c++/8.2.0/thread:234
#9  0x0000000000f6454c in std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> >::operator()() (this=0x7fffb0000e78)
    at /usr/include/c++/8.2.0/thread:243
#10 0x0000000000f64530 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> > >::_M_run() (this=0x7fffb0000e70)
    at /usr/include/c++/8.2.0/thread:186
#11 0x00007ffff7004b1f in ?? () from /usr/lib64/libstdc++.so.6
#12 0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#13 0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 21 (Thread 0x7fffcaffd700 (LWP 7473)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007ffff6fff3cc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib64/libstdc++.so.6
#2  0x00000000009703d5 in PrioritizedWorkQueue::Pop (this=0x7fffb00016a0)
    at /home/orbea/gittings/forks/ppsspp/ext/native/thread/prioritizedworkqueue.cpp:83
#3  0x000000000097058b in threadfunc (wq=0x7fffb00016a0)
    at /home/orbea/gittings/forks/ppsspp/ext/native/thread/prioritizedworkqueue.cpp:117
#4  0x00000000009705fd in <lambda()>::operator()(void) const (
    __closure=0x7fffb0001788)
    at /home/orbea/gittings/forks/ppsspp/ext/native/thread/prioritizedworkqueue.cpp:129
#5  0x000000000097089d in std::__invoke_impl<void, ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue*)::<lambda()> >(std::__invoke_other, <lambda()> &&) (__f=...)
    at /usr/include/c++/8.2.0/bits/invoke.h:60
#6  0x00000000009706de in std::__invoke<ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue*)::<lambda()> >(<lambda()> &&) (__fn=...)
    at /usr/include/c++/8.2.0/bits/invoke.h:95
#7  0x0000000000970a8e in std::thread::_Invoker<std::tuple<ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue*)::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>)
    (this=0x7fffb0001788) at /usr/include/c++/8.2.0/thread:234
#8  0x0000000000970a64 in std::thread::_Invoker<std::tuple<ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue*)::<lambda()> > >::operator()(void) (
    this=0x7fffb0001788) at /usr/include/c++/8.2.0/thread:243
#9  0x0000000000970a48 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue*)::<lambda()> > > >::_M_run(void) (this=0x7fffb0001780) at /usr/include/c++/8.2.0/thread:186
#10 0x00007ffff7004b1f in ?? () from /usr/lib64/libstdc++.so.6
#11 0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#12 0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 20 (Thread 0x7fffcb7fe700 (LWP 7472)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007ffff6fff3cc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib64/libstdc++.so.6
#2  0x000000000094680c in GLRenderManager::BeginFrame (this=0x207dee0)
    at /home/orbea/gittings/forks/ppsspp/ext/native/thin3d/GLRenderManager.cpp:401
#3  0x000000000093de56 in Draw::OpenGLContext::BeginFrame (this=0x207deb0)
    at /home/orbea/gittings/forks/ppsspp/ext/native/thin3d/thin3d_gl.cpp:537
#4  0x000000000097b44c in UIScreen::preRender (this=0x7fffb0007330)
    at /home/orbea/gittings/forks/ppsspp/ext/native/ui/ui_screen.cpp:80
#5  0x0000000000975a0d in ScreenManager::render (this=0x1bb9690)
    at /home/orbea/gittings/forks/ppsspp/ext/native/ui/screen.cpp:144
#6  0x0000000000435102 in NativeRender (graphicsContext=0x1ba59a0)
    at /home/orbea/gittings/forks/ppsspp/UI/NativeApp.cpp:979
#7  0x00000000004f65a2 in UpdateRunLoop ()
    at /home/orbea/gittings/forks/ppsspp/Core/Core.cpp:199
#8  0x0000000000900e07 in EmuThreadFunc (graphicsContext=0x1ba59a0)
    at /home/orbea/gittings/forks/ppsspp/SDL/SDLMain.cpp:309
#9  0x000000000090491e in std::__invoke_impl<void, void (*)(GraphicsContext*), GraphicsContext*> (__f=@0x20e2a10: 0x900dbd <EmuThreadFunc(GraphicsContext*)>, 
    __args#0=@0x20e2a08: 0x1ba59a0) at /usr/include/c++/8.2.0/bits/invoke.h:60
#10 0x000000000090455d in std::__invoke<void (*)(GraphicsContext*), GraphicsContext*> (__fn=@0x20e2a10: 0x900dbd <EmuThreadFunc(GraphicsContext*)>, 
    __args#0=@0x20e2a08: 0x1ba59a0) at /usr/include/c++/8.2.0/bits/invoke.h:95
#11 0x0000000000905311 in std::thread::_Invoker<std::tuple<void (*)(GraphicsContext*), GraphicsContext*> >::_M_invoke<0ul, 1ul> (this=0x20e2a08)
    at /usr/include/c++/8.2.0/thread:234
#12 0x00000000009052cc in std::thread::_Invoker<std::tuple<void (*)(GraphicsContext*), GraphicsContext*> >::operator() (this=0x20e2a08)
    at /usr/include/c++/8.2.0/thread:243
#13 0x00000000009052b0 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(GraphicsContext*), GraphicsContext*> > >::_M_run (this=0x20e2a00)
    at /usr/include/c++/8.2.0/thread:186
#14 0x00007ffff7004b1f in ?? () from /usr/lib64/libstdc++.so.6
#15 0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#16 0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 19 (Thread 0x7fffd0fc3700 (LWP 7471)):
#0  0x00007ffff6cc9329 in poll () from /lib64/libc.so.6
#1  0x00007ffff534e120 in ?? () from /usr/lib64/libasound.so.2
#2  0x00007ffff5352dec in ?? () from /usr/lib64/libasound.so.2
#3  0x00007ffff535de82 in snd_pcm_mmap_writei () from /usr/lib64/libasound.so.2
#4  0x00007ffff7effa77 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#5  0x00007ffff7e5d6c2 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#6  0x00007ffff7ea79ac in ?? () from /usr/lib64/libSDL2-2.0.so.0
#7  0x00007ffff7f13d09 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#8  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#9  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 18 (Thread 0x7fffd19d7700 (LWP 7470)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 17 (Thread 0x7fffd21d8700 (LWP 7469)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 14 (Thread 0x7fffd2bfd700 (LWP 7466)):
#0  0x00007ffff7f85190 in nanosleep () from /lib64/libpthread.so.0
#1  0x00007ffff7f18795 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#2  0x00007ffff7effd37 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#3  0x00007ffff7ea79ac in ?? () from /usr/lib64/libSDL2-2.0.so.0
#4  0x00007ffff7f13d09 in ?? () from /usr/lib64/libSDL2-2.0.so.0
#5  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#6  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7fffd37fe700 (LWP 7463)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7fffcbfff700 (LWP 7462)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7fffd3fff700 (LWP 7461)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7fffe8835700 (LWP 7460)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7fffe9036700 (LWP 7459)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7fffe9837700 (LWP 7458)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7fffea038700 (LWP 7457)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fffea839700 (LWP 7456)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7ffff0cb8700 (LWP 7455)):
#0  0x00007ffff7f812a3 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00007fffeacb3f8b in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#2  0x00007fffeacb3d57 in ?? () from /usr/lib64/xorg/modules/dri/radeonsi_dri.so
#3  0x00007ffff7f7b107 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff6cd5b0f in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ffff5e86bc0 (LWP 7450)):
#0  0x00007ffff6c99f90 in nanosleep () from /lib64/libc.so.6
#1  0x00007ffff6ccbec7 in usleep () from /lib64/libc.so.6
#2  0x000000000090b81e in sleep_ms (ms=16)
    at /home/orbea/gittings/forks/ppsspp/ext/native/base/timeutil.cpp:83
#3  0x0000000000902982 in main (argc=1, argv=0x7fffffffe208)
    at /home/orbea/gittings/forks/ppsspp/SDL/SDLMain.cpp:866

What should happen?

ppsspp should render normally with -DUSING_EGL=ON.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

OS: Slackware64-current
Linux: 4.19.5
ppsspp: 80e7f08
mesa: https://github.com/mesa3d/mesa/commit/94bfb8bf386b560e8e6095727ed1cf08522a027d
SDL: 2.0.9
xorg: https://cgit.freedesktop.org/xorg/xserver/commit/?id=82f8cf8990009f6cac567814dd6b7fd41cfad82d
window manager: conformal/spectrwm@b365987
GPU: AMD RX Vega 56 (amdgpu + radeonsi)

$ glxinfo | grep -e Core -e GLES
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.0.0-devel (git-94bfb8bf38)
@orbea
Copy link
Contributor Author

orbea commented Dec 4, 2018

From the log I think this is the issue.

ERROR: EGL Error detected in file /home/orbea/gittings/forks/ppsspp/SDL/SDLGLGraphicsContext.cpp at line 187: EGL_BAD_ALLOC (0x3003)
EGL ERROR: Unable to create EGL surface!
OpenGL 2.0 or higher.
I: gpu_features.cpp:181: GPU Vendor : X.Org ; renderer: Radeon RX Vega (VEGA10, DRM 3.27.0, 4.19.5, LLVM 7.0.0) version str: 4.5 (Core Profile) Mesa 19.0.0-devel (git-94bfb8bf38) ; GLSL version str: 4.50
D: gpu_features.cpp:99: D: Checking for GL driver bugs... vendor=0 model='Radeon RX Vega (VEGA10, DRM 3.27.0, 4.19.5, LLVM 7.0.0)'

I certainly have higher than OpenGL 2.0 so...

@unknownbrackets
Copy link
Collaborator

Do you have USING_FBDEV? This might just be a configuration issue:

https://github.com/hrydgard/ppsspp/blob/master/SDL/SDLGLGraphicsContext.cpp#L177

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Dec 4, 2018

No difference with or without -DUSING_FBDEV=ON.

From CMakeCache.txt

//Set to ON if target environment uses EGL
USING_EGL:BOOL=ON

//Set to ON if target environment uses fbdev (eg. Pandora)
USING_FBDEV:BOOL=ON

Note I reproduced this when using only cmake -DUSING_EGL=ON ...

@orbea
Copy link
Contributor Author

orbea commented Dec 5, 2018

I'm just shooting in the dark, but maybe its choosing the wrong EGL config?

See this commit that fixed an issue like that in kmscube.
https://cgit.freedesktop.org/mesa/kmscube/commit/?id=56c3917ffd1f05942246e2532ca4a5707554a2fc

Also another unfixed issue in RetroArch.
libretro/RetroArch#7119

Is this the right direction?

@unknownbrackets
Copy link
Collaborator

You can try tweaking the weights above:

https://github.com/hrydgard/ppsspp/blob/master/SDL/SDLGLGraphicsContext.cpp#L140

But ultimately it is only going to pick a config your device says is available. Be warned: the current weight based approach fixed issues a lot of people were having on embedded devices.

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Dec 5, 2018

The problem was that mesa added more formats and where before it would just happen to work, now it actually needs to iterate through the possible formats and choose the right one.

This comment explains it well.
libretro/RetroArch#7119 (comment)

Honestly I'm not sure how to implement this or the RetroArch issue would have been solved already...

@unknownbrackets
Copy link
Collaborator

Looping through the exposed EGL formats is exactly what the code I linked to does. It scores each possible format and picks the one with the best score.

Maybe this extension needs to be used? I know nothing about GBM.

https://www.khronos.org/registry/EGL/extensions/MESA/EGL_MESA_platform_gbm.txt

-[Unknown]

@unknownbrackets
Copy link
Collaborator

The change in #11839 might help if it's just about formats.

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Feb 26, 2019

I'll assume they were merged in #11845, unfortunately the master still seems to show the same behavior.

@unknownbrackets
Copy link
Collaborator

I think there were a few more changes recently, see here:
https://github.com/hrydgard/ppsspp/commits/master/SDL/SDLGLGraphicsContext.cpp

Has this improved the issue at all?

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Aug 17, 2019

The original issue seems fixed, but it does not seem possible to use OpenGL and not GLES with -DUSING_EGL=ON?

@orbea orbea closed this as completed Aug 17, 2019
@unknownbrackets
Copy link
Collaborator

Hm, it should work as long as USING_GLES2 is not defined.

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Aug 17, 2019

I intentionally used cmake -DUSING_GLES2=OFF -DUSING_EGL=ON and ppsspp when starting printed OpenGL ES instead of OpengGL like my normal build.

@unknownbrackets
Copy link
Collaborator

Well, it looks at the available contexts your device provides, and picks among them:

bool renderableGL = (renderable & EGL_OPENGL_BIT) != 0;

If the best context happens to be GLES, it'll use that.

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Aug 18, 2019

I would expect an OpenGL 4.5 core profile to be preferable?

@unknownbrackets
Copy link
Collaborator

Well, if you only have HDR contexts that don't support depth buffers with OpenGL 4.5 Core, but you have a perfect RGBA 8/8/8/8 profile with 24 bit depth that has GLES 3.0, we'll go with GLES 3.0. We get a list of options from your card, and OpenGL desktop support is not the only variable.

You can try listing what your device is offering, to see. We'd rather give you working GLES than unusable OpenGL.

-[Unknown]

@orbea
Copy link
Contributor Author

orbea commented Aug 18, 2019

I'm not sure how to check this on my system, but the mesa matrix should give a pretty good idea of what my card supports. Look under AMD/radeonsi.

https://mesamatrix.net/

It seems I should have complete support up to OpenGL 4.5 and OpenGL ES 3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants