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@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
_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);
}
/**