summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-26 14:10:12 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-28 10:25:13 +0200
commit89510d26a998886f1cf3a3af81dd07929da8a9c9 (patch)
tree5b85df763395b5544f267462100ec0ed05e47aa6 /src/mesa
parent18e31bb25222b8763f8c90eb8a07f6a72bdb0916 (diff)
mesa: prepare create_program_pipelines() for KHR_no_error support
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/pipelineobj.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 0f0d1dafffe..89ab9cfb13c 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -603,20 +603,12 @@ static void
create_program_pipelines(struct gl_context *ctx, GLsizei n, GLuint *pipelines,
bool dsa)
{
- const char *func;
+ const char *func = dsa ? "glCreateProgramPipelines" : "glGenProgramPipelines";
GLuint first;
GLint i;
- func = dsa ? "glCreateProgramPipelines" : "glGenProgramPipelines";
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s (n < 0)", func);
- return;
- }
-
- if (!pipelines) {
+ if (!pipelines)
return;
- }
first = _mesa_HashFindFreeKeyBlock(ctx->Pipeline.Objects, n);
@@ -638,7 +630,20 @@ create_program_pipelines(struct gl_context *ctx, GLsizei n, GLuint *pipelines,
save_pipeline_object(ctx, obj);
pipelines[i] = first + i;
}
+}
+
+static void
+create_program_pipelines_err(struct gl_context *ctx, GLsizei n,
+ GLuint *pipelines, bool dsa)
+{
+ const char *func = dsa ? "glCreateProgramPipelines" : "glGenProgramPipelines";
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s (n < 0)", func);
+ return;
+ }
+ create_program_pipelines(ctx, n, pipelines, dsa);
}
void GLAPIENTRY
@@ -649,7 +654,7 @@ _mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGenProgramPipelines(%d, %p)\n", n, pipelines);
- create_program_pipelines(ctx, n, pipelines, false);
+ create_program_pipelines_err(ctx, n, pipelines, false);
}
void GLAPIENTRY
@@ -660,7 +665,7 @@ _mesa_CreateProgramPipelines(GLsizei n, GLuint *pipelines)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glCreateProgramPipelines(%d, %p)\n", n, pipelines);
- create_program_pipelines(ctx, n, pipelines, true);
+ create_program_pipelines_err(ctx, n, pipelines, true);
}
/**