2 #ifndef __NVC0_PROGRAM_H__
3 #define __NVC0_PROGRAM_H__
5 #include "pipe/p_state.h"
6 #include "tgsi/tgsi_scan.h"
8 #define NVC0_CAP_MAX_PROGRAM_TEMPS 64
10 #define NVC0_SHADER_HEADER_SIZE (20 * 4)
13 struct pipe_shader_state pipe
;
26 uint32_t flags
[2]; /* FP_ZORDER */
35 struct nouveau_resource
*res
;
38 /* first 2 bits are written into the program header, for each input */
39 #define NVC0_INTERP_FLAT (1 << 0)
40 #define NVC0_INTERP_PERSPECTIVE (2 << 0)
41 #define NVC0_INTERP_LINEAR (3 << 0)
42 #define NVC0_INTERP_CENTROID (1 << 2)
44 /* analyze TGSI and see which TEMP[] are used as subroutine inputs/outputs */
45 struct nvc0_subroutine
{
48 uint32_t argv
[NVC0_CAP_MAX_PROGRAM_TEMPS
][4];
49 uint32_t retv
[NVC0_CAP_MAX_PROGRAM_TEMPS
][4];
52 struct nvc0_translation_info
{
53 struct nvc0_program
*prog
;
54 struct tgsi_full_instruction
*insns
;
58 ubyte fp_depth_output
;
59 uint16_t input_loc
[PIPE_MAX_SHADER_INPUTS
][4];
60 uint16_t output_loc
[PIPE_MAX_SHADER_OUTPUTS
][4];
61 uint16_t sysval_loc
[TGSI_SEMANTIC_COUNT
];
62 int input_access
[PIPE_MAX_SHADER_INPUTS
][4];
63 int output_access
[PIPE_MAX_SHADER_OUTPUTS
][4];
64 ubyte interp_mode
[PIPE_MAX_SHADER_INPUTS
];
65 boolean indirect_inputs
;
66 boolean indirect_outputs
;
67 boolean require_stores
;
72 struct nvc0_subroutine
*subr
;
74 struct tgsi_shader_info scan
;
77 int nvc0_generate_code(struct nvc0_translation_info
*);
79 void nvc0_relocate_program(struct nvc0_program
*,
80 uint32_t code_base
, uint32_t data_base
);