struct nvfx_pipe_fragment_program* pfp;
struct nvfx_fragment_program *fp;
+ unsigned max_temps;
unsigned long long r_temps;
unsigned long long r_temps_discard;
struct nvfx_reg r_result[PIPE_MAX_SHADER_OUTPUTS];
static INLINE struct nvfx_reg
temp(struct nvfx_fpc *fpc)
{
- int idx = ffsll(~fpc->r_temps) - 1;
+ int idx = __builtin_ctzll(~fpc->r_temps);
- if (idx < 0) {
+ if (idx >= fpc->max_temps) {
NOUVEAU_ERR("out of temps!!\n");
assert(0);
return nvfx_reg(NVFXSR_TEMP, 0);
if (!fpc)
goto out_err;
+ fpc->max_temps = nvfx->is_nv4x ? 48 : 32;
fpc->pfp = pfp;
fpc->fp = fp;
fpc->num_regs = 2;