Some code refactoring, Fix some test shader compile failures on Intel HD 4000

Added ps5\twoSideDepthWrite test.
Merged TranslateOperand and TranslateIntegerOperand functions. Having
them as separate functions led to unnecessary code duplication.
No longer create global variables to hold certain built-in inputs - use
them directly instead. Fixes the following shaders on Intel HD 4000
(failed to compile  + compile log was empty)
ps4\primID
ps5\twoSideDepthWrite
Use a single function to compile texture sample instructions.

Reduces code duplication.