Merge branch 'master' into pipe-video
[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 #include "pipe/p_video_state.h"
6 #include "tgsi/tgsi_scan.h"
7
8 struct nv40_sampler_state {
9 uint32_t fmt;
10 uint32_t wrap;
11 uint32_t en;
12 uint32_t filt;
13 uint32_t bcol;
14 };
15
16 struct nv40_vertex_program_exec {
17 uint32_t data[4];
18 boolean has_branch_offset;
19 int const_index;
20 };
21
22 struct nv40_vertex_program_data {
23 int index; /* immediates == -1 */
24 float value[4];
25 };
26
27 struct nv40_vertex_program {
28 struct pipe_shader_state pipe;
29
30 struct draw_vertex_shader *draw;
31
32 boolean translated;
33
34 struct pipe_clip_state ucp;
35
36 struct nv40_vertex_program_exec *insns;
37 unsigned nr_insns;
38 struct nv40_vertex_program_data *consts;
39 unsigned nr_consts;
40
41 struct nouveau_resource *exec;
42 unsigned exec_start;
43 struct nouveau_resource *data;
44 unsigned data_start;
45 unsigned data_start_min;
46
47 uint32_t ir;
48 uint32_t or;
49 uint32_t clip_ctrl;
50 struct nouveau_stateobj *so;
51 };
52
53 struct nv40_fragment_program_data {
54 unsigned offset;
55 unsigned index;
56 };
57
58 struct nv40_fragment_program {
59 struct pipe_shader_state pipe;
60 struct tgsi_shader_info info;
61
62 boolean translated;
63 unsigned samplers;
64
65 uint32_t *insn;
66 int insn_len;
67
68 struct nv40_fragment_program_data *consts;
69 unsigned nr_consts;
70
71 struct pipe_buffer *buffer;
72
73 uint32_t fp_control;
74 struct nouveau_stateobj *so;
75 };
76
77 struct nv40_miptree {
78 struct pipe_texture base;
79 struct nouveau_bo *bo;
80
81 struct pipe_buffer *buffer;
82 uint total_size;
83
84 struct {
85 uint pitch;
86 uint *image_offset;
87 } level[PIPE_MAX_TEXTURE_LEVELS];
88 };
89
90 struct nv40_video_surface {
91 struct pipe_video_surface base;
92 struct pipe_texture *tex;
93 };
94
95
96 static INLINE struct nv40_video_surface*
97 nv40_video_surface(struct pipe_video_surface *sfc)
98 {
99 return (struct nv40_video_surface*)sfc;
100 }
101
102 #endif