r600_pipe_state_add_reg(rstate, R_028780_CB_BLEND0_CONTROL + i * 4, blend_cntl[i]);
}
+ blend->alpha_to_one = state->alpha_to_one;
return rstate;
}
S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip) |
S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
+ rs->multisample_enable = state->multisample;
/* offset */
rs->offset_units = state->offset_units;
/* build states */
rctx->export_16bpc = true;
rctx->nr_cbufs = state->nr_cbufs;
+ rctx->cb0_is_integer = state->nr_cbufs &&
+ util_format_is_pure_integer(state->cbufs[0]->format);
for (i = 0; i < state->nr_cbufs; i++) {
surf = (struct r600_surface*)state->cbufs[i];
float offset_units;
float offset_scale;
bool scissor_enable;
+ bool multisample_enable;
};
struct r600_pipe_blend {
unsigned cb_target_mask;
unsigned cb_color_control;
bool dual_src_blend;
+ bool alpha_to_one;
};
struct r600_pipe_dsa {
boolean flatshade;
boolean export_16bpc;
unsigned nr_cbufs;
+ bool alpha_to_one;
+ bool multisample_enable;
+ bool cb0_is_integer;
struct u_upload_mgr *uploader;
struct util_slab_mempool pool_transfers;
j--;
continue;
}
+ output[j].swizzle_w = rctx->alpha_to_one && rctx->multisample_enable && !rctx->cb0_is_integer ? 5 : 3;
output[j].array_base = next_pixel_base++;
output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL;
shader->nr_ps_color_exports++;
output[j].swizzle_x = 0;
output[j].swizzle_y = 1;
output[j].swizzle_z = 2;
- output[j].swizzle_w = 3;
+ output[j].swizzle_w = rctx->alpha_to_one && rctx->multisample_enable && !rctx->cb0_is_integer ? 5 : 3;
output[j].burst_count = 1;
output[j].barrier = 1;
output[j].array_base = next_pixel_base++;
if (i == 0)
r600_pipe_state_add_reg(rstate, R_028804_CB_BLEND_CONTROL, bc);
}
+
+ blend->alpha_to_one = state->alpha_to_one;
return rstate;
}
S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
S_028810_ZCLIP_FAR_DISABLE(!state->depth_clip) |
S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
+ rs->multisample_enable = state->multisample;
/* offset */
rs->offset_units = state->offset_units;
/* build states */
rctx->export_16bpc = true;
rctx->nr_cbufs = state->nr_cbufs;
+ rctx->cb0_is_integer = state->nr_cbufs &&
+ util_format_is_pure_integer(state->cbufs[0]->format);
for (i = 0; i < state->nr_cbufs; i++) {
surf = (struct r600_surface*)state->cbufs[i];
rstate = &blend->rstate;
rctx->states[rstate->id] = rstate;
rctx->dual_src_blend = blend->dual_src_blend;
+ rctx->alpha_to_one = blend->alpha_to_one;
r600_context_pipe_state_set(rctx, rstate);
if (rctx->cb_misc_state.blend_colormask != blend->cb_target_mask) {
rctx->two_side = rs->two_side;
rctx->pa_sc_line_stipple = rs->pa_sc_line_stipple;
rctx->pa_cl_clip_cntl = rs->pa_cl_clip_cntl;
+ rctx->multisample_enable = rs->multisample_enable;
rctx->rasterizer = rs;
if (sel->type == PIPE_SHADER_FRAGMENT) {
key = rctx->two_side |
- MIN2(sel->nr_ps_max_color_exports, rctx->nr_cbufs + rctx->dual_src_blend) << 1;
+ ((rctx->alpha_to_one && rctx->multisample_enable && !rctx->cb0_is_integer) << 1) |
+ (MIN2(sel->nr_ps_max_color_exports, rctx->nr_cbufs + rctx->dual_src_blend) << 2);
} else
key = 0;