diff options
author | Christian König <[email protected]> | 2010-11-28 20:20:47 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2010-12-03 19:04:00 +0100 |
commit | 838d1092077368d45674f5f5637186da5c69ca15 (patch) | |
tree | 5b349f67d5aa75d16b2eb5d16b4c8cc69c337cb7 /src | |
parent | 3e6a5077ca5968a3bf76e6ab6ba8f33487895066 (diff) |
use vl_vb_upload_quads also for mc
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index dbc900d2614..ab6f8b092fe 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -87,11 +87,6 @@ enum VS_OUTPUT VS_O_MV3 }; -/* vertices for a quad covering a macroblock */ -static const struct vertex2f const_quad[4] = { - {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} -}; - static const unsigned const_mbtype_config[VL_NUM_MACROBLOCK_TYPES][2] = { [VL_MACROBLOCK_TYPE_INTRA] = { 0, 0 }, [VL_MACROBLOCK_TYPE_FWD_FRAME_PRED] = { 1, 1 }, @@ -553,15 +548,7 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) r->sampler_views.all[i] = r->pipe->create_sampler_view(r->pipe, r->textures.all[i], &sampler_view); } - r->vertex_bufs.individual.rect.stride = sizeof(struct vertex2f); - r->vertex_bufs.individual.rect.max_index = 4 * r->macroblocks_per_batch - 1; - r->vertex_bufs.individual.rect.buffer_offset = 0; - r->vertex_bufs.individual.rect.buffer = pipe_buffer_create - ( - r->pipe->screen, - PIPE_BIND_VERTEX_BUFFER, - sizeof(struct vertex2f) * 4 * r->macroblocks_per_batch - ); + r->vertex_bufs.individual.quad = vl_vb_upload_quads(r->pipe, r->macroblocks_per_batch); r->vertex_bufs.individual.ycbcr.stride = sizeof(struct vert_stream_0); r->vertex_bufs.individual.ycbcr.max_index = 4 * r->macroblocks_per_batch - 1; @@ -645,27 +632,6 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) } static void -init_const_buffers(struct vl_mpeg12_mc_renderer *r) -{ - struct pipe_transfer *buf_transfer; - struct vertex2f *rect; - unsigned i; - - rect = pipe_buffer_map - ( - r->pipe, - r->vertex_bufs.individual.rect.buffer, - PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD, - &buf_transfer - ); - - for ( i = 0; i < r->macroblocks_per_batch; ++i) - memcpy(rect + i * 4, &const_quad, sizeof(const_quad)); - - pipe_buffer_unmap(r->pipe, r->vertex_bufs.individual.rect.buffer, buf_transfer); -} - -static void cleanup_buffers(struct vl_mpeg12_mc_renderer *r) { unsigned i; @@ -1121,8 +1087,6 @@ vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer, if (!init_buffers(renderer)) goto error_buffers; - init_const_buffers(renderer); - renderer->surface = NULL; renderer->past = NULL; renderer->future = NULL; |