HLSL: Map min types to GLSL 16-bit types
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 8452a68..fc5913e 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -156,6 +156,7 @@
const char* sourceEntryPointName = nullptr;
const char* shaderStageName = nullptr;
const char* variableName = nullptr;
+bool HlslEnable16BitTypes = false;
std::vector<std::string> IncludeDirectoryList;
int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100
int VulkanClientVersion = 100; // would map to, say, Vulkan 1.0
@@ -450,6 +451,8 @@
lowerword == "hlsl-iomapper" ||
lowerword == "hlsl-iomapping") {
Options |= EOptionHlslIoMapping;
+ } else if (lowerword == "hlsl-enable-16bit-types") {
+ HlslEnable16BitTypes = true;
} else if (lowerword == "invert-y" || // synonyms
lowerword == "iy") {
Options |= EOptionInvertY;
@@ -513,7 +516,7 @@
setOpenGlSpv();
OpenGLClientVersion = 450;
} else
- Error("--target-env expected vulkan1.0 or opengl");
+ Error("--target-env expected vulkan1.0, opengl, or hlsl-16bit-types");
}
bumpArg();
} else if (lowerword == "variable-name" || // synonyms
@@ -701,6 +704,8 @@
messages = (EShMessages)(messages | EShMsgHlslOffsets);
if (Options & EOptionDebug)
messages = (EShMessages)(messages | EShMsgDebugInfo);
+ if (HlslEnable16BitTypes)
+ messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes);
}
//
@@ -1334,6 +1339,7 @@
" --hlsl-offsets Allow block offsets to follow HLSL rules\n"
" Works independently of source language\n"
" --hlsl-iomap Perform IO mapping in HLSL register space\n"
+ " --hlsl-enable-16bit-types Allow use of 16-bit types in SPIR-V for HLSL\n"
" --invert-y | --iy invert position.Y output in vertex shader\n"
" --keep-uncalled don't eliminate uncalled functions\n"
" --ku synonym for --keep-uncalled\n"