diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-07-21 16:28:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-21 13:28:01 -0700 |
| commit | 32043a48b6503fe3e493082c33eac02865503031 (patch) | |
| tree | 163ec769bb2fabcd267e96b635d822d5b2c8dc19 /source/slang/slang-ir.cpp | |
| parent | e0a856b8f101ad66159fa9779c36fcc723f611f6 (diff) | |
Better handling of bindings with multiple resource kind "aliases" for GLSL emit (#3009)
* A more way robust way to handle resource consumption might use multiple `kind`s on GLSL emit.
* Improve method naming and some comments.
* Small consistency fix.
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 2fc1a9466..a27bf8658 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -1047,6 +1047,20 @@ namespace Slang return findOffsetAttr(kind) != nullptr; } + bool IRVarLayout::usesResourceFromKinds(LayoutResourceKindFlags kindFlags) + { + // Like usesResourceKind this works because there is an offset stored even if it's 0. + if (kindFlags) + { + for (auto offsetAttr : getOffsetAttrs()) + { + if (LayoutResourceKindFlag::make(offsetAttr->getResourceKind()) & kindFlags ) + return true; + } + } + return false; + } + IRSystemValueSemanticAttr* IRVarLayout::findSystemValueSemanticAttr() { return findAttr<IRSystemValueSemanticAttr>(); |
