if (buf && buf->pixmap == ie->pixmap)
buf->busy = 0;
-
- if (buf && draw->cur_blit_source != b && !buf->busy &&
- (buf->reallocate ||
- (draw->num_back <= b && b < LOADER_DRI3_MAX_BACK))) {
- dri3_free_render_buffer(draw, buf);
- draw->buffers[b] = NULL;
- }
}
break;
}
/* Check whether we need to reuse the current back buffer as new back.
* In that case, wait until it's not busy anymore.
*/
- dri3_update_num_back(draw);
num_to_consider = draw->num_back;
if (!loader_dri3_have_image_blit(draw) && draw->cur_blit_source != -1) {
num_to_consider = 1;
{
struct loader_dri3_drawable *draw = loaderPrivate;
struct loader_dri3_buffer *front, *back;
+ int buf_id;
buffers->image_mask = 0;
buffers->front = NULL;
if (!dri3_update_drawable(driDrawable, draw))
return false;
+ dri3_update_num_back(draw);
+
+ /* Free no longer needed back buffers */
+ for (buf_id = draw->num_back; buf_id < LOADER_DRI3_MAX_BACK; buf_id++) {
+ if (draw->cur_blit_source != buf_id && draw->buffers[buf_id]) {
+ dri3_free_render_buffer(draw, draw->buffers[buf_id]);
+ draw->buffers[buf_id] = NULL;
+ }
+ }
+
/* pixmaps always have front buffers.
* Exchange swaps also mandate fake front buffers.
*/