[Mesa-dev] [PATCH 1/3] gallium/auxiliary/vl: Increase shader_params size
Zhu, James
James.Zhu at amd.com
Tue Mar 12 15:12:21 UTC 2019
Increase shader_params size to pass sampler data to
compute shader during weave de-interlace.
Signed-off-by: James Zhu <James.Zhu at amd.com>
Tested-by: Bruno Milreu <bmilreu at gmail.com>
---
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 a8f3620..12c58ff 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 0e49c11..70898be 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.7.4
More information about the mesa-dev
mailing list