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 90f71a72761f5ed97fefe8398680bc1be8ba976c..c998cc6a02cf6ed04619547ad40f7ce24cfd9d61 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 9f1cefc883c14720c8da119b662884e977350742..ab4a0c4f1ddf987a6ea489f83b26b6c6b2d7dddc 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;
 }
 
 /**