summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-02-10 18:57:15 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-07-06 10:08:59 -0700
commit3539914e49118a5048e7c0f87d5014c088988195 (patch)
tree2351895b0fb90e01120d4259f1eec715ba1e0274
parentde8bb6a59b09821d66f7ff38e35cce20c3cfa86f (diff)
downloadmesa-3539914e49118a5048e7c0f87d5014c088988195.tar.gz
st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
The st_renderbuffer_alloc_storage() function is used to allocate both window-system buffers and user-created renderbuffers. The later kind are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for those surfaces. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (cherry picked from commit 5a70e12fc0897a3178c73b20d99fc0f11b180374)
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index fefd93a4b3c..215e9194c77 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -142,7 +142,12 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
if (util_format_is_depth_or_stencil(format)) {
template.bind = PIPE_BIND_DEPTH_STENCIL;
}
+ else if (strb->Base.Name != 0) {
+ /* this is a user-created renderbuffer */
+ template.bind = PIPE_BIND_RENDER_TARGET;
+ }
else {
+ /* this is a window-system buffer */
template.bind = (PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_RENDER_TARGET);
}
@@ -203,6 +208,7 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name)
{
struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
if (strb) {
+ assert(name != 0);
_mesa_init_renderbuffer(&strb->Base, name);
strb->Base.Delete = st_renderbuffer_delete;
strb->Base.AllocStorage = st_renderbuffer_alloc_storage;