diff options
author | marha <marha@users.sourceforge.net> | 2011-05-22 14:29:51 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-05-22 14:29:51 +0000 |
commit | 016747a04df9d4474489fe3b3d1c0f11a713148b (patch) | |
tree | 69722f37ac06c00d6674c7bf2df6597753b418e6 /mesalib/src/mesa/main/api_validate.c | |
parent | 32a666fa1f26defd3b4e508b75f1acf6e2900a40 (diff) | |
parent | 52011cfedaa930d61d8f60b283a2051093727582 (diff) | |
download | vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.tar.gz vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.tar.bz2 vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r-- | mesalib/src/mesa/main/api_validate.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index c583d1293..5916af9f7 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -116,17 +116,39 @@ check_valid_to_render(struct gl_context *ctx, const char *function) break;
#endif
-#if FEATURE_ES1 || FEATURE_GL
+#if FEATURE_ES1
case API_OPENGLES:
- case API_OPENGL:
- /* 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)
+ /* For OpenGL ES, only draw if we have vertex positions
+ */
+ if (!ctx->Array.ArrayObj->Vertex.Enabled)
return GL_FALSE;
break;
#endif
+#if FEATURE_GL
+ case API_OPENGL:
+ {
+ const struct gl_shader_program *vsProg =
+ ctx->Shader.CurrentVertexProgram;
+ GLboolean haveVertexShader = (vsProg && vsProg->LinkStatus);
+ GLboolean haveVertexProgram = ctx->VertexProgram._Enabled;
+ if (haveVertexShader || haveVertexProgram) {
+ /* Draw regardless of whether or not we have any vertex arrays.
+ * (Ex: could draw a point using a constant vertex pos)
+ */
+ return GL_TRUE;
+ }
+ else {
+ /* Draw if we have vertex positions (GL_VERTEX_ARRAY or generic
+ * array [0]).
+ */
+ return (ctx->Array.ArrayObj->Vertex.Enabled ||
+ ctx->Array.ArrayObj->VertexAttrib[0].Enabled);
+ }
+ }
+ break;
+#endif
+
default:
ASSERT_NO_FEATURE();
}
|