X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_blit.c;h=416be194d113af46208daa1f08158aac05b4e1e2;hb=c1477f6ffe6a3d032dbcc76a5f506a7293e2fece;hp=af41835326a855412f14024af6c2e34b8a36f6b6;hpb=cd6a31cd4a9ea6deef4778c2eaef2d47240c3a6e;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index af41835326a..416be194d11 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -33,14 +33,15 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "main/mfeatures.h" #include "st_context.h" #include "st_texture.h" #include "st_cb_blit.h" #include "st_cb_fbo.h" +#include "st_atom.h" #include "util/u_blit.h" -#include "util/u_inlines.h" void @@ -75,6 +76,8 @@ st_BlitFramebuffer(struct gl_context *ctx, struct gl_framebuffer *readFB = ctx->ReadBuffer; struct gl_framebuffer *drawFB = ctx->DrawBuffer; + st_validate_state(st); + if (!_mesa_clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1, &dstX0, &dstY0, &dstX1, &dstY1)) { return; /* nothing to draw/blit */ @@ -106,6 +109,11 @@ st_BlitFramebuffer(struct gl_context *ctx, dstY1 = tmp; } + /* Disable conditional rendering. */ + if (st->render_condition) { + st->pipe->render_condition(st->pipe, NULL, 0); + } + if (mask & GL_COLOR_BUFFER_BIT) { struct gl_renderbuffer_attachment *srcAtt = &readFB->Attachment[readFB->_ColorReadBufferIndex]; @@ -115,17 +123,14 @@ st_BlitFramebuffer(struct gl_context *ctx, st_texture_object(srcAtt->Texture); struct st_renderbuffer *dstRb = st_renderbuffer(drawFB->_ColorDrawBuffers[0]); - struct pipe_subresource srcSub; struct pipe_surface *dstSurf = dstRb->surface; if (!srcObj->pt) - return; + goto done; - srcSub.face = srcAtt->CubeMapFace; - srcSub.level = srcAtt->TextureLevel; - - util_blit_pixels(st->blit, srcObj->pt, srcSub, - srcX0, srcY0, srcX1, srcY1, srcAtt->Zoffset, + util_blit_pixels(st->blit, srcObj->pt, srcAtt->TextureLevel, + srcX0, srcY0, srcX1, srcY1, + srcAtt->Zoffset + srcAtt->CubeMapFace, dstSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -136,14 +141,11 @@ st_BlitFramebuffer(struct gl_context *ctx, st_renderbuffer(drawFB->_ColorDrawBuffers[0]); struct pipe_surface *srcSurf = srcRb->surface; struct pipe_surface *dstSurf = dstRb->surface; - struct pipe_subresource srcSub; - - srcSub.face = srcSurf->face; - srcSub.level = srcSurf->level; util_blit_pixels(st->blit, - srcRb->texture, srcSub, srcX0, srcY0, srcX1, srcY1, - srcSurf->zslice, + srcRb->texture, srcSurf->u.tex.level, + srcX0, srcY0, srcX1, srcY1, + srcSurf->u.tex.first_layer, dstSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -176,11 +178,11 @@ st_BlitFramebuffer(struct gl_context *ctx, /* 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, - u_subresource(srcDepthRb->surface->face, - srcDepthRb->surface->level), + util_blit_pixels(st->blit, + srcDepthRb->texture, + srcDepthRb->surface->u.tex.level, srcX0, srcY0, srcX1, srcY1, - srcDepthRb->surface->zslice, + srcDepthRb->surface->u.tex.first_layer, dstDepthSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -189,10 +191,9 @@ st_BlitFramebuffer(struct gl_context *ctx, if (mask & GL_DEPTH_BUFFER_BIT) { util_blit_pixels(st->blit, srcDepthRb->texture, - u_subresource(srcDepthRb->surface->face, - srcDepthRb->surface->level), + srcDepthRb->surface->u.tex.level, srcX0, srcY0, srcX1, srcY1, - srcDepthRb->surface->zslice, + srcDepthRb->surface->u.tex.first_layer, dstDepthSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); } @@ -203,6 +204,13 @@ st_BlitFramebuffer(struct gl_context *ctx, } } } + +done: + /* Restore conditional rendering state. */ + if (st->render_condition) { + st->pipe->render_condition(st->pipe, st->render_condition, + st->condition_mode); + } }