st/mesa: simplify some code in get_texture_format_swizzle()
authorBrian Paul <brianp@vmware.com>
Fri, 23 Sep 2016 18:18:46 +0000 (12:18 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 6 Oct 2016 17:29:31 +0000 (11:29 -0600)
There's no need to cast to st_texture_image.  Just use gl_texture_image.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_atom_texture.c

index efc8c90ffae92760ba6dfc73413c4c6208bd5ee8..113c0ed1b06034f575da0d1ff49c3405aa2d8db6 100644 (file)
@@ -211,11 +211,11 @@ get_texture_format_swizzle(const struct st_context *st,
        */
       if (_mesa_is_gles3(st->ctx) &&
           util_format_is_depth_or_stencil(stObj->pt->format)) {
-         const struct st_texture_image *firstImage =
-            st_texture_image_const(_mesa_base_tex_image(&stObj->base));
-         if (firstImage->base.InternalFormat != GL_DEPTH_COMPONENT &&
-             firstImage->base.InternalFormat != GL_DEPTH_STENCIL &&
-             firstImage->base.InternalFormat != GL_STENCIL_INDEX)
+         const struct gl_texture_image *firstImage =
+            _mesa_base_tex_image(&stObj->base);
+         if (firstImage->InternalFormat != GL_DEPTH_COMPONENT &&
+             firstImage->InternalFormat != GL_DEPTH_STENCIL &&
+             firstImage->InternalFormat != GL_STENCIL_INDEX)
             depth_mode = GL_RED;
       }
       tex_swizzle = compute_texture_format_swizzle(baseFormat,