[Mesa-dev] [PATCH 2/3] intel: Add multisample scaled blitting in blorp engine

Matt Turner mattst88 at gmail.com
Wed May 1 14:44:08 PDT 2013


On Wed, May 1, 2013 at 2:10 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> @@ -1063,22 +1176,21 @@ brw_blorp_blit_program::translate_tiling(bool old_tiled_w, bool new_tiled_w)
>         *   X' = (X & ~0b1011) >> 1 | (Y & 0b1) << 2 | X & 0b1         (4)
>         *   Y' = (Y & ~0b1) << 1 | (X & 0b1000) >> 2 | (X & 0b10) >> 1
>         */
> -      brw_AND(&func, t1, X, brw_imm_uw(0xfff4)); /* X & ~0b1011 */
> -      brw_SHR(&func, t1, t1, brw_imm_uw(1)); /* (X & ~0b1011) >> 1 */
> -      brw_AND(&func, t2, Y, brw_imm_uw(1)); /* Y & 0b1 */
> -      brw_SHL(&func, t2, t2, brw_imm_uw(2)); /* (Y & 0b1) << 2 */
> -      brw_OR(&func, t1, t1, t2); /* (X & ~0b1011) >> 1 | (Y & 0b1) << 2 */
> -      brw_AND(&func, t2, X, brw_imm_uw(1)); /* X & 0b1 */
> -      brw_OR(&func, Xp, t1, t2);
> -      brw_AND(&func, t1, Y, brw_imm_uw(0xfffe)); /* Y & ~0b1 */
> -      brw_SHL(&func, t1, t1, brw_imm_uw(1)); /* (Y & ~0b1) << 1 */
> -      brw_AND(&func, t2, X, brw_imm_uw(8)); /* X & 0b1000 */
> -      brw_SHR(&func, t2, t2, brw_imm_uw(2)); /* (X & 0b1000) >> 2 */
> -      brw_OR(&func, t1, t1, t2); /* (Y & ~0b1) << 1 | (X & 0b1000) >> 2 */
> -      brw_AND(&func, t2, X, brw_imm_uw(2)); /* X & 0b10 */
> -      brw_SHR(&func, t2, t2, brw_imm_uw(1)); /* (X & 0b10) >> 1 */
> -      brw_OR(&func, Yp, t1, t2);
> -      SWAP_XY_AND_XPYP();
> +      brw_AND(&func, rt1, rX, brw_imm_uw(0xfff4)); /* X & ~0b1011 */
> +      brw_SHR(&func, rt1, rt1, brw_imm_uw(1)); /* (X & ~0b1011) >> 1 */
> +      brw_AND(&func, rt2, rY, brw_imm_uw(1)); /* Y & 0b1 */
> +      brw_SHL(&func, rt2, rt2, brw_imm_uw(2)); /* (Y & 0b1) << 2 */
> +      brw_OR(&func, rt1, rt1, rt2); /* (X & ~0b1011) >> 1 | (Y & 0b1) << 2 */
> +      brw_AND(&func, rt2, rX, brw_imm_uw(1)); /* X & 0b1 */
> +      brw_OR(&func, rXp, rt1, rt2);
> +      brw_AND(&func, rt1, rY, brw_imm_uw(0xfffe)); /* Y & ~0b1 */
> +      brw_SHL(&func, rt1, rt1, brw_imm_uw(1)); /* (Y & ~0b1) << 1 */
> +      brw_AND(&func, rt2, rX, brw_imm_uw(8)); /* X & 0b1000 */
> +      brw_SHR(&func, rt2, rt2, brw_imm_uw(2)); /* (X & 0b1000) >> 2 */
> +      brw_OR(&func, rt1, rt1, rt2); /* (Y & ~0b1) << 1 | (X & 0b1000) >> 2 */
> +      brw_AND(&func, rt2, rX, brw_imm_uw(2)); /* X & 0b10 */
> +      brw_SHR(&func, rt2, rt2, brw_imm_uw(1)); /* (X & 0b10) >> 1 */
> +      brw_OR(&func, rYp, rt1, rt2);
>     } else {
>        /* Applying the same logic as above, but in reverse, we obtain the
>         * formulas:

In hunks like these I'm having a difficult time determining if there
are differences other than the changing the variables t1 -> rt1; t2 ->
rt2, X -> rX, etc. Are there other functional differences, and if so
is there a way we could separate the two?


More information about the mesa-dev mailing list