From 4177d39c1ec10d252f2d08cc9ab9141f0ca94421 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 28 Jun 2013 14:01:18 -0700 Subject: [PATCH] mesa/sso: Implement _mesa_IsProgramPipeline 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 Reviewed-by: Jordan Justen --- src/mesa/main/mtypes.h | 2 ++ src/mesa/main/pipelineobj.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 90f71a72761..c998cc6a02c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -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 */ }; /** diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 9f1cefc883c..ab4a0c4f1dd 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -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; } /** -- 2.30.2