diff options
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.h')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.h | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 8eaff49ae3..bfa48d07c8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -85,7 +85,6 @@ typedef struct r300_context *r300ContextPtr; typedef GLuint uint32_t; typedef GLubyte uint8_t; -struct r300_fragment_program; /* We should probably change types within vertex_shader and pixel_shader structure later on */ @@ -613,12 +612,46 @@ struct r300_vertex_program { #define PFS_MAX_TEX_INDIRECT 4 #define PFS_NUM_TEMP_REGS 32 #define PFS_NUM_CONST_REGS 32 + +/* Tracking data for Mesa registers */ +struct reg_acc { + int reg; /* Assigned hw temp */ + unsigned int refcount; /* Number of uses by mesa program */ +}; + +struct r300_pfs_compile_state { + int v_pos, s_pos; /* highest ALU slots used */ + + /* Track some information gathered during opcode + * construction. + * + * NOTE: Data is only set by the code, and isn't used yet. + */ + struct { + int vsrc[3]; + int ssrc[3]; + int umask; + } slot[PFS_MAX_ALU_INST]; + + /* Used to map Mesa's inputs/temps onto hardware temps */ + int temp_in_use; + struct reg_acc temps[PFS_NUM_TEMP_REGS]; + struct reg_acc inputs[32]; /* don't actually need 32... */ + + /* Track usage of hardware temps, for register allocation, + * indirection detection, etc. */ + int hwreg_in_use; + GLuint used_in_node; + GLuint dest_in_node; +}; + struct r300_fragment_program { struct fragment_program mesa_program; GLcontext *ctx; GLboolean translated; GLboolean error; + struct r300_pfs_compile_state *cs; struct { int length; @@ -633,14 +666,13 @@ struct r300_fragment_program { GLuint inst3; } inst[PFS_MAX_ALU_INST]; } alu; - int v_pos; - int s_pos; struct { int tex_offset; int tex_end; int alu_offset; int alu_end; + int flags; } node[4]; int cur_node; int first_node_has_tex; @@ -661,14 +693,7 @@ struct r300_fragment_program { } param[PFS_NUM_CONST_REGS]; int param_nr; GLboolean params_uptodate; - - GLuint temps[PFS_NUM_TEMP_REGS]; - int temp_in_use; - GLuint used_in_node; - GLuint dest_in_node; - GLuint inputs[32]; /* don't actually need 32... */ - int hwreg_in_use; int max_temp_idx; }; @@ -794,6 +819,8 @@ struct r300_state { struct r300_vertex_shader_state vertex_shader; #if USE_ARB_F_P == 0 struct r300_pixel_shader_state pixel_shader; +#else + struct r300_pfs_compile_state pfs_compile; #endif struct r300_dma_region aos[R300_MAX_AOS_ARRAYS]; int aos_count; |