u_blitter: don't create fragment program for cube maps unless supported.
authorDave Airlie <airlied@redhat.com>
Fri, 9 Nov 2012 10:31:00 +0000 (20:31 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 9 Nov 2012 10:34:23 +0000 (20:34 +1000)
should fix http://bugs.freedesktop.org/56906

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/util/u_blitter.c

index 5ea6acac71b8b91e4279f8a87bcc5aa9ee89e176..0c1430e23db44fa882e763ed8f5ba053891d2bdb 100644 (file)
@@ -877,13 +877,15 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter)
    struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
    struct pipe_screen *screen = blitter->pipe->screen;
    unsigned num_cbufs, i, target, max_samples;
-   boolean has_arraytex;
+   boolean has_arraytex, has_cubearraytex;
 
    num_cbufs = MAX2(screen->get_param(screen,
                                       PIPE_CAP_MAX_RENDER_TARGETS), 1);
    max_samples = ctx->has_texture_multisample ? 2 : 1;
    has_arraytex = screen->get_param(screen,
                                     PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS) != 0;
+   has_cubearraytex = screen->get_param(screen,
+                                    PIPE_CAP_CUBE_MAP_ARRAY) != 0;
 
    for (i = 0; i < num_cbufs; i++) {
       blitter_get_fs_col(ctx, i, FALSE);
@@ -898,6 +900,9 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter)
               target == PIPE_TEXTURE_2D_ARRAY)) {
             continue;
          }
+         if (!has_arraytex &&
+             (target == PIPE_TEXTURE_CUBE_ARRAY))
+            continue;
 
          blitter_get_fs_texfetch_col(ctx, target, i);
          blitter_get_fs_texfetch_depth(ctx, target, i);