Commit fc43ff62 authored by Lepton Wu's avatar Lepton Wu Committed by Gert Wollny

vrend: Don't crash when no feat_dual_src_blend

When there is no feat_dual_src_blend, avoid calling glBindFragDataLocationIndexed.
Otherwise epoxy could crash the whole process when this function is not available.
Signed-off-by: Lepton Wu's avatarLepton Wu <lepton@chromium.org>
Reviewed-by: Gurchetan Singh's avatarGurchetan Singh <gurchetansingh@chromium.org>
parent ec76a365
Pipeline #107551 passed with stages
in 38 minutes and 10 seconds
......@@ -555,7 +555,8 @@ enum virgl_ctx_errors {
VIRGL_ERROR_GL_ANY_SAMPLES_PASSED,
VIRGL_ERROR_CTX_ILLEGAL_FORMAT,
VIRGL_ERROR_CTX_ILLEGAL_SAMPLER_VIEW_TARGET,
VIRGL_ERROR_CTX_TRANSFER_IOV_BOUNDS
VIRGL_ERROR_CTX_TRANSFER_IOV_BOUNDS,
VIRGL_ERROR_CTX_ILLEGAL_DUAL_SRC_BLEND
};
#define VIRGL_RESOURCE_Y_0_TOP (1 << 0)
......
......@@ -1525,12 +1525,18 @@ static struct vrend_linked_shader_program *add_shader_program(struct vrend_conte
if (fs->sel->sinfo.num_outputs > 1) {
if (util_blend_state_is_dual(&ctx->sub->blend_state, 0)) {
glBindFragDataLocationIndexed(prog_id, 0, 0, "fsout_c0");
glBindFragDataLocationIndexed(prog_id, 0, 1, "fsout_c1");
if (has_feature(feat_dual_src_blend)) {
glBindFragDataLocationIndexed(prog_id, 0, 0, "fsout_c0");
glBindFragDataLocationIndexed(prog_id, 0, 1, "fsout_c1");
} else {
report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_DUAL_SRC_BLEND, 0);
}
sprog->dual_src_linked = true;
} else {
glBindFragDataLocationIndexed(prog_id, 0, 0, "fsout_c0");
glBindFragDataLocationIndexed(prog_id, 1, 0, "fsout_c1");
if (has_feature(feat_dual_src_blend)) {
glBindFragDataLocationIndexed(prog_id, 0, 0, "fsout_c0");
glBindFragDataLocationIndexed(prog_id, 1, 0, "fsout_c1");
}
sprog->dual_src_linked = false;
}
} else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment