summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-02-10 16:12:32 -0700
committerBrian Paul <[email protected]>2014-02-12 11:21:46 -0700
commit23d4ff53d4acd0c33c633174a288a640664036fe (patch)
treeea11b8a6c98a52ff5fd2baf3e1a060ab25fc6ebc /src/gallium
parent76f95ba2721ec3214e39711a991b510bdb3c5a36 (diff)
svga: replace out-of-temps assertion with debug warning
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_insn.c6
1 files changed, 4 insertions, 2 deletions
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 );
}