Avoid forcing nearest/disabling linear if possible.

If we know that the test is trivially true, we don't need to worry about
the test.  May help #4405.
Merge pull request #6088 from unknownbrackets/texfiltering

Avoid forcing nearest/disabling linear if possible