summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-27 15:25:03 -0700
committerEric Anholt <[email protected]>2018-06-29 13:36:28 -0700
commitb65b61cefe012e8bb2a0c7ab7ee41004b5f45da9 (patch)
treeac82e9bb5bfb7f4165798ac9e6eaf3bb81ec9ba0 /src/gallium/drivers/v3d/v3dx_emit.c
parent38172dcba9b2d9f6c51052c5a30ac68a0d3fe755 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_emit.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c24
1 files changed, 6 insertions, 18 deletions
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);
}
}
}