X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fintel%2Fintel_tex_copy.c;h=6043ed26adbf558cee2cae6ccd496e013e5fd959;hb=bdf13dc8324c391b7d34f8bdaea72c4452ab7edb;hp=c9cbcf480d52ff2fb64756d3e1eb51b26cbddd70;hpb=d1f2e9699f3e5e7649fc12c4f2409af91d2494fe;p=mesa.git diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index c9cbcf480d5..6043ed26adb 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -41,6 +41,9 @@ #include "intel_fbo.h" #include "intel_tex.h" #include "intel_blit.h" +#ifndef I915 +#include "brw_context.h" +#endif #define FILE_DEBUG_FLAG DEBUG_TEXTURE @@ -111,8 +114,7 @@ intel_copy_texsubimage(struct intel_context *intel, } if (!copy_supported && !copy_supported_with_alpha_override) { - if (unlikely(INTEL_DEBUG & DEBUG_PERF)) - fprintf(stderr, "%s mismatched formats %s, %s\n", + perf_debug("%s mismatched formats %s, %s\n", __FUNCTION__, _mesa_get_format_name(intelImage->base.Base.TexFormat), _mesa_get_format_name(intel_rb_format(irb))); @@ -177,15 +179,28 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims, GLint x, GLint y, GLsizei width, GLsizei height) { - if (dims == 3 || !intel_copy_texsubimage(intel_context(ctx), - intel_texture_image(texImage), - xoffset, yoffset, - intel_renderbuffer(rb), x, y, width, height)) { - fallback_debug("%s - fallback to swrast\n", __FUNCTION__); - _mesa_meta_CopyTexSubImage(ctx, dims, texImage, - xoffset, yoffset, zoffset, - rb, x, y, width, height); + struct intel_context *intel = intel_context(ctx); + if (dims != 3) { +#ifndef I915 + /* Try BLORP first. It can handle almost everything. */ + if (brw_blorp_copytexsubimage(intel, rb, texImage, x, y, + xoffset, yoffset, width, height)) + return; +#endif + + /* Next, try the BLT engine. */ + if (intel_copy_texsubimage(intel, + intel_texture_image(texImage), + xoffset, yoffset, + intel_renderbuffer(rb), x, y, width, height)) + return; } + + /* Finally, fall back to meta. This will likely be slow. */ + perf_debug("%s - fallback to swrast\n", __FUNCTION__); + _mesa_meta_CopyTexSubImage(ctx, dims, texImage, + xoffset, yoffset, zoffset, + rb, x, y, width, height); }