summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-reflection-api.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp
index d7f793d05..d235c8270 100644
--- a/source/slang/slang-reflection-api.cpp
+++ b/source/slang/slang-reflection-api.cpp
@@ -1,6 +1,7 @@
// slang-reflection-api.cpp
#include "../core/slang-basic.h"
+#include "slang-check-impl.h"
#include "slang-check.h"
#include "slang-compiler.h"
#include "slang-syntax.h"
@@ -353,6 +354,15 @@ SLANG_API SlangResult spReflectionUserAttribute_GetArgumentValueFloat(
*rs = (float)cexpr->value;
return 0;
}
+ else if (auto implicitCastExpr = as<ImplicitCastExpr>(userAttr->args[index]))
+ {
+ auto base = implicitCastExpr->arguments[0];
+ if (auto intLit = as<IntegerLiteralExpr>(base))
+ {
+ *rs = (float)intLit->value;
+ return 0;
+ }
+ }
return SLANG_E_INVALID_ARG;
}
SLANG_API const char* spReflectionUserAttribute_GetArgumentValueString(