Commit ad47ee89 by John Kessenich

Non-functional tweak to hidden-member (of anonymous block) semantics.

parent bae44b74
...@@ -188,7 +188,7 @@ Shader Functionality to Implement/Finish ...@@ -188,7 +188,7 @@ Shader Functionality to Implement/Finish
+ Clarify that .length() returns an int type and can be used as a constant integer expression. + Clarify that .length() returns an int type and can be used as a constant integer expression.
+ Allow swizzle operations on scalars. + Allow swizzle operations on scalars.
+ Positive signed decimal literals, as well as octal and hexadecimal, can set all 32 bits. This includes setting the sign bit to create a negative value. + Positive signed decimal literals, as well as octal and hexadecimal, can set all 32 bits. This includes setting the sign bit to create a negative value.
- Clarified that a comma sequence-operator expression cannot be a constant expression. E.g., “(2,3)” is not allowed, semantically, + Clarified that a comma sequence-operator expression cannot be a constant expression. E.g., “(2,3)” is not allowed, semantically,
as a valid constant expression 3, even though it is an expression that will evaluate to 3. as a valid constant expression 3, even though it is an expression that will evaluate to 3.
+ Use vec2 instead of vec3 for coordinate in textureGather*(sampler2DRect,...). + Use vec2 instead of vec3 for coordinate in textureGather*(sampler2DRect,...).
+ Clarify that textureGatherOffset() can take non-constants for the offsets. + Clarify that textureGatherOffset() can take non-constants for the offsets.
......
...@@ -833,8 +833,8 @@ public: ...@@ -833,8 +833,8 @@ public:
vectorSize = 1; vectorSize = 1;
} }
virtual void hideType() { basicType = EbtVoid; vectorSize = 1; } virtual void hideMember() { basicType = EbtVoid; vectorSize = 1; }
virtual bool wasTypeHidden() const { return basicType == EbtVoid; } virtual bool hiddenMember() const { return basicType == EbtVoid; }
virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); } virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); }
virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); }
...@@ -1062,7 +1062,7 @@ public: ...@@ -1062,7 +1062,7 @@ public:
if (structure) { if (structure) {
s.append("{"); s.append("{");
for (size_t i = 0; i < structure->size(); ++i) { for (size_t i = 0; i < structure->size(); ++i) {
if ((*structure)[i].type->getBasicType() != EbtVoid) { if (! (*structure)[i].type->hiddenMember()) {
s.append((*structure)[i].type->getCompleteString()); s.append((*structure)[i].type->getCompleteString());
s.append(" "); s.append(" ");
s.append((*structure)[i].type->getFieldName()); s.append((*structure)[i].type->getFieldName());
......
...@@ -397,7 +397,7 @@ TIntermTyped* TParseContext::handleVariable(TSourceLoc loc, TSymbol* symbol, TSt ...@@ -397,7 +397,7 @@ TIntermTyped* TParseContext::handleVariable(TSourceLoc loc, TSymbol* symbol, TSt
node = intermediate.addIndex(EOpIndexDirectStruct, container, constNode, loc); node = intermediate.addIndex(EOpIndexDirectStruct, container, constNode, loc);
node->setType(*(*variable->getType().getStruct())[anon->getMemberNumber()].type); node->setType(*(*variable->getType().getStruct())[anon->getMemberNumber()].type);
if (node->getType().wasTypeHidden()) if (node->getType().hiddenMember())
error(loc, "member of nameless block was not redeclared", string->c_str(), ""); error(loc, "member of nameless block was not redeclared", string->c_str(), "");
} else { } else {
// Not a member of an anonymous container. // Not a member of an anonymous container.
...@@ -2574,7 +2574,7 @@ void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList ...@@ -2574,7 +2574,7 @@ void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList
if (instanceName) if (instanceName)
member = type.getWritableStruct()->erase(member); member = type.getWritableStruct()->erase(member);
else { else {
member->type->hideType(); member->type->hideMember();
++member; ++member;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment