diff options
author | Rob Clark <[email protected]> | 2020-04-16 10:53:03 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-23 04:49:52 +0000 |
commit | 85f84ea148474554af42ca513b9cb7c43a78a738 (patch) | |
tree | a5143126169723b0eb5a3ec90a08e4bca240e21b /src/mesa | |
parent | b88778e2de3a593587e20a8d4f0363a499f91455 (diff) |
gallium: add # of MRT to blend state
To make it possible for drivers to avoid unnecessary blend state change
for unused MRTs. Otherwise the driver would have to manage different
blend CSOs for different potential #s of render targets.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_blend.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index 0d429dac460..10e9b6a38c4 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -201,6 +201,8 @@ st_update_blend( struct st_context *st ) memset(blend, 0, sizeof(*blend)); + blend->max_rt = MAX2(1, num_cb) - 1; + if (num_cb > 1 && (blend_per_rt(st, num_cb) || colormask_per_rt(ctx, num_cb))) { num_state = num_cb; diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 3cf4c79f083..b7d44d2c1b5 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -280,6 +280,7 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers) int i; blend.independent_blend_enable = num_buffers > 1; + blend.max_rt = num_buffers - 1; for (i = 0; i < num_buffers; i++) { if (!(clear_buffers & (PIPE_CLEAR_COLOR0 << i))) |