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

Dave Airlie airlied at gmail.com
Mon May 21 02:42:56 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 5f8ff23..25d77d4 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -2989,6 +2989,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 != 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);
@@ -3451,6 +3453,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