[g3dvl] no need for seperate mv vertex states any more
authorChristian König <deathsimple@vodafone.de>
Sun, 17 Apr 2011 19:31:31 +0000 (21:31 +0200)
committerChristian König <deathsimple@vodafone.de>
Sun, 17 Apr 2011 19:31:31 +0000 (21:31 +0200)
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/auxiliary/vl/vl_mpeg12_decoder.h
src/gallium/auxiliary/vl/vl_vertex_buffers.c
src/gallium/auxiliary/vl/vl_vertex_buffers.h

index 1d8f0f92c376d4314187ace34696b501f3167180..10c9c646a517b39c51a2012933c8c7a403c3e269 100644 (file)
@@ -289,8 +289,7 @@ vl_mpeg12_destroy(struct pipe_video_decoder *decoder)
    for (i = 0; i < VL_MAX_PLANES; ++i)
       dec->pipe->delete_vertex_elements_state(dec->pipe, dec->ves_eb[i]);
 
-   for (i = 0; i < 2; ++i)
-      dec->pipe->delete_vertex_elements_state(dec->pipe, dec->ves_mv[i]);
+   dec->pipe->delete_vertex_elements_state(dec->pipe, dec->ves_mv);
 
    pipe_resource_reference(&dec->quads.buffer, NULL);
    pipe_resource_reference(&dec->pos.buffer, NULL);
@@ -476,6 +475,7 @@ vl_mpeg12_decoder_flush_buffer(struct pipe_video_decode_buffer *buffer,
    vb[0] = dec->quads;
    vb[1] = dec->pos;
 
+   dec->pipe->bind_vertex_elements_state(dec->pipe, dec->ves_mv);
    for (i = 0; i < VL_MAX_PLANES; ++i) {
       vl_mc_set_surface(&buf->mc[i], surfaces[i]);
 
@@ -485,7 +485,6 @@ vl_mpeg12_decoder_flush_buffer(struct pipe_video_decode_buffer *buffer,
          vb[2] = vl_vb_get_mv(&buf->vertex_stream, j);;
          dec->pipe->set_vertex_buffers(dec->pipe, 3, vb);
 
-         dec->pipe->bind_vertex_elements_state(dec->pipe, dec->ves_mv[j]);
          vl_mc_render_ref(&buf->mc[i], sv[j][i]);
       }
    }
@@ -710,8 +709,7 @@ vl_create_mpeg12_decoder(struct pipe_video_context *context,
    for (i = 0; i < VL_MAX_PLANES; ++i)
       dec->ves_eb[i] = vl_vb_get_ves_eb(dec->pipe, i);
 
-   for (i = 0; i < 2; ++i)
-      dec->ves_mv[i] = vl_vb_get_ves_mv(dec->pipe, i);
+   dec->ves_mv = vl_vb_get_ves_mv(dec->pipe);
 
    /* TODO: Implement 422, 444 */
    assert(dec->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
index 2bd5591b463d0cfcd201c44edb0c31c905bc8f61..6a6fabdb18825cf9fc9e005ffb75e3c286dc1d02 100644 (file)
@@ -55,7 +55,7 @@ struct vl_mpeg12_decoder
    struct pipe_vertex_buffer pos;
 
    void *ves_eb[VL_MAX_PLANES];
-   void *ves_mv[2];
+   void *ves_mv;
 
    struct vl_idct idct_y, idct_c;
    struct vl_mc mc_y, mc_c;
index c923686b06e0fc33100a38f78317d633071e8d7e..76142559cc8099d9fdf077f6ab384356ee466c2b 100644 (file)
@@ -205,7 +205,7 @@ vl_vb_get_ves_eb(struct pipe_context *pipe, int component)
 }
 
 void *
-vl_vb_get_ves_mv(struct pipe_context *pipe, int motionvector)
+vl_vb_get_ves_mv(struct pipe_context *pipe)
 {
    struct pipe_vertex_element vertex_elems[NUM_VS_INPUTS];
 
index bafaff7a311efddb59f98fed39cf904f21050cfe..ce169ccf64014bcc4fc0d7f452ebc6a9de7387c8 100644 (file)
@@ -76,7 +76,7 @@ struct pipe_vertex_buffer vl_vb_upload_pos(struct pipe_context *pipe, unsigned w
 
 void *vl_vb_get_ves_eb(struct pipe_context *pipe, int component);
 
-void *vl_vb_get_ves_mv(struct pipe_context *pipe, int motionvector);
+void *vl_vb_get_ves_mv(struct pipe_context *pipe);
 
 void vl_vb_init(struct vl_vertex_buffer *buffer,
                 struct pipe_context *pipe,