From e7df8538eb8f0ed06f0838d946bec8e9e0fe0985 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 1 Dec 2022 18:55:43 -0800 Subject: Allow `no_diff` on `this` parameter. (#2543) --- source/slang/slang-syntax.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang-syntax.cpp') 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(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) -- cgit v1.2.3