compiler.state = shader->compare_state;
compiler.Base.is_r500 = r300->screen->caps.is_r500;
compiler.Base.max_temp_regs = compiler.Base.is_r500 ? 128 : 32;
+ compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 512 : 64;
compiler.Base.remove_unused_constants = TRUE;
compiler.AllocateHwInputs = &allocate_hardware_inputs;
compiler.UserData = vs;
compiler.Base.is_r500 = r300->screen->caps.is_r500;
compiler.Base.max_temp_regs = 32;
+ compiler.Base.max_constants = 256;
compiler.Base.max_alu_insts = r300->screen->caps.is_r500 ? 1024 : 256;
compiler.Base.remove_unused_constants = TRUE;
.Split = 0 /* should never be called */
};
-static void validate_final_shader(struct radeon_compiler *c, void *user)
-{
- /* Check the number of constants. */
- if (c->Program.Constants.Count > 256) {
- rc_error(c, "Too many constants. Max: 256, Got: %i\n",
- c->Program.Constants.Count);
- }
-}
-
void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c)
{
int is_r500 = c->Base.is_r500;
{"dataflow swizzles", 1, 1, rc_dataflow_swizzles, NULL},
{"register allocation", 1, 1, allocate_temporary_registers, NULL},
{"dead constants", 1, kill_consts, rc_remove_unused_constants, &c->code->constants_remap_table},
- {"final code validation", 0, 1, validate_final_shader, NULL},
+ {"final code validation", 0, 1, rc_validate_final_shader, NULL},
{"machine code generation", 0, 1, translate_vertex_program, NULL},
{"dump machine code", 0,c->Base.Debug,r300_vertex_program_dump, NULL},
{NULL, 0, 0, NULL, NULL}
}
}
}
+
+void rc_validate_final_shader(struct radeon_compiler *c, void *user)
+{
+ /* Check the number of constants. */
+ if (c->Program.Constants.Count > c->max_constants) {
+ rc_error(c, "Too many constants. Max: 256, Got: %i\n",
+ c->Program.Constants.Count);
+ }
+}
/* Hardware specification. */
unsigned is_r500:1;
unsigned max_temp_regs;
+ unsigned max_constants;
int max_alu_insts;
/* Whether to remove unused constants and empty holes in constant space. */
/* Executes a list of compiler passes given in the parameter 'list'. */
void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list,
const char *shader_name);
+void rc_validate_final_shader(struct radeon_compiler *c, void *user);
#endif /* RADEON_COMPILER_H */
compiler.code = &r300->blit.vp_code;
compiler.Base.is_r500 = r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515;
compiler.Base.max_temp_regs = 32;
+ compiler.Base.max_constants = 256;
compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 1024 : 256;
r3xx_compile_vertex_program(&compiler);
compiler.enable_shadow_ambient = GL_TRUE;
compiler.Base.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515);
compiler.Base.max_temp_regs = (compiler.Base.is_r500) ? 128 : 32;
+ compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 512 : 64;
compiler.code = &r300->blit.fp_code;
compiler.AllocateHwInputs = fp_allocate_hw_inputs;
compiler.enable_shadow_ambient = GL_TRUE;
compiler.Base.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) ? GL_TRUE : GL_FALSE;
compiler.Base.max_temp_regs = (compiler.Base.is_r500) ? 128 : 32;
+ compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 512 : 64;
compiler.OutputDepth = FRAG_RESULT_DEPTH;
memset(compiler.OutputColor, 0, 4 * sizeof(unsigned));
compiler.SetHwInputOutput = &t_inputs_outputs;
compiler.Base.is_r500 = R300_CONTEXT(ctx)->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515;
compiler.Base.max_temp_regs = 32;
+ compiler.Base.max_constants = 256;
compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 1024 : 256;
if (compiler.Base.Debug) {