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
10struct 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
20struct 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   unsigned code_base;
30   unsigned code_size;
31   unsigned parm_size; /* size of non-bindable uniforms (c0[]) */
32
33   uint32_t hdr[20];
34   uint32_t flags[2];
35
36   struct {
37      uint32_t clip_mode; /* clip/cull selection */
38      uint8_t clip_enable; /* mask of defined clip planes */
39      uint8_t cull_enable; /* mask of defined cull distances */
40      uint8_t num_ucps; /* also set to max if ClipDistance is used */
41      uint8_t edgeflag; /* attribute index of edgeflag input */
42      bool need_vertex_id;
43      bool need_draw_parameters;
44   } vp;
45   struct {
46      uint8_t early_z;
47      uint8_t colors;
48      uint8_t color_interp[2];
49      bool sample_mask_in;
50      bool force_persample_interp;
51      bool flatshade;
52      bool reads_framebuffer;
53      bool post_depth_coverage;
54   } fp;
55   struct {
56      uint32_t tess_mode; /* ~0 if defined by the other stage */
57      uint32_t input_patch_size;
58   } tp;
59   struct {
60      uint32_t lmem_size; /* local memory (TGSI PRIVATE resource) size */
61      uint32_t smem_size; /* shared memory (TGSI LOCAL resource) size */
62      void *syms;
63      unsigned num_syms;
64   } cp;
65   uint8_t num_barriers;
66
67   void *relocs;
68   void *fixups;
69
70   struct nvc0_transform_feedback_state *tfb;
71
72   struct nouveau_heap *mem;
73};
74
75#endif
76