gl4es icon indicating copy to clipboard operation
gl4es copied to clipboard

BadWindow error with some apps

Open zhenyolka opened this issue 7 years ago • 5 comments

Hello! I run gl4es on top of swiftshader libraries. Apps like Chocolate Doom, xfce4 works fine, but glxgears, glxinfo, vivaldi browser and maybe other apps dont work. gl4es shows me BadWindow error in log.

As Xorg server i tried to use VcXsrv, android Xsdl and Xvfb.

$ glxinfo

LIBGL: Initialising gl4es LIBGL: v1.1.1 built on Dec 29 2018 12:40:14 LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 32 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 32 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6 LIBGL: Extension GL_EXT_texture_filter_anisotropic detected and used LIBGL: Max Anisotropic filtering: 16 LIBGL: Hardware vendor is Google Inc. LIBGL: Targeting OpenGL 2.0 LIBGL: glX Will try to recycle EGL Surface LIBGL: Current folder is:/home/evgeniy/gl4es Error: unable to open display evgeniy@localhost:~/gl4es$ DISPLAY=:0 glxinfo LIBGL: Initialising gl4es LIBGL: v1.1.1 built on Dec 29 2018 12:40:14 LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 32 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 32 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6 LIBGL: Extension GL_EXT_texture_filter_anisotropic detected and used LIBGL: Max Anisotropic filtering: 16 LIBGL: Hardware vendor is Google Inc. LIBGL: Targeting OpenGL 2.0 LIBGL: glX Will try to recycle EGL Surface LIBGL: Current folder is:/home/evgeniy/gl4es name of display: :0 X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 3 (X_GetWindowAttributes) Resource id in failed request: 0x400002 Serial number of failed request: 7 Current serial number in output stream: 8

zhenyolka avatar Dec 29 '18 08:12 zhenyolka

Are you sure ChocolateDoom and xfce4 use opengl? I think fo now gl4es doesn't work for you on all apps.

I need more logs, please uncomment line 36 of src/glx/glx.c to have more details on the interaction with X Server.

I see EGL is working because gl4es can check some hardware capabilities. I think you can have some stuffs on screen using LIBGL_FB=3 export (but it may be a bit slow). Try also with LIBGL_FB=1 to have fullscreen (using Xvfb I guess).

ptitSeb avatar Dec 29 '18 09:12 ptitSeb

I sure xfce4 and ChocolateDoom use opengl(i see in command output log of gl4es).

This is log without any environment variables: evgeniy@localhost:~$ glxinfo LIBGL: Initialising gl4es LIBGL: v1.1.1 built on Dec 29 2018 12:40:14 LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 32 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 32 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6 LIBGL: Extension GL_EXT_texture_filter_anisotropic detected and used LIBGL: Max Anisotropic filtering: 16 LIBGL: Hardware vendor is Google Inc. LIBGL: Targeting OpenGL 2.0 LIBGL: glX Will try to recycle EGL Surface LIBGL: Current folder is:/home/evgeniy name of display: :0 glXChooseVisual(0xb8e6b4d0, 0, 0xb7001120) glXChooseFBConfig(0xb8e6b4d0, 0, 0xbef62414, 0xbef62410) FBConfig redBits=1 FBConfig greenBits=1 FBConfig blueBits=1 FBConfig depthBits=1 FBConfig stencilBits=1 FBConfig doubleBufferMode=1 glXChooseFBConfig found 15 config glXChooseFBConfig(0xb8e6b4d0, 0, 0xbef6247c, 0xbef62440) FBConfig redBits=1 FBConfig greenBits=1 FBConfig blueBits=1 FBConfig doubleBufferMode=0 glXChooseFBConfig found 75 config glXQueryExtensionString(0xb8e6b4d0, 0) glXCreateContextAttribsARB(0xb8e6b4d0, 0xb6ecfb38, (nil), 1) config is RGBA:8880 , depth=0, stencil=0, drawable=5 => return 0xb8e75960 (context->shared=(nil)) glXIsDirect(0xb8e6b4d0, 0xb8e75960) glXGetVisualFromFBConfig(0xb8e6b4d0, 0xb6ecfb38) glXMakeCurrent(0xb8e6b4d0, 0x400002, 0xb8e75960), isPBuffer(drawable)=0, context ->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=0 X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 3 (X_GetWindowAttributes) Resource id in failed request: 0x400002 Serial number of failed request: 7 Current serial number in output stream: 8

