diff options
Diffstat (limited to 'source/slang/slang-ir-validate.cpp')
| -rw-r--r-- | source/slang/slang-ir-validate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-ir-validate.cpp b/source/slang/slang-ir-validate.cpp index 55f3ad227..e7bb7b548 100644 --- a/source/slang/slang-ir-validate.cpp +++ b/source/slang/slang-ir-validate.cpp @@ -201,9 +201,13 @@ void validateIRInstOperand(IRValidateContext* context, IRInst* inst, IRUse* oper // in order. if (context) { + // There is exception that the use of an inst is defined before the inst, + // e.g. generic parameter can be defined before its data type in some cases. + // In those cases we allow relaxing the rule. validate( context, - context->seenInsts.contains(operandValue), + context->seenInsts.contains(operandValue) || + canRelaxInstOrderRule(operandValue, inst), inst, "def must come before use in same block"); } |
