Minor infrastructure changes, to simplify an upcoming check in:
- print out block member types when printing a block (makes all test results change) - const versions of all intermediate.h type-identification methods - layoutSlotLocation -> layoutLocation git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24664 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
7054075804
commit
7cbfdf4394
50 changed files with 592 additions and 571 deletions
|
|
@ -83,7 +83,9 @@ namespace glslang {
|
|||
//
|
||||
// Do folding between a pair of nodes
|
||||
//
|
||||
TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNode)
|
||||
// Returns a new node representing the result.
|
||||
//
|
||||
TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* constantNode) const
|
||||
{
|
||||
// For most cases, the return type matches the argument type, so set that
|
||||
// up and just code to exceptions below.
|
||||
|
|
@ -94,7 +96,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
|
|||
// A pair of nodes is to be folded together
|
||||
//
|
||||
|
||||
TIntermConstantUnion *node = constantNode->getAsConstantUnion();
|
||||
const TIntermConstantUnion *node = constantNode->getAsConstantUnion();
|
||||
TConstUnionArray unionArray = getConstArray();
|
||||
TConstUnionArray rightUnionArray = node->getConstArray();
|
||||
|
||||
|
|
@ -297,7 +299,9 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
|
|||
//
|
||||
// Do single unary node folding
|
||||
//
|
||||
TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
// Returns a new node representing the result.
|
||||
//
|
||||
TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) const
|
||||
{
|
||||
// First, size the result, which is mostly the same as the argument's size,
|
||||
// but not always, and classify what is componentwise.
|
||||
|
|
|
|||
|
|
@ -1455,7 +1455,7 @@ void TParseContext::constantValueCheck(TIntermTyped* node, const char* token)
|
|||
// Both test, and if necessary spit out an error, to see if the node is really
|
||||
// an integer.
|
||||
//
|
||||
void TParseContext::integerCheck(TIntermTyped* node, const char* token)
|
||||
void TParseContext::integerCheck(const TIntermTyped* node, const char* token)
|
||||
{
|
||||
if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar())
|
||||
return;
|
||||
|
|
@ -2820,7 +2820,7 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
|
|||
if ((unsigned int)value >= TQualifier::layoutLocationEnd)
|
||||
error(loc, "location is too large", id.c_str(), "");
|
||||
else
|
||||
publicType.qualifier.layoutSlotLocation = value;
|
||||
publicType.qualifier.layoutLocation = value;
|
||||
return;
|
||||
}
|
||||
if (id == "binding") {
|
||||
|
|
@ -2882,12 +2882,11 @@ void TParseContext::mergeObjectLayoutQualifiers(TSourceLoc loc, TQualifier& dst,
|
|||
{
|
||||
if (src.layoutMatrix != ElmNone)
|
||||
dst.layoutMatrix = src.layoutMatrix;
|
||||
|
||||
if (src.layoutPacking != ElpNone)
|
||||
dst.layoutPacking = src.layoutPacking;
|
||||
|
||||
if (src.hasLocation())
|
||||
dst.layoutSlotLocation = src.layoutSlotLocation;
|
||||
dst.layoutLocation = src.layoutLocation;
|
||||
|
||||
if (src.hasBinding())
|
||||
dst.layoutBinding = src.layoutBinding;
|
||||
|
|
@ -2910,17 +2909,10 @@ void TParseContext::layoutTypeCheck(TSourceLoc loc, const TSymbol& symbol)
|
|||
if (qualifier.hasLocation()) {
|
||||
switch (qualifier.storage) {
|
||||
case EvqVaryingIn:
|
||||
{
|
||||
if (type.getBasicType() == EbtBlock)
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, 0 /* TODO ARB_enhanced_layouts*/, "location qualifier on input block");
|
||||
break;
|
||||
}
|
||||
case EvqVaryingOut:
|
||||
{
|
||||
if (type.getBasicType() == EbtBlock)
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, 0 /* TODO ARB_enhanced_layouts*/, "location qualifier on output block");
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, 0 /* TODO ARB_enhanced_layouts*/, "location qualifier on in/out block");
|
||||
break;
|
||||
}
|
||||
case EvqUniform:
|
||||
case EvqBuffer:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public:
|
|||
void variableCheck(TIntermTyped*& nodePtr);
|
||||
bool lValueErrorCheck(TSourceLoc, const char* op, TIntermTyped*);
|
||||
void constantValueCheck(TIntermTyped* node, const char* token);
|
||||
void integerCheck(TIntermTyped* node, const char* token);
|
||||
void integerCheck(const TIntermTyped* node, const char* token);
|
||||
void globalCheck(TSourceLoc, const char* token);
|
||||
bool constructorError(TSourceLoc, TIntermNode*, TFunction&, TOperator, TType&);
|
||||
void arraySizeCheck(TSourceLoc, TIntermTyped* expr, int& size);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ const char* TParseContext::getPreamble()
|
|||
"#define GL_ARB_shading_language_420pack 1\n"
|
||||
"#define GL_ARB_texture_gather 1\n"
|
||||
"#define GL_ARB_gpu_shader5 1\n"
|
||||
"#define GL_ARB_separate_shader_objects 1\n";
|
||||
"#define GL_ARB_separate_shader_objects 1\n"
|
||||
"#define GL_ARB_tessellation_shader 1\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,10 +253,10 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
|||
}
|
||||
|
||||
// Layouts...
|
||||
if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix ||
|
||||
symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking ||
|
||||
symbol.getQualifier().layoutSlotLocation != unitSymbol.getQualifier().layoutSlotLocation ||
|
||||
symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) {
|
||||
if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix ||
|
||||
symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking ||
|
||||
symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation ||
|
||||
symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) {
|
||||
error(infoSink, "Layout qualification must match:");
|
||||
writeTypeComparison = true;
|
||||
}
|
||||
|
|
@ -510,7 +510,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
size = computeTypeLocationSize(type);
|
||||
}
|
||||
|
||||
TRange range = { qualifier.layoutSlotLocation, qualifier.layoutSlotLocation + size - 1 };
|
||||
TRange range = { qualifier.layoutLocation, qualifier.layoutLocation + size - 1 };
|
||||
|
||||
// check for collisions, except for vertex inputs on desktop
|
||||
if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue