nouveau: match gallium code reorginisation.
[mesa.git] / src / gallium / drivers / nv40 / nv40_state.h
1 #ifndef __NV40_STATE_H__
2 #define __NV40_STATE_H__
3
4 #include "pipe/p_state.h"
5
6 struct nv40_sampler_state {
7 uint32_t fmt;
8 uint32_t wrap;
9 uint32_t en;
10 uint32_t filt;
11 uint32_t bcol;
12 };
13
14 struct nv40_vertex_program_exec {
15 uint32_t data[4];
16 boolean has_branch_offset;
17 int const_index;
18 };
19
20 struct nv40_vertex_program_data {
21 int index; /* immediates == -1 */
22 float value[4];
23 };
24
25 struct nv40_vertex_program {
26 const struct pipe_shader_state *pipe;
27
28 boolean translated;
29 struct nv40_vertex_program_exec *insns;
30 unsigned nr_insns;
31 struct nv40_vertex_program_data *consts;
32 unsigned nr_consts;
33
34 struct nouveau_resource *exec;
35 unsigned exec_start;
36 struct nouveau_resource *data;
37 unsigned data_start;
38 unsigned data_start_min;
39
40 uint32_t ir;
41 uint32_t or;
42 };
43
44 struct nv40_fragment_program_data {
45 unsigned offset;
46 unsigned index;
47 };
48
49 struct nv40_fragment_program {
50 const struct pipe_shader_state *pipe;
51
52 boolean translated;
53 boolean on_hw;
54 unsigned samplers;
55
56 uint32_t *insn;
57 int insn_len;
58
59 struct nv40_fragment_program_data *consts;
60 unsigned nr_consts;
61
62 struct pipe_buffer *buffer;
63
64 uint32_t fp_control;
65 struct nouveau_stateobj *so;
66 };
67
68 struct nv40_miptree {
69 struct pipe_texture base;
70
71 struct pipe_buffer *buffer;
72 uint total_size;
73
74 struct {
75 uint pitch;
76 uint *image_offset;
77 } level[PIPE_MAX_TEXTURE_LEVELS];
78 };
79
80 #endif