summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_tex_copy.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2014-07-07 16:44:58 -0700
committerKristian Høgsberg <krh@bitplanet.net>2014-08-15 11:25:47 -0700
commit2f28a0dc23165123cf1e8b5942acad37878edd8a (patch)
treefc2ea0cff3565c17b768fa499bdc4991082cf9b0 /src/mesa/drivers/dri/i965/intel_tex_copy.c
parentf9dc7aabb3273d6d8a54c6778a5695a8527f4454 (diff)
downloadexternal_mesa3d-2f28a0dc23165123cf1e8b5942acad37878edd8a.zip
external_mesa3d-2f28a0dc23165123cf1e8b5942acad37878edd8a.tar.gz
external_mesa3d-2f28a0dc23165123cf1e8b5942acad37878edd8a.tar.bz2
i965: Implement fast color clears using meta operations
This patch uses the infrastructure put in place by previous patches to implement fast color clears and replicated color clears in terms of meta operations. This works all the way back to gen7 where fast clear was introduced and adds support for fast clear on gen8. It replaces the blorp path completely and improves on a few cases. Layered clears are now done using instanced rendering and multiple render-target clears use a MRT shader with rep16 writes. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_tex_copy.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_copy.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_copy.c b/src/mesa/drivers/dri/i965/intel_tex_copy.c
index 97f1569..d55539a 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_copy.c
@@ -52,6 +52,7 @@ intel_copy_texsubimage(struct brw_context *brw,
GLint x, GLint y, GLsizei width, GLsizei height)
{
const GLenum internalFormat = intelImage->base.Base.InternalFormat;
+ bool ret;
intel_prepare_render(brw);
@@ -79,17 +80,19 @@ intel_copy_texsubimage(struct brw_context *brw,
int dst_slice = slice + intelImage->base.Base.Face +
intelImage->base.Base.TexObject->MinLayer;
+ _mesa_unlock_texture(&brw->ctx, intelImage->base.Base.TexObject);
+
/* blit from src buffer to texture */
- if (!intel_miptree_blit(brw,
- irb->mt, irb->mt_level, irb->mt_layer,
- x, y, irb->Base.Base.Name == 0,
- intelImage->mt, dst_level, dst_slice,
- dstx, dsty, false,
- width, height, GL_COPY)) {
- return false;
- }
+ ret = intel_miptree_blit(brw,
+ irb->mt, irb->mt_level, irb->mt_layer,
+ x, y, irb->Base.Base.Name == 0,
+ intelImage->mt, dst_level, dst_slice,
+ dstx, dsty, false,
+ width, height, GL_COPY);
+
+ _mesa_lock_texture(&brw->ctx, intelImage->base.Base.TexObject);
- return true;
+ return ret;
}