1 /**************************************************************************
3 * Copyright 2010 Christian König
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
27 #ifndef vl_vertex_buffers_h
28 #define vl_vertex_buffers_h
30 #include <pipe/p_state.h>
31 #include <pipe/p_video_state.h>
33 #include "vl_defines.h"
36 /* vertex buffers act as a todo list
37 * uploading all the usefull informations to video ram
38 * so a vertex shader can work with them
41 /* inputs to the vertex shaders */
53 struct vl_vertex_buffer
55 unsigned width
, height
;
58 struct pipe_resource
*resource
;
59 struct pipe_transfer
*transfer
;
60 struct pipe_ycbcr_block
*vertex_stream
;
61 } ycbcr
[VL_MAX_PLANES
];
64 struct pipe_resource
*resource
;
65 struct pipe_transfer
*transfer
;
66 struct pipe_motionvector
*vertex_stream
;
67 } mv
[VL_MAX_REF_FRAMES
];
70 struct pipe_vertex_buffer
vl_vb_upload_quads(struct pipe_context
*pipe
);
72 struct pipe_vertex_buffer
vl_vb_upload_pos(struct pipe_context
*pipe
, unsigned width
, unsigned height
);
74 void *vl_vb_get_ves_ycbcr(struct pipe_context
*pipe
);
76 void *vl_vb_get_ves_mv(struct pipe_context
*pipe
);
78 void vl_vb_init(struct vl_vertex_buffer
*buffer
,
79 struct pipe_context
*pipe
,
80 unsigned width
, unsigned height
);
82 void vl_vb_map(struct vl_vertex_buffer
*buffer
, struct pipe_context
*pipe
);
84 struct pipe_vertex_buffer
vl_vb_get_ycbcr(struct vl_vertex_buffer
*buffer
, int component
);
86 struct pipe_ycbcr_block
*vl_vb_get_ycbcr_stream(struct vl_vertex_buffer
*buffer
, int component
);
88 struct pipe_vertex_buffer
vl_vb_get_mv(struct vl_vertex_buffer
*buffer
, int ref_frame
);
90 unsigned vl_vb_get_mv_stream_stride(struct vl_vertex_buffer
*buffer
);
92 struct pipe_motionvector
*vl_vb_get_mv_stream(struct vl_vertex_buffer
*buffer
, int ref_frame
);
94 void vl_vb_unmap(struct vl_vertex_buffer
*buffer
, struct pipe_context
*pipe
);
96 void vl_vb_cleanup(struct vl_vertex_buffer
*buffer
);
98 #endif /* vl_vertex_buffers_h */