diff options
author | Paul Berry <[email protected]> | 2013-05-30 07:08:07 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-06-07 13:26:36 -0700 |
commit | 03cc31031315059a80d12485a402ea2a8731dc8a (patch) | |
tree | e1328c769198d741d4aed38e48dcee054d502a08 /src/mesa/drivers | |
parent | bc8bfdc42cce18cf3a44f487b73460bebe8c2ae4 (diff) |
intel: make intel_flush_front safe to call during initial MakeCurrent
The patch that follows will fix a bug that prevents
intel_flush_front() from being called often enough. In doing so, it
will create a situation where intel_flush_front() is called during the
initial call to glXMakeCurrent(). In this circumstance,
ctx->DrawBuffer hasn't been initialized yet and is NULL. Fortunately,
intel->front_buffer_dirty is false, so intel_flush_front() doesn't
actually need to do anything. To avoid a segfault, swap the order of
terms in intel_flush_front()'s if statement.
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 8c88b3ca2f7..54d0a69edc7 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -132,7 +132,7 @@ intel_flush_front(struct gl_context *ctx) __DRIdrawable *driDrawable = driContext->driDrawablePriv; __DRIscreen *const screen = intel->intelScreen->driScrnPriv; - if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) { + if (intel->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) { if (screen->dri2.loader->flushFrontBuffer != NULL && driDrawable && driDrawable->loaderPrivate) { |