mesa: update fallthrough comment so gcc can see it
[mesa.git] / src / mesa / main / textureview.c
index 89af068fae84d7722f8d666c07a91851041fe04a..0e3703a44ad0bf244fe8a0b045c2950d8817450f 100644 (file)
@@ -34,7 +34,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "imports.h"
+
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
@@ -174,6 +174,7 @@ static const struct internal_format_class_info compatible_internal_formats[] = {
    {GL_VIEW_CLASS_8_BITS, GL_R8I},
    {GL_VIEW_CLASS_8_BITS, GL_R8},
    {GL_VIEW_CLASS_8_BITS, GL_R8_SNORM},
+   {GL_VIEW_CLASS_8_BITS, GL_SR8_EXT},
    {GL_VIEW_CLASS_RGTC1_RED, GL_COMPRESSED_RED_RGTC1},
    {GL_VIEW_CLASS_RGTC1_RED, GL_COMPRESSED_SIGNED_RED_RGTC1},
    {GL_VIEW_CLASS_RGTC2_RG, GL_COMPRESSED_RG_RGTC2},
@@ -304,7 +305,8 @@ initialize_texture_fields(struct gl_context *ctx,
                           struct gl_texture_object *texObj,
                           GLint levels,
                           GLsizei width, GLsizei height, GLsizei depth,
-                          GLenum internalFormat, mesa_format texFormat)
+                          GLenum internalFormat, mesa_format texFormat,
+                          GLuint numSamples, GLboolean fixedSampleLocations)
 {
    const GLuint numFaces = _mesa_num_tex_faces(target);
    GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
@@ -326,9 +328,10 @@ initialize_texture_fields(struct gl_context *ctx,
             return GL_FALSE;
          }
 
-         _mesa_init_teximage_fields(ctx, texImage,
+         _mesa_init_teximage_fields_ms(ctx, texImage,
                                     levelWidth, levelHeight, levelDepth,
-                                    0, internalFormat, texFormat);
+                                    0, internalFormat, texFormat,
+                                    numSamples, fixedSampleLocations);
       }
 
       _mesa_next_mipmap_level_size(target, 0,
@@ -500,7 +503,7 @@ _mesa_set_texture_view_state(struct gl_context *ctx,
    case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
       texObj->NumLevels = 1;
       texObj->ImmutableLevels = 1;
-      /* fall through to set NumLayers */
+      /* fallthrough - to set NumLayers */
 
    case GL_TEXTURE_2D_ARRAY:
    case GL_TEXTURE_CUBE_MAP_ARRAY:
@@ -676,7 +679,9 @@ texture_view(struct gl_context *ctx, struct gl_texture_object *origTexObj,
 
    if (!initialize_texture_fields(ctx, target, texObj, newViewNumLevels,
                                   width, height, depth,
-                                  internalformat, texFormat)) {
+                                  internalformat, texFormat,
+                                  origTexImage->NumSamples,
+                                  origTexImage->FixedSampleLocations)) {
       return; /* Already recorded error */
    }