diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 1142461..947b61a 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -242,6 +242,11 @@ struct st_framebuffer_iface const enum st_attachment_type *statts, unsigned count, struct pipe_resource **out); + + /** + * To signal that the framebuffer needs validation. + */ + int32_t revalidate; }; /** diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c index 4c0ce07..6f84533 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_st.c +++ b/src/gallium/state_trackers/glx/xlib/xm_st.c @@ -343,6 +343,11 @@ xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi) if (xmesa_strict_invalidate) xmesa_check_buffer_size(xstfb->buffer); + + /* Signal to the state-tracker/renderer that this framebuffer + * has changed. + */ + p_atomic_set(&stfbi->revalidate, TRUE); } } diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c index a1fe45c..d1479c6 100644 --- a/src/mesa/state_tracker/st_cb_viewport.c +++ b/src/mesa/state_tracker/st_cb_viewport.c @@ -60,9 +60,9 @@ static void st_viewport(GLcontext * ctx, GLint x, GLint y, stread = st_ws_framebuffer(st->ctx->ReadBuffer); if (stdraw) - p_atomic_set(&stdraw->revalidate, TRUE); + p_atomic_set(&stdraw->iface->revalidate, TRUE); if (stread && stread != stdraw) - p_atomic_set(&stread->revalidate, TRUE); + p_atomic_set(&stread->iface->revalidate, TRUE); } void st_init_viewport_functions(struct dd_function_table *functions) diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 991feee..39ae41a 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -213,7 +213,6 @@ struct st_framebuffer struct st_framebuffer_iface *iface; enum st_attachment_type statts[ST_ATTACHMENT_COUNT]; unsigned num_statts; - int32_t revalidate; }; diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index ccce574..c247007 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -148,7 +148,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st) unsigned i; boolean changed = FALSE; - if (!p_atomic_read(&stfb->revalidate)) + if (!p_atomic_read(&stfb->iface->revalidate)) return; /* validate the fb */ @@ -207,7 +207,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st) assert(stfb->Base.Height == height); } - p_atomic_set(&stfb->revalidate, FALSE); + p_atomic_set(&stfb->iface->revalidate, FALSE); } /** @@ -233,7 +233,7 @@ st_framebuffer_update_attachments(struct st_framebuffer *stfb) stfb->statts[stfb->num_statts++] = statt; } - p_atomic_set(&stfb->revalidate, TRUE); + p_atomic_set(&stfb->iface->revalidate, TRUE); } /** @@ -491,7 +491,7 @@ st_context_notify_invalid_framebuffer(struct st_context_iface *stctxi, stfb = st_ws_framebuffer(st->ctx->WinSysReadBuffer); assert(stfb && stfb->iface == stfbi); - p_atomic_set(&stfb->revalidate, TRUE); + p_atomic_set(&stfb->iface->revalidate, TRUE); } static void