mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 05:20:37 +02:00
cell: flush rendering to current surfaces before installing new ones
This fixes crashes when resizing windows.
This commit is contained in:
parent
e082298e31
commit
e5085b83d0
1 changed files with 16 additions and 2 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "pipe/p_inlines.h"
|
||||
#include "draw/draw_context.h"
|
||||
#include "cell_context.h"
|
||||
#include "cell_flush.h"
|
||||
#include "cell_state.h"
|
||||
#include "cell_texture.h"
|
||||
#include "cell_state_per_fragment.h"
|
||||
|
|
@ -310,8 +311,21 @@ cell_set_framebuffer_state(struct pipe_context *pipe,
|
|||
cell->zsbuf_map = NULL;
|
||||
}
|
||||
|
||||
/* update my state */
|
||||
cell->framebuffer = *fb;
|
||||
/* Finish any pending rendering to the current surface before
|
||||
* installing a new surface!
|
||||
*/
|
||||
cell_flush_int(cell, CELL_FLUSH_WAIT);
|
||||
|
||||
/* update my state
|
||||
* (this is also where old surfaces will finally get freed)
|
||||
*/
|
||||
cell->framebuffer.width = fb->width;
|
||||
cell->framebuffer.height = fb->height;
|
||||
cell->framebuffer.num_cbufs = fb->num_cbufs;
|
||||
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
|
||||
pipe_surface_reference(&cell->framebuffer.cbufs[i], fb->cbufs[i]);
|
||||
}
|
||||
pipe_surface_reference(&cell->framebuffer.zsbuf, fb->zsbuf);
|
||||
|
||||
/* map new surfaces */
|
||||
if (csurf)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue