HLSL: Correct use of isPerVertexBuiltIn() to be isClipOrCullDistance().

This allows removal of isPerVertexBuiltIn(). It also leads to
removal of addInterstageIoToLinkage(), which is no longer needed.

Includes related name improvements.
This commit is contained in:
John Kessenich 2017-08-04 13:51:54 -06:00
parent d319fb4e63
commit 2b4f77f2dc
28 changed files with 94 additions and 95 deletions

View File

@ -128,6 +128,7 @@ Shader version: 500
0:11 Constant:
0:11 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
@ -264,6 +265,7 @@ Shader version: 500
0:11 Constant:
0:11 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)

View File

@ -152,6 +152,7 @@ Shader version: 500
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
@ -312,6 +313,7 @@ Shader version: 500
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)

View File

@ -208,6 +208,7 @@ Shader version: 500
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
@ -423,6 +424,7 @@ Shader version: 500
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000

View File

@ -186,6 +186,7 @@ Shader version: 500
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
@ -379,6 +380,7 @@ Shader version: 500
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000

View File

@ -114,6 +114,7 @@ Shader version: 500
0:8 Constant:
0:8 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
@ -235,6 +236,7 @@ Shader version: 500
0:8 Constant:
0:8 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000

View File

@ -91,6 +91,7 @@ Shader version: 500
0:7 3 (const int)
0:? 'clip1' ( temp float)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'clip0' ( out 4-element array of float ClipDistance)
@ -189,6 +190,7 @@ Shader version: 500
0:7 3 (const int)
0:? 'clip1' ( temp float)
0:? Linker Objects
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:? 'clip0' ( out 4-element array of float ClipDistance)
// Module Version 10000

View File

@ -138,9 +138,9 @@ triangle order = none
0:? 'norm' (layout( location=1) out 3-component vector of float)
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo})
0:? 'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
0:? 'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo})
Linked tessellation evaluation stage:
@ -285,9 +285,9 @@ triangle order = none
0:? 'norm' (layout( location=1) out 3-component vector of float)
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo})
0:? 'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
0:? 'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo})
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -82,8 +82,8 @@ gl_FragCoord origin is upper left
0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2})
0:? 'i_fragCoord' ( in 4-component vector of float FragCoord)
0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2})
Linked fragment stage:
@ -172,8 +172,8 @@ gl_FragCoord origin is upper left
0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2})
0:? 'i_fragCoord' ( in 4-component vector of float FragCoord)
0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2})
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -105,6 +105,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
Linked vertex stage:
@ -216,6 +217,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -53,6 +53,7 @@ Shader version: 500
0:? Linker Objects
0:? 'g_sSamp' (layout( binding=0) uniform sampler)
0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
Linked vertex stage:
@ -112,6 +113,7 @@ Shader version: 500
0:? Linker Objects
0:? 'g_sSamp' (layout( binding=0) uniform sampler)
0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -221,6 +221,7 @@ Shader version: 500
0:? 'g_tTexcdi4a' ( uniform itextureCubeArray)
0:? 'g_tTexcdu4a' ( uniform utextureCubeArray)
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4})
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
Linked vertex stage:
@ -448,6 +449,7 @@ Shader version: 500
0:? 'g_tTexcdi4a' ( uniform itextureCubeArray)
0:? 'g_tTexcdu4a' ( uniform utextureCubeArray)
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4})
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -242,6 +242,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
Linked vertex stage:
@ -490,6 +491,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -188,6 +188,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
Linked vertex stage:
@ -382,6 +383,7 @@ Shader version: 500
0:? 'g_tTexcdf4' ( uniform textureCube)
0:? 'g_tTexcdi4' ( uniform itextureCube)
0:? 'g_tTexcdu4' ( uniform utextureCube)
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -158,6 +158,7 @@ Shader version: 500
0:29 Constant:
0:29 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput_position' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord})
@ -323,6 +324,7 @@ Shader version: 500
0:29 Constant:
0:29 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput_position' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord})
// Module Version 10000

View File

