summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-04-10 21:11:55 -0600
committerBrian Paul <[email protected]>2017-04-12 21:13:23 -0600
commit46f49d6fdcb9772fcc7ff3e533646b1b44c5adb9 (patch)
tree4649b27c670866eb72840d1a8a48ced84e5fd1e6 /src/mesa/state_tracker/st_manager.c
parentc36d224921da0846b808a317d5b71a78b31bfd3d (diff)
st/mesa: add some _mesa_is_winsys_fbo() assertions
A few functions related to FBOs/renderbuffers should only be used with window-system buffers, not user-created FBOs. Assert for that. Add additional comments. No piglit regressions. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
-rw-r--r--src/mesa/state_tracker/st_manager.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index a91dc76d226..b9e46fd07e6 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -270,7 +270,8 @@ st_framebuffer_update_attachments(struct st_framebuffer *stfb)
}
/**
- * Add a renderbuffer to the framebuffer.
+ * Add a renderbuffer to the framebuffer. The framebuffer is one that
+ * corresponds to a window and is not a user-created FBO.
*/
static boolean
st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
@@ -283,6 +284,8 @@ st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
if (!stfb->iface)
return FALSE;
+ assert(_mesa_is_winsys_fbo(&stfb->Base));
+
/* do not distinguish depth/stencil buffers */
if (idx == BUFFER_STENCIL)
idx = BUFFER_DEPTH;
@@ -869,7 +872,8 @@ st_manager_validate_framebuffers(struct st_context *st)
}
/**
- * Add a color renderbuffer on demand.
+ * Add a color renderbuffer on demand. The FBO must correspond to a window,
+ * not a user-created FBO.
*/
boolean
st_manager_add_color_renderbuffer(struct st_context *st,
@@ -882,6 +886,8 @@ st_manager_add_color_renderbuffer(struct st_context *st,
if (!stfb)
return FALSE;
+ assert(_mesa_is_winsys_fbo(fb));
+
if (stfb->Base.Attachment[idx].Renderbuffer)
return TRUE;