Updated glslang.

This commit is contained in:
Branimir Karadžić 2017-11-23 15:55:40 -08:00
parent c4cd4876f0
commit a11222e542
11 changed files with 23 additions and 18 deletions

View File

@ -479,7 +479,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInSamplePosition;
case glslang::EbvSampleMask:
builder.addCapability(spv::CapabilitySampleRateShading);
return spv::BuiltInSampleMask;
case glslang::EbvLayer:

View File

@ -210,7 +210,6 @@ gl_FragCoord origin is upper left
// Id's are bound by 88
Capability Shader
Capability SampleRateShading
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 68 78 82 86

View File

@ -4,7 +4,6 @@ spv.arbPostDepthCoverage.frag
// Id's are bound by 18
Capability Shader
Capability SampleRateShading
Capability SampleMaskPostDepthCoverage
Extension "SPV_KHR_post_depth_coverage"
1: ExtInstImport "GLSL.std.450"

View File

@ -4,7 +4,6 @@ spv.sampleMaskOverrideCoverage.frag
// Id's are bound by 20
Capability Shader
Capability SampleRateShading
Extension "SPV_NV_sample_mask_override_coverage"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450

View File

@ -240,7 +240,10 @@ struct TSourceLoc {
int column;
};
typedef TMap<TString, TString> TPragmaTable;
class TPragmaTable : public TMap<TString, TString> {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
};
const int MaxTokenLength = 1024;

View File

@ -1303,8 +1303,8 @@ typedef TVector<TStorageQualifier> TQualifierList;
//
class TIntermAggregate : public TIntermOperator {
public:
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { }
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { }
~TIntermAggregate() { delete pragmaTable; }
virtual TIntermAggregate* getAsAggregate() { return this; }
virtual const TIntermAggregate* getAsAggregate() const { return this; }
@ -1322,7 +1322,7 @@ public:
void setDebug(bool d) { debug = d; }
bool getOptimize() const { return optimize; }
bool getDebug() const { return debug; }
void addToPragmaTable(const TPragmaTable& pTable);
void setPragmaTable(const TPragmaTable& pTable);
const TPragmaTable& getPragmaTable() const { return *pragmaTable; }
protected:
TIntermAggregate(const TIntermAggregate&); // disallow copy constructor

View File

@ -3170,10 +3170,10 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
node->getLoc());
}
void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
void TIntermAggregate::setPragmaTable(const TPragmaTable& pTable)
{
assert(!pragmaTable);
pragmaTable = new TPragmaTable();
assert(pragmaTable == nullptr);
pragmaTable = new TPragmaTable;
*pragmaTable = pTable;
}

View File

@ -201,13 +201,16 @@ void TPoolAllocator::pop()
currentPageOffset = stack.back().offset;
while (inUseList != page) {
// invoke destructor to free allocation list
inUseList->~tHeader();
tHeader* nextInUse = inUseList->nextPage;
if (inUseList->pageCount > 1)
size_t pageCount = inUseList->pageCount;
// This technically ends the lifetime of the header as C++ object,
// but we will still control the memory and reuse it.
inUseList->~tHeader(); // currently, just a debug allocation checker
if (pageCount > 1) {
delete [] reinterpret_cast<char*>(inUseList);
else {
} else {
inUseList->nextPage = freeList;
freeList = inUseList;
}

View File

@ -2916,7 +2916,7 @@ function_definition
// information. This information can be queried from the parse tree
$$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
$$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
$$->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable);
$$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
}
;

View File

@ -7975,7 +7975,7 @@ yyreduce:
// information. This information can be queried from the parse tree
(yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
(yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
(yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable);
(yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
}
#line 7981 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;

View File

@ -280,6 +280,9 @@ INSTANTIATE_TEST_CASE_P(
"spv.precisionNonESSamp.frag",
"spv.prepost.frag",
"spv.qualifiers.vert",
"spv.sample.frag",
"spv.sampleId.frag",
"spv.samplePosition.frag",
"spv.sampleMaskOverrideCoverage.frag",
"spv.shaderBallot.comp",
"spv.shaderDrawParams.vert",