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

Switch from GLEW to epoxy #29

Closed
wants to merge 1 commit into from
Closed

Switch from GLEW to epoxy #29

wants to merge 1 commit into from

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Jun 28, 2018

This implements epoxy as backend for glo (which used to use GLEW).
As epoxy does not do context management, I decided to stick to glo (QEMU uses EGL exclusively)

I did not integrate epoxy directly in our codebase yet due to unfamiliarity with their API, and because I didn't want to delay fixing master.

The display flickers with Gtk, but works fine with SDL.
As I can't run XQEMU without this patch, I don't know if this change is responsible for that problem or not.


As I'm almost exclusively Linux (GLX) user. Therefore I depend on test results by macOS (CGL) and Windows (WGL) users.
Please confirm that XQEMU compiles and runs fine on those platforms with these changes.


TODO:

  • Wait for github support to switch upstream to xqemu/xqemu
  • Have people test on windows and macOS

if (strcmp(ext, ext_name) == 0) return true;
}
return false;
return epoxy_has_gl_extension(ext_name);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is bad


void gl_debug_frame_terminator(void)
{
if (has_GL_GREMEDY_frame_terminator) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check is negated

n = vsnprintf(buffer, sizeof(buffer), fmt, ap);
assert(n <= sizeof(buffer));
va_end(ap);

/* Check for errors before entering group */
assert(glGetError() == GL_NO_ERROR);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be part of the debug group already?

@illwieckz
Copy link

It works on my end, obsoleting xqemu/xqemu#13 and fixing xqemu/xqemu#53 and xqemu/xqemu#20

I tested it on this system:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04 LTS
Release:	18.04
Codename:	bionic

$ uname -a
Linux gollum 4.16.0-16.2-liquorix-amd64 #1 ZEN SMP PREEMPT liquorix 4.16-9.1~sid (2018-06-19) x86_64 x86_64 x86_64 GNU/Linux

$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: AMD Radeon (TM) R9 390 Series (HAWAII, DRM 3.23.0, 4.16.0-16.2-liquorix-amd64, LLVM 6.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.1.1 - padoka PPA
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 18.1.1 - padoka PPA
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.1.1 - padoka PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

$ dpkg -l | grep 'mesa.*-dev:\|epoxy.*-dev:'
ii  libegl1-mesa-dev:amd64                        18.1.1-0~b~padoka0                                                          amd64        free implementation of the EGL API -- development files
ii  libepoxy-dev:amd64                            1.4.3-1                                                                     amd64        OpenGL function pointer management library- development
ii  libgl1-mesa-dev:amd64                         18.1.1-0~b~padoka0                                                          amd64        free implementation of the OpenGL API -- GLX development files
ii  libgles2-mesa-dev:amd64                       18.1.1-0~b~padoka0                                                          amd64        free implementation of the OpenGL|ES 2.x API -- development files
ii  libglu1-mesa-dev:amd64                        9.0.0-2.1build1                                                             amd64        Mesa OpenGL utility library -- development files
ii  mesa-common-dev:amd64                         18.1.1-0~b~padoka0                                                          amd64        Developer documentation for Mesa

@mborgerson
Copy link

Please add "-lepoxy" on line ./configure line 2951 such that:

if test "$darwin" = "yes" ; then
    sdl_libs="$sdl_libs -framework OpenGL -lepoxy"
...

@JayFoxRox
Copy link
Owner Author

  • Added -lepoxy as requestd by @mborgerson
  • Split debugging into Check for GL debug extensions before use #30 because I don't currently have time to test it and it's really a seperate change (I'm fine with merging it into this one if users report problems, otherwise I'll send it shortly after this one)
  • Also running CI now (which is slightly misconfigured)

@mborgerson
Copy link

Appears to be crashing in Windows for unknown reasons. Needs further investigation before merging.

@JayFoxRox JayFoxRox changed the title epoxy backend for glo and check for GL debug extensions Switch from GLEW to epoxy Jun 29, 2018
@JayFoxRox
Copy link
Owner Author

JayFoxRox commented Jun 29, 2018

Moved to JayFoxRox/xqemu#1 to kickoff another CI.
I'll integrate all reports from this one in the new repo and make sure the existing review / testing is not forgotten in upstream PR.

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

Successfully merging this pull request may close these issues.

3 participants