util: Don't create array texture shaders if the driver doesn't support it
authorJakob Bornecrantz <jakob@vmware.com>
Fri, 25 Feb 2011 23:50:52 +0000 (00:50 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 25 Feb 2011 23:50:52 +0000 (00:50 +0100)
src/gallium/auxiliary/util/u_gen_mipmap.c

index 3698be77b2e91e2fa058a5782a3926c5e5a244c2..6fba6000ba889a3f2a497ced79f9f2906a093c81 100644 (file)
@@ -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 */