diff options
author | Christian König <[email protected]> | 2011-12-22 15:43:50 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-01-02 12:47:15 +0100 |
commit | bce506ffc09c44552c3d1053c6a0450b8f010292 (patch) | |
tree | 6a8a0d548ed1a3b27d42aa1b78c7ce7172ae672f /src/gallium/auxiliary/vl/vl_zscan.c | |
parent | 2cd7e5b737e1384bb6d27f3cc2c8524b07230d56 (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_zscan.c')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_zscan.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c index b720d538f9c..600e4152412 100644 --- a/src/gallium/auxiliary/vl/vl_zscan.c +++ b/src/gallium/auxiliary/vl/vl_zscan.c @@ -473,8 +473,6 @@ vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, memset(buffer, 0, sizeof(struct vl_zscan_buffer)); - buffer->zscan = zscan; - pipe_sampler_view_reference(&buffer->src, src); buffer->viewport.scale[0] = dst->width; @@ -537,7 +535,8 @@ vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *la } void -vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], bool intra) +vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, + const uint8_t matrix[64], bool intra) { struct pipe_context *pipe; struct pipe_transfer *buf_transfer; @@ -555,9 +554,9 @@ vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], assert(buffer); assert(matrix); - pipe = buffer->zscan->pipe; + pipe = zscan->pipe; - rect.width *= buffer->zscan->blocks_per_line; + rect.width *= zscan->blocks_per_line; buf_transfer = pipe->get_transfer ( @@ -574,7 +573,7 @@ vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], if (!data) goto error_map; - for (i = 0; i < buffer->zscan->blocks_per_line; ++i) + for (i = 0; i < zscan->blocks_per_line; ++i) for (y = 0; y < BLOCK_HEIGHT; ++y) for (x = 0; x < BLOCK_WIDTH; ++x) data[i * BLOCK_WIDTH + y * pitch + x] = matrix[x + y * BLOCK_WIDTH]; @@ -589,14 +588,10 @@ error_transfer: } void -vl_zscan_render(struct vl_zscan_buffer *buffer, unsigned num_instances) +vl_zscan_render(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, unsigned num_instances) { - struct vl_zscan *zscan; - assert(buffer); - zscan = buffer->zscan; - zscan->pipe->bind_rasterizer_state(zscan->pipe, zscan->rs_state); zscan->pipe->bind_blend_state(zscan->pipe, zscan->blend); zscan->pipe->bind_fragment_sampler_states(zscan->pipe, 3, zscan->samplers); |