void
st_init_blit(struct st_context *st)
{
- st->blit = util_create_blit(st->pipe);
+ st->blit = util_create_blit(st->pipe, st->cso_context);
}
GLbitfield mask, GLenum filter)
{
struct st_context *st = ctx->st;
- struct pipe_context *pipe = st->pipe;
const uint pFilter = ((filter == GL_NEAREST)
? PIPE_TEX_MIPFILTER_NEAREST
struct pipe_surface *srcSurf = srcRb->surface;
struct pipe_surface *dstSurf = dstRb->surface;
- srcY0 = srcRb->Base.Height - srcY0;
- srcY1 = srcRb->Base.Height - srcY1;
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ /* invert Y */
+ srcY0 = srcRb->Base.Height - srcY0;
+ srcY1 = srcRb->Base.Height - srcY1;
- dstY0 = dstRb->Base.Height - dstY0;
- dstY1 = dstRb->Base.Height - dstY1;
+ dstY0 = dstRb->Base.Height - dstY0;
+ dstY1 = dstRb->Base.Height - dstY1;
+ }
util_blit_pixels(st->blit,
srcSurf, srcX0, srcY0, srcX1, srcY1,
0.0, pFilter);
}
-
-#if 0
- /* XXX is this sufficient? */
- st_invalidate_state(ctx, _NEW_COLOR | _NEW_TEXTURE);
-#else
- /* need to "unset" cso state because we went behind the back of the cso
- * tracker. Without unset, the _set_ calls would be no-ops.
- */
- cso_unset_blend(st->cso_context);
- cso_unset_depth_stencil_alpha(st->cso_context);
- cso_unset_rasterizer(st->cso_context);
- cso_set_blend(st->cso_context, &st->state.blend);
- cso_set_depth_stencil_alpha(st->cso_context, &st->state.depth_stencil);
- cso_set_rasterizer(st->cso_context, &st->state.rasterizer);
- pipe->bind_fs_state(pipe, st->fp->driver_shader);
- pipe->bind_vs_state(pipe, st->vp->driver_shader);
-#endif
}
void
st_init_blit_functions(struct dd_function_table *functions)
{
+#if FEATURE_EXT_framebuffer_blit
functions->BlitFramebuffer = st_BlitFramebuffer;
+#endif
}