diff options
author | Paul Berry <[email protected]> | 2012-07-13 18:30:55 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2012-07-24 14:52:57 -0700 |
commit | 0dbec6ae07e7b3d566cc397ab09caa413e412846 (patch) | |
tree | d381832579a2242b7ae4a8bb18eef284d17a42f7 | |
parent | da54d2e576426122009be083ecbfb9eefd8a3799 (diff) |
i965/blorp: Fixup scissoring of blits to window system buffers.
This patch modifies the order of operations in the blorp engine so
that clipping and scissoring are performed before adjusting the
coordinates to account for the difference in origin convention between
window system buffers and framebuffer objects. Previously, we would
do clipping and scissoring after adjusting for origin conventions, so
we would get scissoring wrong in window system buffers.
Fixes Piglit test "fbo-scissor-blit window".
Reviewed-by: Chad Versace <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index eb7935969da..038489fffbd 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -171,18 +171,6 @@ try_blorp_blit(struct intel_context *intel, if (src_mt->format != dst_mt->format) return false; - /* Account for the fact that in the system framebuffer, the origin is at - * the lower left. - */ - if (read_fb->Name == 0) { - srcY0 = read_fb->Height - srcY0; - srcY1 = read_fb->Height - srcY1; - } - if (draw_fb->Name == 0) { - dstY0 = draw_fb->Height - dstY0; - dstY1 = draw_fb->Height - dstY1; - } - /* Detect if the blit needs to be mirrored */ bool mirror_x = false, mirror_y = false; fixup_mirroring(mirror_x, srcX0, srcX1); @@ -213,6 +201,22 @@ try_blorp_blit(struct intel_context *intel, return true; } + /* Account for the fact that in the system framebuffer, the origin is at + * the lower left. + */ + if (read_fb->Name == 0) { + GLint tmp = read_fb->Height - srcY0; + srcY0 = read_fb->Height - srcY1; + srcY1 = tmp; + mirror_y = !mirror_y; + } + if (draw_fb->Name == 0) { + GLint tmp = draw_fb->Height - dstY0; + dstY0 = draw_fb->Height - dstY1; + dstY1 = tmp; + mirror_y = !mirror_y; + } + /* Get ready to blit. This includes depth resolving the src and dst * buffers if necessary. */ |