Prevent Push Constant blocks being an array (#2904)
* Prevent Push Constant blocks being an array * Add push constant array error test Co-authored-by: Greg Fischer <greg@lunarg.com>
This commit is contained in:
parent
c6f8e532dd
commit
610fd6edf3
3 changed files with 36 additions and 28 deletions
|
|
@ -6368,8 +6368,12 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
|||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation);
|
||||
}
|
||||
|
||||
if (qualifier.isPushConstant() && type.getBasicType() != EbtBlock)
|
||||
error(loc, "can only be used with a block", "push_constant", "");
|
||||
if (qualifier.isPushConstant()) {
|
||||
if (type.getBasicType() != EbtBlock)
|
||||
error(loc, "can only be used with a block", "push_constant", "");
|
||||
if (type.isArray())
|
||||
error(loc, "Push constants blocks can't be an array", "push_constant", "");
|
||||
}
|
||||
|
||||
if (qualifier.hasBufferReference() && type.getBasicType() != EbtBlock)
|
||||
error(loc, "can only be used with a block", "buffer_reference", "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue