Merge pull request #2616 from Rob2309/standalone-hlsl-sampled-textures

Exposed #856 as --hlsl-sampled-textures in the StandAlone
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index f76fc05..d38f4ad 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -112,6 +112,7 @@
 bool stripDebugInfo = false;
 bool beQuiet = false;
 bool VulkanRulesRelaxed = false;
+bool autoSampledTextures = false;
 
 //
 // Return codes from main/exit().
@@ -657,6 +658,8 @@
                         HlslEnable16BitTypes = true;
                     } else if (lowerword == "hlsl-dx9-compatible") {
                         HlslDX9compatible = true;
+                    } else if (lowerword == "auto-sampled-textures") { 
+                        autoSampledTextures = true;
                     } else if (lowerword == "invert-y" ||  // synonyms
                                lowerword == "iy") {
                         Options |= EOptionInvertY;
@@ -1222,6 +1225,9 @@
         shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0);
         shader->setResourceSetBinding(baseResourceSetBinding[compUnit.stage]);
 
+        if (autoSampledTextures)
+            shader->setTextureSamplerTransformMode(EShTexSampTransUpgradeTextureRemoveSampler);
+
         if (Options & EOptionAutoMapBindings)
             shader->setAutoMapBindings(true);