Skip to content

Commit

Permalink
Add language support for Slang (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
halli2 committed May 2, 2024
1 parent 1237c8d commit 820cfa3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ Scheme
Scons
Sh
ShaderLab
Slang
Sml
Solidity
SpecmanE
Expand Down
7 changes: 7 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,13 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["shader", "cginc"]
},
"Slang": {
"name": "Slang",
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
"extensions": ["slang"]
},
"Sml": {
"name": "Standard ML (SML)",
"quotes": [["\\\"", "\\\""]],
Expand Down
15 changes: 15 additions & 0 deletions tests/data/slang.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 15 lines 8 code 4 comments 2 blanks

Texture2D<float4> in_tex;
RWTexture2D<float4> out_tex;

// Blit compute shader
[shader("compute")]
[numthreads(8, 8, 1)]
void main(uint2 id: SV_DispatchThreadID) {
/*
Perform the blit
*/
out_tex[id] = in_tex[id];
return;
}

0 comments on commit 820cfa3

Please sign in to comment.