Disallow variable indexing into sampler array for ES and desktop before version 400.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22148 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-06-24 21:52:41 +00:00
parent 01fc0645cb
commit eebed6f60b
4 changed files with 21 additions and 1 deletions

View file

@ -309,6 +309,10 @@ postfix_expression
parseContext.error($2.line, "", "[", "array must be redeclared with a size before being indexed with a variable");
if ($1->getBasicType() == EbtBlock)
parseContext.requireProfile($1->getLine(), static_cast<EProfileMask>(~EEsProfileMask), "variable indexing block array");
if ($1->getBasicType() == EbtSampler) {
parseContext.requireProfile($1->getLine(), static_cast<EProfileMask>(ECoreProfileMask | ECompatibilityProfileMask), "variable indexing sampler array");
parseContext.profileRequires($1->getLine(), ECoreProfile, 400, 0, "variable indexing sampler array");
}
$$ = parseContext.intermediate.addIndex(EOpIndexIndirect, $1, $3, $2.line);
}