vl: ...
[mesa.git] / src / gallium / drivers / nvfx / nvfx_state.h
1 #ifndef __NVFX_STATE_H__
2 #define __NVFX_STATE_H__
3
4 #include "pipe/p_state.h"
5 #include "pipe/p_video_state.h"
6 #include "tgsi/tgsi_scan.h"
7 #include "nouveau/nouveau_statebuf.h"
8
9 struct nvfx_vertex_program_exec {
10 uint32_t data[4];
11 boolean has_branch_offset;
12 int const_index;
13 };
14
15 struct nvfx_vertex_program_data {
16 int index; /* immediates == -1 */
17 float value[4];
18 };
19
20 struct nvfx_vertex_program {
21 struct pipe_shader_state pipe;
22
23 struct draw_vertex_shader *draw;
24
25 boolean translated;
26
27 struct pipe_clip_state ucp;
28
29 struct nvfx_vertex_program_exec *insns;
30 unsigned nr_insns;
31 struct nvfx_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 uint32_t clip_ctrl;
43 };
44
45 struct nvfx_fragment_program_data {
46 unsigned offset;
47 unsigned index;
48 };
49
50 struct nvfx_fragment_program_bo {
51 struct nvfx_fragment_program_bo* next;
52 struct nouveau_bo* bo;
53 char insn[] __attribute__((aligned(16)));
54 };
55
56 struct nvfx_fragment_program {
57 struct pipe_shader_state pipe;
58 struct tgsi_shader_info info;
59
60 boolean translated;
61 unsigned samplers;
62
63 uint32_t *insn;
64 int insn_len;
65
66 struct nvfx_fragment_program_data *consts;
67 unsigned nr_consts;
68
69 uint32_t fp_control;
70
71 unsigned bo_prog_idx;
72 unsigned prog_size;
73 unsigned progs_per_bo;
74 struct nvfx_fragment_program_bo* fpbo;
75 };
76
77
78 #endif