Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
[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/util/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
44 struct nv10_vertex_program_exec {
45 uint32_t data[4];
46 boolean has_branch_offset;
47 int const_index;
48 };
49
50 struct nv10_vertex_program_data {
51 int index; /* immediates == -1 */
52 float value[4];
53 };
54
55 struct nv10_vertex_program {
56 const struct pipe_shader_state *pipe;
57
58 boolean translated;
59 struct nv10_vertex_program_exec *insns;
60 unsigned nr_insns;
61 struct nv10_vertex_program_data *consts;
62 unsigned nr_consts;
63
64 struct nouveau_resource *exec;
65 unsigned exec_start;
66 struct nouveau_resource *data;
67 unsigned data_start;
68 unsigned data_start_min;
69
70 uint32_t ir;
71 uint32_t or;
72 };
73
74 struct nv10_fragment_program_data {
75 unsigned offset;
76 unsigned index;
77 };
78
79 struct nv10_fragment_program {
80 const struct pipe_shader_state *pipe;
81 struct tgsi_shader_info info;
82
83 boolean translated;
84 boolean on_hw;
85 unsigned samplers;
86
87 uint32_t *insn;
88 int insn_len;
89
90 struct nv10_fragment_program_data *consts;
91 unsigned nr_consts;
92
93 struct pipe_buffer *buffer;
94
95 uint32_t fp_control;
96 uint32_t fp_reg_control;
97 };
98
99
100 struct nv10_depth_stencil_alpha_state {
101 struct {
102 uint32_t func;
103 uint32_t write_enable;
104 uint32_t test_enable;
105 } depth;
106
107 struct {
108 uint32_t enable;
109 uint32_t wmask;
110 uint32_t func;
111 uint32_t ref;
112 uint32_t vmask;
113 uint32_t fail;
114 uint32_t zfail;
115 uint32_t zpass;
116 } stencil;
117
118 struct {
119 uint32_t enabled;
120 uint32_t func;
121 uint32_t ref;
122 } alpha;
123 };
124
125 struct nv10_miptree {
126 struct pipe_texture base;
127
128 struct pipe_buffer *buffer;
129 uint total_size;
130
131 struct {
132 uint pitch;
133 uint *image_offset;
134 } level[PIPE_MAX_TEXTURE_LEVELS];
135 };
136
137 #endif