llvmpipe: fix PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS query
authorBrian Paul <brianp@vmware.com>
Thu, 26 Aug 2010 17:45:25 +0000 (11:45 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 26 Aug 2010 21:54:51 +0000 (15:54 -0600)
Fixes crashes in glean glsl1 and demos/src/glsl/vert-tex.
See comments for details.

src/gallium/drivers/llvmpipe/lp_screen.c

index 9b7e0d51cd047cedfb32c5409fb654ba0f098d23..1e65a91fc67e35ba2a60db3648ebaa98c7d4ea14 100644 (file)
@@ -89,7 +89,14 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
       return PIPE_MAX_SAMPLERS;
    case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
-      return PIPE_MAX_VERTEX_SAMPLERS;
+      /* At this time, the draw module and llvmpipe driver only
+       * support vertex shader texture lookups when LLVM is enabled in
+       * the draw module.
+       */
+      if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
+         return PIPE_MAX_VERTEX_SAMPLERS;
+      else
+         return 0;
    case PIPE_CAP_MAX_COMBINED_SAMPLERS:
       return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
    case PIPE_CAP_NPOT_TEXTURES: