Mesa (master): util: Don't create array texture shaders if the driver doesn 't support it

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Fri Feb 25 23:52:17 UTC 2011


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

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Sat Feb 26 00:50:52 2011 +0100

util: Don't create array texture shaders if the driver doesn't support it

---

 src/gallium/auxiliary/util/u_gen_mipmap.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 3698be7..6fba600 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -1321,10 +1321,12 @@ util_create_gen_mipmap(struct pipe_context *pipe,
                                                TGSI_INTERPOLATE_LINEAR);
    ctx->fsCube = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_CUBE,
                                                TGSI_INTERPOLATE_LINEAR);
-   ctx->fs1da = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_1D_ARRAY,
-                                               TGSI_INTERPOLATE_LINEAR);
-   ctx->fs2da = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D_ARRAY,
-                                               TGSI_INTERPOLATE_LINEAR);
+   if (pipe->screen->get_param(pipe->screen, PIPE_CAP_ARRAY_TEXTURES)) {
+      ctx->fs1da = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_1D_ARRAY,
+                                                 TGSI_INTERPOLATE_LINEAR);
+      ctx->fs2da = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D_ARRAY,
+                                                 TGSI_INTERPOLATE_LINEAR);
+   }
 
 
    /* vertex data that doesn't change */




More information about the mesa-commit mailing list