mesa: add storageSamples parameter to renderbuffer functions
[mesa.git] / src / mesa / main / shaderimage.c
index 5e31d4e822081bbeaa6cce6e563c1ad58206cde5..31ac852d37f941cd90bd96fd510a5aac165e8f0a 100644 (file)
@@ -430,9 +430,8 @@ _mesa_is_shader_image_format_supported(const struct gl_context *ctx,
     * ARB_shader_image_load_store extension, c.f. table 3.21 of the OpenGL 4.2
     * specification.
     *
-    * These can be supported by GLES 3.1 with GL_NV_image_formats &
-    * GL_EXT_texture_norm16 extensions but we don't have support for the
-    * latter in Mesa yet.
+    * Following formats are supported by GLES 3.1 with GL_NV_image_formats &
+    * GL_EXT_texture_norm16 extensions.
     */
    case GL_RGBA16:
    case GL_RGBA16_SNORM:
@@ -440,7 +439,7 @@ _mesa_is_shader_image_format_supported(const struct gl_context *ctx,
    case GL_RG16_SNORM:
    case GL_R16:
    case GL_R16_SNORM:
-      return _mesa_is_desktop_gl(ctx);
+      return _mesa_is_desktop_gl(ctx) || _mesa_has_EXT_texture_norm16(ctx);
 
    default:
       return false;
@@ -464,6 +463,8 @@ _mesa_init_image_units(struct gl_context *ctx)
 {
    unsigned i;
 
+   ASSERT_BITFIELD_SIZE(struct gl_image_unit, Format, MESA_FORMAT_COUNT);
+
    for (i = 0; i < ARRAY_SIZE(ctx->ImageUnits); ++i)
       ctx->ImageUnits[i] = _mesa_default_image_unit(ctx);
 }