gallium/auxiliary/vl: Increase shader_params size
authorJames Zhu <James.Zhu@amd.com>
Wed, 6 Mar 2019 17:01:07 +0000 (12:01 -0500)
committerLeo Liu <leo.liu@amd.com>
Fri, 15 Mar 2019 15:53:15 +0000 (11:53 -0400)
Increase shader_params size to pass sampler data to
compute shader during weave de-interlace.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Tested-by: Bruno Milreu <bmilreu@gmail.com>
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_compositor_cs.c

index a8f3620103b52666d7d490fcc98aef701a6fe641..12c58ff7436db2ac865b4847f553646e9a767dd8 100644 (file)
@@ -802,7 +802,7 @@ vl_compositor_init_state(struct vl_compositor_state *s, struct pipe_context *pip
       pipe->screen,
       PIPE_BIND_CONSTANT_BUFFER,
       PIPE_USAGE_DEFAULT,
-      sizeof(csc_matrix) + 4*sizeof(float) + 6*sizeof(int)
+      sizeof(csc_matrix) + 6*sizeof(float) + 6*sizeof(int)
    );
 
    if (!s->shader_params)
index 0e49c11c8bf28c71c7695604f455a35565a6f685..70898be4bd64b4b14a671e9bdda7e97dadf7a510 100644 (file)
@@ -38,6 +38,8 @@ struct cs_viewport {
    struct u_rect area;
    int translate_x;
    int translate_y;
+   float sampler0_w;
+   float sampler0_h;
 };
 
 const char *compute_shader_video_buffer =
@@ -298,8 +300,11 @@ set_viewport(struct vl_compositor_state *s,
    *ptr_int++ = drawn->area.x1;
    *ptr_int++ = drawn->area.y1;
    *ptr_int++ = drawn->translate_x;
-   *ptr_int = drawn->translate_y;
+   *ptr_int++ = drawn->translate_y;
 
+   ptr_float = (float *)ptr_int;
+   *ptr_float++ = drawn->sampler0_w;
+   *ptr_float = drawn->sampler0_h;
    pipe_buffer_unmap(s->pipe, buf_transfer);
 
    return true;
@@ -328,6 +333,8 @@ draw_layers(struct vl_compositor       *c,
          drawn.scale_y = drawn.scale_x;
          drawn.translate_x = (int)layer->viewport.translate[0];
          drawn.translate_y = (int)layer->viewport.translate[1];
+         drawn.sampler0_w = (float)layer->sampler_views[0]->texture->width0;
+         drawn.sampler0_h = (float)layer->sampler_views[0]->texture->height0;
 
          if (memcmp(&drawn, &old_drawn, sizeof(struct cs_viewport))) {
             set_viewport(s, &drawn);