Merge branch '7.8'
[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 "tgsi/tgsi_scan.h"
6 #include "nouveau/nouveau_statebuf.h"
7
8 struct nvfx_vertex_program_exec {
9 uint32_t data[4];
10 boolean has_branch_offset;
11 int const_index;
12 };
13
14 struct nvfx_vertex_program_data {
15 int index; /* immediates == -1 */
16 float value[4];
17 };
18
19 struct nvfx_vertex_program {
20 struct pipe_shader_state pipe;
21
22 struct draw_vertex_shader *draw;
23
24 boolean translated;
25
26 struct pipe_clip_state ucp;
27
28 struct nvfx_vertex_program_exec *insns;
29 unsigned nr_insns;
30 struct nvfx_vertex_program_data *consts;
31 unsigned nr_consts;
32
33 struct nouveau_resource *exec;
34 unsigned exec_start;
35 struct nouveau_resource *data;
36 unsigned data_start;
37 unsigned data_start_min;
38
39 uint32_t ir;
40 uint32_t or;
41 uint32_t clip_ctrl;
42 };
43
44 struct nvfx_fragment_program_data {
45 unsigned offset;
46 unsigned index;
47 };
48
49 struct nvfx_fragment_program_bo {
50 struct nvfx_fragment_program_bo* next;
51 struct nouveau_bo* bo;
52 char insn[] __attribute__((aligned(16)));
53 };
54
55 struct nvfx_fragment_program {
56 struct pipe_shader_state pipe;
57 struct tgsi_shader_info info;
58
59 boolean translated;
60 unsigned samplers;
61
62 uint32_t *insn;
63 int insn_len;
64
65 struct nvfx_fragment_program_data *consts;
66 unsigned nr_consts;
67
68 uint32_t fp_control;
69
70 unsigned bo_prog_idx;
71 unsigned prog_size;
72 unsigned progs_per_bo;
73 struct nvfx_fragment_program_bo* fpbo;
74 };
75
76
77 #endif