diff options
author | Eric Anholt <[email protected]> | 2013-02-06 17:03:49 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-02-13 18:10:20 -0800 |
commit | b8906adb66294e629aba58668a1851ac3fdaa391 (patch) | |
tree | 21651ebba692cbb6e0d51ee60e9ee4b099d8b2b5 /src | |
parent | 516d8be502885f5aadcc43aafe764e617f2593f4 (diff) |
intel: Allow blit readpixels even when the pack alignment is set.
The default alignment is 4, so this fast path was rarely hit. Rather
than introduce logic to handle alignment, just use the Mesa core
function.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46632
Cc: [email protected]
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_read.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index bb9ce994913..324ffb2ee63 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -77,7 +77,6 @@ do_blit_readpixels(struct gl_context * ctx, struct intel_region *src = intel_readbuf_region(intel); struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj); GLuint dst_offset; - GLuint rowLength; drm_intel_bo *dst_buffer; bool all; GLint dst_x, dst_y; @@ -102,23 +101,19 @@ do_blit_readpixels(struct gl_context * ctx, return false; } - if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) { + if (pack->SwapBytes || pack->LsbFirst) { DBG("%s: bad packing params\n", __FUNCTION__); return false; } - if (pack->RowLength > 0) - rowLength = pack->RowLength; - else - rowLength = width; - + int dst_stride = _mesa_image_row_stride(pack, width, format, type); if (pack->Invert) { DBG("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); return false; } else { if (_mesa_is_winsys_fbo(ctx->ReadBuffer)) - rowLength = -rowLength; + dst_stride = -dst_stride; } dst_offset = (GLintptr)pixels; @@ -152,7 +147,7 @@ do_blit_readpixels(struct gl_context * ctx, if (!intelEmitCopyBlit(intel, src->cpp, src->pitch, src->bo, 0, src->tiling, - rowLength * src->cpp, dst_buffer, dst_offset, false, + dst_stride, dst_buffer, dst_offset, false, x, y, dst_x, dst_y, width, height, |