@ -71,10 +71,12 @@ output primitive = line_strip
0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
0:? Linker Objects
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:? 'OutputStream_clip0' ( out float Position)
0:? 'OutputStream_vpai' ( out uint ViewportIndex)
0:? 'OutputStream_rtai' ( out uint Layer)
0:? 'OutputStream' (layout( location=0) out structure{ temp int ii})
0:? 'OutputStream_clip0' ( out 1-element array of float ClipDistance)
0:? 'OutputStream_cull0' ( out 1-element array of float CullDistance)
0:? 'OutputStream_vpai' ( out uint ViewportIndex)
Linked geometry stage:
@ -152,10 +154,12 @@ output primitive = line_strip
0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
0:? Linker Objects
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:? 'OutputStream_clip0' ( out float Position)
0:? 'OutputStream_vpai' ( out uint ViewportIndex)
0:? 'OutputStream_rtai' ( out uint Layer)
0:? 'OutputStream' (layout( location=0) out structure{ temp int ii})
0:? 'OutputStream_clip0' ( out 1-element array of float ClipDistance)
0:? 'OutputStream_cull0' ( out 1-element array of float CullDistance)
0:? 'OutputStream_vpai' ( out uint ViewportIndex)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -117,8 +117,8 @@ gl_FragCoord origin is upper left
0:? 's2' ( global structure{ temp 4-component vector of float i})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4})
0:? 's_ff1' ( flat in bool Face)
0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4})
Linked fragment stage:
@ -238,8 +238,8 @@ gl_FragCoord origin is upper left
0:? 's2' ( global structure{ temp 4-component vector of float i})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4})
0:? 's_ff1' ( flat in bool Face)
0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4})
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -93,6 +93,7 @@ Shader version: 500
0:17 Constant:
0:17 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos_out' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout( location=0) in int)
0:? 'Pos_in' (layout( location=1) in 4-component vector of float)
@ -197,6 +198,7 @@ Shader version: 500
0:17 Constant:
0:17 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos_out' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout( location=0) in int)
0:? 'Pos_in' (layout( location=1) in 4-component vector of float)

View File

@ -72,6 +72,7 @@ output primitive = triangle_strip
0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? Linker Objects
0:? 'v' (layout( location=0) in 1-element array of uint)
0:? 'OutputStream_Pos' ( out 4-component vector of float Position)
0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
@ -151,16 +152,17 @@ output primitive = triangle_strip
0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? Linker Objects
0:? 'v' (layout( location=0) in 1-element array of uint)
0:? 'OutputStream_Pos' ( out 4-component vector of float Position)
0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 77
// Id's are bound by 79
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 66 76
EntryPoint Geometry 4 "main" 66 75 78
ExecutionMode 4 InputPoints
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
@ -184,13 +186,15 @@ output primitive = triangle_strip
Name 68 "OutputStream"
Name 69 "param"
Name 71 "param"
Name 74 "PSInput"
MemberName 74(PSInput) 0 "TexCoord"
MemberName 74(PSInput) 1 "TerrainPos"
MemberName 74(PSInput) 2 "VertexID"
Name 76 "OutputStream"
Name 75 "OutputStream_Pos"
Name 76 "PSInput"
MemberName 76(PSInput) 0 "TexCoord"
MemberName 76(PSInput) 1 "TerrainPos"
MemberName 76(PSInput) 2 "VertexID"
Name 78 "OutputStream"
Decorate 66(v) Location 0
Decorate 76(OutputStream) Location 0
Decorate 75(OutputStream_Pos) BuiltIn Position
Decorate 78(OutputStream) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -223,9 +227,11 @@ output primitive = triangle_strip
60: 28(int) Constant 1
65: TypePointer Input 8
66(v): 65(ptr) Variable Input
74(PSInput): TypeStruct 12(fvec2) 13(fvec3) 6(int)
75: TypePointer Output 74(PSInput)
76(OutputStream): 75(ptr) Variable Output
74: TypePointer Output 11(fvec4)
75(OutputStream_Pos): 74(ptr) Variable Output
76(PSInput): TypeStruct 12(fvec2) 13(fvec3) 6(int)
77: TypePointer Output 76(PSInput)
78(OutputStream): 77(ptr) Variable Output
4(main): 2 Function None 3
5: Label
64(v): 9(ptr) Variable Function

View File

@ -111,8 +111,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f})
0:? 'input_pos' ( in 3-element array of 4-component vector of float FragCoord)
0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f})
Linked fragment stage:
@ -230,8 +230,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f})
0:? 'input_pos' ( in 3-element array of 4-component vector of float FragCoord)
0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f})
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -103,6 +103,7 @@ Shader version: 500
0:22 Constant:
0:22 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos_out' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout( location=0) in int)
0:? 'Pos_in' (layout( location=1) in 4-component vector of float)
@ -216,6 +217,7 @@ Shader version: 500
0:22 Constant:
0:22 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos_out' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout( location=0) in int)
0:? 'Pos_in' (layout( location=1) in 4-component vector of float)

