panfrost: Use the sampler_view target (not the textures)
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 24 Jun 2019 21:39:37 +0000 (14:39 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 25 Jun 2019 20:39:18 +0000 (13:39 -0700)
u_blitter gets "special treatment" and uses this mechanism to cast
cube maps to 2D textures in order to texelFetch them.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c

index ccdeb8e2c2ef8abdd88a549f6495b39571a0fb85..c8d413261502b62ce867b10d930f94870e1ea683 100644 (file)
@@ -2205,7 +2205,7 @@ panfrost_create_sampler_view(
 
         unsigned array_size = texture->array_size;
 
-        if (texture->target == PIPE_TEXTURE_CUBE) {
+        if (template->target == PIPE_TEXTURE_CUBE) {
                 /* TODO: Cubemap arrays */
                 assert(array_size == 6);
                 array_size /= 6;
@@ -2223,7 +2223,7 @@ panfrost_create_sampler_view(
                         .format = format,
 
                         .srgb = desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB,
-                        .type = panfrost_translate_texture_type(texture->target),
+                        .type = panfrost_translate_texture_type(template->target),
 
                         .usage2 = usage2_layout
                 },