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

Elie Tournier tournier.elie at gmail.com
Mon May 21 14:26:40 UTC 2018


On Mon, May 21, 2018 at 12:42:56PM +1000, Dave Airlie wrote:
> 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

This series makes more good than bad.
See attached.
I didn't investigate more.

> ---
>  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
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff_cbuf_patch
Type: application/octet-stream
Size: 7874 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/virglrenderer-devel/attachments/20180521/f11a3e6c/attachment-0001.obj>


More information about the virglrenderer-devel mailing list