Validator: unique type check allows runtime arrays

OpTypeRuntimeArray is an aggregate and therefore can have duplicate
declarations.
This commit is contained in:
Andrey Tuganov 2017-03-02 17:24:29 -05:00
parent a0c5ffe840
commit 11fbe5dc1f
2 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,8 @@ spv_result_t TypeUniquePass(ValidationState_t& _,
const spv_parsed_instruction_t* inst) {
const SpvOp opcode = static_cast<SpvOp>(inst->opcode);
if (spvOpcodeGeneratesType(opcode)) {
if (opcode == SpvOpTypeArray || opcode == SpvOpTypeStruct) {
if (opcode == SpvOpTypeArray || opcode == SpvOpTypeRuntimeArray ||
opcode == SpvOpTypeStruct) {
// Duplicate declarations of aggregates are allowed.
return SPV_SUCCESS;
}

View File

@ -59,6 +59,8 @@ OpMemoryModel Logical GLSL450
%struct2 = OpTypeStruct %floatt %floatt %vec3t
%false = OpConstantFalse %boolt
%true = OpConstantTrue %boolt
%runtime_arrayt = OpTypeRuntimeArray %floatt
%runtime_arrayt2 = OpTypeRuntimeArray %floatt
)";
return header;