diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/dri/dri_drawable.c | 12 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri_drawable.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 15a2088df5..865cc8d0b6 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -138,6 +138,18 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv) dri_drawable->pBackClipRects[0].x2 = dri_drawable->w; dri_drawable->pBackClipRects[0].y2 = dri_drawable->h; + if (drawable->old_num == count && + drawable->old_w == dri_drawable->w && + drawable->old_h == dri_drawable->h && + memcmp(drawable->old, buffers, sizeof(__DRIbuffer) * count) == 0) { + return; + } else { + drawable->old_num = count; + drawable->old_w = dri_drawable->w; + drawable->old_h = dri_drawable->h; + memcpy(drawable->old, buffers, sizeof(__DRIbuffer) * count); + } + for (i = 0; i < count; i++) { enum pipe_format format = 0; int index = 0; diff --git a/src/gallium/state_trackers/dri/dri_drawable.h b/src/gallium/state_trackers/dri/dri_drawable.h index 78a66624aa..0f654d804a 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.h +++ b/src/gallium/state_trackers/dri/dri_drawable.h @@ -46,6 +46,11 @@ struct dri_drawable unsigned attachments[8]; unsigned num_attachments; + __DRIbuffer old[8]; + unsigned old_num; + unsigned old_w; + unsigned old_h; + /* gallium */ struct st_framebuffer *stfb; struct pipe_fence_handle *swap_fences[DRI_SWAP_FENCES_MAX]; |