[Mesa-dev] [PATCH 04/42] mesa: pass the 'caller' function to create_shader()
Timothy Arceri
tarceri at itsqueeze.com
Tue Jun 27 23:10:47 UTC 2017
On 27/06/17 21:20, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/mesa/main/shaderapi.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 7318833e9b8..bb944191813 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -325,14 +325,14 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
>
>
> static GLuint
> -create_shader(struct gl_context *ctx, GLenum type)
> +create_shader(struct gl_context *ctx, GLenum type, const char *caller)
> {
> struct gl_shader *sh;
> GLuint name;
>
> if (!_mesa_validate_shader_target(ctx, type)) {
> - _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(%s)",
> - _mesa_enum_to_string(type));
> + _mesa_error(ctx, GL_INVALID_ENUM, "%s(%s)",
> + caller, _mesa_enum_to_string(type));
> return 0;
> }
>
> @@ -1396,7 +1396,7 @@ _mesa_CreateShader(GLenum type)
> GET_CURRENT_CONTEXT(ctx);
> if (MESA_VERBOSE & VERBOSE_API)
> _mesa_debug(ctx, "glCreateShader %s\n", _mesa_enum_to_string(type));
> - return create_shader(ctx, type);
> + return create_shader(ctx, type, "glCreateShader");
> }
>
>
> @@ -1404,7 +1404,7 @@ GLhandleARB GLAPIENTRY
> _mesa_CreateShaderObjectARB(GLenum type)
> {
> GET_CURRENT_CONTEXT(ctx);
> - return create_shader(ctx, type);
> + return create_shader(ctx, type, "glCreateShaderObjectARB");
> }
>
>
> @@ -2270,7 +2270,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count,
> {
> GET_CURRENT_CONTEXT(ctx);
>
> - const GLuint shader = create_shader(ctx, type);
> + const GLuint shader = create_shader(ctx, type, "glCreateShaderProgram");
glCreateShaderProgram -> glCreateShaderProgramv
With that:
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> GLuint program = 0;
>
> /*
>
More information about the mesa-dev
mailing list