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
7 struct nvfx_vertex_program_exec {
8 uint32_t data[4];
9 boolean has_branch_offset;
10 int const_index;
11 };
12
13 struct nvfx_vertex_program_data {
14 int index; /* immediates == -1 */
15 float value[4];
16 };
17
18 struct nvfx_vertex_program {
19 struct pipe_shader_state pipe;
20
21 struct draw_vertex_shader *draw;
22
23 boolean translated;
24
25 struct pipe_clip_state ucp;
26
27 struct nvfx_vertex_program_exec *insns;
28 unsigned nr_insns;
29 struct nvfx_vertex_program_data *consts;
30 unsigned nr_consts;
31
32 struct nouveau_resource *exec;
33 unsigned exec_start;
34 struct nouveau_resource *data;
35 unsigned data_start;
36 unsigned data_start_min;
37
38 uint32_t ir;
39 uint32_t or;
40 uint32_t clip_ctrl;
41 struct nouveau_stateobj *so;
42 };
43
44 struct nvfx_fragment_program_data {
45 unsigned offset;
46 unsigned index;
47 };
48
49 struct nvfx_fragment_program {
50 struct pipe_shader_state pipe;
51 struct tgsi_shader_info info;
52
53 boolean translated;
54 unsigned samplers;
55
56 uint32_t *insn;
57 int insn_len;
58
59 struct nvfx_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 #define NVFX_MAX_TEXTURE_LEVELS 16
69
70 struct nvfx_miptree {
71 struct pipe_texture base;
72 struct nouveau_bo *bo;
73
74 struct pipe_buffer *buffer;
75 uint total_size;
76
77 struct {
78 uint pitch;
79 uint *image_offset;
80 } level[NVFX_MAX_TEXTURE_LEVELS];
81 };
82
83 #endif