From: Jordan Justen Date: Tue, 7 Nov 2017 08:21:33 +0000 (-0800) Subject: main: Support 1 Mesa format with get for GL_PROGRAM_BINARY_FORMATS X-Git-Tag: upstream/18.1.0~3351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64ad804e596075c06f5a1f2bdc0d45b5d2f2ead2;p=platform%2Fupstream%2Fmesa.git 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 Reviewed-by: Nicolai Hähnle --- diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index ea8d932..c1b1a89 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -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; } } diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 6d99a02..eac250a 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -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" ],