Non-functional: Make the vulkan version number meaning be only 0 or not 0.

This commit is contained in:
John Kessenich 2018-03-02 18:17:42 -07:00
parent e58d58b782
commit b5b5f918c6
6 changed files with 13 additions and 13 deletions

View File

@ -3195,7 +3195,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
// GL_AMD_shader_fragment_mask
if (profile != EEsProfile && version >= 450 && spvVersion.vulkan >= 100) {
if (profile != EEsProfile && version >= 450 && spvVersion.vulkan > 0) {
stageBuiltins[EShLangFragment].append(
"uint fragmentMaskFetchAMD(subpassInputMS);"
"uint fragmentMaskFetchAMD(isubpassInputMS);"
@ -3494,7 +3494,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangVertex].append(
"int gl_InstanceID;" // needs qualifier fixed later
);
if (spvVersion.vulkan >= 100 && version >= 140)
if (spvVersion.vulkan > 0 && version >= 140)
stageBuiltins[EShLangVertex].append(
"in int gl_VertexIndex;"
"in int gl_InstanceIndex;"
@ -3544,7 +3544,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in highp int gl_VertexID;" // needs qualifier fixed later
"in highp int gl_InstanceID;" // needs qualifier fixed later
);
if (spvVersion.vulkan >= 100)
if (spvVersion.vulkan > 0)
stageBuiltins[EShLangVertex].append(
"in highp int gl_VertexIndex;"
"in highp int gl_InstanceIndex;"
@ -5569,7 +5569,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
if (spvVersion.vulkan >= 100)
if (spvVersion.vulkan > 0)
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
@ -5670,7 +5670,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable);
}
if (spvVersion.vulkan >= 100) {
if (spvVersion.vulkan > 0) {
BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable);
BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable);
}

View File

@ -1244,7 +1244,7 @@ int TScanContext::tokenizeIdentifier()
case TEXTURE1DARRAY:
case SAMPLER:
case SAMPLERSHADOW:
if (parseContext.spvVersion.vulkan >= 100)
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
return identifierOrType();
@ -1255,7 +1255,7 @@ int TScanContext::tokenizeIdentifier()
case ISUBPASSINPUTMS:
case USUBPASSINPUT:
case USUBPASSINPUTMS:
if (parseContext.spvVersion.vulkan >= 100)
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
return identifierOrType();

View File

@ -578,7 +578,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
if (spvVersion.spv != 0) {
switch (profile) {
case EEsProfile:
if (spvVersion.vulkan >= 100 && version < 310) {
if (spvVersion.vulkan > 0 && version < 310) {
correct = false;
infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher");
version = 310;
@ -593,7 +593,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
infoSink.info.message(EPrefixError, "#version: compilation for SPIR-V does not support the compatibility profile");
break;
default:
if (spvVersion.vulkan >= 100 && version < 140) {
if (spvVersion.vulkan > 0 && version < 140) {
correct = false;
infoSink.info.message(EPrefixError, "#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher");
version = 140;
@ -814,7 +814,7 @@ bool ProcessDeferred(
intermediate.setProfile(profile);
intermediate.setSpv(spvVersion);
RecordProcesses(intermediate, messages, sourceEntryPointName);
if (spvVersion.vulkan >= 100)
if (spvVersion.vulkan > 0)
intermediate.setOriginUpperLeft();
if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl)
intermediate.setHlslOffsets();

View File

@ -802,7 +802,7 @@ void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
// Call for any operation removed because Vulkan SPIR-V is being generated.
void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op)
{
if (spvVersion.vulkan >= 100)
if (spvVersion.vulkan > 0)
error(loc, "not allowed when using GLSL for Vulkan", op, "");
}

View File

@ -83,7 +83,7 @@ struct SpvVersion {
SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0) {}
unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header
int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX"
int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use (100 means 1.0)
int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use
int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX"
};

View File

@ -378,7 +378,7 @@ public:
processes.addProcess("client opengl100");
// target-environment processes
if (spvVersion.vulkan == 100)
if (spvVersion.vulkan > 0)
processes.addProcess("target-env vulkan1.0");
else if (spvVersion.vulkan > 0)
processes.addProcess("target-env vulkanUnknown");