[Mesa-dev] [PATCH 7/9] i965/gen6+: Use blorp for tex_image_2d
Topi Pohjolainen
topi.pohjolainen at gmail.com
Tue Dec 20 14:45:35 UTC 2016
instead of _mesa_meta_pbo_TexSubImage().
While the newly introduced intel_texsubimage_gpu_copy() is capable
of handling all the cases _mesa_meta_pbo_TexSubImage() can, it
is also capable of handling everything intel_texsubimage_tiled_memcpy()
does. And in addition part of the cases left to _mesa_store_teximage()
as well.
This, however, leads to performance regressions in few benchmarks,
especially with Synmark OglDrvRes. Therefore intel_texsubimage_gpu_copy
is only used to replace the meta path for now.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/intel_tex_image.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 141996f..67f83db 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -125,6 +125,7 @@ intelTexImage(struct gl_context * ctx,
GLenum format, GLenum type, const void *pixels,
const struct gl_pixelstore_attrib *unpack)
{
+ struct brw_context *brw = brw_context(ctx);
struct intel_texture_image *intelImage = intel_texture_image(texImage);
bool ok;
@@ -147,12 +148,20 @@ intelTexImage(struct gl_context * ctx,
if (intelImage->mt->format == MESA_FORMAT_S_UINT8)
intelImage->mt->r8stencil_needs_update = true;
- ok = _mesa_meta_pbo_TexSubImage(ctx, dims, texImage, 0, 0, 0,
- texImage->Width, texImage->Height,
- texImage->Depth,
- format, type, pixels,
- tex_busy, unpack);
- if (ok)
+ const bool is_src_bo = _mesa_is_bufferobj(unpack->BufferObj);
+ if (brw->gen >= 6 && (tex_busy || is_src_bo) &&
+ intel_texsubimage_gpu_copy(brw, dims, texImage, 0, 0, 0,
+ texImage->Width, texImage->Height,
+ texImage->Depth,
+ format, type, pixels, unpack))
+ return;
+
+ if (brw->gen < 6 &&
+ _mesa_meta_pbo_TexSubImage(ctx, dims, texImage, 0, 0, 0,
+ texImage->Width, texImage->Height,
+ texImage->Depth,
+ format, type, pixels,
+ tex_busy, unpack))
return;
ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
--
2.5.5
More information about the mesa-dev
mailing list