main: Support 1 Mesa format with get for GL_PROGRAM_BINARY_FORMATS

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>
This commit is contained in:
Jordan Justen
2017-11-07 00:21:33 -08:00
committed by Timothy Arceri
parent fb077d603b
commit 64ad804e59
2 changed files with 10 additions and 1 deletions

View 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;
}
}

View 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" ],