summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-04-15 22:15:17 +0200
committerChristian König <[email protected]>2011-04-15 22:15:17 +0200
commitc87b83d4b2b860bb4c9f90897232e661a2b94c07 (patch)
tree926504d8f95edbaaadcb97eceea7a0b6e6eb584e /src
parentb1c44b0ea6b3e891086ce554edf3c26dbd3708cd (diff)
[g3dvl] give mc and ycbcr stage its own vertex element state
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c4
-rw-r--r--src/gallium/auxiliary/vl/vl_vertex_buffers.c26
-rw-r--r--src/gallium/auxiliary/vl/vl_vertex_buffers.h10
3 files changed, 32 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 906be3775c4..9e0d40e7f5b 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -715,10 +715,10 @@ vl_create_mpeg12_decoder(struct pipe_video_context *context,
dec->quads = vl_vb_upload_quads(dec->pipe, 2, 2);
for (i = 0; i < VL_MAX_PLANES; ++i)
- dec->ves_eb[i] = vl_vb_get_elems_state(dec->pipe, i, 0);
+ 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_elems_state(dec->pipe, 0, i);
+ dec->ves_mv[i] = vl_vb_get_ves_mv(dec->pipe, i);
dec->base.width = align(width, MACROBLOCK_WIDTH);
dec->base.height = align(height, MACROBLOCK_HEIGHT);
diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
index 925ad10c6e0..fc30e85a4d7 100644
--- a/src/gallium/auxiliary/vl/vl_vertex_buffers.c
+++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
@@ -130,10 +130,12 @@ vl_vb_element_helper(struct pipe_vertex_element* elements, unsigned num_elements
}
void *
-vl_vb_get_elems_state(struct pipe_context *pipe, int component, int motionvector)
+vl_vb_get_ves_eb(struct pipe_context *pipe, int component)
{
struct pipe_vertex_element vertex_elems[NUM_VS_INPUTS];
+ assert(pipe);
+
memset(&vertex_elems, 0, sizeof(vertex_elems));
vertex_elems[VS_I_RECT] = vl_vb_get_quad_vertex_element();
@@ -144,11 +146,29 @@ vl_vb_get_elems_state(struct pipe_context *pipe, int component, int motionvector
vertex_elems[VS_I_FLAGS].src_format = PIPE_FORMAT_R8G8B8A8_USCALED;
/* empty block element of selected component */
- vertex_elems[VS_I_EB].src_offset = 8 + component * 4;
+ vertex_elems[VS_I_EB].src_offset = offsetof(struct vl_vertex_stream, eb[component]);
vertex_elems[VS_I_EB].src_format = PIPE_FORMAT_R8G8B8A8_USCALED;
+ vl_vb_element_helper(&vertex_elems[VS_I_VPOS], NUM_VS_INPUTS - 1, 1);
+
+ return pipe->create_vertex_elements_state(pipe, NUM_VS_INPUTS, vertex_elems);
+}
+
+void *
+vl_vb_get_ves_mv(struct pipe_context *pipe, int motionvector)
+{
+ struct pipe_vertex_element vertex_elems[NUM_VS_INPUTS];
+
+ memset(&vertex_elems, 0, sizeof(vertex_elems));
+ vertex_elems[VS_I_RECT] = vl_vb_get_quad_vertex_element();
+
+ assert(pipe);
+
+ /* Position element */
+ vertex_elems[VS_I_VPOS].src_format = PIPE_FORMAT_R16G16_SSCALED;
+
/* motion vector TOP element */
- vertex_elems[VS_I_MV_TOP].src_offset = 20 + motionvector * 16;
+ vertex_elems[VS_I_MV_TOP].src_offset = offsetof(struct vl_vertex_stream, mv[motionvector * 2]);
vertex_elems[VS_I_MV_TOP].src_format = PIPE_FORMAT_R16G16B16A16_SSCALED;
/* motion vector BOTTOM element */
diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.h b/src/gallium/auxiliary/vl/vl_vertex_buffers.h
index 6cbda7cc9b1..62f7bf00508 100644
--- a/src/gallium/auxiliary/vl/vl_vertex_buffers.h
+++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.h
@@ -42,10 +42,12 @@ enum VS_INPUT
{
VS_I_RECT,
VS_I_VPOS,
+
VS_I_FLAGS,
VS_I_EB,
- VS_I_MV_TOP,
- VS_I_MV_BOTTOM,
+
+ VS_I_MV_TOP = VS_I_FLAGS,
+ VS_I_MV_BOTTOM = VS_I_EB,
NUM_VS_INPUTS
};
@@ -64,7 +66,9 @@ struct vl_vertex_buffer
struct pipe_vertex_buffer vl_vb_upload_quads(struct pipe_context *pipe,
unsigned blocks_x, unsigned blocks_y);
-void *vl_vb_get_elems_state(struct pipe_context *pipe, int component, int motionvector);
+void *vl_vb_get_ves_eb(struct pipe_context *pipe, int component);
+
+void *vl_vb_get_ves_mv(struct pipe_context *pipe, int motionvector);
struct pipe_vertex_buffer vl_vb_init(struct vl_vertex_buffer *buffer,
struct pipe_context *pipe,