nvfx: slightly improve handling of overlong vps
authorLuca Barbieri <luca@luca-barbieri.com>
Sat, 21 Aug 2010 18:23:41 +0000 (20:23 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Sat, 21 Aug 2010 18:42:15 +0000 (20:42 +0200)
src/gallium/drivers/nvfx/nvfx_vertprog.c

index 8ca7cfef742f7bdf4e476cd867058f3a23baa243..7cccffe0ffe4f4b7f2a40f2b5a8f066fe2f2433c 100644 (file)
@@ -1110,7 +1110,11 @@ nvfx_vertprog_validate(struct nvfx_context *nvfx)
                        }
 
                        if (nouveau_resource_alloc(heap, vplen, vp, &vp->exec))
-                               assert(0);
+                       {
+                               debug_printf("Vertex shader too long: %u instructions\n", vplen);
+                               nvfx->fallback_swtnl |= NVFX_NEW_VERTPROG;
+                               return FALSE;
+                       }
                }
 
                upload_code = TRUE;
@@ -1129,7 +1133,11 @@ nvfx_vertprog_validate(struct nvfx_context *nvfx)
                        }
 
                        if (nouveau_resource_alloc(heap, vp->nr_consts, vp, &vp->data))
-                               assert(0);
+                        {
+                                debug_printf("Vertex shader uses too many constants: %u constants\n", vp->nr_consts);
+                                nvfx->fallback_swtnl |= NVFX_NEW_VERTPROG;
+                                return FALSE;
+                        }
                }
 
                /*XXX: handle this some day */