#include <cassert>
+#include "opcode.h"
#include "val/basic_block.h"
#include "val/construct.h"
#include "val/function.h"
}
break;
case kLayoutTypes:
+ if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) {
+ out = true;
+ break;
+ }
switch (op) {
- case SpvOpTypeVoid:
- case SpvOpTypeBool:
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
- case SpvOpTypeImage:
- case SpvOpTypeSampler:
- case SpvOpTypeSampledImage:
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
- case SpvOpTypeStruct:
- case SpvOpTypeOpaque:
- case SpvOpTypePointer:
- case SpvOpTypeFunction:
- case SpvOpTypeEvent:
- case SpvOpTypeDeviceEvent:
- case SpvOpTypeReserveId:
- case SpvOpTypeQueue:
- case SpvOpTypePipe:
case SpvOpTypeForwardPointer:
- case SpvOpConstantTrue:
- case SpvOpConstantFalse:
- case SpvOpConstant:
- case SpvOpConstantComposite:
- case SpvOpConstantSampler:
- case SpvOpConstantNull:
- case SpvOpSpecConstantTrue:
- case SpvOpSpecConstantFalse:
- case SpvOpSpecConstant:
- case SpvOpSpecConstantComposite:
- case SpvOpSpecConstantOp:
case SpvOpVariable:
case SpvOpLine:
case SpvOpNoLine:
case kLayoutFunctionDeclarations:
case kLayoutFunctionDefinitions:
// NOTE: These instructions should NOT be in these layout sections
+ if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) {
+ out = false;
+ break;
+ }
switch (op) {
case SpvOpCapability:
case SpvOpExtension:
case SpvOpGroupDecorate:
case SpvOpGroupMemberDecorate:
case SpvOpDecorationGroup:
- case SpvOpTypeVoid:
- case SpvOpTypeBool:
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
- case SpvOpTypeImage:
- case SpvOpTypeSampler:
- case SpvOpTypeSampledImage:
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
- case SpvOpTypeStruct:
- case SpvOpTypeOpaque:
- case SpvOpTypePointer:
- case SpvOpTypeFunction:
- case SpvOpTypeEvent:
- case SpvOpTypeDeviceEvent:
- case SpvOpTypeReserveId:
- case SpvOpTypeQueue:
- case SpvOpTypePipe:
case SpvOpTypeForwardPointer:
- case SpvOpConstantTrue:
- case SpvOpConstantFalse:
- case SpvOpConstant:
- case SpvOpConstantComposite:
- case SpvOpConstantSampler:
- case SpvOpConstantNull:
- case SpvOpSpecConstantTrue:
- case SpvOpSpecConstantFalse:
- case SpvOpSpecConstant:
- case SpvOpSpecConstantComposite:
- case SpvOpSpecConstantOp:
out = false;
break;
default: