Mesa (master): main: Support getting GL_PROGRAM_BINARY_LENGTH

Timothy Arceri tarceri at kemper.freedesktop.org
Fri Dec 8 06:03:47 UTC 2017


Module: Mesa
Branch: master
Commit: e30ed18215c2b59b2b4de355b96fe553b5a8ce17
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e30ed18215c2b59b2b4de355b96fe553b5a8ce17

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Sat Nov  4 16:43:21 2017 -0700

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 <tarceri at itsqueeze.com>
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>i (v1)
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/mesa/main/shaderapi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 7282435583..82a7fde697 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)




More information about the mesa-commit mailing list