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:
@@ -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", "");
|
||||
|
||||
Reference in New Issue
Block a user