View File

@ -195,7 +195,9 @@ output primitive = triangle_strip
0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:? 'ts' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? Linker Objects
0:? 'tin_pos' ( in 3-element array of 4-component vector of float Position)
0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc})
0:? 'ts_psIn_pos' ( out 4-component vector of float Position)
0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
@ -398,7 +400,9 @@ output primitive = triangle_strip
0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:? 'ts' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? Linker Objects
0:? 'tin_pos' ( in 3-element array of 4-component vector of float Position)
0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc})
0:? 'ts_psIn_pos' ( out 4-component vector of float Position)
0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
// Module Version 10000

View File

@ -90,6 +90,8 @@ output primitive = triangle_strip
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos})
0:? 'ts' ( temp structure{ temp 4-component vector of float pos})
0:? Linker Objects
0:? 'i_pos' ( in 3-element array of 4-component vector of float Position)
0:? 'ts_pos' ( out 4-component vector of float Position)
Linked geometry stage:
@ -186,6 +188,8 @@ output primitive = triangle_strip
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos})
0:? 'ts' ( temp structure{ temp 4-component vector of float pos})
0:? Linker Objects
0:? 'i_pos' ( in 3-element array of 4-component vector of float Position)
0:? 'ts_pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@ -42,6 +42,7 @@ Shader version: 500
0:16 Constant:
0:16 0 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
0:? 'Pos_in' (layout( location=0) in 4-component vector of float)
0:? 'Pos_loose' (layout( location=1) in 4-component vector of float)
@ -92,6 +93,7 @@ Shader version: 500
0:16 Constant:
0:16 0 (const int)
0:? Linker Objects
0:? '@entryPointOutput_Pos' ( out 4-component vector of float Position)
0:? 'Pos_in' (layout( location=0) in 4-component vector of float)
0:? 'Pos_loose' (layout( location=1) in 4-component vector of float)

View File

@ -84,6 +84,7 @@ output primitive = triangle_strip
0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Linker Objects
0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream_position' ( out 4-component vector of float Position)
0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv})
@ -175,6 +176,7 @@ output primitive = triangle_strip
0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Linker Objects
0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream_position' ( out 4-component vector of float Position)
0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv})
// Module Version 10000

View File

@ -150,6 +150,7 @@ Shader version: 500
0:8 Constant:
0:8 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_coord' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b})
0:? 'd' (layout( location=0) in 4-component vector of float)
0:? 'm[0]' (layout( location=1) in 4-component vector of float)
@ -315,6 +316,7 @@ Shader version: 500
0:8 Constant:
0:8 2 (const int)
0:? Linker Objects
0:? '@entryPointOutput_coord' ( out 4-component vector of float Position)
0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b})
0:? 'd' (layout( location=0) in 4-component vector of float)
0:? 'm[0]' (layout( location=1) in 4-component vector of float)

View File

@ -1365,39 +1365,12 @@ public:
return false;
}
virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint; }
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
// "Image" is a superset of "Subpass"
virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); }
virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); }
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
// Return true if this is a per-vertex built-in
virtual bool isPerVertexBuiltIn(EShLanguage language) const
{
if (getQualifier().builtIn == EbvNone || language == EShLangFragment)
return false;
// Any non-fragment stage
switch (getQualifier().builtIn) {
case EbvPosition:
case EbvPointSize:
case EbvClipDistance:
case EbvCullDistance:
#ifdef NV_EXTENSIONS
case EbvLayer:
case EbvViewportMaskNV:
case EbvSecondaryPositionNV:
case EbvSecondaryViewportMaskNV:
case EbvPositionPerViewNV:
case EbvViewportMaskPerViewNV:
#endif
return true;
default:
return false;
}
}
// return true if this type contains any subtype which satisfies the given predicate.
template <typename P>
bool contains(P predicate) const

View File

