diff options
-rw-r--r-- | src/mesa/main/shaderapi.c | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index caeb9657e4c..612c1fc64c2 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -481,28 +481,28 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param switch (pname) { case GL_DELETE_STATUS: *params = shProg->DeletePending; - break; + return; case GL_LINK_STATUS: *params = shProg->LinkStatus; - break; + return; case GL_VALIDATE_STATUS: *params = shProg->Validated; - break; + return; case GL_INFO_LOG_LENGTH: *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0; - break; + return; case GL_ATTACHED_SHADERS: *params = shProg->NumShaders; - break; + return; case GL_ACTIVE_ATTRIBUTES: *params = _mesa_count_active_attribs(shProg); - break; + return; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: *params = _mesa_longest_attribute_name_length(shProg); - break; + return; case GL_ACTIVE_UNIFORMS: *params = shProg->NumUserUniformStorage; - break; + return; case GL_ACTIVE_UNIFORM_MAX_LENGTH: { unsigned i; GLint max_len = 0; @@ -517,41 +517,48 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param } *params = max_len; - break; + return; } - case GL_PROGRAM_BINARY_LENGTH_OES: - *params = 0; - break; #if FEATURE_EXT_transform_feedback case GL_TRANSFORM_FEEDBACK_VARYINGS: + if (!ctx->Extensions.EXT_transform_feedback) + break; *params = shProg->TransformFeedback.NumVarying; - break; + return; case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: + if (!ctx->Extensions.EXT_transform_feedback) + break; *params = longest_feedback_varying_name(shProg) + 1; - break; + return; case GL_TRANSFORM_FEEDBACK_BUFFER_MODE: + if (!ctx->Extensions.EXT_transform_feedback) + break; *params = shProg->TransformFeedback.BufferMode; - break; + return; #endif #if FEATURE_ARB_geometry_shader4 case GL_GEOMETRY_VERTICES_OUT_ARB: + if (!ctx->Extensions.ARB_geometry_shader4) + break; *params = shProg->Geom.VerticesOut; - break; + return; case GL_GEOMETRY_INPUT_TYPE_ARB: + if (!ctx->Extensions.ARB_geometry_shader4) + break; *params = shProg->Geom.InputType; - break; + return; case GL_GEOMETRY_OUTPUT_TYPE_ARB: + if (!ctx->Extensions.ARB_geometry_shader4) + break; *params = shProg->Geom.OutputType; - break; + return; #endif case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: { unsigned i; GLint max_len = 0; - if (!ctx->Extensions.ARB_uniform_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); - return; - } + if (!ctx->Extensions.ARB_uniform_buffer_object) + break; for (i = 0; i < shProg->NumUniformBlocks; i++) { /* Add one for the terminating NUL character. @@ -563,20 +570,20 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param } *params = max_len; - break; + return; } case GL_ACTIVE_UNIFORM_BLOCKS: - if (!ctx->Extensions.ARB_uniform_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); - return; - } + if (!ctx->Extensions.ARB_uniform_buffer_object) + break; *params = shProg->NumUniformBlocks; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); return; + default: + break; } + + _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname=%s)", + _mesa_lookup_enum_by_nr(pname)); } |