HLSL: Implement proper nesting of symbol-table scopes and identifier searching.
This commit is contained in:
150
Test/baseResults/hlsl.scope.frag.out
Executable file
150
Test/baseResults/hlsl.scope.frag.out
Executable file
@@ -0,0 +1,150 @@
|
||||
hlsl.scope.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:31 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
|
||||
0:2 Function Parameters:
|
||||
0:2 'input' (temp 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:4 'x' (temp int)
|
||||
0:? Sequence
|
||||
0:7 'x' (temp float)
|
||||
0:? Sequence
|
||||
0:10 'x' (temp bool)
|
||||
0:? Sequence
|
||||
0:13 'x' (temp 3-component vector of float)
|
||||
0:15 'x' (temp bool)
|
||||
0:17 'x' (temp float)
|
||||
0:19 'x' (temp int)
|
||||
0:21 Test condition and select (temp void)
|
||||
0:21 Condition
|
||||
0:21 Compare Greater Than (temp bool)
|
||||
0:21 'x' (temp int)
|
||||
0:21 Constant:
|
||||
0:21 0 (const int)
|
||||
0:21 true case is null
|
||||
0:24 Loop with condition tested first
|
||||
0:24 Loop Condition
|
||||
0:24 Compare Greater Than (temp bool)
|
||||
0:24 'x' (temp int)
|
||||
0:24 Constant:
|
||||
0:24 0 (const int)
|
||||
0:24 No loop body
|
||||
0:27 Loop with condition not tested first
|
||||
0:27 Loop Condition
|
||||
0:29 Compare Greater Than (temp bool)
|
||||
0:29 'x' (temp int)
|
||||
0:29 Constant:
|
||||
0:29 0 (const int)
|
||||
0:27 No loop body
|
||||
0:? Linker Objects
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:31 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
|
||||
0:2 Function Parameters:
|
||||
0:2 'input' (temp 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:4 'x' (temp int)
|
||||
0:? Sequence
|
||||
0:7 'x' (temp float)
|
||||
0:? Sequence
|
||||
0:10 'x' (temp bool)
|
||||
0:? Sequence
|
||||
0:13 'x' (temp 3-component vector of float)
|
||||
0:15 'x' (temp bool)
|
||||
0:17 'x' (temp float)
|
||||
0:19 'x' (temp int)
|
||||
0:21 Test condition and select (temp void)
|
||||
0:21 Condition
|
||||
0:21 Compare Greater Than (temp bool)
|
||||
0:21 'x' (temp int)
|
||||
0:21 Constant:
|
||||
0:21 0 (const int)
|
||||
0:21 true case is null
|
||||
0:24 Loop with condition tested first
|
||||
0:24 Loop Condition
|
||||
0:24 Compare Greater Than (temp bool)
|
||||
0:24 'x' (temp int)
|
||||
0:24 Constant:
|
||||
0:24 0 (const int)
|
||||
0:24 No loop body
|
||||
0:27 Loop with condition not tested first
|
||||
0:27 Loop Condition
|
||||
0:29 Compare Greater Than (temp bool)
|
||||
0:29 'x' (temp int)
|
||||
0:29 Constant:
|
||||
0:29 0 (const int)
|
||||
0:27 No loop body
|
||||
0:? Linker Objects
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 36
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 8 "x"
|
||||
Name 11 "x"
|
||||
Name 14 "x"
|
||||
Name 17 "x"
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Function 6(int)
|
||||
9: TypeFloat 32
|
||||
10: TypePointer Function 9(float)
|
||||
12: TypeBool
|
||||
13: TypePointer Function 12(bool)
|
||||
15: TypeVector 9(float) 3
|
||||
16: TypePointer Function 15(fvec3)
|
||||
19: 6(int) Constant 0
|
||||
4(PixelShaderFunction): 2 Function None 3
|
||||
5: Label
|
||||
8(x): 7(ptr) Variable Function
|
||||
11(x): 10(ptr) Variable Function
|
||||
14(x): 13(ptr) Variable Function
|
||||
17(x): 16(ptr) Variable Function
|
||||
18: 6(int) Load 8(x)
|
||||
20: 12(bool) SGreaterThan 18 19
|
||||
SelectionMerge 22 None
|
||||
BranchConditional 20 21 22
|
||||
21: Label
|
||||
Branch 22
|
||||
22: Label
|
||||
Branch 23
|
||||
23: Label
|
||||
LoopMerge 25 26 None
|
||||
Branch 27
|
||||
27: Label
|
||||
28: 6(int) Load 8(x)
|
||||
29: 12(bool) SGreaterThan 28 19
|
||||
BranchConditional 29 24 25
|
||||
24: Label
|
||||
Branch 26
|
||||
26: Label
|
||||
Branch 23
|
||||
25: Label
|
||||
Branch 30
|
||||
30: Label
|
||||
LoopMerge 32 33 None
|
||||
Branch 31
|
||||
31: Label
|
||||
Branch 33
|
||||
33: Label
|
||||
34: 6(int) Load 8(x)
|
||||
35: 12(bool) SGreaterThan 34 19
|
||||
BranchConditional 35 30 32
|
||||
32: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
30
Test/hlsl.scope.frag
Normal file
30
Test/hlsl.scope.frag
Normal file
@@ -0,0 +1,30 @@
|
||||
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||
{
|
||||
int x;
|
||||
x;
|
||||
{
|
||||
float x;
|
||||
x;
|
||||
{
|
||||
bool x;
|
||||
x;
|
||||
{
|
||||
float3 x;
|
||||
x;
|
||||
}
|
||||
x;
|
||||
}
|
||||
x;
|
||||
}
|
||||
x;
|
||||
|
||||
if (x > 0)
|
||||
bool x;
|
||||
|
||||
while (x > 0)
|
||||
bool x;
|
||||
|
||||
do {
|
||||
bool x;
|
||||
} while (x > 0);
|
||||
}
|
||||
Reference in New Issue
Block a user