nv30_state.h revision 9a4938d7033101122b627786273ff37229b5558a
1#ifndef __NV30_STATE_H__
2#define __NV30_STATE_H__
3
4#include "pipe/p_state.h"
5
6struct nv30_blend_state {
7	uint32_t b_enable;
8	uint32_t b_srcfunc;
9	uint32_t b_dstfunc;
10	uint32_t b_eqn;
11
12	uint32_t l_enable;
13	uint32_t l_op;
14
15	uint32_t c_mask;
16
17	uint32_t d_enable;
18};
19
20struct nv30_sampler_state {
21	uint32_t fmt;
22	uint32_t wrap;
23	uint32_t en;
24	uint32_t filt;
25	uint32_t bcol;
26};
27
28struct nv30_rasterizer_state {
29	uint32_t shade_model;
30
31	uint32_t line_width;
32	uint32_t line_smooth_en;
33	uint32_t line_stipple_en;
34	uint32_t line_stipple;
35
36	uint32_t point_size;
37
38	uint32_t poly_smooth_en;
39	uint32_t poly_stipple_en;
40
41	uint32_t poly_mode_front;
42	uint32_t poly_mode_back;
43
44	uint32_t front_face;
45	uint32_t cull_face;
46	uint32_t cull_face_en;
47
48	uint32_t point_sprite;
49};
50
51struct nv30_vertex_program_exec {
52	uint32_t data[4];
53	boolean has_branch_offset;
54	int const_index;
55};
56
57struct nv30_vertex_program_data {
58	int index; /* immediates == -1 */
59	float value[4];
60};
61
62struct nv30_vertex_program {
63	struct pipe_shader_state pipe;
64
65	boolean translated;
66	struct nv30_vertex_program_exec *insns;
67	unsigned nr_insns;
68	struct nv30_vertex_program_data *consts;
69	unsigned nr_consts;
70
71	struct nouveau_resource *exec;
72	unsigned exec_start;
73	struct nouveau_resource *data;
74	unsigned data_start;
75	unsigned data_start_min;
76
77	uint32_t ir;
78	uint32_t or;
79};
80
81struct nv30_fragment_program_data {
82	unsigned offset;
83	unsigned index;
84};
85
86struct nv30_fragment_program {
87	struct pipe_shader_state pipe;
88
89	boolean translated;
90	boolean on_hw;
91	unsigned samplers;
92
93	uint32_t *insn;
94	int       insn_len;
95
96	struct nv30_fragment_program_data *consts;
97	unsigned nr_consts;
98
99	struct pipe_buffer *buffer;
100
101	uint32_t fp_control;
102	uint32_t fp_reg_control;
103};
104
105struct nv30_stencil_push {
106	uint32_t enable;
107	uint32_t wmask;
108	uint32_t func;
109	uint32_t ref;
110	uint32_t vmask;
111	uint32_t fail;
112	uint32_t zfail;
113	uint32_t zpass;
114};
115
116struct nv30_depth_stencil_alpha_state {
117	struct {
118		uint32_t func;
119		uint32_t write_enable;
120		uint32_t test_enable;
121	} depth;
122
123	struct {
124		struct nv30_stencil_push back;
125		struct nv30_stencil_push front;
126	} stencil;
127
128	struct {
129		uint32_t enabled;
130		uint32_t func;
131		uint32_t ref;
132	} alpha;
133};
134
135struct nv30_miptree {
136	struct pipe_texture base;
137
138	struct pipe_buffer *buffer;
139	uint total_size;
140
141	struct {
142		uint pitch;
143		uint *image_offset;
144	} level[PIPE_MAX_TEXTURE_LEVELS];
145};
146
147#endif
148