nvc0: do upload-time fixups for interpolation parameters
[mesa.git] / src / gallium / drivers / nouveau / 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 stream[4];
13 uint8_t varying_count[4];
14 uint8_t varying_index[4][128];
15 };
16
17
18 #define NVC0_SHADER_HEADER_SIZE (20 * 4)
19
20 struct nvc0_program {
21 struct pipe_shader_state pipe;
22
23 ubyte type;
24 bool translated;
25 bool need_tls;
26 uint8_t num_gprs;
27
28 uint32_t *code;
29 uint32_t *immd_data;
30 unsigned code_base;
31 unsigned code_size;
32 unsigned immd_base;
33 unsigned immd_size; /* size of immediate array data */
34 unsigned parm_size; /* size of non-bindable uniforms (c0[]) */
35
36 uint32_t hdr[20];
37 uint32_t flags[2];
38
39 struct {
40 uint32_t clip_mode; /* clip/cull selection */
41 uint8_t clip_enable; /* mask of defined clip planes */
42 uint8_t num_ucps; /* also set to max if ClipDistance is used */
43 uint8_t edgeflag; /* attribute index of edgeflag input */
44 bool need_vertex_id;
45 } vp;
46 struct {
47 uint8_t early_z;
48 uint8_t colors;
49 uint8_t color_interp[2];
50 bool force_persample_interp;
51 bool flatshade;
52 } fp;
53 struct {
54 uint32_t tess_mode; /* ~0 if defined by the other stage */
55 uint32_t input_patch_size;
56 } tp;
57 struct {
58 uint32_t lmem_size; /* local memory (TGSI PRIVATE resource) size */
59 uint32_t smem_size; /* shared memory (TGSI LOCAL resource) size */
60 void *syms;
61 unsigned num_syms;
62 } cp;
63 uint8_t num_barriers;
64
65 void *relocs;
66 void *interps;
67
68 struct nvc0_transform_feedback_state *tfb;
69
70 struct nouveau_heap *mem;
71 };
72
73 #endif