Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / gallium / drivers / nv10 / nv10_state.h
1 #ifndef __NV10_STATE_H__
2 #define __NV10_STATE_H__
3
4 #include "pipe/p_state.h"
5 #include "tgsi/tgsi_scan.h"
6
7 struct nv10_blend_state {
8 uint32_t b_enable;
9 uint32_t b_srcfunc;
10 uint32_t b_dstfunc;
11
12 uint32_t c_mask;
13
14 uint32_t d_enable;
15 };
16
17 struct nv10_sampler_state {
18 uint32_t wrap;
19 uint32_t en;
20 uint32_t filt;
21 uint32_t bcol;
22 };
23
24 struct nv10_rasterizer_state {
25 uint32_t shade_model;
26
27 uint32_t line_width;
28 uint32_t line_smooth_en;
29
30 uint32_t point_size;
31
32 uint32_t poly_smooth_en;
33
34 uint32_t poly_mode_front;
35 uint32_t poly_mode_back;
36
37 uint32_t front_face;
38 uint32_t cull_face;
39 uint32_t cull_face_en;
40
41 uint32_t point_sprite;
42
43 const struct pipe_rasterizer_state *templ;
44 };
45
46 struct nv10_vertex_program_exec {
47 uint32_t data[4];
48 boolean has_branch_offset;
49 int const_index;
50 };
51
52 struct nv10_vertex_program_data {
53 int index; /* immediates == -1 */
54 float value[4];
55 };
56
57 struct nv10_vertex_program {
58 const struct pipe_shader_state *pipe;
59
60 boolean translated;
61 struct nv10_vertex_program_exec *insns;
62 unsigned nr_insns;
63 struct nv10_vertex_program_data *consts;
64 unsigned nr_consts;
65
66 struct nouveau_resource *exec;
67 unsigned exec_start;
68 struct nouveau_resource *data;
69 unsigned data_start;
70 unsigned data_start_min;
71
72 uint32_t ir;
73 uint32_t or;
74 };
75
76 struct nv10_fragment_program_data {
77 unsigned offset;
78 unsigned index;
79 };
80
81 struct nv10_fragment_program {
82 struct pipe_shader_state pipe;
83 struct tgsi_shader_info info;
84
85 boolean translated;
86 boolean on_hw;
87 unsigned samplers;
88
89 uint32_t *insn;
90 int insn_len;
91
92 struct nv10_fragment_program_data *consts;
93 unsigned nr_consts;
94
95 struct pipe_buffer *buffer;
96
97 uint32_t fp_control;
98 uint32_t fp_reg_control;
99 };
100
101
102 struct nv10_depth_stencil_alpha_state {
103 struct {
104 uint32_t func;
105 uint32_t write_enable;
106 uint32_t test_enable;
107 } depth;
108
109 struct {
110 uint32_t enable;
111 uint32_t wmask;
112 uint32_t func;
113 uint32_t ref;
114 uint32_t vmask;
115 uint32_t fail;
116 uint32_t zfail;
117 uint32_t zpass;
118 } stencil;
119
120 struct {
121 uint32_t enabled;
122 uint32_t func;
123 uint32_t ref;
124 } alpha;
125 };
126
127 struct nv10_miptree {
128 struct pipe_texture base;
129
130 struct pipe_buffer *buffer;
131 uint total_size;
132
133 struct {
134 uint pitch;
135 uint *image_offset;
136 } level[PIPE_MAX_TEXTURE_LEVELS];
137 };
138
139 #endif