From 773c53d82eb92a0eb5d32c800d9272d07763a4c0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 3 Jun 2014 21:12:49 +0100 Subject: [PATCH] Use the same FBConfig for both the pbuffer and context, else it might fail --- renderdoc/driver/gl/gl_replay_linux.cpp | 27 ++++++++----------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/renderdoc/driver/gl/gl_replay_linux.cpp b/renderdoc/driver/gl/gl_replay_linux.cpp index 5cadbe77a..421882faf 100644 --- a/renderdoc/driver/gl/gl_replay_linux.cpp +++ b/renderdoc/driver/gl/gl_replay_linux.cpp @@ -85,25 +85,6 @@ uint64_t GLReplay::MakeOutputWindow(void *wn, bool depth) if(dpy == NULL) return 0; - - // don't need to care about the fb config as we won't be using the default framebuffer (backbuffer) - static int visAttribs[] = { 0 }; - int numCfgs = 0; - GLXFBConfig *fbcfg = glXChooseFBConfigProc(dpy, DefaultScreen(dpy), visAttribs, &numCfgs); - - if(fbcfg == NULL) - { - XCloseDisplay(dpy); - RDCERR("Couldn't choose default framebuffer config"); - return 0; - } - - // don't care about pbuffer properties for same reason as backbuffer - int pbAttribs[] = { GLX_PBUFFER_WIDTH, 32, GLX_PBUFFER_HEIGHT, 32, 0 }; - - wnd = glXCreatePbufferProc(dpy, fbcfg[0], pbAttribs); - - XFree(fbcfg); } static int visAttribs[] = { @@ -147,6 +128,14 @@ uint64_t GLReplay::MakeOutputWindow(void *wn, bool depth) return 0; } + if(wnd == 0) + { + // don't care about pbuffer properties as we won't render directly to this + int pbAttribs[] = { GLX_PBUFFER_WIDTH, 32, GLX_PBUFFER_HEIGHT, 32, 0 }; + + wnd = glXCreatePbufferProc(dpy, fbcfg[0], pbAttribs); + } + XFree(fbcfg); OutputWindow win;