From: Ian Romanick <[email protected]>

Previosly it only looked at GL_CURRENT_PROGRAM to determine whether the
active vertex shader used piglit_vertex as an input.  With
ARB_separate_shader_objects, it also needs to look at the
GL_VERTEX_SHADER associated with the current
GL_PROGRAM_PIPELINE_BINDING.

Signed-off-by: Ian Romanick <[email protected]>
---
 tests/util/piglit-util-gl-common.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/util/piglit-util-gl-common.c 
b/tests/util/piglit-util-gl-common.c
index 4abbd57..45ca099 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -608,6 +608,25 @@ piglit_draw_rect_from_arrays(const void *verts, const void 
*tex)
 
                glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *) &prog);
 
+               /* If no there is no program bound to the traditional,
+                * monolithic program binding pipe (via glUseProgram), get the
+                * vertex shader program attached to the current program
+                * pipeline.
+                */
+               if (prog == 0 &&
+                   (piglit_get_gl_version() >= 42
+                    || 
piglit_is_extension_supported("GL_ARB_separate_shader_objects"))) {
+                       GLuint pipe;
+
+                       glGetIntegerv(GL_PROGRAM_PIPELINE_BINDING,
+                                     (GLint *) &pipe);
+                       if (pipe != 0)
+                               glGetProgramPipelineiv(pipe,
+                                                      GL_VERTEX_SHADER,
+                                                      (GLint *) &prog);
+               }
+
+
                /* If there is a current program and that program has an
                 * active attribute named piglit_vertex, don't use the fixed
                 * function inputs.
-- 
1.8.1.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to