st/mesa: simplify integer texture check
authorBrian Paul <brianp@vmware.com>
Fri, 13 Dec 2013 16:26:24 +0000 (09:26 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 13 Dec 2013 23:06:06 +0000 (16:06 -0700)
Just use the gl_texture_object::_IsInteger field instead of
computing it from scratch.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_atom_sampler.c

index 302e1298143c6e7b71c3fa47da21f8fc3cbe2c51..989e42c08cd7a87cbf23264b7981da988dc6f183 100644 (file)
@@ -170,21 +170,18 @@ convert_sampler(struct st_context *st,
       assert(sampler->min_lod <= sampler->max_lod);
    }
 
+   /* For non-black borders... */
    if (msamp->BorderColor.ui[0] ||
        msamp->BorderColor.ui[1] ||
        msamp->BorderColor.ui[2] ||
        msamp->BorderColor.ui[3]) {
       struct st_texture_object *stobj = st_texture_object(texobj);
       struct gl_texture_image *teximg;
-      GLboolean is_integer = GL_FALSE;
+      const GLboolean is_integer = texobj->_IsIntegerFormat;
       union pipe_color_union border_color;
 
       teximg = texobj->Image[0][texobj->BaseLevel];
 
-      if (teximg) {
-         is_integer = _mesa_is_enum_format_integer(teximg->InternalFormat);
-      }
-
       if (st->apply_texture_swizzle_to_border_color && stobj->sampler_view) {
          const unsigned char swz[4] =
          {