From 998dca4dbb2b2866c2bc7e42e757af48717ed854 Mon Sep 17 00:00:00 2001 From: James Zhu Date: Wed, 6 Mar 2019 12:01:07 -0500 Subject: [PATCH] gallium/auxiliary/vl: Increase shader_params size Increase shader_params size to pass sampler data to compute shader during weave de-interlace. Signed-off-by: James Zhu Acked-by: Leo Liu Tested-by: Bruno Milreu --- src/gallium/auxiliary/vl/vl_compositor.c | 2 +- src/gallium/auxiliary/vl/vl_compositor_cs.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index a8f3620103b..12c58ff7436 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -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) diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c index 0e49c11c8bf..70898be4bd6 100644 --- a/src/gallium/auxiliary/vl/vl_compositor_cs.c +++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c @@ -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); -- 2.30.2