From 23d4ff53d4acd0c33c633174a288a640664036fe Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Feb 2014 16:12:32 -0700 Subject: svga: replace out-of-temps assertion with debug warning Signed-off-by: Brian Paul --- src/gallium/drivers/svga/svga_tgsi_insn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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 ); } -- cgit v1.2.3