[Mesa-dev] [PATCH] mesa: fix ES only draw if we have vertex positions

Marek Olšák maraeo at gmail.com
Mon Aug 21 21:34:17 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Aug 21, 2017 at 2:42 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> This code was separated from the validation code so it could
> use used with KHR_no_error paths. The return values were inverted
> to reflect the name of the helper, but here the condtion was
> mistakenly inverted rather than the return value.
>
> Fixes: 4df2931a87fe (mesa/vbo: move some Draw checks out of validation)
>
> Reported-by: Brian Paul <brianp at vmware.com>
> Cc: Brian Paul <brianp at vmware.com>
> ---
>  src/mesa/vbo/vbo_exec_array.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 92f04726c7..0617d65935 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -186,22 +186,22 @@ static bool
>  skip_validated_draw(struct gl_context *ctx)
>  {
>     switch (ctx->API) {
>     case API_OPENGLES2:
>        /* For ES2, we can draw if we have a vertex program/shader). */
>        return ctx->VertexProgram._Current == NULL;
>
>     case API_OPENGLES:
>        /* For OpenGL ES, only draw if we have vertex positions
>         */
> -      if (ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Enabled)
> -         return false;
> +      if (!ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Enabled)
> +         return true;
>        break;
>
>     case API_OPENGL_CORE:
>        /* Section 7.3 (Program Objects) of the OpenGL 4.5 Core Profile spec
>         * says:
>         *
>         *     "If there is no active program for the vertex or fragment shader
>         *     stages, the results of vertex and/or fragment processing will be
>         *     undefined. However, this is not an error."
>         *
> --
> 2.13.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list