diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2010-01-08 12:35:47 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-01-08 12:40:58 -0500 |
commit | 7c50d29f7ced3d60e52ee0146d982b49ea421de2 (patch) | |
tree | b867c8735db9b8f6b16a629e3b530e1505547e2e /src/mesa/drivers/dri/intel/intel_context.c | |
parent | c642f3941ba2ab68135037e1fcb1c29dcb820de7 (diff) |
intel/DRI2: add DRI2flushExtension support with invalidate hook
Needed to support the SwapBuffers code properly.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_context.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index eccba5bd23..a3c828027f 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -72,8 +72,6 @@ int INTEL_DEBUG = (0); #define DRIVER_DATE_GEM "GEM " DRIVER_DATE -static void intel_flush(GLcontext *ctx, GLboolean needs_mi_flush); - static const GLubyte * intelGetString(GLcontext * ctx, GLenum name) { @@ -380,6 +378,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) } } + drawable->validBuffers = GL_TRUE; driUpdateFramebufferSize(&intel->ctx, drawable); } @@ -467,7 +466,7 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state) intel->vtbl.invalidate_state( intel, new_state ); } -static void +void intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) { struct intel_context *intel = intel_context(ctx); @@ -950,11 +949,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, (struct intel_framebuffer *) driDrawPriv->driverPrivate; GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate; - if (driContextPriv->driScreenPriv->dri2.enabled) { - intel_update_renderbuffers(driContextPriv, driDrawPriv); - if (driDrawPriv != driReadPriv) - intel_update_renderbuffers(driContextPriv, driReadPriv); - } else { + if (!driContextPriv->driScreenPriv->dri2.enabled) { /* XXX FBO temporary fix-ups! These are released in * intelDextroyContext(), above. Changes here should be * reflected there. @@ -1088,6 +1083,10 @@ void LOCK_HARDWARE( struct intel_context *intel ) if (intel->driDrawable) { intel_fb = intel->driDrawable->driverPrivate; + if (!intel->driDrawable->validBuffers) + intel_update_renderbuffers(intel->driContext, + intel->driDrawable); + if (intel_fb) intel_rb = intel_get_renderbuffer(&intel_fb->Base, |