summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-08-14 08:47:32 -0700
committerBrian Paul <brianp@vmware.com>2010-08-22 19:40:26 -0600
commit36e523f4a3383bc9e6170d0bc959ba9ffdb85016 (patch)
treefe873109113110d0852bf8fbc67165786fde6031 /src/mesa/state_tracker/st_cb_blit.c
parent24bd9780bcf400a00f6fc5a89b1648c7e3b7df07 (diff)
st/mesa: fix BlitFramebuffer for D24S8 textures
This is the same issue as in the previous patch, but here the Blit is not implemented for separate depth and stencil buffers at all (such a configuration is not supported in Gallium) and the code incorrectly treated a D24S8 texture as two separate buffers, making this Blit a no-op. Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_blit.c')
-rw-r--r--src/mesa/state_tracker/st_cb_blit.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index 1f73f503f6..b3c754477a 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -40,6 +40,7 @@
#include "st_cb_fbo.h"
#include "util/u_blit.h"
+#include "util/u_inlines.h"
void
@@ -152,38 +153,33 @@ st_BlitFramebuffer(GLcontext *ctx,
/* depth and/or stencil blit */
/* get src/dst depth surfaces */
- struct st_renderbuffer *srcDepthRb =
+ struct gl_renderbuffer_attachment *srcDepth =
+ &readFB->Attachment[BUFFER_DEPTH];
+ struct gl_renderbuffer_attachment *dstDepth =
+ &drawFB->Attachment[BUFFER_DEPTH];
+ struct gl_renderbuffer_attachment *srcStencil =
+ &readFB->Attachment[BUFFER_STENCIL];
+ struct gl_renderbuffer_attachment *dstStencil =
+ &drawFB->Attachment[BUFFER_STENCIL];
+
+ struct st_renderbuffer *srcDepthRb =
st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer);
struct st_renderbuffer *dstDepthRb =
st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer);
- struct pipe_surface *srcDepthSurf =
- srcDepthRb ? srcDepthRb->surface : NULL;
struct pipe_surface *dstDepthSurf =
dstDepthRb ? dstDepthRb->surface : NULL;
- /* get src/dst stencil surfaces */
- struct st_renderbuffer *srcStencilRb =
- st_renderbuffer(readFB->Attachment[BUFFER_STENCIL].Renderbuffer);
- struct st_renderbuffer *dstStencilRb =
- st_renderbuffer(drawFB->Attachment[BUFFER_STENCIL].Renderbuffer);
- struct pipe_surface *srcStencilSurf =
- srcStencilRb ? srcStencilRb->surface : NULL;
- struct pipe_surface *dstStencilSurf =
- dstStencilRb ? dstStencilRb->surface : NULL;
-
if ((mask & depthStencil) == depthStencil &&
- srcDepthSurf == srcStencilSurf &&
- dstDepthSurf == dstStencilSurf) {
- struct pipe_subresource srcSub;
-
- srcSub.face = srcDepthRb->surface->face;
- srcSub.level = srcDepthRb->surface->level;
+ st_is_depth_stencil_combined(srcDepth, srcStencil) &&
+ st_is_depth_stencil_combined(dstDepth, dstStencil)) {
/* Blitting depth and stencil values between combined
* depth/stencil buffers. This is the ideal case for such buffers.
*/
- util_blit_pixels(st->blit,
- srcDepthRb->texture, srcSub, srcX0, srcY0, srcX1, srcY1,
+ util_blit_pixels(st->blit, srcDepthRb->texture,
+ u_subresource(srcDepthRb->surface->face,
+ srcDepthRb->surface->level),
+ srcX0, srcY0, srcX1, srcY1,
srcDepthRb->surface->zslice,
dstDepthSurf, dstX0, dstY0, dstX1, dstY1,
0.0, pFilter);