summaryrefslogtreecommitdiff
path: root/source/slang/glsl.meta.slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-03-08 12:35:00 -0800
committerGitHub <noreply@github.com>2018-03-08 12:35:00 -0800
commita22b7520745334ecef3cbd920a0331f01c905935 (patch)
treef5ecf29f957f6b40f3fb5a4f987b2a1d00dd3bed /source/slang/glsl.meta.slang
parented718ba1048ef856efbf0d02902e4d60f173b207 (diff)
Cleanups on slang-generate (#437)
* Cleanups on slang-generate There is nothing too significant in these changes, but I'm trying to get things in place so that we can: - Clean up the stdlib code to do less explicit `StringBuilder` operations and instead to use more of the "template engine" approach - Start using slang-generate for code other than the slang stdlib, so that we can generate more of our boilerplate. The main new functionality here is that in a template/meta file, you can now enclose an expression in `$(...)` to indicate that is should be spliced into the result. E.g. instead of: class ${{ sb << someClassName; }} { ... } We can now write: class $(someClassName) { ... } The other bit of new functionality is support for a whole-line statement escape, so that instead of: ${{ for( auto a : someCollection ) { }} void $(a)() { ... } ${{ } }} We can instead write: $: for(auto a : someCollection) { void $(a)() { ... } $: } I haven't yet tried to use that functionality in the stdlib meta-code, but doing so would be an obvious next step. * Fixup: change some $P to $p The capitalization on some of the GLSL intrinsic mappings got messed up during a find-and-replace operation when removing the double `$` that used to be required to escape things.
Diffstat (limited to 'source/slang/glsl.meta.slang')
-rw-r--r--source/slang/glsl.meta.slang5
1 files changed, 1 insertions, 4 deletions
diff --git a/source/slang/glsl.meta.slang b/source/slang/glsl.meta.slang
index ffbb6b670..a1ee2d9cf 100644
--- a/source/slang/glsl.meta.slang
+++ b/source/slang/glsl.meta.slang
@@ -1,7 +1,6 @@
// Slang GLSL compatibility library
${{{{
-
static const struct {
char const* name;
char const* glslPrefix;
@@ -199,7 +198,5 @@ sb << "syntax writeonly : GLSLWriteOnlyModifier;\n";
// We will treat `subroutine` as a qualifier for now
sb << "syntax subroutine : SimpleModifier;\n";
+}}}}
-
-
-}}}} \ No newline at end of file