SPV: Non-functional: Condense SPV-related versioning, and rationalize all uses.

This commit is contained in:
John Kessenich
2016-06-16 20:59:42 -06:00
parent 65336488a8
commit b901ade058
17 changed files with 174 additions and 153 deletions

View File

@@ -49,9 +49,9 @@
namespace glslang {
HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool /*parsingBuiltins*/,
int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink,
int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
bool forwardCompatible, EShMessages messages) :
TParseContextBase(symbolTable, interm, version, profile, spv, vulkan, language, infoSink, forwardCompatible, messages),
TParseContextBase(symbolTable, interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
postMainReturn(false),
limits(resources.limits),
@@ -62,11 +62,11 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
globalUniformDefaults.clear();
globalUniformDefaults.layoutMatrix = ElmColumnMajor;
globalUniformDefaults.layoutPacking = vulkan > 0 ? ElpStd140 : ElpShared;
globalUniformDefaults.layoutPacking = ElpStd140;
globalBufferDefaults.clear();
globalBufferDefaults.layoutMatrix = ElmColumnMajor;
globalBufferDefaults.layoutPacking = vulkan > 0 ? ElpStd430 : ElpShared;
globalBufferDefaults.layoutPacking = ElpStd430;
globalInputDefaults.clear();
globalOutputDefaults.clear();
@@ -2416,18 +2416,6 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& pu
publicType.qualifier.layoutMatrix = ElmRowMajor;
return;
}
if (id == TQualifier::getLayoutPackingString(ElpPacked)) {
if (vulkan > 0)
vulkanRemoved(loc, "packed");
publicType.qualifier.layoutPacking = ElpPacked;
return;
}
if (id == TQualifier::getLayoutPackingString(ElpShared)) {
if (vulkan > 0)
vulkanRemoved(loc, "shared");
publicType.qualifier.layoutPacking = ElpShared;
return;
}
if (id == "push_constant") {
requireVulkan(loc, "push_constant");
publicType.qualifier.layoutPushConstant = true;
@@ -2714,7 +2702,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& pu
publicType.shaderQualifiers.localSize[2] = value;
return;
}
if (spv > 0) {
if (spvVersion.spv != 0) {
if (id == "local_size_x_id") {
publicType.shaderQualifiers.localSizeSpecId[0] = value;
return;

View File

@@ -44,7 +44,7 @@ namespace glslang {
class HlslParseContext : public TParseContextBase {
public:
HlslParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins,
int version, EProfile, int spv, int vulkan, EShLanguage, TInfoSink&,
int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&,
bool forwardCompatible = false, EShMessages messages = EShMsgDefault);
virtual ~HlslParseContext();
void setLimits(const TBuiltInResource&);

View File

@@ -218,7 +218,7 @@ TBuiltInParseablesHlsl::TBuiltInParseablesHlsl()
// Most built-ins variables can be added as simple text strings. Some need to
// be added programmatically, which is done later in IdentifyBuiltIns() below.
//
void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv, int vulkan)
void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
{
static const EShLanguageMask EShLangAll = EShLanguageMask(EShLangCount - 1);
@@ -229,8 +229,8 @@ void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv,
// typekey can be:
// D = double, F = float, U = uint, I = int, B = bool, S = sampler, - = void
// An empty order or type key repeats the first one. E.g: SVM,, means 3 args each of SVM.
// '>' as first letter of order creates an output paremeter
// '<' as first letter of order creates an input paremeter
// '>' as first letter of order creates an output parameter
// '<' as first letter of order creates an input parameter
// '^' as first letter of order takes transpose dimensions
static const struct {
@@ -498,8 +498,8 @@ void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv,
// add stage-specific entries to the commonBuiltins, and only if that stage
// was requested.
//
void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv,
int vulkan, EShLanguage language)
void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int version, EProfile profile,
const SpvVersion& spvVersion, EShLanguage language)
{
}
@@ -512,7 +512,7 @@ void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int v
// 3) Tag extension-related symbols added to their base version with their extensions, so
// that if an early version has the extension turned off, there is an error reported on use.
//
void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language,
void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
TSymbolTable& symbolTable)
{
// symbolTable.relateToOperator("abort", EOpAbort);
@@ -660,7 +660,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int
// 2) Tag extension-related symbols added to their base version with their extensions, so
// that if an early version has the extension turned off, there is an error reported on use.
//
void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language,
void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
TSymbolTable& symbolTable, const TBuiltInResource &resources)
{
}

View File

@@ -48,12 +48,12 @@ class TBuiltInParseablesHlsl : public TBuiltInParseables {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
TBuiltInParseablesHlsl();
void initialize(int version, EProfile, int spv, int vulkan);
void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage);
void initialize(int version, EProfile, const SpvVersion& spvVersion);
void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage);
void identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable);
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable);
void identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
};
} // end namespace glslang