hlsl: "in out" is also an inout qualifier.

This commit is contained in:
xavier 2017-06-20 07:49:22 +02:00
parent f02c8e6ba1
commit b1d97537e8
3 changed files with 262 additions and 230 deletions

View File

@ -2,11 +2,12 @@ hlsl.inoutquals.frag
Shader version: 500 Shader version: 500
gl_FragCoord origin is upper left gl_FragCoord origin is upper left
0:? Sequence 0:? Sequence
0:8 Function Definition: MyFunc(f1;f1;f1; ( temp void) 0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void)
0:8 Function Parameters: 0:8 Function Parameters:
0:8 'x' ( in float) 0:8 'x' ( in float)
0:8 'y' ( out float) 0:8 'y' ( out float)
0:8 'z' ( inout float) 0:8 'z' ( inout float)
0:8 'w' ( inout float)
0:? Sequence 0:? Sequence
0:9 move second child to first child ( temp float) 0:9 move second child to first child ( temp float)
0:9 'y' ( out float) 0:9 'y' ( out float)
@ -18,71 +19,79 @@ gl_FragCoord origin is upper left
0:11 'x' ( in float) 0:11 'x' ( in float)
0:11 Constant: 0:11 Constant:
0:11 -1.000000 0:11 -1.000000
0:15 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:12 multiply second child into first child ( temp float)
0:15 Function Parameters: 0:12 'w' ( inout float)
0:15 'inpos' ( in 4-component vector of float) 0:12 Constant:
0:15 'sampleMask' ( out int) 0:12 1.000000
0:16 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:16 Function Parameters:
0:16 'inpos' ( in 4-component vector of float)
0:16 'sampleMask' ( out int)
0:? Sequence 0:? Sequence
0:18 Sequence 0:19 Sequence
0:18 move second child to first child ( temp float) 0:19 move second child to first child ( temp float)
0:18 'x' ( temp float)
0:18 Constant:
0:18 7.000000
0:18 move second child to first child ( temp float)
0:18 'z' ( temp float)
0:18 Constant:
0:18 3.000000
0:19 Function Call: MyFunc(f1;f1;f1; ( temp void)
0:19 'x' ( temp float) 0:19 'x' ( temp float)
0:19 'y' ( temp float) 0:19 Constant:
0:19 7.000000
0:19 move second child to first child ( temp float)
0:19 'z' ( temp float) 0:19 'z' ( temp float)
0:21 move second child to first child ( temp 4-component vector of float) 0:19 Constant:
0:21 Color: direct index for structure ( temp 4-component vector of float) 0:19 3.000000
0:21 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Call: MyFunc(f1;f1;f1;f1; ( temp void)
0:21 Constant: 0:20 'x' ( temp float)
0:21 0 (const int) 0:20 'y' ( temp float)
0:? Construct vec4 ( temp 4-component vector of float) 0:20 'z' ( temp float)
0:21 'x' ( temp float) 0:20 direct index ( temp float)
0:21 'y' ( temp float) 0:20 'inpos' ( in 4-component vector of float)
0:21 'z' ( temp float) 0:20 Constant:
0:21 Constant: 0:20 3 (const int)
0:21 1.000000 0:22 move second child to first child ( temp 4-component vector of float)
0:22 move second child to first child ( temp float) 0:22 Color: direct index for structure ( temp 4-component vector of float)
0:22 Depth: direct index for structure ( temp float)
0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:22 Constant: 0:22 Constant:
0:22 1 (const int) 0:22 0 (const int)
0:22 direct index ( temp float) 0:? Construct vec4 ( temp 4-component vector of float)
0:22 'inpos' ( in 4-component vector of float) 0:22 'x' ( temp float)
0:22 'y' ( temp float)
0:22 'z' ( temp float)
0:22 Constant: 0:22 Constant:
0:22 3 (const int) 0:22 1.000000
0:24 Branch: Return with expression 0:23 move second child to first child ( temp float)
0:24 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:23 Depth: direct index for structure ( temp float)
0:15 Function Definition: main( ( temp void) 0:23 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters: 0:23 Constant:
0:23 1 (const int)
0:23 direct index ( temp float)
0:23 'inpos' ( in 4-component vector of float)
0:23 Constant:
0:23 3 (const int)
0:25 Branch: Return with expression
0:25 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:16 Function Definition: main( ( temp void)
0:16 Function Parameters:
0:? Sequence 0:? Sequence
0:15 move second child to first child ( temp 4-component vector of float) 0:16 move second child to first child ( temp 4-component vector of float)
0:? 'inpos' ( temp 4-component vector of float) 0:? 'inpos' ( temp 4-component vector of float)
0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) 0:? 'inpos' ( noperspective in 4-component vector of float FragCoord)
0:15 Sequence 0:16 Sequence
0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:? 'inpos' ( temp 4-component vector of float) 0:? 'inpos' ( temp 4-component vector of float)
0:? 'sampleMask' ( temp int) 0:? 'sampleMask' ( temp int)
0:15 move second child to first child ( temp 4-component vector of float) 0:16 move second child to first child ( temp 4-component vector of float)
0:? 'Color' (layout( location=0) out 4-component vector of float) 0:? 'Color' (layout( location=0) out 4-component vector of float)
0:15 Color: direct index for structure ( temp 4-component vector of float) 0:16 Color: direct index for structure ( temp 4-component vector of float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant: 0:16 Constant:
0:15 0 (const int) 0:16 0 (const int)
0:15 move second child to first child ( temp float) 0:16 move second child to first child ( temp float)
0:? 'Depth' ( out float FragDepth) 0:? 'Depth' ( out float FragDepth)
0:15 Depth: direct index for structure ( temp float) 0:16 Depth: direct index for structure ( temp float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant: 0:16 Constant:
0:15 1 (const int) 0:16 1 (const int)
0:15 move second child to first child ( temp int) 0:16 move second child to first child ( temp int)
0:? 'sampleMask' ( out int SampleMaskIn) 0:? 'sampleMask' ( out int SampleMaskIn)
0:? 'sampleMask' ( temp int) 0:? 'sampleMask' ( temp int)
0:? Linker Objects 0:? Linker Objects
@ -98,11 +107,12 @@ Linked fragment stage:
Shader version: 500 Shader version: 500
gl_FragCoord origin is upper left gl_FragCoord origin is upper left
0:? Sequence 0:? Sequence
0:8 Function Definition: MyFunc(f1;f1;f1; ( temp void) 0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void)
0:8 Function Parameters: 0:8 Function Parameters:
0:8 'x' ( in float) 0:8 'x' ( in float)
0:8 'y' ( out float) 0:8 'y' ( out float)
0:8 'z' ( inout float) 0:8 'z' ( inout float)
0:8 'w' ( inout float)
0:? Sequence 0:? Sequence
0:9 move second child to first child ( temp float) 0:9 move second child to first child ( temp float)
0:9 'y' ( out float) 0:9 'y' ( out float)
@ -114,71 +124,79 @@ gl_FragCoord origin is upper left
0:11 'x' ( in float) 0:11 'x' ( in float)
0:11 Constant: 0:11 Constant:
0:11 -1.000000 0:11 -1.000000
0:15 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:12 multiply second child into first child ( temp float)
0:15 Function Parameters: 0:12 'w' ( inout float)
0:15 'inpos' ( in 4-component vector of float) 0:12 Constant:
0:15 'sampleMask' ( out int) 0:12 1.000000
0:16 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:16 Function Parameters:
0:16 'inpos' ( in 4-component vector of float)
0:16 'sampleMask' ( out int)
0:? Sequence 0:? Sequence
0:18 Sequence 0:19 Sequence
0:18 move second child to first child ( temp float) 0:19 move second child to first child ( temp float)
0:18 'x' ( temp float)
0:18 Constant:
0:18 7.000000
0:18 move second child to first child ( temp float)
0:18 'z' ( temp float)
0:18 Constant:
0:18 3.000000
0:19 Function Call: MyFunc(f1;f1;f1; ( temp void)
0:19 'x' ( temp float) 0:19 'x' ( temp float)
0:19 'y' ( temp float) 0:19 Constant:
0:19 7.000000
0:19 move second child to first child ( temp float)
0:19 'z' ( temp float) 0:19 'z' ( temp float)
0:21 move second child to first child ( temp 4-component vector of float) 0:19 Constant:
0:21 Color: direct index for structure ( temp 4-component vector of float) 0:19 3.000000
0:21 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Call: MyFunc(f1;f1;f1;f1; ( temp void)
0:21 Constant: 0:20 'x' ( temp float)
0:21 0 (const int) 0:20 'y' ( temp float)
0:? Construct vec4 ( temp 4-component vector of float) 0:20 'z' ( temp float)
0:21 'x' ( temp float) 0:20 direct index ( temp float)
0:21 'y' ( temp float) 0:20 'inpos' ( in 4-component vector of float)
0:21 'z' ( temp float) 0:20 Constant:
0:21 Constant: 0:20 3 (const int)
0:21 1.000000 0:22 move second child to first child ( temp 4-component vector of float)
0:22 move second child to first child ( temp float) 0:22 Color: direct index for structure ( temp 4-component vector of float)
0:22 Depth: direct index for structure ( temp float)
0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:22 Constant: 0:22 Constant:
0:22 1 (const int) 0:22 0 (const int)
0:22 direct index ( temp float) 0:? Construct vec4 ( temp 4-component vector of float)
0:22 'inpos' ( in 4-component vector of float) 0:22 'x' ( temp float)
0:22 'y' ( temp float)
0:22 'z' ( temp float)
0:22 Constant: 0:22 Constant:
0:22 3 (const int) 0:22 1.000000
0:24 Branch: Return with expression 0:23 move second child to first child ( temp float)
0:24 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:23 Depth: direct index for structure ( temp float)
0:15 Function Definition: main( ( temp void) 0:23 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters: 0:23 Constant:
0:23 1 (const int)
0:23 direct index ( temp float)
0:23 'inpos' ( in 4-component vector of float)
0:23 Constant:
0:23 3 (const int)
0:25 Branch: Return with expression
0:25 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:16 Function Definition: main( ( temp void)
0:16 Function Parameters:
0:? Sequence 0:? Sequence
0:15 move second child to first child ( temp 4-component vector of float) 0:16 move second child to first child ( temp 4-component vector of float)
0:? 'inpos' ( temp 4-component vector of float) 0:? 'inpos' ( temp 4-component vector of float)
0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) 0:? 'inpos' ( noperspective in 4-component vector of float FragCoord)
0:15 Sequence 0:16 Sequence
0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:? 'inpos' ( temp 4-component vector of float) 0:? 'inpos' ( temp 4-component vector of float)
0:? 'sampleMask' ( temp int) 0:? 'sampleMask' ( temp int)
0:15 move second child to first child ( temp 4-component vector of float) 0:16 move second child to first child ( temp 4-component vector of float)
0:? 'Color' (layout( location=0) out 4-component vector of float) 0:? 'Color' (layout( location=0) out 4-component vector of float)
0:15 Color: direct index for structure ( temp 4-component vector of float) 0:16 Color: direct index for structure ( temp 4-component vector of float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant: 0:16 Constant:
0:15 0 (const int) 0:16 0 (const int)
0:15 move second child to first child ( temp float) 0:16 move second child to first child ( temp float)
0:? 'Depth' ( out float FragDepth) 0:? 'Depth' ( out float FragDepth)
0:15 Depth: direct index for structure ( temp float) 0:16 Depth: direct index for structure ( temp float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant: 0:16 Constant:
0:15 1 (const int) 0:16 1 (const int)
0:15 move second child to first child ( temp int) 0:16 move second child to first child ( temp int)
0:? 'sampleMask' ( out int SampleMaskIn) 0:? 'sampleMask' ( out int SampleMaskIn)
0:? 'sampleMask' ( temp int) 0:? 'sampleMask' ( temp int)
0:? Linker Objects 0:? Linker Objects
@ -189,144 +207,157 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 80 // Id's are bound by 88
Capability Shader Capability Shader
Capability SampleRateShading Capability SampleRateShading
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 60 70 74 78 EntryPoint Fragment 4 "main" 68 78 82 86
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
Name 12 "MyFunc(f1;f1;f1;" Name 13 "MyFunc(f1;f1;f1;f1;"
Name 9 "x" Name 9 "x"
Name 10 "y" Name 10 "y"
Name 11 "z" Name 11 "z"
Name 18 "PS_OUTPUT" Name 12 "w"
MemberName 18(PS_OUTPUT) 0 "Color" Name 19 "PS_OUTPUT"
MemberName 18(PS_OUTPUT) 1 "Depth" MemberName 19(PS_OUTPUT) 0 "Color"
Name 22 "@main(vf4;i1;" MemberName 19(PS_OUTPUT) 1 "Depth"
Name 20 "inpos" Name 23 "@main(vf4;i1;"
Name 21 "sampleMask" Name 21 "inpos"
Name 27 "x" Name 22 "sampleMask"
Name 29 "z" Name 31 "x"
Name 31 "y" Name 33 "z"
Name 32 "param" Name 35 "y"
Name 34 "param" Name 36 "param"
Name 35 "param" Name 38 "param"
Name 41 "psout" Name 39 "param"
Name 58 "inpos" Name 41 "param"
Name 60 "inpos" Name 52 "psout"
Name 62 "flattenTemp" Name 66 "inpos"
Name 63 "sampleMask" Name 68 "inpos"
Name 64 "param" Name 70 "flattenTemp"
Name 66 "param" Name 71 "sampleMask"
Name 70 "Color" Name 72 "param"
Name 74 "Depth" Name 74 "param"
Name 78 "sampleMask" Name 78 "Color"
Decorate 60(inpos) NoPerspective Name 82 "Depth"
Decorate 60(inpos) BuiltIn FragCoord Name 86 "sampleMask"
Decorate 70(Color) Location 0 Decorate 68(inpos) NoPerspective
Decorate 74(Depth) BuiltIn FragDepth Decorate 68(inpos) BuiltIn FragCoord
Decorate 78(sampleMask) BuiltIn SampleMask Decorate 78(Color) Location 0
Decorate 82(Depth) BuiltIn FragDepth
Decorate 86(sampleMask) BuiltIn SampleMask
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypePointer Function 6(float) 7: TypePointer Function 6(float)
8: TypeFunction 2 7(ptr) 7(ptr) 7(ptr) 8: TypeFunction 2 7(ptr) 7(ptr) 7(ptr) 7(ptr)
14: TypeVector 6(float) 4 15: TypeVector 6(float) 4
15: TypePointer Function 14(fvec4) 16: TypePointer Function 15(fvec4)
16: TypeInt 32 1 17: TypeInt 32 1
17: TypePointer Function 16(int) 18: TypePointer Function 17(int)
18(PS_OUTPUT): TypeStruct 14(fvec4) 6(float) 19(PS_OUTPUT): TypeStruct 15(fvec4) 6(float)
19: TypeFunction 18(PS_OUTPUT) 15(ptr) 17(ptr) 20: TypeFunction 19(PS_OUTPUT) 16(ptr) 18(ptr)
26: 6(float) Constant 3212836864 27: 6(float) Constant 3212836864
28: 6(float) Constant 1088421888 28: 6(float) Constant 1065353216
30: 6(float) Constant 1077936128 32: 6(float) Constant 1088421888
40: TypePointer Function 18(PS_OUTPUT) 34: 6(float) Constant 1077936128
42: 16(int) Constant 0 42: TypeInt 32 0
46: 6(float) Constant 1065353216 43: 42(int) Constant 3
49: 16(int) Constant 1 51: TypePointer Function 19(PS_OUTPUT)
50: TypeInt 32 0 53: 17(int) Constant 0
51: 50(int) Constant 3 59: 17(int) Constant 1
59: TypePointer Input 14(fvec4) 67: TypePointer Input 15(fvec4)
60(inpos): 59(ptr) Variable Input 68(inpos): 67(ptr) Variable Input
69: TypePointer Output 14(fvec4) 77: TypePointer Output 15(fvec4)
70(Color): 69(ptr) Variable Output 78(Color): 77(ptr) Variable Output
73: TypePointer Output 6(float) 81: TypePointer Output 6(float)
74(Depth): 73(ptr) Variable Output 82(Depth): 81(ptr) Variable Output
77: TypePointer Output 16(int) 85: TypePointer Output 17(int)
78(sampleMask): 77(ptr) Variable Output 86(sampleMask): 85(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
58(inpos): 15(ptr) Variable Function 66(inpos): 16(ptr) Variable Function
62(flattenTemp): 40(ptr) Variable Function 70(flattenTemp): 51(ptr) Variable Function
63(sampleMask): 17(ptr) Variable Function 71(sampleMask): 18(ptr) Variable Function
64(param): 15(ptr) Variable Function 72(param): 16(ptr) Variable Function
66(param): 17(ptr) Variable Function 74(param): 18(ptr) Variable Function
61: 14(fvec4) Load 60(inpos) 69: 15(fvec4) Load 68(inpos)
Store 58(inpos) 61 Store 66(inpos) 69
65: 14(fvec4) Load 58(inpos) 73: 15(fvec4) Load 66(inpos)
Store 64(param) 65 Store 72(param) 73
67:18(PS_OUTPUT) FunctionCall 22(@main(vf4;i1;) 64(param) 66(param) 75:19(PS_OUTPUT) FunctionCall 23(@main(vf4;i1;) 72(param) 74(param)
68: 16(int) Load 66(param) 76: 17(int) Load 74(param)
Store 63(sampleMask) 68 Store 71(sampleMask) 76
Store 62(flattenTemp) 67 Store 70(flattenTemp) 75
71: 15(ptr) AccessChain 62(flattenTemp) 42 79: 16(ptr) AccessChain 70(flattenTemp) 53
72: 14(fvec4) Load 71 80: 15(fvec4) Load 79
Store 70(Color) 72 Store 78(Color) 80
75: 7(ptr) AccessChain 62(flattenTemp) 49 83: 7(ptr) AccessChain 70(flattenTemp) 59
76: 6(float) Load 75 84: 6(float) Load 83
Store 74(Depth) 76 Store 82(Depth) 84
79: 16(int) Load 63(sampleMask) 87: 17(int) Load 71(sampleMask)
Store 78(sampleMask) 79 Store 86(sampleMask) 87
Return Return
FunctionEnd FunctionEnd
12(MyFunc(f1;f1;f1;): 2 Function None 8 13(MyFunc(f1;f1;f1;f1;): 2 Function None 8
9(x): 7(ptr) FunctionParameter 9(x): 7(ptr) FunctionParameter
10(y): 7(ptr) FunctionParameter 10(y): 7(ptr) FunctionParameter
11(z): 7(ptr) FunctionParameter 11(z): 7(ptr) FunctionParameter
13: Label 12(w): 7(ptr) FunctionParameter
24: 6(float) Load 9(x) 14: Label
Store 10(y) 24 25: 6(float) Load 9(x)
25: 6(float) Load 10(y) Store 10(y) 25
Store 11(z) 25 26: 6(float) Load 10(y)
Store 9(x) 26 Store 11(z) 26
Store 9(x) 27
29: 6(float) Load 12(w)
30: 6(float) FMul 29 28
Store 12(w) 30
Return Return
FunctionEnd FunctionEnd
22(@main(vf4;i1;):18(PS_OUTPUT) Function None 19 23(@main(vf4;i1;):19(PS_OUTPUT) Function None 20
20(inpos): 15(ptr) FunctionParameter 21(inpos): 16(ptr) FunctionParameter
21(sampleMask): 17(ptr) FunctionParameter 22(sampleMask): 18(ptr) FunctionParameter
23: Label 24: Label
27(x): 7(ptr) Variable Function 31(x): 7(ptr) Variable Function
29(z): 7(ptr) Variable Function 33(z): 7(ptr) Variable Function
31(y): 7(ptr) Variable Function 35(y): 7(ptr) Variable Function
32(param): 7(ptr) Variable Function 36(param): 7(ptr) Variable Function
34(param): 7(ptr) Variable Function 38(param): 7(ptr) Variable Function
35(param): 7(ptr) Variable Function 39(param): 7(ptr) Variable Function
41(psout): 40(ptr) Variable Function 41(param): 7(ptr) Variable Function
Store 27(x) 28 52(psout): 51(ptr) Variable Function
Store 29(z) 30 Store 31(x) 32
33: 6(float) Load 27(x) Store 33(z) 34
Store 32(param) 33 37: 6(float) Load 31(x)
36: 6(float) Load 29(z) Store 36(param) 37
Store 35(param) 36 40: 6(float) Load 33(z)
37: 2 FunctionCall 12(MyFunc(f1;f1;f1;) 32(param) 34(param) 35(param) Store 39(param) 40
38: 6(float) Load 34(param) 44: 7(ptr) AccessChain 21(inpos) 43
Store 31(y) 38 45: 6(float) Load 44
39: 6(float) Load 35(param) Store 41(param) 45
Store 29(z) 39 46: 2 FunctionCall 13(MyFunc(f1;f1;f1;f1;) 36(param) 38(param) 39(param) 41(param)
43: 6(float) Load 27(x) 47: 6(float) Load 38(param)
44: 6(float) Load 31(y) Store 35(y) 47
45: 6(float) Load 29(z) 48: 6(float) Load 39(param)
47: 14(fvec4) CompositeConstruct 43 44 45 46 Store 33(z) 48
48: 15(ptr) AccessChain 41(psout) 42 49: 6(float) Load 41(param)
Store 48 47 50: 7(ptr) AccessChain 21(inpos) 43
52: 7(ptr) AccessChain 20(inpos) 51 Store 50 49
53: 6(float) Load 52 54: 6(float) Load 31(x)
54: 7(ptr) AccessChain 41(psout) 49 55: 6(float) Load 35(y)
Store 54 53 56: 6(float) Load 33(z)
55:18(PS_OUTPUT) Load 41(psout) 57: 15(fvec4) CompositeConstruct 54 55 56 28
ReturnValue 55 58: 16(ptr) AccessChain 52(psout) 53
Store 58 57
60: 7(ptr) AccessChain 21(inpos) 43
61: 6(float) Load 60
62: 7(ptr) AccessChain 52(psout) 59
Store 62 61
63:19(PS_OUTPUT) Load 52(psout)
ReturnValue 63
FunctionEnd FunctionEnd

View File

@ -4,11 +4,12 @@ struct PS_OUTPUT
float Depth : SV_Depth; float Depth : SV_Depth;
}; };
inline void MyFunc(in float x, out float y, inout float z) inline void MyFunc(in float x, out float y, inout float z, in out float w)
{ {
y = x; y = x;
z = y; z = y;
x = -1; // no effect since x = in param x = -1; // no effect since x = in param
w *= 1;
} }
PS_OUTPUT main(noperspective in float4 inpos : SV_Position, out int sampleMask : SV_Coverage) PS_OUTPUT main(noperspective in float4 inpos : SV_Position, out int sampleMask : SV_Coverage)
@ -16,7 +17,7 @@ PS_OUTPUT main(noperspective in float4 inpos : SV_Position, out int sampleMask :
PS_OUTPUT psout; PS_OUTPUT psout;
float x = 7, y, z = 3; float x = 7, y, z = 3;
MyFunc(x, y, z); MyFunc(x, y, z, inpos.w);
psout.Color = float4(x, y, z, 1); psout.Color = float4(x, y, z, 1);
psout.Depth = inpos.w; psout.Depth = inpos.w;

View File

@ -680,10 +680,10 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier)
qualifier.noContraction = true; qualifier.noContraction = true;
break; break;
case EHTokIn: case EHTokIn:
qualifier.storage = EvqIn; qualifier.storage = (qualifier.storage == EvqOut) ? EvqInOut : EvqIn;
break; break;
case EHTokOut: case EHTokOut:
qualifier.storage = EvqOut; qualifier.storage = (qualifier.storage == EvqIn) ? EvqInOut : EvqOut;
break; break;
case EHTokInOut: case EHTokInOut:
qualifier.storage = EvqInOut; qualifier.storage = EvqInOut;