blob: c162f2f4678e22e27b06cd3843014415db52f586 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// slang-emit-glsl-extension-tracker.cpp
#include "slang-emit-glsl-extension-tracker.h"
namespace Slang {
void GLSLExtensionTracker::requireExtension(const String& name)
{
if (m_extensionsRequired.Contains(name))
return;
StringBuilder& sb = m_extensionRequireLines;
sb.append("#extension ");
sb.append(name);
sb.append(" : require\n");
m_extensionsRequired.Add(name);
}
void GLSLExtensionTracker::requireVersion(ProfileVersion version)
{
// Check if this profile is newer
if ((UInt)version > (UInt)m_profileVersion)
{
m_profileVersion = version;
}
}
void GLSLExtensionTracker::requireHalfExtension()
{
if (!m_hasHalfExtension)
{
// https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GL_EXT_shader_16bit_storage.txt
requireExtension("GL_EXT_shader_16bit_storage");
// https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GL_EXT_shader_explicit_arithmetic_types.txt
requireExtension("GL_EXT_shader_explicit_arithmetic_types");
m_hasHalfExtension = true;
}
}
} // namespace Slang
|