[Mesa-dev] [PATCH 27/42] i965/blorp: wrap LRP
Pohjolainen, Topi
topi.pohjolainen at intel.com
Mon Jan 20 22:06:40 PST 2014
On Mon, Jan 20, 2014 at 07:47:45PM -0800, Paul Berry wrote:
> On 20 December 2013 06:38, Topi Pohjolainen <topi.pohjolainen at intel.com>
> wrote:
>
> The split of the emission of the two halfs into single emission
> call prapares for fs_generator support that already does similar
> thing. No regressions seen on IVB (unit tests and piglit quick).
>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 26
> ++++++++++----------------
> src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h | 13 +++++++++++++
> 2 files changed, 23 insertions(+), 16 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> index 1b7310b..b95104e 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> @@ -1679,29 +1679,23 @@
> brw_blorp_blit_program::manual_blend_bilinear(unsigned num_samples)
> }
>
> #define SAMPLE(x, y) offset(texture_data[x], y)
> - brw_set_access_mode(&func, BRW_ALIGN_16);
> - brw_set_compression_control(&func, BRW_COMPRESSION_NONE);
> for (int index = 3; index > 0; ) {
> /* Since we're doing SIMD16, 4 color channels fits in to 8
> registers.
> * Counter value of 8 in 'for' loop below is used to interpolate
> all
> * the color components.
> */
> - for (int k = 0; k < 8; ++k)
> - brw_LRP(&func,
> - vec8(SAMPLE(index - 1, k)),
> - offset(x_frac, k & 1),
> - SAMPLE(index, k),
> - SAMPLE(index - 1, k));
> + for (int k = 0; k < 8; k += 2)
> + emit_lrp(vec8(SAMPLE(index - 1, k)),
> + offset(x_frac, k & 1),
>
> This line can just be "x_frac" now, because k is always even, so (k & 1)
> is always zero.
Nice catch, I probably should have paid more attention to what I was doing also.
>
>
> + SAMPLE(index, k),
> + SAMPLE(index - 1, k));
> index -= 2;
> }
> - for (int k = 0; k < 8; ++k)
> - brw_LRP(&func,
> - vec8(SAMPLE(0, k)),
> - offset(y_frac, k & 1),
> - vec8(SAMPLE(2, k)),
> - vec8(SAMPLE(0, k)));
> - brw_set_compression_control(&func, BRW_COMPRESSION_COMPRESSED);
> - brw_set_access_mode(&func, BRW_ALIGN_1);
> + for (int k = 0; k < 8; k += 2)
> + emit_lrp(vec8(SAMPLE(0, k)),
> + offset(y_frac, k & 1),
>
> Same comment applies here.
>
>
> + vec8(SAMPLE(2, k)),
> + vec8(SAMPLE(0, k)));
> #undef SAMPLE
> }
>
> With those two things fixed, this patch is:
>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>
More information about the mesa-dev
mailing list