mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 19:20:05 +00:00
Validator: unique type check allows runtime arrays
OpTypeRuntimeArray is an aggregate and therefore can have duplicate declarations.
This commit is contained in:
parent
a0c5ffe840
commit
11fbe5dc1f
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user