diff options
author | Kenneth Graunke <[email protected]> | 2013-05-15 20:40:33 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-05-16 22:35:01 -0700 |
commit | ccb041fe8e0f4ed7e393bb82e89a7c57d222bec7 (patch) | |
tree | 5ab1a1f6fa985ca955d869de4ef371885e98796c | |
parent | 46ea8041074df79561f9771e2ecf198f2cbd088f (diff) |
intel: Don't spam "intelReadPixels: fallback to swrast" in non-PBO case.
When an application is using PBOs, we attempt to use the BLT engine to
perform ReadPixels. If that fails due to some restrictions, it's useful
to raise a performance warning.
In the non-PBO case, we always use a CPU mapping since getting the data
into client memory requires a CPU-side copy. This is a very common case,
so raising a performance warning is annoying. In particular, apitrace's
image dumping code hits this path, causing it to print hundreds of
thousands of performance warnings via ARB_debug_output. This tends to
obscure actual errors or other important messages.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_read.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 6b715d0af61..ebdc5282c3d 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -89,12 +89,7 @@ do_blit_readpixels(struct gl_context * ctx, if (!src) return false; - if (!_mesa_is_bufferobj(pack->BufferObj)) { - /* PBO only for now: - */ - DBG("%s - not PBO\n", __FUNCTION__); - return false; - } + assert(_mesa_is_bufferobj(pack->BufferObj)); struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; struct intel_renderbuffer *irb = intel_renderbuffer(rb); @@ -178,9 +173,15 @@ intelReadPixels(struct gl_context * ctx, DBG("%s\n", __FUNCTION__); - if (do_blit_readpixels - (ctx, x, y, width, height, format, type, pack, pixels)) - return; + if (_mesa_is_bufferobj(pack->BufferObj)) { + /* Using PBOs, so try the BLT based path. */ + if (do_blit_readpixels(ctx, x, y, width, height, format, type, pack, + pixels)) { + return; + } + + perf_debug("%s: fallback to CPU mapping in PBO case\n", __FUNCTION__); + } /* glReadPixels() wont dirty the front buffer, so reset the dirty * flag after calling intel_prepare_render(). */ @@ -188,8 +189,6 @@ intelReadPixels(struct gl_context * ctx, intel_prepare_render(intel); intel->front_buffer_dirty = dirty; - perf_debug("%s: fallback to swrast\n", __FUNCTION__); - /* Update Mesa state before calling _mesa_readpixels(). * XXX this may not be needed since ReadPixels no longer uses the * span code. |