summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2017-11-04 16:47:25 -0700
committerTimothy Arceri <[email protected]>2017-12-08 16:59:25 +1100
commit7ee54ad057f05881d650443de13a6bf8099e7922 (patch)
treef9c6bd45b2c556f49cacbe071f9dd607c8bc6962 /src/mesa
parente30ed18215c2b59b2b4de355b96fe553b5a8ce17 (diff)
main: add binary support to GetProgramBinary
V2: call generic _mesa_get_program_binary() helper rather than driver function directly to allow greater code sharing. Signed-off-by: Timothy Arceri <[email protected]> Signed-off-by: Jordan Justen <[email protected]> (v1) Reviewed-by: Nicolai Hähnle <[email protected]> (v1) Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/shaderapi.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 82a7fde697b..b728b320ac4 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2199,12 +2199,15 @@ _mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length,
return;
}
- *length = 0;
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetProgramBinary(driver supports zero binary formats)");
-
- (void) binaryFormat;
- (void) binary;
+ if (ctx->Const.NumProgramBinaryFormats == 0) {
+ *length = 0;
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetProgramBinary(driver supports zero binary formats)");
+ } else {
+ _mesa_get_program_binary(ctx, shProg, bufSize, length, binaryFormat,
+ binary);
+ assert(*length == 0 || *binaryFormat == GL_PROGRAM_BINARY_FORMAT_MESA);
+ }
}
void GLAPIENTRY