summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-09-21 09:51:58 -0700
committerEric Anholt <[email protected]>2011-09-22 11:03:26 -0700
commit86939e05d232d9b882f0b427b2efad9d754f463a (patch)
treea976ff2a80a68599632da358516f4df3bfa4eef0 /src/mesa
parent275ce9631b18ea77a160e3201fc3ba5549a462d3 (diff)
intel: Unindent the blit call in PBO blit uploads.
Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 37704bcca0e..8fd69c3734a 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -181,8 +181,9 @@ try_pbo_upload(struct intel_context *intel,
}
dst_buffer = intel_region_buffer(intel, intelImage->mt->region, INTEL_WRITE_FULL);
+ src_buffer = intel_bufferobj_source(intel, pbo, 64, &src_offset);
/* note: potential 64-bit ptr to 32-bit int cast */
- src_offset = (GLuint) (unsigned long) pixels;
+ src_offset += (GLuint) (unsigned long) pixels;
if (unpack->RowLength > 0)
src_stride = unpack->RowLength;
@@ -195,22 +196,16 @@ try_pbo_upload(struct intel_context *intel,
dst_stride = intelImage->mt->region->pitch;
- {
- GLuint offset;
- drm_intel_bo *src_buffer =
- intel_bufferobj_source(intel, pbo, 64, &offset);
-
- if (!intelEmitCopyBlit(intel,
- intelImage->mt->cpp,
- src_stride, src_buffer,
- src_offset + offset, GL_FALSE,
- dst_stride, dst_buffer, 0,
- intelImage->mt->region->tiling,
- 0, 0, dst_x, dst_y, width, height,
- GL_COPY)) {
- DBG("%s: blit failed\n", __FUNCTION__);
- return false;
- }
+ if (!intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_stride, src_buffer,
+ src_offset, GL_FALSE,
+ dst_stride, dst_buffer, 0,
+ intelImage->mt->region->tiling,
+ 0, 0, dst_x, dst_y, width, height,
+ GL_COPY)) {
+ DBG("%s: blit failed\n", __FUNCTION__);
+ return false;
}
DBG("%s: success\n", __FUNCTION__);