diff options
author | Kenneth Graunke <[email protected]> | 2016-05-19 20:29:04 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-05-25 14:17:29 -0700 |
commit | 2dc98d9a15ba2ca48e6e50f2232f4a9fcd4c312f (patch) | |
tree | 35a1ee82e052bf91ebc0d6e2e9406276e8ce4780 | |
parent | 1b39c5efcabb7c4676c57ddc01d37edcce0f2d03 (diff) |
i965: Combine src/dest tex vs. rb checks in intel_copy_image_sub_data.
This simplifies things a little - now we only have one (tex or rb?)
if-ladder for src, and a second for dst, rather than four.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_copy_image.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_copy_image.c b/src/mesa/drivers/dri/i965/intel_copy_image.c index 834c1a7b569..a94f17196cd 100644 --- a/src/mesa/drivers/dri/i965/intel_copy_image.c +++ b/src/mesa/drivers/dri/i965/intel_copy_image.c @@ -225,26 +225,6 @@ intel_copy_image_sub_data(struct gl_context *ctx, if (src_image) { src_mt = intel_texture_image(src_image)->mt; - } else { - assert(src_renderbuffer); - src_mt = intel_renderbuffer(src_renderbuffer)->mt; - src_image = src_renderbuffer->TexImage; - } - - if (dst_image) { - dst_mt = intel_texture_image(dst_image)->mt; - } else { - assert(dst_renderbuffer); - dst_mt = intel_renderbuffer(dst_renderbuffer)->mt; - dst_image = dst_renderbuffer->TexImage; - } - - if (src_mt->num_samples > 0 || dst_mt->num_samples > 0) { - _mesa_problem(ctx, "Failed to copy multisampled texture with meta path\n"); - return; - } - - if (src_image) { src_level = src_image->Level + src_image->TexObject->MinLevel; /* Cube maps actually have different images per face */ @@ -253,10 +233,15 @@ intel_copy_image_sub_data(struct gl_context *ctx, src_z += src_image->TexObject->MinLayer; } else { + assert(src_renderbuffer); + src_mt = intel_renderbuffer(src_renderbuffer)->mt; + src_image = src_renderbuffer->TexImage; src_level = 0; } if (dst_image) { + dst_mt = intel_texture_image(dst_image)->mt; + dst_level = dst_image->Level + dst_image->TexObject->MinLevel; /* Cube maps actually have different images per face */ @@ -265,9 +250,17 @@ intel_copy_image_sub_data(struct gl_context *ctx, dst_z += dst_image->TexObject->MinLayer; } else { + assert(dst_renderbuffer); + dst_mt = intel_renderbuffer(dst_renderbuffer)->mt; + dst_image = dst_renderbuffer->TexImage; dst_level = 0; } + if (src_mt->num_samples > 0 || dst_mt->num_samples > 0) { + _mesa_problem(ctx, "Failed to copy multisampled texture with BLORP\n"); + return; + } + /* We are now going to try and copy the texture using the blitter. If * that fails, we will fall back mapping the texture and using memcpy. * In either case, we need to do a full resolve. |