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);
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
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
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);
}
/**