| 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 |
struct nir_shader; |
| 9 |
|
| 10 |
|
| 11 |
struct nvc0_transform_feedback_state { |
| 12 |
uint32_t stride[4]; |
| 13 |
uint8_t stream[4]; |
| 14 |
uint8_t varying_count[4]; |
| 15 |
uint8_t varying_index[4][128]; |
| 16 |
}; |
| 17 |
|
| 18 |
|
| 19 |
#define GF100_SHADER_HEADER_SIZE (20 * 4) |
| 20 |
#define TU102_SHADER_HEADER_SIZE (32 * 4) |
| 21 |
#define NVC0_MAX_SHADER_HEADER_SIZE TU102_SHADER_HEADER_SIZE |
| 22 |
|
| 23 |
struct nvc0_program { |
| 24 |
struct nir_shader *nir; |
| 25 |
struct pipe_stream_output_info stream_output; |
| 26 |
|
| 27 |
uint8_t type; |
| 28 |
bool translated; |
| 29 |
bool need_tls; |
| 30 |
uint8_t num_gprs; |
| 31 |
|
| 32 |
uint32_t *code; |
| 33 |
unsigned code_base; |
| 34 |
unsigned code_size; |
| 35 |
|
| 36 |
uint32_t hdr[NVC0_MAX_SHADER_HEADER_SIZE/4]; |
| 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 cull_enable; /* mask of defined cull distances */ |
| 43 |
uint8_t num_ucps; /* also set to max if ClipDistance is used */ |
| 44 |
uint8_t edgeflag; /* attribute index of edgeflag input */ |
| 45 |
bool need_vertex_id; |
| 46 |
bool need_draw_parameters; |
| 47 |
bool layer_viewport_relative; /* also applies go gp and tp */ |
| 48 |
} vp; |
| 49 |
struct { |
| 50 |
uint8_t early_z; |
| 51 |
uint8_t colors; |
| 52 |
uint8_t color_interp[2]; |
| 53 |
bool sample_mask_in; |
| 54 |
bool force_persample_interp; |
| 55 |
bool flatshade; |
| 56 |
bool reads_framebuffer; |
| 57 |
bool post_depth_coverage; |
| 58 |
bool msaa; |
| 59 |
} fp; |
| 60 |
struct { |
| 61 |
uint32_t tess_mode; /* ~0 if defined by the other stage */ |
| 62 |
} tp; |
| 63 |
struct { |
| 64 |
uint32_t smem_size; /* shared memory (TGSI LOCAL resource) size */ |
| 65 |
} cp; |
| 66 |
uint8_t num_barriers; |
| 67 |
|
| 68 |
void *relocs; |
| 69 |
void *fixups; |
| 70 |
|
| 71 |
struct nvc0_transform_feedback_state *tfb; |
| 72 |
|
| 73 |
struct nouveau_heap *mem; |
| 74 |
}; |
| 75 |
|
| 76 |
void |
| 77 |
nvc0_program_sp_start_id(struct nvc0_context *, int, struct nvc0_program *); |
| 78 |
#endif |