From: Brian Paul Date: Mon, 10 Feb 2014 23:12:32 +0000 (-0700) Subject: svga: replace out-of-temps assertion with debug warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23d4ff53d4acd0c33c633174a288a640664036fe;p=mesa.git svga: replace out-of-temps assertion with debug warning Signed-off-by: Brian Paul --- diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 4d78e96375c..73303e35222 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -287,8 +287,10 @@ static SVGA3dShaderDestToken get_temp( struct svga_shader_emitter *emit ) { int i = emit->nr_hw_temp + emit->internal_temp_count++; - assert(i < SVGA3D_TEMPREG_MAX); - i = MIN2(i, SVGA3D_TEMPREG_MAX - 1); + if (i >= SVGA3D_TEMPREG_MAX) { + debug_warn_once("svga: Too many temporary registers used in shader\n"); + i = SVGA3D_TEMPREG_MAX - 1; + } return dst_register( SVGA3DREG_TEMP, i ); }