summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-16 14:32:33 -0800
committerGitHub <noreply@github.com>2023-11-16 14:32:33 -0800
commit4c78efd0c34442866f20e9d00bbb6908115c9a01 (patch)
tree03ca8584847f0937a926f6b27386dcd982ed7780 /source/slang/slang-check-expr.cpp
parent12f7237e4060388494c549623f4a640327b7ca08 (diff)
Unify stdlib `Texture` types into one generic type. (#3327)
* Unify Texture types in stdlib into 1 generic type. * Fixes. * Fix. * Fixes. * Fix reflection. * Fix binding reflection. * Add gather intrinsics. * Fix gather intrinsics. * Fix texture type toText. * Fix intrinsic. * fix cuda intrinsic. * Fix project files. * cleanup. * Fix. * Fix. * Fix sampler feedback test. * Fix getDimension intrinsics. * Fix spirv sample image intrinsics. * Fix test. * Fix GLSL intrinsic. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index e130275bb..7edf27b30 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -723,7 +723,11 @@ namespace Slang
expr->loc = loc;
if (auto declRefExpr = as<DeclRefExpr>(originalExpr))
expr->scope = declRefExpr->scope;
-
+ else if (auto invokeExpr = as<InvokeExpr>(originalExpr))
+ {
+ if (auto calleeDeclRefExpr = as<DeclRefExpr>(invokeExpr->originalFunctionExpr))
+ expr->scope = calleeDeclRefExpr->scope;
+ }
// Whether or not the implicit `this` is mutable depends
// on the context in which it is used, and the lookup
// logic will have computed an appropriate "mode" based
@@ -2246,8 +2250,9 @@ namespace Slang
Expr* SemanticsExprVisitor::visitInvokeExpr(InvokeExpr* expr)
{
// check the base expression first
+ if (!expr->originalFunctionExpr)
+ expr->originalFunctionExpr = expr->functionExpr;
expr->functionExpr = CheckTerm(expr->functionExpr);
-
auto treatAsDifferentiableExpr = m_treatAsDifferentiableExpr;
m_treatAsDifferentiableExpr = nullptr;
// Next check the argument expressions
@@ -4018,7 +4023,9 @@ namespace Slang
operand.expr = typeExpr.exp;
}
else if(operand.flavor == SPIRVAsmOperand::SlangValue
- || operand.flavor == SPIRVAsmOperand::SlangValueAddr)
+ || operand.flavor == SPIRVAsmOperand::SlangValueAddr
+ || operand.flavor == SPIRVAsmOperand::ImageType
+ || operand.flavor == SPIRVAsmOperand::SampledImageType)
{
// This is a $expr operand, check the expr
operand.expr = dispatch(operand.expr);