From: Eric Anholt Date: Wed, 27 Jun 2018 22:25:03 +0000 (-0700) Subject: v3d: Rewrite the color write masks to match CLIF format. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b65b61cefe012e8bb2a0c7ab7ee41004b5f45da9;p=mesa.git v3d: Rewrite the color write masks to match CLIF format. The render_target_* fields gave us pretty(ish) printing, but meant we were incompatible with CLIF, and had much more verbose code generating them. --- diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml index 5fa5ddd530b..9ffc07b9845 100644 --- a/src/broadcom/cle/v3d_packet_v33.xml +++ b/src/broadcom/cle/v3d_packet_v33.xml @@ -597,11 +597,7 @@ - - - - - + diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c index d5549bb945c..03e47d66156 100644 --- a/src/gallium/drivers/v3d/v3dx_emit.c +++ b/src/gallium/drivers/v3d/v3dx_emit.c @@ -496,24 +496,12 @@ v3dX(emit_state)(struct pipe_context *pctx) struct pipe_blend_state *blend = v3d->blend; cl_emit(&job->bcl, COLOUR_WRITE_MASKS, mask) { - if (blend->independent_blend_enable) { - mask.render_target_0_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[0].colormask, 0); - mask.render_target_1_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[1].colormask, 1); - mask.render_target_2_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[2].colormask, 2); - mask.render_target_3_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[3].colormask, 3); - } else { - mask.render_target_0_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[0].colormask, 0); - mask.render_target_1_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[0].colormask, 1); - mask.render_target_2_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[0].colormask, 2); - mask.render_target_3_per_colour_component_write_masks = - translate_colormask(v3d, blend->rt[0].colormask, 3); + for (int i = 0; i < 4; i++) { + int rt = blend->independent_blend_enable ? i : 0; + int rt_mask = blend->rt[rt].colormask; + + mask.mask |= translate_colormask(v3d, rt_mask, + i) << (4 * i); } } }