diff options
author | Jordan Justen <[email protected]> | 2017-11-04 16:43:21 -0700 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-12-08 16:59:25 +1100 |
commit | e30ed18215c2b59b2b4de355b96fe553b5a8ce17 (patch) | |
tree | a0608f120d985aeb6bcd626f0b278fd538e586ab /src/mesa/main | |
parent | c20fd744fef1ffb938f74dbafbe375c863fecc65 (diff) |
main: Support getting GL_PROGRAM_BINARY_LENGTH
V2: call generic _mesa_get_program_binary_length() 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]>i (v1)
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/shaderapi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 72824355838..82a7fde697b 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -45,6 +45,7 @@ #include "main/hash.h" #include "main/mtypes.h" #include "main/pipelineobj.h" +#include "main/program_binary.h" #include "main/shaderapi.h" #include "main/shaderobj.h" #include "main/transformfeedback.h" @@ -834,7 +835,11 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, *params = shProg->BinaryRetreivableHint; return; case GL_PROGRAM_BINARY_LENGTH: - *params = 0; + if (ctx->Const.NumProgramBinaryFormats == 0) { + *params = 0; + } else { + _mesa_get_program_binary_length(ctx, shProg, params); + } return; case GL_ACTIVE_ATOMIC_COUNTER_BUFFERS: if (!ctx->Extensions.ARB_shader_atomic_counters) |