compiler.code = &shader->code;
compiler.state = shader->compare_state;
compiler.is_r500 = r300_screen(r300->context.screen)->caps->is_r500;
+ compiler.max_temp_regs = compiler.is_r500 ? 128 : 32;
compiler.AllocateHwInputs = &allocate_hardware_inputs;
compiler.UserData = &fs->inputs;
}
}
- if (code->pixsize >= R300_PFS_NUM_TEMP_REGS)
+ if (code->pixsize >= compiler->max_temp_regs)
rc_error(&compiler->Base, "Too many hardware temporaries used.\n");
if (compiler->Base.Error)
fflush(stderr);
}
- if (c->is_r500)
- rc_pair_regalloc(c, 128);
- else
- rc_pair_regalloc(c, R300_PFS_NUM_TEMP_REGS);
+ rc_pair_regalloc(c, c->max_temp_regs);
if (c->Base.Error)
return;
struct rX00_fragment_program_code *code;
struct r300_fragment_program_external_state state;
unsigned is_r500;
+ unsigned max_temp_regs;
/* Register corresponding to the depthbuffer. */
unsigned OutputDepth;
/* Registers corresponding to the four colorbuffers. */
compiler.code = &fp->code;
compiler.state = fp->state;
compiler.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) ? GL_TRUE : GL_FALSE;
+ compiler.max_temp_regs = (compiler.is_r500) ? 128 : 32;
compiler.OutputDepth = FRAG_RESULT_DEPTH;
memset(compiler.OutputColor, 0, 4 * sizeof(unsigned));
compiler.OutputColor[0] = FRAG_RESULT_COLOR;