aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_fragprog.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/swrast/s_fragprog.c')
-rw-r--r--mesalib/src/mesa/swrast/s_fragprog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c
index 1caa0ebc2..cd20d8e36 100644
--- a/mesalib/src/mesa/swrast/s_fragprog.c
+++ b/mesalib/src/mesa/swrast/s_fragprog.c
@@ -30,6 +30,18 @@
#include "s_fragprog.h"
#include "s_span.h"
+/**
+ * \brief Should swrast use a fragment program?
+ *
+ * \return true if the current fragment program exists and is not the fixed
+ * function fragment program
+ */
+GLboolean
+_swrast_use_fragment_program(struct gl_context *ctx)
+{
+ struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+ return fp && fp != ctx->FragmentProgram._TexEnvProgram;
+}
/**
* Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel'