r300/compiler: Replace asserts with error messages
authorTom Stellard <tstellar@gmail.com>
Tue, 7 Sep 2010 03:48:10 +0000 (20:48 -0700)
committerTom Stellard <tstellar@gmail.com>
Sat, 11 Sep 2010 01:18:09 +0000 (18:18 -0700)
src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c

index 4cdb7ea748ee3b71fdccc441d701d9bc327e00e4..2ba25d2601454199e137ce43bf64166bc3a3525a 100644 (file)
@@ -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;