c90f364ab9f4ff266711545bfccf8c076d148de1
[mesa.git] / src / gallium / drivers / nvc0 / nvc0_program.h
1
2 #ifndef __NVC0_PROGRAM_H__
3 #define __NVC0_PROGRAM_H__
4
5 #include "pipe/p_state.h"
6
7 #define NVC0_CAP_MAX_PROGRAM_TEMPS 128
8
9
10 struct nvc0_transform_feedback_state {
11 uint32_t stride[4];
12 uint8_t varying_count[4];
13 uint8_t varying_index[4][128];
14 };
15
16
17 #define NVC0_SHADER_HEADER_SIZE (20 * 4)
18
19 struct nvc0_program {
20 struct pipe_shader_state pipe;
21
22 ubyte type;
23 boolean translated;
24 uint8_t max_gpr;
25
26 uint32_t *code;
27 uint32_t *immd_data;
28 unsigned code_base;
29 unsigned code_size;
30 unsigned immd_base;
31 unsigned immd_size; /* size of immediate array data */
32 unsigned parm_size; /* size of non-bindable uniforms (c0[]) */
33
34 uint32_t hdr[20];
35 uint32_t flags[2];
36
37 struct {
38 uint32_t clip_mode; /* clip/cull selection */
39 uint8_t clip_enable; /* mask of defined clip planes */
40 uint8_t num_ucps; /* also set to max if ClipDistance is used */
41 uint8_t edgeflag; /* attribute index of edgeflag input */
42 boolean need_vertex_id;
43 } vp;
44 struct {
45 uint8_t early_z;
46 uint8_t in_pos[PIPE_MAX_SHADER_INPUTS];
47 } fp;
48 struct {
49 uint32_t tess_mode; /* ~0 if defined by the other stage */
50 uint32_t input_patch_size;
51 } tp;
52
53 void *relocs;
54
55 struct nvc0_transform_feedback_state *tfb;
56
57 struct nouveau_resource *res;
58 };
59
60 #endif