Mesa (8.0): swrast: Only avoid empty _TexEnvPrograms

Ian Romanick idr at kemper.freedesktop.org
Wed Feb 15 22:52:46 UTC 2012


Module: Mesa
Branch: 8.0
Commit: ff1d9450321d5fe164611f819ee299706d9cbe02
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff1d9450321d5fe164611f819ee299706d9cbe02

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Feb 10 16:00:27 2012 -0800

swrast: Only avoid empty _TexEnvPrograms

If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
(cherry picked from commit 3e22d4e5fc32dafcb9669a9d6376323aa88e300c)

---

 src/mesa/swrast/s_fragprog.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index cd20d8e..8d59371 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -40,7 +40,8 @@ GLboolean
 _swrast_use_fragment_program(struct gl_context *ctx)
 {
    struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
-   return fp && fp != ctx->FragmentProgram._TexEnvProgram;
+   return fp && !(fp == ctx->FragmentProgram._TexEnvProgram
+                  && fp->Base.NumInstructions == 0);
 }
 
 /**




More information about the mesa-commit mailing list