[Mesa-dev] [PATCH 24/42] i965/blorp: move emission of sample combining into eu-emitter
Paul Berry
stereotype441 at gmail.com
Mon Jan 20 19:36:35 PST 2014
On 20 December 2013 06:38, Topi Pohjolainen <topi.pohjolainen at intel.com>wrote:
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> index b189aa2..dcfd82b 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> @@ -148,3 +148,15 @@ brw_blorp_eu_emitter::emit_render_target_write(const
> struct brw_reg &src0,
> true /* eot */,
> use_header);
> }
> +
> +void
> +brw_blorp_eu_emitter::emit_combine(unsigned texture_data_type,
> + const struct brw_reg &dst,
> + const struct brw_reg &src_1,
> + const struct brw_reg &src_2)
> +{
> + if (texture_data_type == BRW_REGISTER_TYPE_F)
> + brw_ADD(&func, dst, src_1, src_2);
> + else
> + brw_AVG(&func, dst, src_1, src_2);
> +}
>
It's a bit of an awkward split to have most of the algorithm for combining
samples in brw_blorp_blit_program::manual_blend_average(), but the choice
of whether to use ADD or AVG is here in
brw_blorp_eu_emitter::emit_combine(). How about if we replace
texture_data_type with a bool called "combine_using_add"? That way someone
reading manual_blend_average() won't have to refer to emit_combine() to
understand what the algorithm does; and similarly someone reading
emt_combine() won't have to look at manual_blend_average() to understand
why we use ADD for floats and AVG for ints.
With that change, this patch is:
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140120/58375a9a/attachment.html>
More information about the mesa-dev
mailing list