summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index a79c48227..4e5db17c0 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -1368,6 +1368,14 @@ Module* getModule(Decl* decl)
return moduleDecl->module;
}
+Decl* getParentDecl(Decl* decl)
+{
+ decl = decl->parentDecl;
+ while (as<GenericDecl>(decl))
+ decl = decl->parentDecl;
+ return decl;
+}
+
static const ImageFormatInfo kImageFormatInfos[] =
{
#define SLANG_IMAGE_FORMAT_INFO(TYPE, COUNT, SIZE) SLANG_SCALAR_TYPE_##TYPE, uint8_t(COUNT), uint8_t(SIZE)