On 22 June 2012 14:41, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@linux.intel.com" target="_blank">chad.versace@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/12/2012 03:14 PM, Paul Berry wrote:<br>
> There are three reasons why the set of rectangles passed to<br>
> glBlitFramebuffer() might need to be clipped before performing the<br>
> blit:<br>
><br>
> 1. If the destination rectangle falls (partly or completely) outside<br>
> the bounds of the draw framebuffer.<br>
><br>
> 2. If the destination rectangle falls (partly or completely) outside<br>
> the scissor rectangle.<br>
><br>
> 3. If the source rectangle falls (party or completely) outside the<br>
> bounds of the read framebuffer.<br>
><br>
> In cases 1 and 2, it is clear from the GL spec that the blit should be<br>
> clipped.  In case 3, the spec is less clear, however Ian Romanick and<br>
> I have received clarification from the ARB that clipping is the<br>
> intended behaviour.<br>
><br>
> This test verifies that blits are properly clipped in cases 1-3.  It<br>
> only tests blits in which the source and destination rectangles are<br>
> the same size (i.e. no scaling is occurring), since scaling blits are<br>
> not allowed for MSAA.<br>
> ---<br>
>  tests/all.tests                                    |    9 +<br>
>  .../ext_framebuffer_multisample/CMakeLists.gl.txt  |    1 +<br>
>  .../clip-and-scissor-blit.cpp                      |  398 ++++++++++++++++++++<br>
>  3 files changed, 408 insertions(+), 0 deletions(-)<br>
>  create mode 100644 tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp<br>
<br>
</div>[snip]<br>
<div class="im"><br>
> +     bool pass = true;<br>
> +     for (int coord = 0; coord < 2; ++coord) {<br>
> +             for (int clip_low = 0; clip_low < 2; ++clip_low) {<br>
> +                     for (int test_type = 0; test_type < NUM_TEST_TYPES;<br>
> +                          ++test_type) {<br>
> +                             for (int flip_src = 0; flip_src < 2;<br>
> +                                  ++flip_src) {<br>
> +                                     for (int flip_dst = 0; flip_dst < 2;<br>
> +                                          ++flip_dst) {<br>
> +                                             pass = do_test(coord, clip_low,<br>
> +                                                            test_type_enum(test_type),<br>
> +                                                            flip_src,<br>
> +                                                            flip_dst)<br>
> +                                                     && pass;<br>
> +                                     }<br>
> +                             }<br>
> +                     }<br>
> +             }<br>
> +     }<br>
<br>
</div>The embedding goes so deep here that I say screw the 80-column rule. If this were written with long lines, it would be<br>
much easier to read.<br></blockquote><div><br>Good point, I agree.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
It took a few minutes to figure out how the test works, but once it clicked it was fairly easy to follow.<br>
At several points I said to myself, "Oh, this other variation needs testing too. I need to tell Paul", only later to<br>
find that you did test that variation.<br>
<br>
Reviewed-by: Chad Versace <<a href="mailto:chad.versace@linux.intel.com">chad.versace@linux.intel.com</a>><br>
<br>
<br>
</blockquote></div><br>