From dc0e9d7bca21d8a67ec9f044c0d390bda6ebfcbf Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 17 Jul 2017 10:51:18 -0700 Subject: Pick correct GLSL version when `gl_Layer` used `gl_Layer` as a fragment input requires at least version 4.30 of GLSL, so we try to track that information when we see the name used. Note that this does *not* override a user-specified `#version` line. This required re-ordering when lowering happens relative to emitting the `#version` directive, since this code works by actually modifying the chosen profile for the entry point. Yes, that is kind of gross and we should do something cleaner in the long term. --- source/slang/profile.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/profile.h') diff --git a/source/slang/profile.h b/source/slang/profile.h index 6d55d3195..3b5242ada 100644 --- a/source/slang/profile.h +++ b/source/slang/profile.h @@ -70,6 +70,11 @@ namespace Slang ProfileVersion GetVersion() const { return ProfileVersion(uint32_t(raw) & 0xFFFF); } ProfileFamily getFamily() const { return getProfileFamily(GetVersion()); } + void setVersion(ProfileVersion version) + { + raw = (raw & ~0xFFFF) | uint32_t(version); + } + static Profile LookUp(char const* name); RawVal raw = Unknown; -- cgit v1.2.3