summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_mc.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-12-22 15:43:50 +0100
committerChristian König <[email protected]>2012-01-02 12:47:15 +0100
commitbce506ffc09c44552c3d1053c6a0450b8f010292 (patch)
tree6a8a0d548ed1a3b27d42aa1b78c7ce7172ae672f /src/gallium/auxiliary/vl/vl_mc.c
parent2cd7e5b737e1384bb6d27f3cc2c8524b07230d56 (diff)
vl: seperate shader buffers from components
Buffers for shader based decoding can now be released without its component still being around. Signed-off-by: Christian König <[email protected]> Acked-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_mc.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_mc.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mc.c b/src/gallium/auxiliary/vl/vl_mc.c
index 9534a8f0050..0f41c687f46 100644
--- a/src/gallium/auxiliary/vl/vl_mc.c
+++ b/src/gallium/auxiliary/vl/vl_mc.c
@@ -551,8 +551,6 @@ vl_mc_init_buffer(struct vl_mc *renderer, struct vl_mc_buffer *buffer)
{
assert(renderer && buffer);
- buffer->renderer = renderer;
-
buffer->viewport.scale[2] = 1;
buffer->viewport.scale[3] = 1;
buffer->viewport.translate[0] = 0;
@@ -588,13 +586,10 @@ vl_mc_set_surface(struct vl_mc_buffer *buffer, struct pipe_surface *surface)
}
static void
-prepare_pipe_4_rendering(struct vl_mc_buffer *buffer, unsigned mask)
+prepare_pipe_4_rendering(struct vl_mc *renderer, struct vl_mc_buffer *buffer, unsigned mask)
{
- struct vl_mc *renderer;
-
assert(buffer);
- renderer = buffer->renderer;
renderer->pipe->bind_rasterizer_state(renderer->pipe, renderer->rs_state);
if (buffer->surface_cleared)
@@ -607,15 +602,11 @@ prepare_pipe_4_rendering(struct vl_mc_buffer *buffer, unsigned mask)
}
void
-vl_mc_render_ref(struct vl_mc_buffer *buffer, struct pipe_sampler_view *ref)
+vl_mc_render_ref(struct vl_mc *renderer, struct vl_mc_buffer *buffer, struct pipe_sampler_view *ref)
{
- struct vl_mc *renderer;
-
assert(buffer && ref);
- prepare_pipe_4_rendering(buffer, PIPE_MASK_R | PIPE_MASK_G | PIPE_MASK_B);
-
- renderer = buffer->renderer;
+ prepare_pipe_4_rendering(renderer, buffer, PIPE_MASK_R | PIPE_MASK_G | PIPE_MASK_B);
renderer->pipe->bind_vs_state(renderer->pipe, renderer->vs_ref);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs_ref);
@@ -631,9 +622,8 @@ vl_mc_render_ref(struct vl_mc_buffer *buffer, struct pipe_sampler_view *ref)
}
void
-vl_mc_render_ycbcr(struct vl_mc_buffer *buffer, unsigned component, unsigned num_instances)
+vl_mc_render_ycbcr(struct vl_mc *renderer, struct vl_mc_buffer *buffer, unsigned component, unsigned num_instances)
{
- struct vl_mc *renderer;
unsigned mask = 1 << component;
assert(buffer);
@@ -641,9 +631,7 @@ vl_mc_render_ycbcr(struct vl_mc_buffer *buffer, unsigned component, unsigned num
if (num_instances == 0)
return;
- prepare_pipe_4_rendering(buffer, mask);
-
- renderer = buffer->renderer;
+ prepare_pipe_4_rendering(renderer, buffer, mask);
renderer->pipe->bind_vs_state(renderer->pipe, renderer->vs_ycbcr);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs_ycbcr);