diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-03-03 13:18:15 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-03-03 13:18:15 +0000 |
commit | c7e46c1857b744a35c086dddb651f38df948a5fa (patch) | |
tree | 6d984aea871340574cd7286c11a53a7b9b094f81 /src/mesa/main/api_validate.c | |
parent | 97a1fd158c9acfaa3a8deda7eb5bf0b253e85c15 (diff) | |
parent | dceb09909ea9d6eaef0334897ebed6da45db6faa (diff) |
Merge commit 'origin/master' into gallium-map-range
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r-- | src/mesa/main/api_validate.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 5c8955d7c8..42d1e579e0 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -87,11 +87,20 @@ check_valid_to_render(GLcontext *ctx, char *function) return GL_FALSE; } - /* Always need vertex positions, unless a vertex program is in use */ - if (!ctx->VertexProgram._Current && - !ctx->Array.ArrayObj->Vertex.Enabled && +#if FEATURE_es2_glsl + /* For ES2, we can draw if any vertex array is enabled (and we should + * always have a vertex program/shader). + */ + if (ctx->Array.ArrayObj->_Enabled == 0x0 || !ctx->VertexProgram._Current) + return GL_FALSE; +#else + /* For regular OpenGL, only draw if we have vertex positions (regardless + * of whether or not we have a vertex program/shader). + */ + if (!ctx->Array.ArrayObj->Vertex.Enabled && !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) return GL_FALSE; +#endif return GL_TRUE; } |