SPV: Implement Vulkan 1.1 features and extensions.

This commit is contained in:
John Kessenich
2018-03-06 16:12:04 -07:00
parent b2ae1d0521
commit 66011cb2c2
121 changed files with 51726 additions and 7500 deletions

View File

@@ -157,11 +157,14 @@ const char* sourceEntryPointName = nullptr;
const char* shaderStageName = nullptr;
const char* variableName = nullptr;
std::vector<std::string> IncludeDirectoryList;
int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100
int VulkanClientVersion = 100; // would map to, say, Vulkan 1.0
int OpenGLClientVersion = 450; // doesn't influence anything yet, but maps to OpenGL 4.50
unsigned int TargetVersion = 0x00010000; // maps to, say, SPIR-V 1.0
std::vector<std::string> Processes; // what should be recorded by OpModuleProcessed, or equivalent
int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100
glslang::EshTargetClientVersion VulkanClientVersion =
glslang::EShTargetVulkan_1_0; // would map to, say, Vulkan 1.0
glslang::EshTargetClientVersion OpenGLClientVersion =
glslang::EShTargetOpenGL_450; // doesn't influence anything yet, but maps to OpenGL 4.50
glslang::EShTargetLanguageVersion TargetVersion =
glslang::EShTargetSpv_1_0; // maps to, say, SPIR-V 1.0
std::vector<std::string> Processes; // what should be recorded by OpModuleProcessed, or equivalent
// Per descriptor-set binding base data
typedef std::map<unsigned int, unsigned int> TPerSetBaseBinding;
@@ -508,16 +511,20 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
if (argc > 1) {
if (strcmp(argv[1], "vulkan1.0") == 0) {
setVulkanSpv();
VulkanClientVersion = 100;
VulkanClientVersion = glslang::EShTargetVulkan_1_0;
} else if (strcmp(argv[1], "vulkan1.1") == 0) {
setVulkanSpv();
TargetVersion = glslang::EShTargetSpv_1_3;
VulkanClientVersion = glslang::EShTargetVulkan_1_1;
} else if (strcmp(argv[1], "opengl") == 0) {
setOpenGlSpv();
OpenGLClientVersion = 450;
OpenGLClientVersion = glslang::EShTargetOpenGL_450;
} else
Error("--target-env expected vulkan1.0 or opengl");
}
bumpArg();
} else if (lowerword == "variable-name" || // synonyms
lowerword == "vn") {
lowerword == "vn") {
Options |= EOptionOutputHexadecimal;
if (argc <= 1)
Error("no <C-variable-name> provided for --variable-name");
@@ -1373,8 +1380,9 @@ void usage()
" using -S.\n"
" --suppress-warnings suppress GLSL warnings\n"
" (except as required by #extension : warn)\n"
" --target-env {vulkan1.0|opengl} set the execution environment code will\n"
" execute in (as opposed to language\n"
" --target-env {vulkan1.0 | vulkan1.1 | opengl} \n"
" set execution environment that emitted code\n"
" will execute in (as opposed to the language\n"
" semantics selected by --client) defaults:\n"
" 'vulkan1.0' under '--client vulkan<ver>'\n"
" 'opengl' under '--client opengl<ver>'\n"