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

Timothy Arceri tarceri at itsqueeze.com
Mon Aug 21 00:42:21 UTC 2017


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



More information about the mesa-dev mailing list