diff options
author | Brian Paul <[email protected]> | 2015-01-02 16:56:12 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-01-05 13:50:54 -0700 |
commit | 5b7e7cfb2b15e787e13abc8506cee9e731257902 (patch) | |
tree | 5470bb987ebf00cabf12ac8466dae80b8be47f73 /src | |
parent | 41dc2fee4e6f314fb7f9a13908c8b380333c9bc8 (diff) |
mesa: rearrange error handling in glProgramParameteri()
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/shaderapi.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index b7c39ee195c..8e49e3010c4 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1755,12 +1755,7 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value) * ProgramParameteri is not TRUE or FALSE." */ if (value != GL_TRUE && value != GL_FALSE) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glProgramParameteri(pname=%s, value=%d): " - "value must be 0 or 1.", - _mesa_lookup_enum_by_nr(pname), - value); - return; + goto invalid_value; } /* No need to notify the driver. Any changes will actually take effect @@ -1791,22 +1786,23 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value) * Chapter 7.3 Program Objects */ if (value != GL_TRUE && value != GL_FALSE) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glProgramParameteri(pname=%s, value=%d): " - "value must be 0 or 1.", - _mesa_lookup_enum_by_nr(pname), - value); - return; + goto invalid_value; } shProg->SeparateShader = value; return; default: - break; + _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)", + _mesa_lookup_enum_by_nr(pname)); + return; } - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); +invalid_value: + _mesa_error(ctx, GL_INVALID_VALUE, + "glProgramParameteri(pname=%s, value=%d): " + "value must be 0 or 1.", + _mesa_lookup_enum_by_nr(pname), + value); } void |