diff options
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/dri/dri_drawable.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/glx/xlib/xm_api.c | 5 | ||||
-rw-r--r-- | src/gallium/state_trackers/glx/xlib/xm_st.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/wgl/stw_st.c | 6 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 0cfdc305583..c7df0f63327 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -169,6 +169,8 @@ void dri_destroy_buffer(__DRIdrawable * dPriv) { struct dri_drawable *drawable = dri_drawable(dPriv); + struct dri_screen *screen = drawable->screen; + struct st_api *stapi = screen->st_api; int i; pipe_surface_reference(&drawable->drisw_surface, NULL); @@ -180,7 +182,9 @@ dri_destroy_buffer(__DRIdrawable * dPriv) swap_fences_unref(drawable); - drawable->base.ID = 0; + /* Notify the st manager that this drawable is no longer valid */ + stapi->destroy_drawable(stapi, &drawable->base); + FREE(drawable); } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 881dd443232..e4b1e9dd4de 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -595,6 +595,11 @@ xmesa_free_buffer(XMesaBuffer buffer) */ b->ws.drawable = 0; + /* Notify the st manager that the associated framebuffer interface + * object is no longer valid. + */ + stapi->destroy_drawable(stapi, buffer->stfb); + /* XXX we should move the buffer to a delete-pending list and destroy * the buffer until it is no longer current. */ diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c index 9e30efad60d..6a0f4aad7d8 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_st.c +++ b/src/gallium/state_trackers/glx/xlib/xm_st.c @@ -273,6 +273,7 @@ xmesa_st_framebuffer_flush_front(struct st_context_iface *stctx, return ret; } +static uint32_t xmesa_stfbi_ID = 0; struct st_framebuffer_iface * xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b) @@ -302,6 +303,7 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b) stfbi->visual = &xstfb->stvis; stfbi->flush_front = xmesa_st_framebuffer_flush_front; stfbi->validate = xmesa_st_framebuffer_validate; + stfbi->ID = p_atomic_inc_return(&xmesa_stfbi_ID); p_atomic_set(&stfbi->stamp, 1); stfbi->st_manager_private = (void *) xstfb; diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c index c2844b04c4e..85a8b1743ea 100644 --- a/src/gallium/state_trackers/wgl/stw_st.c +++ b/src/gallium/state_trackers/wgl/stw_st.c @@ -256,7 +256,11 @@ stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb) for (i = 0; i < ST_ATTACHMENT_COUNT; i++) pipe_resource_reference(&stwfb->textures[i], NULL); - stwfb->base.ID = 0; + /* Notify the st manager that the framebuffer interface is no + * longer valid. + */ + stw_dev->stapi->destroy_drawable(stw_dev->stapi, &stwfb->base); + FREE(stwfb); } |