summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-stdlib.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-13 09:54:47 -0700
committerGitHub <noreply@github.com>2017-07-13 09:54:47 -0700
commitc963b44aa48a4349e20a0afcd423b55b1996d2fa (patch)
tree88f7f0b51d679cc308437461b8c210e828efeda0 /source/slang/slang-stdlib.cpp
parent9058358792fa393e0e92af80f24a54a037aa9691 (diff)
parentc51fd4ee8f478aa3d3b7e6208a3a4e9c00e2413a (diff)
Merge pull request #85 from tfoleyNV/working
Various bug fixes
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
-rw-r--r--source/slang/slang-stdlib.cpp41
1 files changed, 37 insertions, 4 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index 563f5a015..3450e72d7 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -2073,13 +2073,46 @@ namespace Slang
sb << "__magic_type(GLSLInputAttachmentType) struct subpassInput {};";
// Define additional keywords
+
sb << "__modifier(GLSLBufferModifier) buffer;\n";
- sb << "__modifier(GLSLWriteOnlyModifier) writeonly;\n";
- sb << "__modifier(GLSLReadOnlyModifier) readonly;\n";
+
+ // [GLSL 4.3] Storage Qualifiers
+
+ // TODO: need to support `shared` here with its GLSL meaning
+
sb << "__modifier(GLSLPatchModifier) patch;\n";
+ // `centroid` and `sample` handled centrally
+
+ // [GLSL 4.5] Interpolation Qualifiers
+ sb << "__modifier(SimpleModifier) smooth;\n";
+ sb << "__modifier(SimpleModifier) flat;\n";
+ sb << "__modifier(SimpleModifier) noperspective;\n";
+
+
+ // [GLSL 4.3.2] Constant Qualifier
+
+ // We need to handle GLSL `const` separately from HLSL `const`,
+ // since they mean such different things.
+
+ // [GLSL 4.7.2] Precision Qualifiers
+ sb << "__modifier(SimpleModifier) highp;\n";
+ sb << "__modifier(SimpleModifier) mediump;\n";
+ sb << "__modifier(SimpleModifier) lowp;\n";
+
+ // [GLSL 4.8.1] The Invariant Qualifier
+
+ sb << "__modifier(GLSLWriteOnlyModifier) invariant;\n";
+
+ // [GLSL 4.10] Memory Qualifiers
+
+ sb << "__modifier(SimpleModifier) coherent;\n";
+ sb << "__modifier(SimpleModifier) volatile;\n";
+ sb << "__modifier(SimpleModifier) restrict;\n";
+ sb << "__modifier(GLSLReadOnlyModifier) readonly;\n";
+ sb << "__modifier(GLSLWriteOnlyModifier) writeonly;\n";
- sb << "__modifier(SimpleModifier) flat;\n";
- sb << "__modifier(SimpleModifier) highp;\n";
+ // We will treat `subroutine` as a qualifier
+ sb << "__modifier(SimpleModifier) subroutine;\n";
glslLibraryCode = sb.ProduceString();
return glslLibraryCode;