From: Christian König Date: Sun, 28 Nov 2010 19:20:47 +0000 (+0100) Subject: use vl_vb_upload_quads also for mc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=838d1092077368d45674f5f5637186da5c69ca15;p=mesa.git use vl_vb_upload_quads also for mc --- 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; @@ -644,27 +631,6 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) return true; } -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) { @@ -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;