trace_dump_member_begin("rt");
if (state->independent_blend_enable)
- valid_entries = PIPE_MAX_COLOR_BUFS;
+ valid_entries = state->max_rt + 1;
trace_dump_struct_array(rt_blend_state, state->rt, valid_entries);
trace_dump_member_end();
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
if (clear_buffers & (PIPE_CLEAR_COLOR0 << i)) {
blend.rt[i].colormask = PIPE_MASK_RGBA;
+ blend.max_rt = i;
}
}
util_dump_member(stream, bool, state, dither);
util_dump_member(stream, bool, state, alpha_to_coverage);
util_dump_member(stream, bool, state, alpha_to_one);
+ util_dump_member(stream, uint, state, max_rt);
util_dump_member(stream, bool, state, logicop_enable);
if (state->logicop_enable) {
util_dump_member_begin(stream, "rt");
if (state->independent_blend_enable)
- valid_entries = PIPE_MAX_COLOR_BUFS;
+ valid_entries = state->max_rt + 1;
util_dump_struct_array(stream, rt_blend_state, state->rt, valid_entries);
util_dump_member_end(stream);
}
If enabled, the fragment's alpha value will be set to one. As with
alpha_to_coverage, this step happens regardless of whether multisample
is enabled or the destination buffer is multisampled.
+max_rt
+ The index of the max render target (irrespecitive of whether independent
+ blend is enabled), ie. the number of MRTs minus one. This is provided
+ so that the driver can avoid the overhead of programming unused MRTs.
Per-rendertarget Members
unsigned dither:1;
unsigned alpha_to_coverage:1;
unsigned alpha_to_one:1;
+ unsigned max_rt:3; /* index of max rt, Ie. # of cbufs minus 1 */
struct pipe_rt_blend_state rt[PIPE_MAX_COLOR_BUFS];
};
nine_convert_blend_state_fixup(&blend, rs); /* for BOTH[INV]SRCALPHA */
}
+ blend.max_rt = 0;
blend.rt[0].colormask = rs[D3DRS_COLORWRITEENABLE];
if (rs[D3DRS_COLORWRITEENABLE1] != rs[D3DRS_COLORWRITEENABLE] ||
blend.rt[1].colormask = rs[D3DRS_COLORWRITEENABLE1];
blend.rt[2].colormask = rs[D3DRS_COLORWRITEENABLE2];
blend.rt[3].colormask = rs[D3DRS_COLORWRITEENABLE3];
+ blend.max_rt = 3;
}
/* blend.force_srgb = !!rs[D3DRS_SRGBWRITEENABLE]; */
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;
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)))