summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/g3dvl/vl_context.h
blob: 0aeba184ccba20e72607aacb7363e5043daf62df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef vl_context_h
#define vl_context_h

#include <X11/Xlib.h>
#include <pipe/p_state.h>
#include "vl_types.h"

struct pipe_context;

struct VL_CONTEXT
{
	Display			*display;
	struct pipe_context	*pipe;
	unsigned int		video_width;
	unsigned int		video_height;
	enum VL_FORMAT		video_format;
	
	struct
	{
		struct
		{
			struct pipe_rasterizer_state		*raster;
			struct pipe_depth_stencil_alpha_state	*dsa;
			struct pipe_blend_state			*blend;
		} common;
		
		struct
		{
		} idct;
		
		struct
		{
			struct pipe_viewport_state		viewport;
			struct pipe_framebuffer_state		render_target;
			struct pipe_sampler_state		*samplers[5];
			struct pipe_texture			*textures[5];
			struct pipe_shader_state		*i_vs, *p_vs, *b_vs;
			struct pipe_shader_state		*i_fs, *p_fs, *b_fs;
			struct pipe_vertex_buffer 		vertex_bufs[6];
			struct pipe_vertex_element		vertex_buf_elems[6];
			struct pipe_constant_buffer		vs_const_buf, fs_const_buf;
		} mc;
		
		struct
		{
			struct pipe_viewport_state		viewport;
			struct pipe_framebuffer_state		framebuffer;
			struct pipe_sampler_state		*sampler;
			struct pipe_shader_state		*vertex_shader, *fragment_shader;
			struct pipe_vertex_buffer 		vertex_bufs[2];
			struct pipe_vertex_element		vertex_buf_elems[2];
			struct pipe_constant_buffer		fs_const_buf;
		} csc;
	} states;
};

int vlCreateContext
(
	Display *display,
	struct pipe_context *pipe,
	unsigned int video_width,
	unsigned int video_height,
	enum VL_FORMAT video_format,
	struct VL_CONTEXT **context
);

int vlDestroyContext(struct VL_CONTEXT *context);

int vlBeginRender(struct VL_CONTEXT *context);
int vlEndRender(struct VL_CONTEXT *context);

#endif