aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-17 09:25:28 +0100
committermarha <marha@users.sourceforge.net>2013-01-17 09:25:28 +0100
commit50c07563e17397daf040a32d8fdd3ab397e72371 (patch)
treeae9c109e16ba86a498c43ab62830bca3641a78aa /mesalib/src/mesa/state_tracker
parentdc163f625ef006c8550791122bda28fb3eb67e3d (diff)
parent4fc6b34d1c14cc61f553ca59264d0909656933f3 (diff)
downloadvcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.tar.gz
vcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.tar.bz2
vcxsrv-50c07563e17397daf040a32d8fdd3ab397e72371.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libxcb mesa xkbcomp git update 17 jan 2013
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_blit.c90
1 files changed, 56 insertions, 34 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.c b/mesalib/src/mesa/state_tracker/st_cb_blit.c
index 603c8d4b4..ddef2707a 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_blit.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_blit.c
@@ -184,48 +184,70 @@ st_BlitFramebuffer(struct gl_context *ctx,
blit.mask = PIPE_MASK_RGBA;
if (srcAtt->Type == GL_TEXTURE) {
- struct st_texture_object *srcObj =
- st_texture_object(srcAtt->Texture);
- struct st_renderbuffer *dstRb =
- st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
- struct pipe_surface *dstSurf = dstRb->surface;
-
- assert(srcObj->pt);
- if (!srcObj->pt) {
+ struct st_texture_object *srcObj = st_texture_object(srcAtt->Texture);
+ GLuint i;
+
+ if (!srcObj || !srcObj->pt) {
return;
}
- blit.dst.resource = dstSurf->texture;
- blit.dst.level = dstSurf->u.tex.level;
- blit.dst.box.z = dstSurf->u.tex.first_layer;
- blit.dst.format = util_format_linear(dstSurf->format);
+ for (i = 0; i < drawFB->_NumColorDrawBuffers; i++) {
+ struct st_renderbuffer *dstRb =
+ st_renderbuffer(drawFB->_ColorDrawBuffers[i]);
- blit.src.resource = srcObj->pt;
- blit.src.level = srcAtt->TextureLevel;
- blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
- blit.src.format = util_format_linear(srcObj->pt->format);
+ if (dstRb) {
+ struct pipe_surface *dstSurf = dstRb->surface;
- st->pipe->blit(st->pipe, &blit);
+ if (dstSurf) {
+ blit.dst.resource = dstSurf->texture;
+ blit.dst.level = dstSurf->u.tex.level;
+ blit.dst.box.z = dstSurf->u.tex.first_layer;
+ blit.dst.format = util_format_linear(dstSurf->format);
+
+ blit.src.resource = srcObj->pt;
+ blit.src.level = srcAtt->TextureLevel;
+ blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
+ blit.src.format = util_format_linear(srcObj->pt->format);
+
+ st->pipe->blit(st->pipe, &blit);
+ }
+ }
+ }
}
else {
struct st_renderbuffer *srcRb =
st_renderbuffer(readFB->_ColorReadBuffer);
- struct st_renderbuffer *dstRb =
- st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
- struct pipe_surface *srcSurf = srcRb->surface;
- struct pipe_surface *dstSurf = dstRb->surface;
+ struct pipe_surface *srcSurf;
+ GLuint i;
- blit.dst.resource = dstSurf->texture;
- blit.dst.level = dstSurf->u.tex.level;
- blit.dst.box.z = dstSurf->u.tex.first_layer;
- blit.dst.format = util_format_linear(dstSurf->format);
+ if (!srcRb || !srcRb->surface) {
+ return;
+ }
- blit.src.resource = srcSurf->texture;
- blit.src.level = srcSurf->u.tex.level;
- blit.src.box.z = srcSurf->u.tex.first_layer;
- blit.src.format = util_format_linear(srcSurf->format);
+ srcSurf = srcRb->surface;
- st->pipe->blit(st->pipe, &blit);
+ for (i = 0; i < drawFB->_NumColorDrawBuffers; i++) {
+ struct st_renderbuffer *dstRb =
+ st_renderbuffer(drawFB->_ColorDrawBuffers[i]);
+
+ if (dstRb) {
+ struct pipe_surface *dstSurf = dstRb->surface;
+
+ if (dstSurf) {
+ blit.dst.resource = dstSurf->texture;
+ blit.dst.level = dstSurf->u.tex.level;
+ blit.dst.box.z = dstSurf->u.tex.first_layer;
+ blit.dst.format = util_format_linear(dstSurf->format);
+
+ blit.src.resource = srcSurf->texture;
+ blit.src.level = srcSurf->u.tex.level;
+ blit.src.box.z = srcSurf->u.tex.first_layer;
+ blit.src.format = util_format_linear(srcSurf->format);
+
+ st->pipe->blit(st->pipe, &blit);
+ }
+ }
+ }
}
}
@@ -243,16 +265,16 @@ st_BlitFramebuffer(struct gl_context *ctx,
&drawFB->Attachment[BUFFER_STENCIL];
struct st_renderbuffer *srcDepthRb =
- st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer);
+ st_renderbuffer(srcDepth->Renderbuffer);
struct st_renderbuffer *dstDepthRb =
- st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer);
+ st_renderbuffer(dstDepth->Renderbuffer);
struct pipe_surface *dstDepthSurf =
dstDepthRb ? dstDepthRb->surface : NULL;
struct st_renderbuffer *srcStencilRb =
- st_renderbuffer(readFB->Attachment[BUFFER_STENCIL].Renderbuffer);
+ st_renderbuffer(srcStencil->Renderbuffer);
struct st_renderbuffer *dstStencilRb =
- st_renderbuffer(drawFB->Attachment[BUFFER_STENCIL].Renderbuffer);
+ st_renderbuffer(dstStencil->Renderbuffer);
struct pipe_surface *dstStencilSurf =
dstStencilRb ? dstStencilRb->surface : NULL;