HLSL: Add string basic type and recognize string declaration grammar.

This includes the "< decl ; decl ; >" syntax which has its own namespace.
This functionality is not implemented, just silently accepted.
This commit is contained in:
John Kessenich
2016-09-19 20:23:18 -06:00
parent eee9d536bc
commit 86f7138706
10 changed files with 146 additions and 1 deletions

View File

@@ -0,0 +1,64 @@
hlsl.string.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:10 Function Definition: main(f1; (global float)
0:10 Function Parameters:
0:10 'f' (layout(location=0 ) in float)
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 'f' (layout(location=0 ) in float)
0:11 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:? 'f' (layout(location=0 ) in float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:10 Function Definition: main(f1; (global float)
0:10 Function Parameters:
0:10 'f' (layout(location=0 ) in float)
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 'f' (layout(location=0 ) in float)
0:11 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:? 'f' (layout(location=0 ) in float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 13
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 8 10
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "@entryPointOutput"
Name 10 "f"
Decorate 8(@entryPointOutput) Location 0
Decorate 10(f) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(@entryPointOutput): 7(ptr) Variable Output
9: TypePointer Input 6(float)
10(f): 9(ptr) Variable Input
4(main): 2 Function None 3
5: Label
11: 6(float) Load 10(f)
Store 8(@entryPointOutput) 11
Return
FunctionEnd

12
Test/hlsl.string.frag Executable file
View File

@@ -0,0 +1,12 @@
string s = "string1";
string e = "";
string bracket < string a = "nested" ; > ;
string brackets < string b = "nest1" ; string c = "nest2" ; string d = "nest3" ; > ;
string brackete1 < > ;
string brackete2 < ; > ;
string brackete3 < ; ; > ;
float main(float f)
{
return f;
}