[Mesa-dev] [PATCH 2/3] svga: use svga_shader_too_large() in compile_fs()

Brian Paul brianp at vmware.com
Thu May 29 13:59:58 PDT 2014


---
 src/gallium/drivers/svga/svga_state_fs.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c
index 7931528..8f419fa 100644
--- a/src/gallium/drivers/svga/svga_state_fs.c
+++ b/src/gallium/drivers/svga/svga_state_fs.c
@@ -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",
-- 
1.7.10.4



More information about the mesa-dev mailing list