From: Ian Romanick Date: Sat, 11 Feb 2012 00:00:27 +0000 (-0800) Subject: swrast: Only avoid empty _TexEnvPrograms X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e22d4e5fc32dafcb9669a9d6376323aa88e300c;p=mesa.git 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 Reviewed-by: Chad Versace Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876 --- diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index cd20d8e3647..8d59371c836 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); } /**