mesa/sso: Implement _mesa_IsProgramPipeline
authorGregory Hainaut <gregory.hainaut@gmail.com>
Fri, 28 Jun 2013 21:01:18 +0000 (14:01 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 21 Feb 2014 23:41:02 +0000 (15:41 -0800)
Implement IsProgramPipeline based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/main/mtypes.h
src/mesa/main/pipelineobj.c

index 90f71a7..c998cc6 100644 (file)
@@ -2789,6 +2789,8 @@ struct gl_pipeline_object
    struct gl_shader_program *ActiveProgram;
 
    GLbitfield Flags;                    /**< Mask of GLSL_x flags */
+
+   GLboolean EverBound;                 /**< Has the pipeline object been created */
 };
 
 /**
index 9f1cefc..ab4a0c4 100644 (file)
@@ -327,7 +327,13 @@ _mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)
 GLboolean GLAPIENTRY
 _mesa_IsProgramPipeline(GLuint pipeline)
 {
-   return GL_FALSE;
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_pipeline_object *obj = lookup_pipeline_object(ctx, pipeline);
+   if (obj == NULL)
+      return GL_FALSE;
+
+   return obj->EverBound;
 }
 
 /**