With LIBGL_FB=3: evgeniy@localhost:~$ LIBGL_FB=3 glxinfo LIBGL: Initialising gl4es LIBGL: v1.1.1 built on Dec 29 2018 12:40:14 LIBGL: using pbuffer LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 32 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 32 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6 LIBGL: Extension GL_EXT_texture_filter_anisotropic detected and used LIBGL: Max Anisotropic filtering: 16 LIBGL: Hardware vendor is Google Inc. LIBGL: Targeting OpenGL 2.0 LIBGL: Current folder is:/home/evgeniy name of display: :0 glXChooseVisual(0xb75244d0, 0, 0xb6f3e120) glXChooseFBConfig(0xb75244d0, 0, 0xbec46404, 0xbec46400) FBConfig redBits=1 FBConfig greenBits=1 FBConfig blueBits=1 FBConfig depthBits=1 FBConfig stencilBits=1 FBConfig doubleBufferMode=1 glXChooseFBConfig found 0 config with PixMap, trying again with PBuffer Ошибка сегментирования(segfault)

zhenyolka avatar Dec 29 '18 13:12 zhenyolka

with LIBGL_FB=1: glxinfo LIBGL: Initialising gl4es LIBGL: v1.1.1 built on Dec 29 2018 12:40:14 LIBGL: framebuffer output enabled LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 32 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 32 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6 LIBGL: Extension GL_EXT_texture_filter_anisotropic detected and used LIBGL: Max Anisotropic filtering: 16 LIBGL: Hardware vendor is Google Inc. LIBGL: Targeting OpenGL 2.0 LIBGL: glXMakeCurrent FBO workaround enabled LIBGL: Current folder is:/home/evgeniy name of display: :0 glXChooseVisual(0xb744d4d0, 0, 0xb6f7b120) glXChooseFBConfig(0xb744d4d0, 0, 0xbee2c404, 0xbee2c400) FBConfig redBits=1 FBConfig greenBits=1 FBConfig blueBits=1 FBConfig depthBits=1 FBConfig stencilBits=1 FBConfig doubleBufferMode=1 glXChooseFBConfig found 15 config glXChooseFBConfig(0xb744d4d0, 0, 0xbee2c46c, 0xbee2c430) FBConfig redBits=1 FBConfig greenBits=1 FBConfig blueBits=1 FBConfig doubleBufferMode=0 glXChooseFBConfig found 75 config glXQueryExtensionString(0xb744d4d0, 0) glXCreateContextAttribsARB(0xb744d4d0, 0xb6e49b38, (nil), 1) config is RGBA:8880 , depth=0, stencil=0, drawable=5 => return 0xb7457960 (context->shared=(nil)) glXIsDirect(0xb744d4d0, 0xb7457960) glXGetVisualFromFBConfig(0xb744d4d0, 0xb6e49b38) glXMakeCurrent(0xb744d4d0, 0x400002, 0xb7457960), isPBuffer(drawable)=0, context ->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=0 X11 gives a size of desktop 1920x1080 for drawable 0x400002 X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 3 (X_GetWindowAttributes) Resource id in failed request: 0x0 Serial number of failed request: 7 Current serial number in output stream: 8

zhenyolka avatar Dec 29 '18 13:12 zhenyolka

Can i close this issue or you will answer?

zhenyolka avatar Jan 09 '19 07:01 zhenyolka

If it's still not working, don't close the issue.

I'm still unsure why it doesn't want to create that context. I need to think about it. I'll put a comment here when I have a new code to test.

ptitSeb avatar Jan 09 '19 11:01 ptitSeb