Infrastructure: Non-functional: Move to rich description of environment.

This is for input languages, client APIs, code to generate, etc.
This commit is contained in:
John Kessenich
2017-06-23 10:50:22 -06:00
parent 4fbb8cb45e
commit 4be4aebdcd
6 changed files with 191 additions and 34 deletions

View File

@@ -715,9 +715,27 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
if (Options & EOptionAutoMapLocations)
shader->setAutoMapLocations(true);
// Set up the environment, some subsettings take precedence over earlier
// ways of setting things.
if (Options & EOptionSpv) {
if (Options & EOptionVulkanRules) {
shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
: glslang::EShSourceGlsl,
compUnit.stage, glslang::EShClientVulkan, 100);
shader->setEnvClient(glslang::EShClientVulkan, 100);
shader->setEnvTarget(glslang::EshTargetSpv, 0x00001000);
} else {
shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
: glslang::EShSourceGlsl,
compUnit.stage, glslang::EShClientOpenGL, 100);
shader->setEnvClient(glslang::EShClientOpenGL, 450);
shader->setEnvTarget(glslang::EshTargetSpv, 0x00001000);
}
}
shaders.push_back(shader);
const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100;
const int defaultVersion = Options & EOptionDefaultDesktop ? 110 : 100;
DirStackFileIncluder includer;
std::for_each(IncludeDirectoryList.rbegin(), IncludeDirectoryList.rend(), [&includer](const std::string& dir) {