GLSL front-end: Check recursively for opaque types in a block; these are all illegal.

This commit is contained in:
John Kessenich 2015-09-30 18:57:47 -06:00
parent ee21fc9081
commit 3cd0024ea8
6 changed files with 23 additions and 10 deletions

View file

@ -4981,9 +4981,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
profileRequires(memberLoc, ~EEsProfile, 440, E_GL_ARB_enhanced_layouts, "offset on block member");
}
TBasicType basicType = memberType.getBasicType();
if (basicType == EbtSampler)
error(memberLoc, "member of block cannot be a sampler type", typeList[member].type->getFieldName().c_str(), "");
if (memberType.containsOpaque())
error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), "");
}
// This might be a redeclaration of a built-in block. If so, redeclareBuiltinBlock() will