vrend: fix dual src blending.

For dual src blending to work we have to link the shader in a certain
way, so we have to dirty the shaders on a new blend state, then
we have to make sure the dual src bit is the same before avoiding
a relink state, otherwise have to relink.

This fixes:
piglit arb_blend_func_extended-fbo-extended-blend

Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Dave Airlie 7 years ago committed by Jakob Bornecrantz
parent 4f60af6ea2
commit a78923efaa
  1. 3
      src/vrend_renderer.c

@ -2996,6 +2996,8 @@ void vrend_draw_vbo(struct vrend_context *ctx,
same_prog = false;
if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] && ctx->sub->shaders[PIPE_SHADER_GEOMETRY]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_GEOMETRY])
same_prog = false;
if (ctx->sub->prog && ctx->sub->prog->dual_src_linked != dual_src)
same_prog = false;
if (!same_prog) {
prog = lookup_shader_program(ctx, ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id, ctx->sub->shaders[PIPE_SHADER_FRAGMENT]->current->id, ctx->sub->shaders[PIPE_SHADER_GEOMETRY] ? ctx->sub->shaders[PIPE_SHADER_GEOMETRY]->current->id : 0, dual_src);
@ -3460,6 +3462,7 @@ void vrend_object_bind_blend(struct vrend_context *ctx,
return;
}
ctx->sub->shader_dirty = true;
ctx->sub->blend_state = *state;
vrend_hw_emit_blend(ctx, &ctx->sub->blend_state);

Loading…
Cancel
Save