Got the drawing working properly on Nvidia

It seems that Mesa is not doing something properly when the texture
compare mode is set to compare ref to texture, but we need to unset
that compare mode if we want to draw the texture out normally instead
of using it as a shadow map. It seems that something about this change
is also triggering a fragment shader recompilation, I'm not sure of the
cause of that.

Mesa also gives lots of warnings about shader recompilation but I guess
since I don't care so much about performance now I won't worry too much
about it.