| 1051 | } |
| 1052 | |
| 1053 | bool Instruction::IsOpcodeSafeToDelete() const { |
| 1054 | if (context()->IsCombinatorInstruction(this)) { |
| 1055 | return true; |
| 1056 | } |
| 1057 | |
| 1058 | if (IsNonSemanticInstruction() && |
| 1059 | (GetShaderDebugOpcode() == NonSemanticShaderDebugInfoDebugDeclare || |
| 1060 | GetShaderDebugOpcode() == NonSemanticShaderDebugInfoDebugValue)) { |
| 1061 | return true; |
| 1062 | } |
| 1063 | |
| 1064 | switch (opcode()) { |
| 1065 | case spv::Op::OpDPdx: |
| 1066 | case spv::Op::OpDPdy: |
| 1067 | case spv::Op::OpFwidth: |
| 1068 | case spv::Op::OpDPdxFine: |
| 1069 | case spv::Op::OpDPdyFine: |
| 1070 | case spv::Op::OpFwidthFine: |
| 1071 | case spv::Op::OpDPdxCoarse: |
| 1072 | case spv::Op::OpDPdyCoarse: |
| 1073 | case spv::Op::OpFwidthCoarse: |
| 1074 | case spv::Op::OpImageQueryLod: |
| 1075 | return true; |
| 1076 | default: |
| 1077 | return false; |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | bool Instruction::IsNonSemanticInstruction() const { |
| 1082 | if (!HasResultId()) return false; |
no test coverage detected