summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/state_tracker/st_manager.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index ab86ed5513a..ca3a29cb2b8 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -59,10 +59,13 @@ void st_flush(struct st_context *st, uint pipeFlushFlags,
struct pipe_fence_handle **fence);
/**
+ * Cast wrapper to convert a GLframebuffer to an st_framebuffer.
+ * Return NULL if the GLframebuffer is a user-created framebuffer.
+ * We'll only return non-null for window system framebuffers.
* Note that this function may fail.
*/
static INLINE struct st_framebuffer *
-st_framebuffer(GLframebuffer *fb)
+st_ws_framebuffer(GLframebuffer *fb)
{
/* FBO cannot be casted. See st_new_framebuffer */
return (struct st_framebuffer *) ((fb && !fb->Name) ? fb : NULL);
@@ -473,9 +476,9 @@ st_context_notify_invalid_framebuffer(struct st_context_iface *stctxi,
struct st_framebuffer *stfb;
/* either draw or read winsys fb */
- stfb = st_framebuffer(st->ctx->WinSysDrawBuffer);
+ stfb = st_ws_framebuffer(st->ctx->WinSysDrawBuffer);
if (!stfb || stfb->iface != stfbi)
- stfb = st_framebuffer(st->ctx->WinSysReadBuffer);
+ stfb = st_ws_framebuffer(st->ctx->WinSysReadBuffer);
assert(stfb && stfb->iface == stfbi);
p_atomic_set(&stfb->revalidate, TRUE);
@@ -616,7 +619,7 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi,
if (st) {
/* reuse/create the draw fb */
- stfb = st_framebuffer(st->ctx->WinSysDrawBuffer);
+ stfb = st_ws_framebuffer(st->ctx->WinSysDrawBuffer);
if (stfb && stfb->iface == stdrawi) {
stdraw = NULL;
st_framebuffer_reference(&stdraw, stfb);
@@ -626,7 +629,7 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi,
}
/* reuse/create the read fb */
- stfb = st_framebuffer(st->ctx->WinSysReadBuffer);
+ stfb = st_ws_framebuffer(st->ctx->WinSysReadBuffer);
if (!stfb || stfb->iface != streadi)
stfb = stdraw;
if (stfb && stfb->iface == streadi) {
@@ -698,7 +701,7 @@ st_api_destroy(struct st_api *stapi)
void
st_manager_flush_frontbuffer(struct st_context *st)
{
- struct st_framebuffer *stfb = st_framebuffer(st->ctx->DrawBuffer);
+ struct st_framebuffer *stfb = st_ws_framebuffer(st->ctx->DrawBuffer);
struct st_renderbuffer *strb = NULL;
if (stfb)
@@ -723,8 +726,8 @@ st_manager_flush_frontbuffer(struct st_context *st)
void
st_manager_validate_framebuffers(struct st_context *st)
{
- struct st_framebuffer *stdraw = st_framebuffer(st->ctx->DrawBuffer);
- struct st_framebuffer *stread = st_framebuffer(st->ctx->ReadBuffer);
+ struct st_framebuffer *stdraw = st_ws_framebuffer(st->ctx->DrawBuffer);
+ struct st_framebuffer *stread = st_ws_framebuffer(st->ctx->ReadBuffer);
/* st_public.h */
if ((stdraw && !stdraw->iface) || (stread && !stread->iface)) {
@@ -747,7 +750,7 @@ boolean
st_manager_add_color_renderbuffer(struct st_context *st, GLframebuffer *fb,
gl_buffer_index idx)
{
- struct st_framebuffer *stfb = st_framebuffer(fb);
+ struct st_framebuffer *stfb = st_ws_framebuffer(fb);
/* FBO or st_public.h */
if (!stfb || !stfb->iface)