svga: use svga_shader_too_large() in compile_fs()
authorBrian Paul <brianp@vmware.com>
Thu, 29 May 2014 19:56:22 +0000 (13:56 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 31 May 2014 12:25:35 +0000 (06:25 -0600)
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/svga/svga_state_fs.c

index 7931528c661421f97fdd48ec32f3edd36a6e0468..8f419fa69ac8a320b3b979fe525a558113b6cbd8 100644 (file)
@@ -157,9 +157,7 @@ compile_fs(struct svga_context *svga,
       }
    }
 
-   if (variant->nr_tokens * sizeof(variant->tokens[0])
-       + sizeof(SVGA3dCmdDefineShader) + sizeof(SVGA3dCmdHeader)
-       >= SVGA_CB_MAX_COMMAND_SIZE) {
+   if (svga_shader_too_large(svga, variant)) {
       /* too big, use dummy shader */
       debug_printf("Shader too large (%lu bytes),"
                    " using dummy shader instead.\n",