X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fnvc0%2Fnvc0_program.h;h=9c184d1f1d5215536325294fb1aeb05d17396d6c;hb=2737abb44efebfa10ac84b183c20fc5818d1514e;hp=3450cec175d3b328f192c66ed941f6e6f42bdb30;hpb=a287a758c6567405a7ea10df21e586d1e2ff08ec;p=mesa.git diff --git a/src/gallium/drivers/nvc0/nvc0_program.h b/src/gallium/drivers/nvc0/nvc0_program.h index 3450cec175d..9c184d1f1d5 100644 --- a/src/gallium/drivers/nvc0/nvc0_program.h +++ b/src/gallium/drivers/nvc0/nvc0_program.h @@ -3,9 +3,16 @@ #define __NVC0_PROGRAM_H__ #include "pipe/p_state.h" -#include "tgsi/tgsi_scan.h" -#define NVC0_CAP_MAX_PROGRAM_TEMPS 64 +#define NVC0_CAP_MAX_PROGRAM_TEMPS 128 + + +struct nvc0_transform_feedback_state { + uint32_t stride[4]; + uint8_t varying_count[4]; + uint8_t varying_index[4][128]; +}; + #define NVC0_SHADER_HEADER_SIZE (20 * 4) @@ -14,78 +21,48 @@ struct nvc0_program { ubyte type; boolean translated; - ubyte max_gpr; + boolean need_tls; + uint8_t num_gprs; uint32_t *code; + uint32_t *immd_data; unsigned code_base; unsigned code_size; - unsigned parm_size; - - uint32_t hdr[20]; /* TODO: move this into code to save space */ + unsigned immd_base; + unsigned immd_size; /* size of immediate array data */ + unsigned parm_size; /* size of non-bindable uniforms (c0[]) */ + uint32_t hdr[20]; uint32_t flags[2]; struct { - uint8_t edgeflag; - uint8_t num_ucps; - uint8_t out_pos[PIPE_MAX_SHADER_OUTPUTS]; + uint32_t clip_mode; /* clip/cull selection */ + uint8_t clip_enable; /* mask of defined clip planes */ + uint8_t num_ucps; /* also set to max if ClipDistance is used */ + uint8_t edgeflag; /* attribute index of edgeflag input */ + boolean need_vertex_id; } vp; struct { uint8_t early_z; uint8_t in_pos[PIPE_MAX_SHADER_INPUTS]; } fp; + struct { + uint32_t tess_mode; /* ~0 if defined by the other stage */ + uint32_t input_patch_size; + } tp; + struct { + uint32_t lmem_size; /* local memory (TGSI PRIVATE resource) size */ + uint32_t smem_size; /* shared memory (TGSI LOCAL resource) size */ + void *syms; + unsigned num_syms; + } cp; + uint8_t num_barriers; void *relocs; - unsigned num_relocs; - - struct nouveau_resource *res; -}; -/* first 2 bits are written into the program header, for each input */ -#define NVC0_INTERP_FLAT (1 << 0) -#define NVC0_INTERP_PERSPECTIVE (2 << 0) -#define NVC0_INTERP_LINEAR (3 << 0) -#define NVC0_INTERP_CENTROID (1 << 2) - -/* analyze TGSI and see which TEMP[] are used as subroutine inputs/outputs */ -struct nvc0_subroutine { - unsigned id; - unsigned first_insn; - uint32_t argv[NVC0_CAP_MAX_PROGRAM_TEMPS][4]; - uint32_t retv[NVC0_CAP_MAX_PROGRAM_TEMPS][4]; -}; + struct nvc0_transform_feedback_state *tfb; -struct nvc0_translation_info { - struct nvc0_program *prog; - struct tgsi_full_instruction *insns; - unsigned num_insns; - ubyte input_file; - ubyte output_file; - ubyte fp_depth_output; - uint16_t input_loc[PIPE_MAX_SHADER_INPUTS][4]; - uint16_t output_loc[PIPE_MAX_SHADER_OUTPUTS][4]; - uint16_t sysval_loc[TGSI_SEMANTIC_COUNT]; - boolean sysval_in[TGSI_SEMANTIC_COUNT]; - int input_access[PIPE_MAX_SHADER_INPUTS][4]; - int output_access[PIPE_MAX_SHADER_OUTPUTS][4]; - ubyte interp_mode[PIPE_MAX_SHADER_INPUTS]; - boolean indirect_inputs; - boolean indirect_outputs; - boolean require_stores; - boolean global_stores; - uint32_t *immd32; - ubyte *immd32_ty; - unsigned immd32_nr; - ubyte edgeflag_out; - struct nvc0_subroutine *subr; - unsigned num_subrs; - boolean append_ucp; - struct tgsi_shader_info scan; + struct nouveau_heap *mem; }; -int nvc0_generate_code(struct nvc0_translation_info *); - -void nvc0_relocate_program(struct nvc0_program *, - uint32_t code_base, uint32_t data_base); - #endif