[Mesa-dev] [PATCH 7/7] intel: Allow blorp CopyTexSubImage to nonzero destination slices.
Eric Anholt
eric at anholt.net
Wed Jun 5 10:14:18 PDT 2013
---
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 12 ++++--------
src/mesa/drivers/dri/i965/brw_context.h | 1 +
src/mesa/drivers/dri/intel/intel_tex_copy.c | 10 ++++------
3 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index a6b2bbf..c3008db 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -323,6 +323,7 @@ bool
brw_blorp_copytexsubimage(struct intel_context *intel,
struct gl_renderbuffer *src_rb,
struct gl_texture_image *dst_image,
+ int slice,
int srcX0, int srcY0,
int dstX0, int dstY0,
int width, int height)
@@ -347,12 +348,6 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
return false;
}
- /* We can't use blorp to copy to a 1D array texture, since it can only
- * write to one layer of the texture at a time.
- */
- if (dst_mt->target == GL_TEXTURE_1D_ARRAY)
- return false;
-
/* Source clipping shouldn't be necessary, since copytexsubimage (in
* src/mesa/main/teximage.c) calls _mesa_clip_copytexsubimage() which
* takes care of it.
@@ -381,7 +376,7 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
brw_blorp_blit_miptrees(intel,
src_mt, src_irb->mt_level, src_irb->mt_layer,
- dst_mt, dst_image->Level, dst_image->Face,
+ dst_mt, dst_image->Level, dst_image->Face + slice,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
false, mirror_y);
@@ -404,7 +399,8 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
if (src_mt != dst_mt) {
brw_blorp_blit_miptrees(intel,
src_mt, src_irb->mt_level, src_irb->mt_layer,
- dst_mt, dst_image->Level, dst_image->Face,
+ dst_mt, dst_image->Level,
+ dst_image->Face + slice,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
false, mirror_y);
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 60b713d..b95026d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1245,6 +1245,7 @@ bool
brw_blorp_copytexsubimage(struct intel_context *intel,
struct gl_renderbuffer *src_rb,
struct gl_texture_image *dst_image,
+ int slice,
int srcX0, int srcY0,
int dstX0, int dstY0,
int width, int height);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 9413b14..d018cec 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -102,14 +102,12 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
{
struct intel_context *intel = intel_context(ctx);
- if (slice == 0) {
#ifndef I915
- /* Try BLORP first. It can handle almost everything. */
- if (brw_blorp_copytexsubimage(intel, rb, texImage, x, y,
- xoffset, yoffset, width, height))
- return;
+ /* Try BLORP first. It can handle almost everything. */
+ if (brw_blorp_copytexsubimage(intel, rb, texImage, slice, x, y,
+ xoffset, yoffset, width, height))
+ return;
#endif
- }
/* Next, try the BLT engine. */
if (intel_copy_texsubimage(intel,
--
1.8.3.rc0
More information about the mesa-dev
mailing list