[virglrenderer-devel] [PATCH] vrend: fix dual src blending.

Dave Airlie airlied at gmail.com
Fri May 18 00:15:35 UTC 2018


From: Dave Airlie <airlied at redhat.com>

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
---
 src/vrend_renderer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 15e87ef..c1cd3be 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -3052,6 +3052,8 @@ void vrend_draw_vbo(struct vrend_context *ctx,
          same_prog = false;
       if (ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] && ctx->sub->shaders[PIPE_SHADER_TESS_EVAL]->current->id != ctx->sub->prog_ids[PIPE_SHADER_TESS_EVAL])
          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,
@@ -3530,6 +3532,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);
-- 
2.14.3



More information about the virglrenderer-devel mailing list