mesa: added _mesa_is_fragment_shader_active() helper
authorBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 15:33:36 +0000 (09:33 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 16:19:30 +0000 (10:19 -0600)
src/mesa/main/shaderobj.h

index 346a5b75175da10f34fc3bb73ee5568e356634ce..5c6a056bcc908a84587af9c3401cda7434f461be 100644 (file)
@@ -130,6 +130,18 @@ _mesa_shader_index_to_type(GLuint i)
 }
 
 
+/**
+ * Check if there's a fragment shader active.
+ */
+static INLINE GLboolean
+_mesa_is_fragment_shader_active(const struct gl_context *ctx)
+{
+   return (ctx->Shader.CurrentProgram &&
+           ctx->Shader.CurrentProgram->LinkStatus &&
+           ctx->Shader.CurrentProgram->FragmentProgram);
+}
+
+
 #ifdef __cplusplus
 }
 #endif