HLSL: Fix #1154: Support PointSize, as an attribute.
This commit is contained in:
143
Test/baseResults/hlsl.PointSize.geom.out
Executable file
143
Test/baseResults/hlsl.PointSize.geom.out
Executable file
@@ -0,0 +1,143 @@
|
||||
hlsl.PointSize.geom
|
||||
Shader version: 500
|
||||
invocations = -1
|
||||
max_vertices = 4
|
||||
input primitive = triangles
|
||||
output primitive = line_strip
|
||||
0:? Sequence
|
||||
0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void)
|
||||
0:8 Function Parameters:
|
||||
0:8 'ps' ( in 3-element array of uint)
|
||||
0:8 'OutputStream' ( out structure{ temp float ps})
|
||||
0:? Sequence
|
||||
0:10 Sequence
|
||||
0:10 Sequence
|
||||
0:10 move second child to first child ( temp float)
|
||||
0:? 'OutputStream.ps' ( out float PointSize)
|
||||
0:10 ps: direct index for structure ( temp float)
|
||||
0:10 's' ( temp structure{ temp float ps})
|
||||
0:10 Constant:
|
||||
0:10 0 (const int)
|
||||
0:10 EmitVertex ( temp void)
|
||||
0:8 Function Definition: main( ( temp void)
|
||||
0:8 Function Parameters:
|
||||
0:? Sequence
|
||||
0:8 move second child to first child ( temp 3-element array of uint)
|
||||
0:? 'ps' ( temp 3-element array of uint)
|
||||
0:? 'ps' ( in 3-element array of uint PointSize)
|
||||
0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void)
|
||||
0:? 'ps' ( temp 3-element array of uint)
|
||||
0:? 'OutputStream' ( temp structure{ temp float ps})
|
||||
0:? Linker Objects
|
||||
0:? 'ps' ( in 3-element array of uint PointSize)
|
||||
0:? 'OutputStream.ps' ( out float PointSize)
|
||||
|
||||
|
||||
Linked geometry stage:
|
||||
|
||||
|
||||
Shader version: 500
|
||||
invocations = 1
|
||||
max_vertices = 4
|
||||
input primitive = triangles
|
||||
output primitive = line_strip
|
||||
0:? Sequence
|
||||
0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void)
|
||||
0:8 Function Parameters:
|
||||
0:8 'ps' ( in 3-element array of uint)
|
||||
0:8 'OutputStream' ( out structure{ temp float ps})
|
||||
0:? Sequence
|
||||
0:10 Sequence
|
||||
0:10 Sequence
|
||||
0:10 move second child to first child ( temp float)
|
||||
0:? 'OutputStream.ps' ( out float PointSize)
|
||||
0:10 ps: direct index for structure ( temp float)
|
||||
0:10 's' ( temp structure{ temp float ps})
|
||||
0:10 Constant:
|
||||
0:10 0 (const int)
|
||||
0:10 EmitVertex ( temp void)
|
||||
0:8 Function Definition: main( ( temp void)
|
||||
0:8 Function Parameters:
|
||||
0:? Sequence
|
||||
0:8 move second child to first child ( temp 3-element array of uint)
|
||||
0:? 'ps' ( temp 3-element array of uint)
|
||||
0:? 'ps' ( in 3-element array of uint PointSize)
|
||||
0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void)
|
||||
0:? 'ps' ( temp 3-element array of uint)
|
||||
0:? 'OutputStream' ( temp structure{ temp float ps})
|
||||
0:? Linker Objects
|
||||
0:? 'ps' ( in 3-element array of uint PointSize)
|
||||
0:? 'OutputStream.ps' ( out float PointSize)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80002
|
||||
// Id's are bound by 36
|
||||
|
||||
Capability Geometry
|
||||
Capability GeometryPointSize
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Geometry 4 "main" 19 28
|
||||
ExecutionMode 4 Triangles
|
||||
ExecutionMode 4 Invocations 1
|
||||
ExecutionMode 4 OutputLineStrip
|
||||
ExecutionMode 4 OutputVertices 4
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 11 "S"
|
||||
MemberName 11(S) 0 "ps"
|
||||
Name 16 "@main(u1[3];struct-S-f11;"
|
||||
Name 14 "ps"
|
||||
Name 15 "OutputStream"
|
||||
Name 19 "OutputStream.ps"
|
||||
Name 20 "s"
|
||||
Name 26 "ps"
|
||||
Name 28 "ps"
|
||||
Name 30 "OutputStream"
|
||||
Name 31 "param"
|
||||
Name 33 "param"
|
||||
Decorate 19(OutputStream.ps) BuiltIn PointSize
|
||||
Decorate 28(ps) BuiltIn PointSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: 6(int) Constant 3
|
||||
8: TypeArray 6(int) 7
|
||||
9: TypePointer Function 8
|
||||
10: TypeFloat 32
|
||||
11(S): TypeStruct 10(float)
|
||||
12: TypePointer Function 11(S)
|
||||
13: TypeFunction 2 9(ptr) 12(ptr)
|
||||
18: TypePointer Output 10(float)
|
||||
19(OutputStream.ps): 18(ptr) Variable Output
|
||||
21: TypeInt 32 1
|
||||
22: 21(int) Constant 0
|
||||
23: TypePointer Function 10(float)
|
||||
27: TypePointer Input 8
|
||||
28(ps): 27(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
26(ps): 9(ptr) Variable Function
|
||||
30(OutputStream): 12(ptr) Variable Function
|
||||
31(param): 9(ptr) Variable Function
|
||||
33(param): 12(ptr) Variable Function
|
||||
29: 8 Load 28(ps)
|
||||
Store 26(ps) 29
|
||||
32: 8 Load 26(ps)
|
||||
Store 31(param) 32
|
||||
34: 2 FunctionCall 16(@main(u1[3];struct-S-f11;) 31(param) 33(param)
|
||||
35: 11(S) Load 33(param)
|
||||
Store 30(OutputStream) 35
|
||||
Return
|
||||
FunctionEnd
|
||||
16(@main(u1[3];struct-S-f11;): 2 Function None 13
|
||||
14(ps): 9(ptr) FunctionParameter
|
||||
15(OutputStream): 12(ptr) FunctionParameter
|
||||
17: Label
|
||||
20(s): 12(ptr) Variable Function
|
||||
24: 23(ptr) AccessChain 20(s) 22
|
||||
25: 10(float) Load 24
|
||||
Store 19(OutputStream.ps) 25
|
||||
EmitVertex
|
||||
Return
|
||||
FunctionEnd
|
||||
69
Test/baseResults/hlsl.PointSize.vert.out
Executable file
69
Test/baseResults/hlsl.PointSize.vert.out
Executable file
@@ -0,0 +1,69 @@
|
||||
hlsl.PointSize.vert
|
||||
Shader version: 500
|
||||
0:? Sequence
|
||||
0:2 Function Definition: @main( ( temp float)
|
||||
0:2 Function Parameters:
|
||||
0:? Sequence
|
||||
0:3 Branch: Return with expression
|
||||
0:3 Constant:
|
||||
0:3 2.300000
|
||||
0:2 Function Definition: main( ( temp void)
|
||||
0:2 Function Parameters:
|
||||
0:? Sequence
|
||||
0:2 move second child to first child ( temp float)
|
||||
0:? '@entryPointOutput' ( out float PointSize)
|
||||
0:2 Function Call: @main( ( temp float)
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' ( out float PointSize)
|
||||
|
||||
|
||||
Linked vertex stage:
|
||||
|
||||
|
||||
Shader version: 500
|
||||
0:? Sequence
|
||||
0:2 Function Definition: @main( ( temp float)
|
||||
0:2 Function Parameters:
|
||||
0:? Sequence
|
||||
0:3 Branch: Return with expression
|
||||
0:3 Constant:
|
||||
0:3 2.300000
|
||||
0:2 Function Definition: main( ( temp void)
|
||||
0:2 Function Parameters:
|
||||
0:? Sequence
|
||||
0:2 move second child to first child ( temp float)
|
||||
0:? '@entryPointOutput' ( out float PointSize)
|
||||
0:2 Function Call: @main( ( temp float)
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' ( out float PointSize)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80002
|
||||
// Id's are bound by 16
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 14
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 8 "@main("
|
||||
Name 14 "@entryPointOutput"
|
||||
Decorate 14(@entryPointOutput) BuiltIn PointSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeFunction 6(float)
|
||||
10: 6(float) Constant 1075000115
|
||||
13: TypePointer Output 6(float)
|
||||
14(@entryPointOutput): 13(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
15: 6(float) FunctionCall 8(@main()
|
||||
Store 14(@entryPointOutput) 15
|
||||
Return
|
||||
FunctionEnd
|
||||
8(@main(): 6(float) Function None 7
|
||||
9: Label
|
||||
ReturnValue 10
|
||||
FunctionEnd
|
||||
11
Test/hlsl.PointSize.geom
Normal file
11
Test/hlsl.PointSize.geom
Normal file
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
[[vk::builtin("PointSize")]] float ps;
|
||||
};
|
||||
|
||||
[maxvertexcount(4)]
|
||||
void main([[vk::builtin("PointSize")]] triangle in uint ps[3],
|
||||
inout LineStream<S> OutputStream)
|
||||
{
|
||||
S s;
|
||||
OutputStream.Append(s);
|
||||
}
|
||||
4
Test/hlsl.PointSize.vert
Normal file
4
Test/hlsl.PointSize.vert
Normal file
@@ -0,0 +1,4 @@
|
||||
[[vk::builtin("PointSize")]] float main()
|
||||
{
|
||||
return 2.3;
|
||||
}
|
||||
Reference in New Issue
Block a user