diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-07-11 03:05:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-10 12:05:15 -0700 |
| commit | 0363a4d18c655697cfb0d958add2c7bf4b156874 (patch) | |
| tree | 0bb9ad1a58916e21b58386ce5bea9f9527d1c9b5 /source/slang/slang-ir-util.cpp | |
| parent | cb9eb58d189af5f7e99e4aeccd5de7bab93b22dd (diff) | |
Do not fail when emitting GLSL using unorm/snorm textures (#2973)
* Do not fail when emitting GLSL using unorm/snorm textures
Ignored in glslang https://github.com/KhronosGroup/glslang/blob/main/glslang/HLSL/hlslGrammar.cpp\#L1476
* Add test for unorm modifier on glsl
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index d2bf928a4..6b94711e0 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -1074,4 +1074,18 @@ IRInst* GenericChildrenMigrationContext::cloneInst(IRBuilder* builder, IRInst* s return impl->cloneInst(builder, src); } +IRType* dropNormAttributes(IRType* const t) +{ + if(const auto a = as<IRAttributedType>(t)) + { + switch(a->getAttr()->getOp()) + { + case kIROp_UNormAttr: + case kIROp_SNormAttr: + return dropNormAttributes(a->getBaseType()); + } + } + return t; +} + } |
