1848b8605Smrg/*
2848b8605Smrg * Mesa 3-D graphics library
3848b8605Smrg *
4848b8605Smrg * Copyright © 2013 Gregory Hainaut <gregory.hainaut@gmail.com>
5848b8605Smrg *
6848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
7848b8605Smrg * copy of this software and associated documentation files (the "Software"),
8848b8605Smrg * to deal in the Software without restriction, including without limitation
9848b8605Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10848b8605Smrg * and/or sell copies of the Software, and to permit persons to whom the
11848b8605Smrg * Software is furnished to do so, subject to the following conditions:
12848b8605Smrg *
13848b8605Smrg * The above copyright notice and this permission notice (including the next
14848b8605Smrg * paragraph) shall be included in all copies or substantial portions of the
15848b8605Smrg * Software.
16848b8605Smrg *
17848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18848b8605Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19848b8605Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20848b8605Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21848b8605Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22848b8605Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23848b8605Smrg * IN THE SOFTWARE.
24848b8605Smrg */
25848b8605Smrg
26848b8605Smrg#ifndef PIPELINEOBJ_H
27848b8605Smrg#define PIPELINEOBJ_H
28848b8605Smrg
29848b8605Smrg#include "glheader.h"
30848b8605Smrg
31848b8605Smrg#ifdef __cplusplus
32848b8605Smrgextern "C" {
33848b8605Smrg#endif
34848b8605Smrg
35848b8605Smrgstruct _glapi_table;
36848b8605Smrgstruct gl_context;
37848b8605Smrgstruct gl_pipeline_object;
38848b8605Smrg
39848b8605Smrgextern void
40848b8605Smrg_mesa_delete_pipeline_object(struct gl_context *ctx, struct gl_pipeline_object *obj);
41848b8605Smrg
42848b8605Smrgextern void
43848b8605Smrg_mesa_init_pipeline(struct gl_context *ctx);
44848b8605Smrg
45848b8605Smrgextern void
46848b8605Smrg_mesa_free_pipeline_data(struct gl_context *ctx);
47848b8605Smrg
48b8e80941Smrgextern struct gl_pipeline_object *
49b8e80941Smrg_mesa_lookup_pipeline_object(struct gl_context *ctx, GLuint id);
50b8e80941Smrg
51848b8605Smrgextern void
52848b8605Smrg_mesa_reference_pipeline_object_(struct gl_context *ctx,
53848b8605Smrg                                 struct gl_pipeline_object **ptr,
54848b8605Smrg                                 struct gl_pipeline_object *obj);
55848b8605Smrg
56848b8605Smrgstatic inline void
57848b8605Smrg_mesa_reference_pipeline_object(struct gl_context *ctx,
58848b8605Smrg                                struct gl_pipeline_object **ptr,
59848b8605Smrg                                struct gl_pipeline_object *obj)
60848b8605Smrg{
61848b8605Smrg   if (*ptr != obj)
62848b8605Smrg      _mesa_reference_pipeline_object_(ctx, ptr, obj);
63848b8605Smrg}
64848b8605Smrg
65848b8605Smrgextern void
66848b8605Smrg_mesa_bind_pipeline(struct gl_context *ctx,
67848b8605Smrg                    struct gl_pipeline_object *pipe);
68848b8605Smrg
69848b8605Smrgextern GLboolean
70b8e80941Smrg_mesa_validate_program_pipeline(struct gl_context * ctx,
71b8e80941Smrg                                struct gl_pipeline_object *pipe);
72848b8605Smrg
73848b8605Smrg
74b8e80941Smrgvoid GLAPIENTRY
75b8e80941Smrg_mesa_UseProgramStages_no_error(GLuint pipeline, GLbitfield stages,
76b8e80941Smrg                                GLuint prog);
77848b8605Smrgextern void GLAPIENTRY
78848b8605Smrg_mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
79848b8605Smrg
80b8e80941Smrgvoid GLAPIENTRY
81b8e80941Smrg_mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program);
82848b8605Smrgextern void GLAPIENTRY
83848b8605Smrg_mesa_ActiveShaderProgram(GLuint pipeline, GLuint program);
84848b8605Smrg
85b8e80941Smrgvoid GLAPIENTRY
86b8e80941Smrg_mesa_BindProgramPipeline_no_error(GLuint pipeline);
87848b8605Smrgextern void GLAPIENTRY
88848b8605Smrg_mesa_BindProgramPipeline(GLuint pipeline);
89848b8605Smrg
90848b8605Smrgextern void GLAPIENTRY
91848b8605Smrg_mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines);
92848b8605Smrg
93b8e80941Smrgvoid GLAPIENTRY
94b8e80941Smrg_mesa_GenProgramPipelines_no_error(GLsizei n, GLuint *pipelines);
95b8e80941Smrg
96848b8605Smrgextern void GLAPIENTRY
97848b8605Smrg_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines);
98848b8605Smrg
99b8e80941Smrgvoid GLAPIENTRY
100b8e80941Smrg_mesa_CreateProgramPipelines_no_error(GLsizei n, GLuint *pipelines);
101b8e80941Smrg
102b8e80941Smrgvoid GLAPIENTRY
103b8e80941Smrg_mesa_CreateProgramPipelines(GLsizei n, GLuint *pipelines);
104b8e80941Smrg
105848b8605Smrgextern GLboolean GLAPIENTRY
106848b8605Smrg_mesa_IsProgramPipeline(GLuint pipeline);
107848b8605Smrg
108848b8605Smrgextern void GLAPIENTRY
109848b8605Smrg_mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params);
110848b8605Smrg
111848b8605Smrgextern void GLAPIENTRY
112848b8605Smrg_mesa_ValidateProgramPipeline(GLuint pipeline);
113848b8605Smrg
114848b8605Smrgextern void GLAPIENTRY
115848b8605Smrg_mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
116848b8605Smrg                                GLsizei *length, GLchar *infoLog);
117848b8605Smrg
118848b8605Smrg#ifdef __cplusplus
119848b8605Smrg}
120848b8605Smrg#endif
121848b8605Smrg
122848b8605Smrg#endif /* PIPELINEOBJ_H */
123