@ -1138,7 +1138,9 @@ TType& HlslParseContext::split(TType& type, TString name, const TType* outerStru
fixBuiltInIoType(ioVar->getWritableType());
interstageBuiltInIo[tInterstageIoData(memberType, *outerStructType)] = ioVar;
splitBuiltIns[tInterstageIoData(memberType, *outerStructType)] = ioVar;
if (!isClipOrCullDistance(ioVar->getType()))
trackLinkage(*ioVar);
// Merge qualifier from the user structure
mergeQualifiers(ioVar->getWritableType().getQualifier(), outerStructType->getQualifier());
@ -1388,7 +1390,7 @@ void HlslParseContext::trackLinkage(TSymbol& symbol)
TBuiltInVariable biType = symbol.getType().getQualifier().builtIn;
if (biType != EbvNone)
builtInLinkageSymbols[biType] = symbol.clone();
builtInTessLinkageSymbols[biType] = symbol.clone();
TParseContextBase::trackLinkage(symbol);
}
@ -1530,32 +1532,6 @@ void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction
error(loc, "function name is redeclaration of existing name", function.getName().c_str(), "");
}
// Finalization step: Add interstage IO variables to the linkage in canonical order.
void HlslParseContext::addInterstageIoToLinkage()
{
TSourceLoc loc;
loc.init();
std::vector<tInterstageIoData> io;
io.reserve(interstageBuiltInIo.size());
for (auto ioVar = interstageBuiltInIo.begin(); ioVar != interstageBuiltInIo.end(); ++ioVar)
io.push_back(ioVar->first);
// Our canonical order is the TBuiltInVariable numeric order.
std::sort(io.begin(), io.end());
// We have to (potentially) track two IO blocks, one in, one out. E.g, a GS may have a
// PerVertex block in both directions, possibly with different members.
for (int idx = 0; idx < int(io.size()); ++idx) {
TVariable* var = interstageBuiltInIo[io[idx]];
// Add the loose interstage IO to the linkage
if (! var->getType().isPerVertexBuiltIn(language))
trackLinkage(*var);
}
}
// For struct buffers with counters, we must pass the counter buffer as hidden parameter.
// This adds the hidden parameter to the parameter list in 'paramNodes' if needed.
// Otherwise, it's a no-op
@ -1983,7 +1959,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
// an array element as indexed by invocation ID, which we might have to make up.
// This is required to match SPIR-V semantics.
if (language == EShLangTessControl) {
TIntermSymbol* invocationIdSym = findLinkageSymbol(EbvInvocationId);
TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId);
// If there is no user declared invocation ID, we must make one.
if (invocationIdSym == nullptr) {
@ -2532,7 +2508,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
if (split && derefType.isBuiltIn()) {
// copy from interstage IO built-in if needed
const TIntermTyped* outer = isLeft ? outerLeft : outerRight;
subTree = intermediate.addSymbol(*interstageBuiltInIo.find(
subTree = intermediate.addSymbol(*splitBuiltIns.find(
HlslParseContext::tInterstageIoData(derefType, outer->getType()))->second);
// Arrayness of builtIn symbols isn't handled by the normal recursion:
@ -8859,11 +8835,11 @@ void HlslParseContext::clearUniformInputOutput(TQualifier& qualifier)
}
// Return a symbol for the linkage variable of the given TBuiltInVariable type
TIntermSymbol* HlslParseContext::findLinkageSymbol(TBuiltInVariable biType) const
// Return a symbol for the tessellation linkage variable of the given TBuiltInVariable type
TIntermSymbol* HlslParseContext::findTessLinkageSymbol(TBuiltInVariable biType) const
{
const auto it = builtInLinkageSymbols.find(biType);
if (it == builtInLinkageSymbols.end()) // if it wasn't declared by the user, return nullptr
const auto it = builtInTessLinkageSymbols.find(biType);
if (it == builtInTessLinkageSymbols.end()) // if it wasn't declared by the user, return nullptr
return nullptr;
return intermediate.addSymbol(*it->second->getAsVariable());
@ -8973,7 +8949,7 @@ void HlslParseContext::addPatchConstantInvocation()
TFunction& patchConstantFunction = const_cast<TFunction&>(*candidateList[0]);
const int pcfParamCount = patchConstantFunction.getParamCount();
TIntermSymbol* invocationIdSym = findLinkageSymbol(EbvInvocationId);
TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId);
TIntermSequence& epBodySeq = entryPointFunctionBody->getAsAggregate()->getSequence();
int outPatchParam = -1; // -1 means there isn't one.
@ -9023,7 +8999,7 @@ void HlslParseContext::addPatchConstantInvocation()
// Presently, the only non-built-in we support is InputPatch, which is treated as
// a pseudo-built-in.
if (biType == EbvInputPatch) {
builtInLinkageSymbols[biType] = inputPatch;
builtInTessLinkageSymbols[biType] = inputPatch;
} else if (biType == EbvOutputPatch) {
// Nothing...
} else {
@ -9069,7 +9045,7 @@ void HlslParseContext::addPatchConstantInvocation()
// find which built-in it is
const TBuiltInVariable biType = patchConstantFunction[p].getDeclaredBuiltIn();
inputArg = findLinkageSymbol(biType);
inputArg = findTessLinkageSymbol(biType);
if (inputArg == nullptr) {
error(loc, "unable to find patch constant function built-in variable", "", "");
@ -9263,7 +9239,6 @@ void HlslParseContext::finish()
removeUnusedStructBufferCounters();
addPatchConstantInvocation();
addInterstageIoToLinkage();
TParseContextBase::finish();
}

View File

@ -260,7 +260,6 @@ protected:
TVariable* getSplitIoVar(const TIntermTyped* node) const;
TVariable* getSplitIoVar(const TVariable* var) const;
TVariable* getSplitIoVar(int id) const;
void addInterstageIoToLinkage();
void addPatchConstantInvocation();
TIntermTyped* makeIntegerIndex(TIntermTyped*);
@ -312,14 +311,14 @@ protected:
static bool isClipOrCullDistance(const TQualifier& qual) { return isClipOrCullDistance(qual.builtIn); }
static bool isClipOrCullDistance(const TType& type) { return isClipOrCullDistance(type.getQualifier()); }
// Pass through to base class after remembering builtin mappings.
// Pass through to base class after remembering built-in mappings.
using TParseContextBase::trackLinkage;
void trackLinkage(TSymbol& variable) override;
void finish() override; // post-processing
// Linkage symbol helpers
TIntermSymbol* findLinkageSymbol(TBuiltInVariable biType) const;
TIntermSymbol* findTessLinkageSymbol(TBuiltInVariable biType) const;
// Current state of parsing
int annotationNestingLevel; // 0 if outside all annotations
@ -383,14 +382,14 @@ protected:
TMap<const TTypeList*, tIoKinds> ioTypeMap;
// Structure splitting data:
TMap<int, TVariable*> splitIoVars; // variables with the builtin interstage IO removed, indexed by unique ID.
TMap<int, TVariable*> splitIoVars; // variables with the built-in interstage IO removed, indexed by unique ID.
// Structuredbuffer shared types. Typically there are only a few.
TVector<TType*> structBufferTypes;
TMap<TString, bool> structBufferCounter;
// The builtin interstage IO map considers e.g, EvqPosition on input and output separately, so that we
// The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we
// can build the linkage correctly if position appears on both sides. Otherwise, multiple positions
// are considered identical.
struct tInterstageIoData {
@ -410,7 +409,7 @@ protected:
}
};
TMap<tInterstageIoData, TVariable*> interstageBuiltInIo; // individual builtin interstage IO vars, indexed by builtin type.
TMap<tInterstageIoData, TVariable*> splitBuiltIns; // split built-ins, indexed by built-in type.
TVariable* inputPatch;
unsigned int nextInLocation;
@ -421,7 +420,7 @@ protected:
TIntermNode* entryPointFunctionBody;
TString patchConstantFunctionName; // hull shader patch constant function name, from function level attribute.
TMap<TBuiltInVariable, TSymbol*> builtInLinkageSymbols; // used for tessellation, finding declared builtins
TMap<TBuiltInVariable, TSymbol*> builtInTessLinkageSymbols; // used for tessellation, finding declared built-ins
TVector<TString> currentTypePrefix; // current scoping prefix for nested structures
TVector<TVariable*> implicitThisStack; // currently active 'this' variables for nested structures
@ -447,7 +446,7 @@ protected:
TVector<tMipsOperatorData> mipsOperatorMipArg;
};
// This is the prefix we use for builtin methods to avoid namespace collisions with
// This is the prefix we use for built-in methods to avoid namespace collisions with
// global scope user functions.
// TODO: this would be better as a nonparseable character, but that would
// require changing the scanner.