summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-02-14 23:57:46 +0100
committerMarek Olšák <maraeo@gmail.com>2010-04-05 07:09:45 +0200
commite41a64591bf1a74465bf0adc7d35c991c4cfb4fe (patch)
treec12c0d1c717c4ed57c4ea8ae1c462b994a476cae /src/mesa/drivers/dri/r300/compiler
parent4e949271c25ccc5a06fbbbe912b0b43b75d1d169 (diff)
r300/compiler: make the max number of fragment shader temporaries adjustable
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c2
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c5
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_compiler.h1
3 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
index cc552aee17..37dafa7710 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
@@ -353,7 +353,7 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi
}
}
- 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)
diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
index c2d5dc27b4..d06429254d 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
@@ -156,10 +156,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
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;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
index 6bfda0574f..934ae28da5 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
@@ -83,6 +83,7 @@ struct r300_fragment_program_compiler {
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. */