diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-26 18:25:10 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-28 10:25:13 +0200 |
commit | beb74c9b87b90a4a10c9c4b26191d3d2ebd973d6 (patch) | |
tree | de423d991456987eb9946f68cdf8848854200718 /src/mesa/main | |
parent | 836b48a8361a5e8409d0313c527ceb6800ebe870 (diff) |
mesa: prepare create_render_buffers() for KHR_no_error support
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 74b38180900..4c312332079 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1705,11 +1705,6 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers, GLuint first; GLint i; - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func); - return; - } - if (!renderbuffers) return; @@ -1734,11 +1729,26 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers, } +static void +create_render_buffers_err(struct gl_context *ctx, GLsizei n, + GLuint *renderbuffers, bool dsa) +{ + const char *func = dsa ? "glCreateRenderbuffers" : "glGenRenderbuffers"; + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func); + return; + } + + create_render_buffers(ctx, n, renderbuffers, dsa); +} + + void GLAPIENTRY _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers) { GET_CURRENT_CONTEXT(ctx); - create_render_buffers(ctx, n, renderbuffers, false); + create_render_buffers_err(ctx, n, renderbuffers, false); } @@ -1746,7 +1756,7 @@ void GLAPIENTRY _mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers) { GET_CURRENT_CONTEXT(ctx); - create_render_buffers(ctx, n, renderbuffers, true); + create_render_buffers_err(ctx, n, renderbuffers, true); } |