On 27/06/17 21:20, Samuel Pitoiset wrote:
Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
---
  src/mesa/main/pipelineobj.c | 33 +++++++++++++++++++--------------
  1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 0f0d1dafffe..ca17fa3f06c 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -603,21 +603,10 @@ 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) {
-      return;
-   }

again please leave. With that 22-23:

Reviewed-by: Timothy Arceri <tarc...@itsqueeze.com>

-
     first = _mesa_HashFindFreeKeyBlock(ctx->Pipeline.Objects, n);
for (i = 0; i < n; i++) {
@@ -638,7 +627,23 @@ 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;
+   }
+
+   if (!pipelines)
+      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);
  }
/**

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to