[Mesa-dev] [PATCH 7/7] intel: Unindent the blit call in PBO blit uploads.
Eric Anholt
eric at anholt.net
Wed Sep 21 10:15:49 PDT 2011
---
src/mesa/drivers/dri/intel/intel_tex_image.c | 30 +++++++++++--------------
1 files changed, 13 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 ac3489b..5cfd3a7 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -158,6 +158,7 @@ try_pbo_upload(struct intel_context *intel,
drm_intel_bo *dst_buffer = intel_region_buffer(intel,
intelImage->mt->region,
INTEL_WRITE_FULL);
+ drm_intel_bo *src_buffer;
if (!_mesa_is_bufferobj(unpack->BufferObj))
return false;
@@ -182,8 +183,9 @@ try_pbo_upload(struct intel_context *intel,
return false;
}
+ 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;
@@ -196,22 +198,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__);
--
1.7.5.4
More information about the mesa-dev
mailing list