Mesa (master): llvmpipe: fix PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS query

Brian Paul brianp at kemper.freedesktop.org
Thu Aug 26 14:54:59 PDT 2010


Module: Mesa
Branch: master
Commit: 4418a493c2466e734e1ca5ace51535d1dbcf8a46
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4418a493c2466e734e1ca5ace51535d1dbcf8a46

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Aug 26 11:45:25 2010 -0600

llvmpipe: fix PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS query

Fixes crashes in glean glsl1 and demos/src/glsl/vert-tex.
See comments for details.

---

 src/gallium/drivers/llvmpipe/lp_screen.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 9b7e0d5..1e65a91 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -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:



More information about the mesa-commit mailing list