[v3] gallium/auxiliary/vl: Fix transparent issue on compute shader with rgba

Submitted by Zhu, James on Feb. 15, 2019, 9:19 p.m.

Details

Message ID 1550265575-16301-1-git-send-email-James.Zhu@amd.com
State New
Headers show
Series "gallium/auxiliary/vl: Revert rgba back to frament shader" ( rev: 3 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhu, James Feb. 15, 2019, 9:19 p.m.
Fixes: 9364d66cb7f7 (Add video compositor compute shader render)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109646
Problem 1,4: they are caused by imcomplete blend comute shader
implementation. So Reverts rgba back to frament shader.

Signed-off-by: James Zhu <James.Zhu@amd.com>
---
 src/gallium/auxiliary/vl/vl_compositor.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 8731ad9..a8f3620 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -100,12 +100,12 @@  init_shaders(struct vl_compositor *c)
          debug_printf("Unable to create YCbCr-to-RGB weave fragment shader.\n");
          return false;
       }
+   }
 
-      c->fs_rgba = create_frag_shader_rgba(c);
-      if (!c->fs_rgba) {
-         debug_printf("Unable to create RGB-to-RGB fragment shader.\n");
-         return false;
-      }
+   c->fs_rgba = create_frag_shader_rgba(c);
+   if (!c->fs_rgba) {
+      debug_printf("Unable to create RGB-to-RGB fragment shader.\n");
+      return false;
    }
 
    return true;
@@ -132,8 +132,8 @@  static void cleanup_shaders(struct vl_compositor *c)
    } else {
       c->pipe->delete_fs_state(c->pipe, c->fs_video_buffer);
       c->pipe->delete_fs_state(c->pipe, c->fs_weave_rgb);
-      c->pipe->delete_fs_state(c->pipe, c->fs_rgba);
    }
+   c->pipe->delete_fs_state(c->pipe, c->fs_rgba);
 }
 
 static bool
@@ -642,10 +642,7 @@  vl_compositor_set_rgba_layer(struct vl_compositor_state *s,
    assert(layer < VL_COMPOSITOR_MAX_LAYERS);
 
    s->used_layers |= 1 << layer;
-   if (c->pipe_compute_supported)
-      s->layers[layer].cs = c->cs_rgba;
-   else
-      s->layers[layer].fs = c->fs_rgba;
+   s->layers[layer].fs = c->fs_rgba;
    s->layers[layer].samplers[0] = c->sampler_linear;
    s->layers[layer].samplers[1] = NULL;
    s->layers[layer].samplers[2] = NULL;

Comments

Reviewed-by: Leo Liu <leo.liu@amd.com>


On 2019-02-15 4:19 p.m., Zhu, James wrote:
> Fixes: 9364d66cb7f7 (Add video compositor compute shader render)

> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109646

> Problem 1,4: they are caused by imcomplete blend comute shader

> implementation. So Reverts rgba back to frament shader.

>

> Signed-off-by: James Zhu <James.Zhu@amd.com>

> ---

>   src/gallium/auxiliary/vl/vl_compositor.c | 17 +++++++----------

>   1 file changed, 7 insertions(+), 10 deletions(-)

>

> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c

> index 8731ad9..a8f3620 100644

> --- a/src/gallium/auxiliary/vl/vl_compositor.c

> +++ b/src/gallium/auxiliary/vl/vl_compositor.c

> @@ -100,12 +100,12 @@ init_shaders(struct vl_compositor *c)

>            debug_printf("Unable to create YCbCr-to-RGB weave fragment shader.\n");

>            return false;

>         }

> +   }

>   

> -      c->fs_rgba = create_frag_shader_rgba(c);

> -      if (!c->fs_rgba) {

> -         debug_printf("Unable to create RGB-to-RGB fragment shader.\n");

> -         return false;

> -      }

> +   c->fs_rgba = create_frag_shader_rgba(c);

> +   if (!c->fs_rgba) {

> +      debug_printf("Unable to create RGB-to-RGB fragment shader.\n");

> +      return false;

>      }

>   

>      return true;

> @@ -132,8 +132,8 @@ static void cleanup_shaders(struct vl_compositor *c)

>      } else {

>         c->pipe->delete_fs_state(c->pipe, c->fs_video_buffer);

>         c->pipe->delete_fs_state(c->pipe, c->fs_weave_rgb);

> -      c->pipe->delete_fs_state(c->pipe, c->fs_rgba);

>      }

> +   c->pipe->delete_fs_state(c->pipe, c->fs_rgba);

>   }

>   

>   static bool

> @@ -642,10 +642,7 @@ vl_compositor_set_rgba_layer(struct vl_compositor_state *s,

>      assert(layer < VL_COMPOSITOR_MAX_LAYERS);

>   

>      s->used_layers |= 1 << layer;

> -   if (c->pipe_compute_supported)

> -      s->layers[layer].cs = c->cs_rgba;

> -   else

> -      s->layers[layer].fs = c->fs_rgba;

> +   s->layers[layer].fs = c->fs_rgba;

>      s->layers[layer].samplers[0] = c->sampler_linear;

>      s->layers[layer].samplers[1] = NULL;

>      s->layers[layer].samplers[2] = NULL;