summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-07-31 17:35:08 -0700
committerGitHub <noreply@github.com>2024-07-31 17:35:08 -0700
commit4c6b0a2831a7edd1419bd0b2e6edd089080e07be (patch)
tree54557efa8bfc9e316014fe1555f07c94afa93cd4 /source
parentbab4b821dc6bcee4ff86751743762584c17e9103 (diff)
Allow generic type deduction from ParameterBlock arguments. (#4766)
* Allow generic type deduction from ParameterBlock arguments. * Fix test. * Update expected failure list. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-check-constraint.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp
index 23f7354d9..1195ed1f9 100644
--- a/source/slang/slang-check-constraint.cpp
+++ b/source/slang/slang-check-constraint.cpp
@@ -949,6 +949,11 @@ namespace Slang
QualType(sndVectorType->getElementType(), snd.isLeftValue));
}
}
+
+ if (auto fstUniformParamGroupType = as<UniformParameterGroupType>(fst))
+ return TryUnifyTypes(constraints, QualType(fstUniformParamGroupType->getElementType(), fst.isLeftValue), snd);
+ if (auto sndUniformParamGroupType = as<UniformParameterGroupType>(snd))
+ return TryUnifyTypes(constraints, fst, QualType(sndUniformParamGroupType->getElementType(), snd.isLeftValue));
return false;
}