[Mesa-dev] [PATCH] mesa: fix error handling in _mesa_TransformFeedbackVaryings

Iago Toral itoral at igalia.com
Mon Oct 10 13:44:39 UTC 2016


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

On Mon, 2016-10-10 at 09:49 +0300, Tapani Pälli wrote:
> Patch changes function to use _mesa_lookup_shader_program_err both
> in TransformFeedbackVaryings and GetTransformFeedbackVarying that
> handles errors correctly for invalid values of shader program.
> 
> Fixes following dEQP test:
>    dEQP-
> GLES31.functional.debug.negative_coverage.get_error.shader.transform_
> feedback_varyings
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98135
> ---
>  src/mesa/main/transformfeedback.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/main/transformfeedback.c
> b/src/mesa/main/transformfeedback.c
> index 7c0ff6f..738d63e 100644
> --- a/src/mesa/main/transformfeedback.c
> +++ b/src/mesa/main/transformfeedback.c
> @@ -846,12 +846,10 @@ _mesa_TransformFeedbackVaryings(GLuint program,
> GLsizei count,
>        return;
>     }
>  
> -   shProg = _mesa_lookup_shader_program(ctx, program);
> -   if (!shProg) {
> -      _mesa_error(ctx, GL_INVALID_VALUE,
> -                  "glTransformFeedbackVaryings(program=%u)",
> program);
> +   shProg = _mesa_lookup_shader_program_err(ctx, program,
> +                                            "glTransformFeedbackVary
> ings");
> +   if (!shProg)
>        return;
> -   }
>  
>     if (ctx->Extensions.ARB_transform_feedback3) {
>        if (bufferMode == GL_INTERLEAVED_ATTRIBS) {
> @@ -927,12 +925,10 @@ _mesa_GetTransformFeedbackVarying(GLuint
> program, GLuint index,
>     struct gl_program_resource *res;
>     GET_CURRENT_CONTEXT(ctx);
>  
> -   shProg = _mesa_lookup_shader_program(ctx, program);
> -   if (!shProg) {
> -      _mesa_error(ctx, GL_INVALID_VALUE,
> -                  "glGetTransformFeedbackVarying(program=%u)",
> program);
> +   shProg = _mesa_lookup_shader_program_err(ctx, program,
> +                                            "glGetTransformFeedbackV
> arying");
> +   if (!shProg)
>        return;
> -   }
>  
>     res = _mesa_program_resource_find_index((struct gl_shader_program
> *) shProg,
>                                             GL_TRANSFORM_FEEDBACK_VAR
> YING,


More information about the mesa-dev mailing list