aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory Hainaut <[email protected]>2013-06-28 14:00:13 -0700
committerIan Romanick <[email protected]>2014-02-21 15:41:02 -0800
commit0c265526626c91aa4a54923e5eab7d12b668739a (patch)
tree4e7c718a877af9787dae1f257a80cc1eb70d5cea
parent55311557fda35d3e304039cc8700a43d04a0c077 (diff)
mesa/sso: Implement _mesa_GenProgramPipelines
Implement GenProgramPipelines based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r--src/mesa/main/pipelineobj.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 810c6fd1081..9f1cefc883c 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -285,6 +285,36 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)
void GLAPIENTRY
_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)
{
+ GET_CURRENT_CONTEXT(ctx);
+
+ GLuint first;
+ GLint i;
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenProgramPipelines(n<0)");
+ return;
+ }
+
+ if (!pipelines) {
+ return;
+ }
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Pipeline.Objects, n);
+
+ for (i = 0; i < n; i++) {
+ struct gl_pipeline_object *obj;
+ GLuint name = first + i;
+
+ obj = _mesa_new_pipeline_object(ctx, name);
+ if (!obj) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenProgramPipelines");
+ return;
+ }
+
+ save_pipeline_object(ctx, obj);
+ pipelines[i] = first + i;
+ }
+
}
/**