summaryrefslogtreecommitdiff
path: root/source/slang/lower.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-19 10:20:12 -0700
committerGitHub <noreply@github.com>2017-07-19 10:20:12 -0700
commitc5ed9e8d6bc1668d6075b42b17d65a97c168c98b (patch)
treef8016cf92678a6dfaa1903a161ebcad78f0f42d0 /source/slang/lower.cpp
parenta727017340165d02977387e1e1a2a7e328308295 (diff)
parent55a29042a2826f26272c9e1b65cd3745bad3ee31 (diff)
Merge pull request #124 from tfoleyNV/gh-122
Fix up translation of `GetDimensions()`
Diffstat (limited to 'source/slang/lower.cpp')
-rw-r--r--source/slang/lower.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp
index 127ef75ca..c61003bc6 100644
--- a/source/slang/lower.cpp
+++ b/source/slang/lower.cpp
@@ -291,6 +291,10 @@ static void attachLayout(
addModifier(syntax, modifier);
}
+void requireGLSLVersion(
+ EntryPointRequest* entryPoint,
+ ProfileVersion version);
+
struct LoweringVisitor
: ExprVisitor<LoweringVisitor, RefPtr<ExpressionSyntaxNode>>
, StmtVisitor<LoweringVisitor, void>
@@ -2958,23 +2962,7 @@ struct LoweringVisitor
return;
auto entryPoint = shared->entryPointRequest;
- auto profile = entryPoint->profile;
- auto currentVersion = profile.GetVersion();
- if (profile.getFamily() == ProfileFamily::GLSL)
- {
- // Check if this profile is newer
- if ((UInt)version > (UInt)profile.GetVersion())
- {
- profile.setVersion(version);
- entryPoint->profile = profile;
- }
- }
- else
- {
- // Non-GLSL target? Set it to a GLSL one.
- profile.setVersion(version);
- entryPoint->profile = profile;
- }
+ Slang::requireGLSLVersion(entryPoint, version);
}
RefPtr<ExpressionSyntaxNode> lowerSimpleShaderParameterToGLSLGlobal(