- /* FINISHME: If GL_NV_geometry_program4 is ever supported, the current
- * FINISHME: geometry program should validated here.
- */
- (void) from_glsl_shader[MESA_SHADER_GEOMETRY];
+ /* In OpenGL Core Profile and OpenGL ES 2.0 / 3.0, there are no assembly
+ * shaders. Don't check state related to those.
+ */
+ } else {
+ bool has_vertex_shader = false;
+ bool has_fragment_shader = false;
+
+ /* In OpenGL Compatibility Profile, there is only vertex shader and
+ * fragment shader. We take this path also for API_OPENGLES because
+ * optimizing that path would make the other (more common) paths
+ * slightly slower.
+ */
+ if (!shader_linked_or_absent(ctx,
+ ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX],
+ &has_vertex_shader, where))
+ return GL_FALSE;