summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/util/u_debug.c2
-rw-r--r--src/glx/x11/dri2_glx.c2
-rw-r--r--src/glx/x11/dri_glx.c2
-rw-r--r--src/glx/x11/drisw_glx.c2
-rw-r--r--src/glx/x11/glxclient.h2
-rw-r--r--src/glx/x11/glxext.c6
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c24
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c12
8 files changed, 45 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index a5ca0b72bd7..96d400c839b 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -143,11 +143,9 @@ void _debug_vprintf(const char *format, va_list ap)
#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
/* TODO */
#else /* !PIPE_SUBSYSTEM_WINDOWS */
-#ifdef DEBUG
fflush(stdout);
vfprintf(stderr, format, ap);
#endif
-#endif
}
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index f4865aecb1c..54add049ff2 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -488,6 +488,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
+ psc->driver_configs = driver_configs;
+
psp->destroyScreen = dri2DestroyScreen;
psp->createContext = dri2CreateContext;
psp->createDrawable = dri2CreateDrawable;
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index ac2eb05341a..d24471c4369 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -418,6 +418,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
+ psc->driver_configs = driver_configs;
+
/* Visuals with depth != screen depth are subject to automatic compositing
* in the X server, so DRI1 can't render to them properly. Mark them as
* non-conformant to prevent apps from picking them up accidentally.
diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index 1c229dde900..15e15866582 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -401,7 +401,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
- free(driver_configs);
+ psc->driver_configs = driver_configs;
psp->destroyScreen = driDestroyScreen;
psp->createContext = driCreateContext;
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index aff1c85fba1..09db8ea6a63 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -499,6 +499,8 @@ struct __GLXscreenConfigsRec {
__GLXDRIscreen *driScreen;
+ const __DRIconfig** driver_configs;
+
#ifdef __DRI_COPY_SUB_BUFFER
const __DRIcopySubBufferExtension *driCopySubBuffer;
#endif
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index e07ed29790c..c6ab4b5890d 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -149,6 +149,12 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
Xfree((char *) psc->serverGLXexts);
#ifdef GLX_DIRECT_RENDERING
+ if (psc->driver_configs) {
+ for(unsigned int i = 0; psc->driver_configs[i]; i++)
+ free((__DRIconfig*)psc->driver_configs[i]);
+ free(psc->driver_configs);
+ psc->driver_configs = NULL;
+ }
if (psc->driScreen) {
psc->driScreen->destroyScreen(psc);
__glxHashDestroy(psc->drawHash);
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 668acbccb88..8a8c99f7e17 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -280,7 +280,11 @@ clear_with_quad(GLcontext *ctx,
static INLINE GLboolean
check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
{
- if (ctx->Scissor.Enabled)
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
return TRUE;
if (!ctx->Color.ColorMask[0] ||
@@ -300,7 +304,11 @@ check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
GLboolean maskStencil
= (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
- if (ctx->Scissor.Enabled)
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
return TRUE;
if (maskStencil)
@@ -319,7 +327,11 @@ check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
const struct st_renderbuffer *strb = st_renderbuffer(rb);
const GLboolean isDS = pf_is_depth_and_stencil(strb->surface->format);
- if (ctx->Scissor.Enabled)
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
return TRUE;
if (isDS &&
@@ -345,7 +357,11 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
if (maskStencil)
return TRUE;
- if (ctx->Scissor.Enabled)
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
return TRUE;
/* This is correct, but it is necessary to look at the depth clear
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 8ceeeabcd37..1329f807bc9 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -161,4 +161,16 @@ void st_init_flush_functions(struct dd_function_table *functions)
{
functions->Flush = st_glFlush;
functions->Finish = st_glFinish;
+
+ /* Windows opengl32.dll calls glFinish prior to every swapbuffers.
+ * This is unnecessary and degrades performance. Luckily we have some
+ * scope to work around this, as the externally-visible behaviour of
+ * Finish() is identical to Flush() in all cases - no differences in
+ * rendering or ReadPixels are visible if we opt not to wait here.
+ *
+ * Only set this up on windows to avoid suprise elsewhere.
+ */
+#ifdef PIPE_OS_WINDOWS
+ functions->Finish = st_glFlush;
+#endif
}