Fix bug when setting input and getting output

And improve unit test.
Support textures in shader unit tests