summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2010-09-06 20:48:10 -0700
committerTom Stellard <[email protected]>2010-09-10 18:18:09 -0700
commitd442c7f172df72875bc4a4c8e20ddd8c49dee12a (patch)
treee92a64f81cccf61bfbeaf9ac25ab090293249206 /src/mesa/drivers
parent66b1e716fb2f36db98ce490dc6e58d5585c652ae (diff)
r300/compiler: Replace asserts with error messages
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
index 4cdb7ea748e..2ba25d26014 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
@@ -224,7 +224,11 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c,
}
source = rc_pair_alloc_source(pair, srcrgb, srcalpha,
inst->SrcReg[i].File, inst->SrcReg[i].Index);
- assert(source != -1);
+ if (source < 0) {
+ rc_error(c, "Failed to translate "
+ "rgb instruction.\n");
+ return;
+ }
pair->RGB.Arg[i].Source = source;
pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff;
pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs;
@@ -240,7 +244,11 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c,
srcalpha = 1;
source = rc_pair_alloc_source(pair, srcrgb, srcalpha,
inst->SrcReg[i].File, inst->SrcReg[i].Index);
- assert(source != -1);
+ if (source < 0) {
+ rc_error(c, "Failed to translate "
+ "alpha instruction.\n");
+ return;
+ }
pair->Alpha.Arg[i].Source = source;
pair->Alpha.Arg[i].Swizzle = swz;
pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs;