if (!stw_dev->stapi->make_current(stw_dev->stapi, ctx->st, fb->stfb, fb->stfb))
goto fail;
- stw_framebuffer_reference(&curctx->current_framebuffer, fb);
+ stw_framebuffer_reference(&ctx->current_framebuffer, fb);
success:
assert(fb);
struct pipe_texture templ;
unsigned i;
+ /* remove outdated surface */
+ pipe_surface_reference(&stwfb->front_surface, NULL);
+ pipe_surface_reference(&stwfb->back_surface, NULL);
+
/* remove outdated textures */
if (stwfb->texture_width != width || stwfb->texture_height != height) {
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
if (stwfb->fb->must_resize || (statt_mask & ~stwfb->texture_mask)) {
stw_st_framebuffer_validate_locked(&stwfb->base,
- statt_mask, stwfb->fb->width, stwfb->fb->height);
+ stwfb->fb->width, stwfb->fb->height, statt_mask);
stwfb->fb->must_resize = FALSE;
}