* are too strict for CopyTexImage. We know meta will be fine with format
* changes.
*/
- _mesa_meta_BlitFramebuffer(ctx, x, y,
- x + width, y + height,
- xoffset, yoffset,
- xoffset + width, yoffset + height,
- mask, GL_NEAREST);
+ _mesa_meta_and_swrast_BlitFramebuffer(ctx, x, y,
+ x + width, y + height,
+ xoffset, yoffset,
+ xoffset + width, yoffset + height,
+ mask, GL_NEAREST);
ctx->Meta->Blit.no_ctsi_fallback = false;
success = true;
const struct gl_texture_object *texObj,
GLenum target, GLenum filter, GLuint srcLevel);
-extern void
+extern GLbitfield
_mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
+extern void
+_mesa_meta_and_swrast_BlitFramebuffer(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0,
+ GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter);
+
extern void
_mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers);
* Meta implementation of ctx->Driver.BlitFramebuffer() in terms
* of texture mapping and polygon rendering.
*/
-void
+GLbitfield
_mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
/* Multisample texture blit support requires texture multisample. */
if (ctx->ReadBuffer->Visual.samples > 0 &&
!ctx->Extensions.ARB_texture_multisample) {
- goto fallback;
+ return mask;
}
/* Clip a copy of the blit coordinates. If these differ from the input
if (!_mesa_clip_blit(ctx, &clip.srcX0, &clip.srcY0, &clip.srcX1, &clip.srcY1,
&clip.dstX0, &clip.dstY0, &clip.dstX1, &clip.dstY1)) {
/* clipped/scissored everything away */
- return;
+ return 0;
}
/* Only scissor affects blit, but we're doing to set a custom scissor if
_mesa_meta_end(ctx);
-fallback:
- if (mask) {
- _swrast_BlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1, mask, filter);
- }
+ return mask;
}
void
_mesa_DeleteTextures(1, &blit->depthTex.TexObj);
blit->depthTex.TexObj = 0;
}
+
+void
+_mesa_meta_and_swrast_BlitFramebuffer(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0,
+ GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ mask = _mesa_meta_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
+
+ _swrast_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+}
return;
- _mesa_meta_BlitFramebuffer(ctx,
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
+ _mesa_meta_and_swrast_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
}
/**
if (mask == 0x0)
return;
+ mask = _mesa_meta_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
- _mesa_meta_BlitFramebuffer(ctx,
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
+ _swrast_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
}
/**
functions->DrawPixels = _mesa_meta_DrawPixels;
functions->CopyPixels = _mesa_meta_CopyPixels;
functions->Bitmap = _mesa_meta_Bitmap;
- functions->BlitFramebuffer = _mesa_meta_BlitFramebuffer;
+ functions->BlitFramebuffer = _mesa_meta_and_swrast_BlitFramebuffer;
}
radeon->glCtx.Driver.RenderTexture = radeon_render_texture;
radeon->glCtx.Driver.FinishRenderTexture = radeon_finish_render_texture;
radeon->glCtx.Driver.ValidateFramebuffer = radeon_validate_framebuffer;
- radeon->glCtx.Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer;
+ radeon->glCtx.Driver.BlitFramebuffer = _mesa_meta_and_swrast_BlitFramebuffer;
radeon->glCtx.Driver.EGLImageTargetRenderbufferStorage =
radeon_image_target_renderbuffer_storage;
}
if (TEST_META_FUNCS) {
driver->Clear = _mesa_meta_Clear;
driver->CopyPixels = _mesa_meta_CopyPixels;
- driver->BlitFramebuffer = _mesa_meta_BlitFramebuffer;
+ driver->BlitFramebuffer = _mesa_meta_and_swrast_BlitFramebuffer;
driver->DrawPixels = _mesa_meta_DrawPixels;
driver->Bitmap = _mesa_meta_Bitmap;
}