HLSL: Implement packoffset production.
This commit is contained in:
@@ -2,37 +2,37 @@ hlsl.buffer.frag
|
|||||||
Shader version: 450
|
Shader version: 450
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:23 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
0:29 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
||||||
0:20 Function Parameters:
|
0:26 Function Parameters:
|
||||||
0:20 'input' (in 4-component vector of float)
|
0:26 'input' (in 4-component vector of float)
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:21 Branch: Return with expression
|
0:27 Branch: Return with expression
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 'input' (in 4-component vector of float)
|
0:27 'input' (in 4-component vector of float)
|
||||||
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
0:27 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||||
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
0:27 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
0:27 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||||
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
0:27 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
0:27 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||||
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
0:27 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
0:27 v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
|
||||||
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
0:27 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||||
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||||
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
|
||||||
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
|
||||||
|
|
||||||
|
|
||||||
Linked fragment stage:
|
Linked fragment stage:
|
||||||
@@ -41,37 +41,37 @@ Linked fragment stage:
|
|||||||
Shader version: 450
|
Shader version: 450
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:23 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
0:29 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
||||||
0:20 Function Parameters:
|
0:26 Function Parameters:
|
||||||
0:20 'input' (in 4-component vector of float)
|
0:26 'input' (in 4-component vector of float)
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:21 Branch: Return with expression
|
0:27 Branch: Return with expression
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 add (temp 4-component vector of float)
|
0:27 add (temp 4-component vector of float)
|
||||||
0:21 'input' (in 4-component vector of float)
|
0:27 'input' (in 4-component vector of float)
|
||||||
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
0:27 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||||
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
0:27 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
0:27 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||||
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
0:27 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
0:27 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||||
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
0:27 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
0:27 v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
|
||||||
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
0:27 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
|
||||||
0:21 Constant:
|
0:27 Constant:
|
||||||
0:21 0 (const uint)
|
0:27 0 (const uint)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||||
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||||
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
|
||||||
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
|
||||||
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80001
|
// Generated by (magic number): 80001
|
||||||
@@ -98,6 +98,12 @@ gl_FragCoord origin is upper left
|
|||||||
Name 32 ""
|
Name 32 ""
|
||||||
MemberName 32 0 "v4"
|
MemberName 32 0 "v4"
|
||||||
MemberName 32 1 "i4"
|
MemberName 32 1 "i4"
|
||||||
|
MemberName 32 2 "f1"
|
||||||
|
MemberName 32 3 "f3"
|
||||||
|
MemberName 32 4 "f4"
|
||||||
|
MemberName 32 5 "f5"
|
||||||
|
MemberName 32 6 "f6"
|
||||||
|
MemberName 32 7 "f7"
|
||||||
Name 34 ""
|
Name 34 ""
|
||||||
MemberDecorate 11 0 Offset 0
|
MemberDecorate 11 0 Offset 0
|
||||||
Decorate 11 Block
|
Decorate 11 Block
|
||||||
@@ -106,11 +112,17 @@ gl_FragCoord origin is upper left
|
|||||||
Decorate 20 BufferBlock
|
Decorate 20 BufferBlock
|
||||||
Decorate 22 DescriptorSet 0
|
Decorate 22 DescriptorSet 0
|
||||||
MemberDecorate 26 0 Offset 0
|
MemberDecorate 26 0 Offset 0
|
||||||
MemberDecorate 26 1 Offset 16
|
MemberDecorate 26 1 Offset 20
|
||||||
Decorate 26 Block
|
Decorate 26 Block
|
||||||
Decorate 28 DescriptorSet 0
|
Decorate 28 DescriptorSet 0
|
||||||
MemberDecorate 32 0 Offset 0
|
MemberDecorate 32 0 Offset 16
|
||||||
MemberDecorate 32 1 Offset 16
|
MemberDecorate 32 1 Offset 48
|
||||||
|
MemberDecorate 32 2 Offset 60
|
||||||
|
MemberDecorate 32 3 Offset 64
|
||||||
|
MemberDecorate 32 4 Offset 68
|
||||||
|
MemberDecorate 32 5 Offset 72
|
||||||
|
MemberDecorate 32 6 Offset 76
|
||||||
|
MemberDecorate 32 7 Offset 80
|
||||||
Decorate 32 BufferBlock
|
Decorate 32 BufferBlock
|
||||||
Decorate 34 DescriptorSet 0
|
Decorate 34 DescriptorSet 0
|
||||||
2: TypeVoid
|
2: TypeVoid
|
||||||
@@ -131,7 +143,7 @@ gl_FragCoord origin is upper left
|
|||||||
26: TypeStruct 7(fvec4) 14(int)
|
26: TypeStruct 7(fvec4) 14(int)
|
||||||
27: TypePointer Uniform 26(struct)
|
27: TypePointer Uniform 26(struct)
|
||||||
28: 27(ptr) Variable Uniform
|
28: 27(ptr) Variable Uniform
|
||||||
32: TypeStruct 7(fvec4) 14(int)
|
32: TypeStruct 7(fvec4) 14(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float)
|
||||||
33: TypePointer Uniform 32(struct)
|
33: TypePointer Uniform 32(struct)
|
||||||
34: 33(ptr) Variable Uniform
|
34: 33(ptr) Variable Uniform
|
||||||
4(PixelShaderFunction): 2 Function None 3
|
4(PixelShaderFunction): 2 Function None 3
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ gl_FragCoord origin is upper left
|
|||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 'AmbientColor' (global 4-component vector of float)
|
0:? 'AmbientColor' (global 4-component vector of float)
|
||||||
0:? 'ff1' (global bool Face)
|
0:? 'ff1' (global bool Face)
|
||||||
0:? 'ff2' (global 4-component vector of float)
|
0:? 'ff2' (layout(offset=4 ) global 4-component vector of float)
|
||||||
0:? 'ff3' (global 4-component vector of float)
|
0:? 'ff3' (layout(offset=4 ) global 4-component vector of float)
|
||||||
0:? 'ff4' (global 4-component vector of float FragCoord)
|
0:? 'ff4' (layout(offset=4 ) global 4-component vector of float FragCoord)
|
||||||
|
|
||||||
|
|
||||||
Linked fragment stage:
|
Linked fragment stage:
|
||||||
@@ -51,9 +51,9 @@ gl_FragCoord origin is upper left
|
|||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 'AmbientColor' (global 4-component vector of float)
|
0:? 'AmbientColor' (global 4-component vector of float)
|
||||||
0:? 'ff1' (global bool Face)
|
0:? 'ff1' (global bool Face)
|
||||||
0:? 'ff2' (global 4-component vector of float)
|
0:? 'ff2' (layout(offset=4 ) global 4-component vector of float)
|
||||||
0:? 'ff3' (global 4-component vector of float)
|
0:? 'ff3' (layout(offset=4 ) global 4-component vector of float)
|
||||||
0:? 'ff4' (global 4-component vector of float FragCoord)
|
0:? 'ff4' (layout(offset=4 ) global 4-component vector of float FragCoord)
|
||||||
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80001
|
// Generated by (magic number): 80001
|
||||||
@@ -74,6 +74,9 @@ gl_FragCoord origin is upper left
|
|||||||
Name 28 "ff3"
|
Name 28 "ff3"
|
||||||
Name 29 "ff4"
|
Name 29 "ff4"
|
||||||
Decorate 26(ff1) BuiltIn FrontFacing
|
Decorate 26(ff1) BuiltIn FrontFacing
|
||||||
|
Decorate 27(ff2) Offset 4
|
||||||
|
Decorate 28(ff3) Offset 4
|
||||||
|
Decorate 29(ff4) Offset 4
|
||||||
Decorate 29(ff4) BuiltIn FragCoord
|
Decorate 29(ff4) BuiltIn FragCoord
|
||||||
2: TypeVoid
|
2: TypeVoid
|
||||||
3: TypeFunction 2
|
3: TypeFunction 2
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ gl_FragCoord origin is upper left
|
|||||||
0:37 's2' (global structure{temp 4-component vector of float i})
|
0:37 's2' (global structure{temp 4-component vector of float i})
|
||||||
0:37 Constant:
|
0:37 Constant:
|
||||||
0:37 0 (const int)
|
0:37 0 (const int)
|
||||||
0:37 ff4: direct index for structure (temp 4-component vector of float FragCoord)
|
0:37 ff4: direct index for structure (layout(offset=4 ) temp 4-component vector of float FragCoord)
|
||||||
0:37 's4' (global structure{smooth in 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, temp bool Face ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float FragCoord ff4})
|
0:37 's4' (global structure{smooth in 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, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(offset=4 ) temp bool ff3, layout(offset=4 ) temp 4-component vector of float FragCoord ff4})
|
||||||
0:37 Constant:
|
0:37 Constant:
|
||||||
0:37 7 (const int)
|
0:37 7 (const int)
|
||||||
0:39 Branch: Return with expression
|
0:39 Branch: Return with expression
|
||||||
@@ -23,7 +23,7 @@ gl_FragCoord origin is upper left
|
|||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 's1' (global structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d})
|
0:? 's1' (global structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d})
|
||||||
0:? 's2' (global structure{temp 4-component vector of float i})
|
0:? 's2' (global structure{temp 4-component vector of float i})
|
||||||
0:? 's4' (global structure{smooth in 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, temp bool Face ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float FragCoord ff4})
|
0:? 's4' (global structure{smooth in 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, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(offset=4 ) temp bool ff3, layout(offset=4 ) temp 4-component vector of float FragCoord ff4})
|
||||||
|
|
||||||
|
|
||||||
Linked fragment stage:
|
Linked fragment stage:
|
||||||
@@ -44,8 +44,8 @@ gl_FragCoord origin is upper left
|
|||||||
0:37 's2' (global structure{temp 4-component vector of float i})
|
0:37 's2' (global structure{temp 4-component vector of float i})
|
||||||
0:37 Constant:
|
0:37 Constant:
|
||||||
0:37 0 (const int)
|
0:37 0 (const int)
|
||||||
0:37 ff4: direct index for structure (temp 4-component vector of float FragCoord)
|
0:37 ff4: direct index for structure (layout(offset=4 ) temp 4-component vector of float FragCoord)
|
||||||
0:37 's4' (global structure{smooth in 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, temp bool Face ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float FragCoord ff4})
|
0:37 's4' (global structure{smooth in 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, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(offset=4 ) temp bool ff3, layout(offset=4 ) temp 4-component vector of float FragCoord ff4})
|
||||||
0:37 Constant:
|
0:37 Constant:
|
||||||
0:37 7 (const int)
|
0:37 7 (const int)
|
||||||
0:39 Branch: Return with expression
|
0:39 Branch: Return with expression
|
||||||
@@ -53,7 +53,7 @@ gl_FragCoord origin is upper left
|
|||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 's1' (global structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d})
|
0:? 's1' (global structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d})
|
||||||
0:? 's2' (global structure{temp 4-component vector of float i})
|
0:? 's2' (global structure{temp 4-component vector of float i})
|
||||||
0:? 's4' (global structure{smooth in 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, temp bool Face ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float FragCoord ff4})
|
0:? 's4' (global structure{smooth in 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, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(offset=4 ) temp bool ff3, layout(offset=4 ) temp 4-component vector of float FragCoord ff4})
|
||||||
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80001
|
// Generated by (magic number): 80001
|
||||||
|
|||||||
@@ -13,7 +13,13 @@ cbuffer cbufName : register(b2) {
|
|||||||
|
|
||||||
tbuffer tbufName : register(b8) {
|
tbuffer tbufName : register(b8) {
|
||||||
float4 v4 : packoffset(c1);
|
float4 v4 : packoffset(c1);
|
||||||
int i4 : packoffset(c3);
|
int i4 : packoffset(c3);
|
||||||
|
float f1 : packoffset(c3.w);
|
||||||
|
float f3 : packoffset(c4.x);
|
||||||
|
float f4 : packoffset(c4.y);
|
||||||
|
float f5 : packoffset(c4.z);
|
||||||
|
float f6 : packoffset(c);
|
||||||
|
float f7;
|
||||||
};
|
};
|
||||||
|
|
||||||
float4 PixelShaderFunction(float4 input) : COLOR0
|
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
// For the date, it uses the current date (when then script is run).
|
// For the date, it uses the current date (when then script is run).
|
||||||
|
|
||||||
#define GLSLANG_REVISION "SPIRV99.1362"
|
#define GLSLANG_REVISION "SPIRV99.1362"
|
||||||
#define GLSLANG_DATE "28-Jul-2016"
|
#define GLSLANG_DATE "29-Jul-2016"
|
||||||
|
|||||||
@@ -2537,15 +2537,23 @@ void HlslGrammar::acceptPostDecls(TType& type)
|
|||||||
expected("(");
|
expected("(");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
acceptTokenClass(EHTokIdentifier);
|
HlslToken locationToken;
|
||||||
acceptTokenClass(EHTokDot);
|
if (! acceptIdentifier(locationToken)) {
|
||||||
acceptTokenClass(EHTokIdentifier);
|
expected("c[subcomponent][.component]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HlslToken componentToken;
|
||||||
|
if (acceptTokenClass(EHTokDot)) {
|
||||||
|
if (! acceptIdentifier(componentToken)) {
|
||||||
|
expected("component");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (! acceptTokenClass(EHTokRightParen)) {
|
if (! acceptTokenClass(EHTokRightParen)) {
|
||||||
expected(")");
|
expected(")");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// TODO: process the packoffset information
|
parseContext.handlePackOffset(locationToken.loc, type, *locationToken.string, componentToken.string);
|
||||||
// c1.y means component y of location slot 1
|
|
||||||
} else if (! acceptIdentifier(idToken)) {
|
} else if (! acceptIdentifier(idToken)) {
|
||||||
expected("semantic or packoffset or register");
|
expected("semantic or packoffset or register");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2134,6 +2134,46 @@ void HlslParseContext::handleSemantic(TType& type, const TString& semantic)
|
|||||||
type.getQualifier().builtIn = EbvViewportIndex;
|
type.getQualifier().builtIn = EbvViewportIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Handle seeing something like ": packoffset( c[Subcomponent][.component] )"
|
||||||
|
//
|
||||||
|
// 'location' has the "c[Subcomponent]" part.
|
||||||
|
// 'component' points to the "component" part, or nullptr if not present.
|
||||||
|
//
|
||||||
|
void HlslParseContext::handlePackOffset(const TSourceLoc& loc, TType& type, const glslang::TString& location,
|
||||||
|
const glslang::TString* component)
|
||||||
|
{
|
||||||
|
if (location.size() == 0 || location[0] != 'c') {
|
||||||
|
error(loc, "expected 'c'", "packoffset", "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (location.size() == 1)
|
||||||
|
return;
|
||||||
|
if (! isdigit(location[1])) {
|
||||||
|
error(loc, "expected number after 'c'", "packoffset", "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
type.getQualifier().layoutOffset = 16 * atoi(location.substr(1, location.size()).c_str());
|
||||||
|
if (component) {
|
||||||
|
int componentOffset = 0;
|
||||||
|
switch ((*component)[0]) {
|
||||||
|
case 'x': componentOffset = 0; break;
|
||||||
|
case 'y': componentOffset = 4; break;
|
||||||
|
case 'z': componentOffset = 8; break;
|
||||||
|
case 'w': componentOffset = 12; break;
|
||||||
|
default:
|
||||||
|
componentOffset = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (componentOffset < 0 || component->size() > 1) {
|
||||||
|
error(loc, "expected {x, y, z, w} for component", "packoffset", "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
type.getQualifier().layoutOffset += componentOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Same error message for all places assignments don't work.
|
// Same error message for all places assignments don't work.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ public:
|
|||||||
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
|
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
|
||||||
TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
|
TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
|
||||||
void handleSemantic(TType& type, const TString& semantic);
|
void handleSemantic(TType& type, const TString& semantic);
|
||||||
|
void handlePackOffset(const TSourceLoc&, TType& type, const glslang::TString& location, const glslang::TString* component);
|
||||||
|
|
||||||
TIntermAggregate* handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex, TIntermTyped* argSampler);
|
TIntermAggregate* handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex, TIntermTyped* argSampler);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user