mesa: allow multisampled format info to be returned on GLES 3.1
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 11 Feb 2016 20:02:30 +0000 (15:02 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 18 Feb 2016 00:30:40 +0000 (19:30 -0500)
The restriction on multisampled integer texture formats only applies to
GLES 3.0, so don't apply it to GLES 3.1 contexts. This fixes a slew of

dEQP-GLES31.functional.state_query.internal_format.*

tests, which now all pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/main/formatquery.c

index 85f7b6b56648c544d851e4948d2144a641e1353e..816f12bf9e243a81c3fb9653c40450ad2405ab2f 100644 (file)
@@ -131,11 +131,14 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
             internalformat, buffer);
       break;
    case GL_NUM_SAMPLE_COUNTS: {
             internalformat, buffer);
       break;
    case GL_NUM_SAMPLE_COUNTS: {
-      if (_mesa_is_gles3(ctx) && _mesa_is_enum_format_integer(internalformat)) {
+      if ((ctx->API == API_OPENGLES2 && ctx->Version == 30) &&
+          _mesa_is_enum_format_integer(internalformat)) {
          /* From GL ES 3.0 specification, section 6.1.15 page 236: "Since
           * multisampling is not supported for signed and unsigned integer
           * internal formats, the value of NUM_SAMPLE_COUNTS will be zero
           * for such formats.
          /* From GL ES 3.0 specification, section 6.1.15 page 236: "Since
           * multisampling is not supported for signed and unsigned integer
           * internal formats, the value of NUM_SAMPLE_COUNTS will be zero
           * for such formats.
+          *
+          * Such a restriction no longer exists in GL ES 3.1.
           */
          buffer[0] = 0;
          count = 1;
           */
          buffer[0] = 0;
          count = 1;