Added compare mode and compare func setter for texture + made a few fixes.