summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2015-01-30 14:03:53 -0800
committerLaura Ekstrand <[email protected]>2015-02-02 13:21:20 -0800
commite187c2f5432466c7b49dba266026fb9b01f5f667 (patch)
tree6232bca416174ed9c15bdbc69b8c6e650cad76c8 /src/mesa/drivers/dri/i915
parentad2c64abbd7326be35fa1f94c7e056e868ee6185 (diff)
DD: Refactor BlitFramebuffer.
In preparation for glBlitNamedFramebuffer, the DD table function BlitFramebuffer needs to accept two arbitrary framebuffer objects rather than assuming ctx->ReadBuffer and ctx->DrawBuffer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/intel_fbo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
index e138b854e33..ead1b17b69d 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -649,6 +649,8 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
*/
static GLbitfield
intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
+ const struct gl_framebuffer *readFb,
+ const struct gl_framebuffer *drawFb,
GLint srcX0, GLint srcY0,
GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0,
@@ -659,8 +661,6 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
if (mask & GL_COLOR_BUFFER_BIT) {
GLint i;
- const struct gl_framebuffer *drawFb = ctx->DrawBuffer;
- const struct gl_framebuffer *readFb = ctx->ReadBuffer;
struct gl_renderbuffer *src_rb = readFb->_ColorReadBuffer;
struct intel_renderbuffer *src_irb = intel_renderbuffer(src_rb);
@@ -696,8 +696,8 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
* results are undefined if any destination pixels have a dependency on
* source pixels.
*/
- for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
- struct gl_renderbuffer *dst_rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
+ for (i = 0; i < drawFb->_NumColorDrawBuffers; i++) {
+ struct gl_renderbuffer *dst_rb = drawFb->_ColorDrawBuffers[i];
struct intel_renderbuffer *dst_irb = intel_renderbuffer(dst_rb);
if (!dst_irb) {
@@ -738,12 +738,14 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
static void
intel_blit_framebuffer(struct gl_context *ctx,
+ struct gl_framebuffer *readFb,
+ struct gl_framebuffer *drawFb,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
{
/* Try using the BLT engine. */
- mask = intel_blit_framebuffer_with_blitter(ctx,
+ mask = intel_blit_framebuffer_with_blitter(ctx, readFb, drawFb,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
mask, filter);
@@ -751,7 +753,7 @@ intel_blit_framebuffer(struct gl_context *ctx,
return;
- _mesa_meta_and_swrast_BlitFramebuffer(ctx,
+ _mesa_meta_and_swrast_BlitFramebuffer(ctx, readFb, drawFb,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
mask, filter);