main: Support 1 Mesa format with get for GL_PROGRAM_BINARY_FORMATS
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 7 Nov 2017 08:21:33 +0000 (00:21 -0800)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 8 Dec 2017 05:59:25 +0000 (16:59 +1100)
Mesa supports either 0 or 1 formats. If 1 format is supported, it is
GL_PROGRAM_BINARY_FORMAT_MESA as defined in the
GL_MESA_program_binary_formats extension spec.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/get.c
src/mesa/main/get_hash_params.py

index ea8d932b182cf8007411cde1c29f4c668ea9409a..c1b1a89ee057fcfa7f5fe1ea671ea20939739c57 100644 (file)
@@ -1151,6 +1151,15 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
          }
       }
       break;
+
+   /* GL_ARB_get_program_binary */
+   case GL_PROGRAM_BINARY_FORMATS:
+      assert(ctx->Const.NumProgramBinaryFormats <= 1);
+      v->value_int_n.n = MIN2(ctx->Const.NumProgramBinaryFormats, 1);
+      if (ctx->Const.NumProgramBinaryFormats > 0) {
+         v->value_int_n.ints[0] = GL_PROGRAM_BINARY_FORMAT_MESA;
+      }
+      break;
    }
 }
 
index 6d99a029ed28812b4598e182dc184d57a5cdd43a..eac250a1ecfabaf3fe9b64f5ae09b19c4114697f 100644 (file)
@@ -325,7 +325,7 @@ descriptor=[
 
 # GL_ARB_get_program_binary / GL_OES_get_program_binary
   [ "NUM_PROGRAM_BINARY_FORMATS", "CONTEXT_UINT(Const.NumProgramBinaryFormats), NO_EXTRA" ],
-  [ "PROGRAM_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, NO_EXTRA" ],
+  [ "PROGRAM_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA" ],
 
 # GL_INTEL_performance_query
   [ "PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL", "CONST(MAX_PERFQUERY_QUERY_NAME_LENGTH), extra_INTEL_performance_query" ],