HLSL: add 2DMS texture formats, and matching Load / GetDimensions support

This commit is contained in:
steve-lunarg 2016-07-26 15:19:28 -06:00
parent 8c8505c604
commit 1e19d90043
9 changed files with 2161 additions and 634 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,340 @@
hlsl.load.2dms.dx10.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:57 Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:28 Function Parameters:
0:? Sequence
0:32 textureFetch (global 4-component vector of float)
0:32 'g_tTex2dmsf4' (uniform texture2DMS)
0:32 'c2' (uniform 2-component vector of int)
0:32 Constant:
0:32 3 (const int)
0:33 textureFetch (global 4-component vector of int)
0:33 'g_tTex2dmsi4' (uniform itexture2DMS)
0:33 'c2' (uniform 2-component vector of int)
0:33 Constant:
0:33 3 (const int)
0:34 textureFetch (global 4-component vector of uint)
0:34 'g_tTex2dmsu4' (uniform utexture2DMS)
0:34 'c2' (uniform 2-component vector of int)
0:34 Constant:
0:34 3 (const int)
0:37 textureFetchOffset (global 4-component vector of float)
0:37 'g_tTex2dmsf4' (uniform texture2DMS)
0:37 'c2' (uniform 2-component vector of int)
0:37 Constant:
0:37 3 (const int)
0:37 'o2' (uniform 2-component vector of int)
0:38 textureFetchOffset (global 4-component vector of int)
0:38 'g_tTex2dmsi4' (uniform itexture2DMS)
0:38 'c2' (uniform 2-component vector of int)
0:38 Constant:
0:38 3 (const int)
0:38 'o2' (uniform 2-component vector of int)
0:39 textureFetchOffset (global 4-component vector of uint)
0:39 'g_tTex2dmsu4' (uniform utexture2DMS)
0:39 'c2' (uniform 2-component vector of int)
0:39 Constant:
0:39 3 (const int)
0:39 'o2' (uniform 2-component vector of int)
0:42 textureFetch (global 4-component vector of float)
0:42 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:42 'c3' (uniform 3-component vector of int)
0:42 Constant:
0:42 3 (const int)
0:43 textureFetch (global 4-component vector of int)
0:43 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:43 'c3' (uniform 3-component vector of int)
0:43 Constant:
0:43 3 (const int)
0:44 textureFetch (global 4-component vector of uint)
0:44 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:44 'c3' (uniform 3-component vector of int)
0:44 Constant:
0:44 3 (const int)
0:47 textureFetchOffset (global 4-component vector of float)
0:47 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:47 'c3' (uniform 3-component vector of int)
0:47 Constant:
0:47 3 (const int)
0:47 'o2' (uniform 2-component vector of int)
0:48 textureFetchOffset (global 4-component vector of int)
0:48 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:48 'c3' (uniform 3-component vector of int)
0:48 Constant:
0:48 3 (const int)
0:48 'o2' (uniform 2-component vector of int)
0:49 textureFetchOffset (global 4-component vector of uint)
0:49 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:49 'c3' (uniform 3-component vector of int)
0:49 Constant:
0:49 3 (const int)
0:49 'o2' (uniform 2-component vector of int)
0:52 move second child to first child (temp float)
0:52 Depth: direct index for structure (temp float FragDepth)
0:52 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:52 Constant:
0:52 1 (const int)
0:52 Constant:
0:52 1.000000
0:54 Branch: Return with expression
0:54 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Linker Objects
0:? 'g_sSamp' (uniform sampler)
0:? 'g_tTex2dmsf4' (uniform texture2DMS)
0:? 'g_tTex2dmsi4' (uniform itexture2DMS)
0:? 'g_tTex2dmsu4' (uniform utexture2DMS)
0:? 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:? 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:? 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:? 'c1' (uniform int)
0:? 'c2' (uniform 2-component vector of int)
0:? 'c3' (uniform 3-component vector of int)
0:? 'c4' (uniform 4-component vector of int)
0:? 'o1' (uniform int)
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:57 Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:28 Function Parameters:
0:? Sequence
0:32 textureFetch (global 4-component vector of float)
0:32 'g_tTex2dmsf4' (uniform texture2DMS)
0:32 'c2' (uniform 2-component vector of int)
0:32 Constant:
0:32 3 (const int)
0:33 textureFetch (global 4-component vector of int)
0:33 'g_tTex2dmsi4' (uniform itexture2DMS)
0:33 'c2' (uniform 2-component vector of int)
0:33 Constant:
0:33 3 (const int)
0:34 textureFetch (global 4-component vector of uint)
0:34 'g_tTex2dmsu4' (uniform utexture2DMS)
0:34 'c2' (uniform 2-component vector of int)
0:34 Constant:
0:34 3 (const int)
0:37 textureFetchOffset (global 4-component vector of float)
0:37 'g_tTex2dmsf4' (uniform texture2DMS)
0:37 'c2' (uniform 2-component vector of int)
0:37 Constant:
0:37 3 (const int)
0:37 'o2' (uniform 2-component vector of int)
0:38 textureFetchOffset (global 4-component vector of int)
0:38 'g_tTex2dmsi4' (uniform itexture2DMS)
0:38 'c2' (uniform 2-component vector of int)
0:38 Constant:
0:38 3 (const int)
0:38 'o2' (uniform 2-component vector of int)
0:39 textureFetchOffset (global 4-component vector of uint)
0:39 'g_tTex2dmsu4' (uniform utexture2DMS)
0:39 'c2' (uniform 2-component vector of int)
0:39 Constant:
0:39 3 (const int)
0:39 'o2' (uniform 2-component vector of int)
0:42 textureFetch (global 4-component vector of float)
0:42 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:42 'c3' (uniform 3-component vector of int)
0:42 Constant:
0:42 3 (const int)
0:43 textureFetch (global 4-component vector of int)
0:43 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:43 'c3' (uniform 3-component vector of int)
0:43 Constant:
0:43 3 (const int)
0:44 textureFetch (global 4-component vector of uint)
0:44 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:44 'c3' (uniform 3-component vector of int)
0:44 Constant:
0:44 3 (const int)
0:47 textureFetchOffset (global 4-component vector of float)
0:47 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:47 'c3' (uniform 3-component vector of int)
0:47 Constant:
0:47 3 (const int)
0:47 'o2' (uniform 2-component vector of int)
0:48 textureFetchOffset (global 4-component vector of int)
0:48 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:48 'c3' (uniform 3-component vector of int)
0:48 Constant:
0:48 3 (const int)
0:48 'o2' (uniform 2-component vector of int)
0:49 textureFetchOffset (global 4-component vector of uint)
0:49 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:49 'c3' (uniform 3-component vector of int)
0:49 Constant:
0:49 3 (const int)
0:49 'o2' (uniform 2-component vector of int)
0:52 move second child to first child (temp float)
0:52 Depth: direct index for structure (temp float FragDepth)
0:52 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:52 Constant:
0:52 1 (const int)
0:52 Constant:
0:52 1.000000
0:54 Branch: Return with expression
0:54 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Linker Objects
0:? 'g_sSamp' (uniform sampler)
0:? 'g_tTex2dmsf4' (uniform texture2DMS)
0:? 'g_tTex2dmsi4' (uniform itexture2DMS)
0:? 'g_tTex2dmsu4' (uniform utexture2DMS)
0:? 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:? 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:? 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:? 'c1' (uniform int)
0:? 'c2' (uniform 2-component vector of int)
0:? 'c3' (uniform 3-component vector of int)
0:? 'c4' (uniform 4-component vector of int)
0:? 'o1' (uniform int)
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 99
Capability Shader
Capability ImageGatherExtended
Capability ImageMSArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source HLSL 450
Name 4 "main"
Name 9 "g_tTex2dmsf4"
Name 14 "c2"
Name 21 "g_tTex2dmsi4"
Name 29 "g_tTex2dmsu4"
Name 36 "o2"
Name 49 "g_tTex2dmsf4a"
Name 53 "c3"
Name 58 "g_tTex2dmsi4a"
Name 64 "g_tTex2dmsu4a"
Name 80 "PS_OUTPUT"
MemberName 80(PS_OUTPUT) 0 "Color"
MemberName 80(PS_OUTPUT) 1 "Depth"
Name 82 "psout"
Name 91 "g_sSamp"
Name 93 "c1"
Name 95 "c4"
Name 96 "o1"
Name 97 "o3"
Name 98 "o4"
Decorate 9(g_tTex2dmsf4) DescriptorSet 0
Decorate 21(g_tTex2dmsi4) DescriptorSet 0
Decorate 29(g_tTex2dmsu4) DescriptorSet 0
Decorate 49(g_tTex2dmsf4a) DescriptorSet 0
Decorate 58(g_tTex2dmsi4a) DescriptorSet 0
Decorate 64(g_tTex2dmsu4a) DescriptorSet 0
MemberDecorate 80(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 91(g_sSamp) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D multi-sampled sampled format:Unknown
8: TypePointer UniformConstant 7
9(g_tTex2dmsf4): 8(ptr) Variable UniformConstant
11: TypeInt 32 1
12: TypeVector 11(int) 2
13: TypePointer UniformConstant 12(ivec2)
14(c2): 13(ptr) Variable UniformConstant
16: 11(int) Constant 3
17: TypeVector 6(float) 4
19: TypeImage 11(int) 2D multi-sampled sampled format:Unknown
20: TypePointer UniformConstant 19
21(g_tTex2dmsi4): 20(ptr) Variable UniformConstant
24: TypeVector 11(int) 4
26: TypeInt 32 0
27: TypeImage 26(int) 2D multi-sampled sampled format:Unknown
28: TypePointer UniformConstant 27
29(g_tTex2dmsu4): 28(ptr) Variable UniformConstant
32: TypeVector 26(int) 4
36(o2): 13(ptr) Variable UniformConstant
47: TypeImage 6(float) 2D array multi-sampled sampled format:Unknown
48: TypePointer UniformConstant 47
49(g_tTex2dmsf4a): 48(ptr) Variable UniformConstant
51: TypeVector 11(int) 3
52: TypePointer UniformConstant 51(ivec3)
53(c3): 52(ptr) Variable UniformConstant
56: TypeImage 11(int) 2D array multi-sampled sampled format:Unknown
57: TypePointer UniformConstant 56
58(g_tTex2dmsi4a): 57(ptr) Variable UniformConstant
62: TypeImage 26(int) 2D array multi-sampled sampled format:Unknown
63: TypePointer UniformConstant 62
64(g_tTex2dmsu4a): 63(ptr) Variable UniformConstant
80(PS_OUTPUT): TypeStruct 17(fvec4) 6(float)
81: TypePointer Function 80(PS_OUTPUT)
83: 11(int) Constant 1
84: 6(float) Constant 1065353216
85: TypePointer Function 6(float)
89: TypeSampler
90: TypePointer UniformConstant 89
91(g_sSamp): 90(ptr) Variable UniformConstant
92: TypePointer UniformConstant 11(int)
93(c1): 92(ptr) Variable UniformConstant
94: TypePointer UniformConstant 24(ivec4)
95(c4): 94(ptr) Variable UniformConstant
96(o1): 92(ptr) Variable UniformConstant
97(o3): 52(ptr) Variable UniformConstant
98(o4): 94(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
82(psout): 81(ptr) Variable Function
10: 7 Load 9(g_tTex2dmsf4)
15: 12(ivec2) Load 14(c2)
18: 17(fvec4) ImageFetch 10 15 Sample 16
22: 19 Load 21(g_tTex2dmsi4)
23: 12(ivec2) Load 14(c2)
25: 24(ivec4) ImageFetch 22 23 Sample 16
30: 27 Load 29(g_tTex2dmsu4)
31: 12(ivec2) Load 14(c2)
33: 32(ivec4) ImageFetch 30 31 Sample 16
34: 7 Load 9(g_tTex2dmsf4)
35: 12(ivec2) Load 14(c2)
37: 12(ivec2) Load 36(o2)
38: 17(fvec4) ImageFetch 34 35 Offset Sample 37 16
39: 19 Load 21(g_tTex2dmsi4)
40: 12(ivec2) Load 14(c2)
41: 12(ivec2) Load 36(o2)
42: 24(ivec4) ImageFetch 39 40 Offset Sample 41 16
43: 27 Load 29(g_tTex2dmsu4)
44: 12(ivec2) Load 14(c2)
45: 12(ivec2) Load 36(o2)
46: 32(ivec4) ImageFetch 43 44 Offset Sample 45 16
50: 47 Load 49(g_tTex2dmsf4a)
54: 51(ivec3) Load 53(c3)
55: 17(fvec4) ImageFetch 50 54 Sample 16
59: 56 Load 58(g_tTex2dmsi4a)
60: 51(ivec3) Load 53(c3)
61: 24(ivec4) ImageFetch 59 60 Sample 16
65: 62 Load 64(g_tTex2dmsu4a)
66: 51(ivec3) Load 53(c3)
67: 32(ivec4) ImageFetch 65 66 Sample 16
68: 47 Load 49(g_tTex2dmsf4a)
69: 51(ivec3) Load 53(c3)
70: 12(ivec2) Load 36(o2)
71: 17(fvec4) ImageFetch 68 69 Offset Sample 70 16
72: 56 Load 58(g_tTex2dmsi4a)
73: 51(ivec3) Load 53(c3)
74: 12(ivec2) Load 36(o2)
75: 24(ivec4) ImageFetch 72 73 Offset Sample 74 16
76: 62 Load 64(g_tTex2dmsu4a)
77: 51(ivec3) Load 53(c3)
78: 12(ivec2) Load 36(o2)
79: 32(ivec4) ImageFetch 76 77 Offset Sample 78 16
86: 85(ptr) AccessChain 82(psout) 83
Store 86 84
87:80(PS_OUTPUT) Load 82(psout)
ReturnValue 87
FunctionEnd

View File

@ -0,0 +1,565 @@
hlsl.load.basic.dx10.vert
Shader version: 450
0:? Sequence
0:71 Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
0:47 Function Parameters:
0:? Sequence
0:51 textureFetch (global 4-component vector of float)
0:51 'g_tTex1df4' (uniform texture1D)
0:51 vector swizzle (temp int)
0:51 'c2' (uniform 2-component vector of int)
0:51 Sequence
0:51 Constant:
0:51 0 (const int)
0:51 direct index (temp int)
0:51 'c2' (uniform 2-component vector of int)
0:51 Constant:
0:51 1 (const int)
0:52 textureFetch (global 4-component vector of int)
0:52 'g_tTex1di4' (uniform itexture1D)
0:52 vector swizzle (temp int)
0:52 'c2' (uniform 2-component vector of int)
0:52 Sequence
0:52 Constant:
0:52 0 (const int)
0:52 direct index (temp int)
0:52 'c2' (uniform 2-component vector of int)
0:52 Constant:
0:52 1 (const int)
0:53 textureFetch (global 4-component vector of uint)
0:53 'g_tTex1du4' (uniform utexture1D)
0:53 vector swizzle (temp int)
0:53 'c2' (uniform 2-component vector of int)
0:53 Sequence
0:53 Constant:
0:53 0 (const int)
0:53 direct index (temp int)
0:53 'c2' (uniform 2-component vector of int)
0:53 Constant:
0:53 1 (const int)
0:56 textureFetch (global 4-component vector of float)
0:56 'g_tTex2df4' (uniform texture2D)
0:56 vector swizzle (temp 2-component vector of int)
0:56 'c3' (uniform 3-component vector of int)
0:56 Sequence
0:56 Constant:
0:56 0 (const int)
0:56 Constant:
0:56 1 (const int)
0:56 direct index (temp int)
0:56 'c3' (uniform 3-component vector of int)
0:56 Constant:
0:56 2 (const int)
0:57 textureFetch (global 4-component vector of int)
0:57 'g_tTex2di4' (uniform itexture2D)
0:57 vector swizzle (temp 2-component vector of int)
0:57 'c3' (uniform 3-component vector of int)
0:57 Sequence
0:57 Constant:
0:57 0 (const int)
0:57 Constant:
0:57 1 (const int)
0:57 direct index (temp int)
0:57 'c3' (uniform 3-component vector of int)
0:57 Constant:
0:57 2 (const int)
0:58 textureFetch (global 4-component vector of uint)
0:58 'g_tTex2du4' (uniform utexture2D)
0:58 vector swizzle (temp 2-component vector of int)
0:58 'c3' (uniform 3-component vector of int)
0:58 Sequence
0:58 Constant:
0:58 0 (const int)
0:58 Constant:
0:58 1 (const int)
0:58 direct index (temp int)
0:58 'c3' (uniform 3-component vector of int)
0:58 Constant:
0:58 2 (const int)
0:61 textureFetch (global 4-component vector of float)
0:61 'g_tTex3df4' (uniform texture3D)
0:61 vector swizzle (temp 3-component vector of int)
0:61 'c4' (uniform 4-component vector of int)
0:61 Sequence
0:61 Constant:
0:61 0 (const int)
0:61 Constant:
0:61 1 (const int)
0:61 Constant:
0:61 2 (const int)
0:61 direct index (temp int)
0:61 'c4' (uniform 4-component vector of int)
0:61 Constant:
0:61 3 (const int)
0:62 textureFetch (global 4-component vector of int)
0:62 'g_tTex3di4' (uniform itexture3D)
0:62 vector swizzle (temp 3-component vector of int)
0:62 'c4' (uniform 4-component vector of int)
0:62 Sequence
0:62 Constant:
0:62 0 (const int)
0:62 Constant:
0:62 1 (const int)
0:62 Constant:
0:62 2 (const int)
0:62 direct index (temp int)
0:62 'c4' (uniform 4-component vector of int)
0:62 Constant:
0:62 3 (const int)
0:63 textureFetch (global 4-component vector of uint)
0:63 'g_tTex3du4' (uniform utexture3D)
0:63 vector swizzle (temp 3-component vector of int)
0:63 'c4' (uniform 4-component vector of int)
0:63 Sequence
0:63 Constant:
0:63 0 (const int)
0:63 Constant:
0:63 1 (const int)
0:63 Constant:
0:63 2 (const int)
0:63 direct index (temp int)
0:63 'c4' (uniform 4-component vector of int)
0:63 Constant:
0:63 3 (const int)
0:67 move second child to first child (temp 4-component vector of float)
0:67 Pos: direct index for structure (temp 4-component vector of float FragCoord)
0:67 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:67 Constant:
0:67 0 (const int)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:69 Branch: Return with expression
0:69 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:? Linker Objects
0:? 'g_sSamp' (uniform sampler)
0:? 'g_tTex1df4' (uniform texture1D)
0:? 'g_tTex1di4' (uniform itexture1D)
0:? 'g_tTex1du4' (uniform utexture1D)
0:? 'g_tTex2df4' (uniform texture2D)
0:? 'g_tTex2di4' (uniform itexture2D)
0:? 'g_tTex2du4' (uniform utexture2D)
0:? 'g_tTex3df4' (uniform texture3D)
0:? 'g_tTex3di4' (uniform itexture3D)
0:? 'g_tTex3du4' (uniform utexture3D)
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'g_tTex1df4a' (uniform texture1DArray)
0:? 'g_tTex1di4a' (uniform itexture1DArray)
0:? 'g_tTex1du4a' (uniform utexture1DArray)
0:? 'g_tTex2df4a' (uniform texture2DArray)
0:? 'g_tTex2di4a' (uniform itexture2DArray)
0:? 'g_tTex2du4a' (uniform utexture2DArray)
0:? 'g_tTexcdf4a' (uniform textureCubeArray)
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
0:? 'c1' (uniform int)
0:? 'c2' (uniform 2-component vector of int)
0:? 'c3' (uniform 3-component vector of int)
0:? 'c4' (uniform 4-component vector of int)
0:? 'o1' (uniform int)
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
Linked vertex stage:
Shader version: 450
0:? Sequence
0:71 Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
0:47 Function Parameters:
0:? Sequence
0:51 textureFetch (global 4-component vector of float)
0:51 'g_tTex1df4' (uniform texture1D)
0:51 vector swizzle (temp int)
0:51 'c2' (uniform 2-component vector of int)
0:51 Sequence
0:51 Constant:
0:51 0 (const int)
0:51 direct index (temp int)
0:51 'c2' (uniform 2-component vector of int)
0:51 Constant:
0:51 1 (const int)
0:52 textureFetch (global 4-component vector of int)
0:52 'g_tTex1di4' (uniform itexture1D)
0:52 vector swizzle (temp int)
0:52 'c2' (uniform 2-component vector of int)
0:52 Sequence
0:52 Constant:
0:52 0 (const int)
0:52 direct index (temp int)
0:52 'c2' (uniform 2-component vector of int)
0:52 Constant:
0:52 1 (const int)
0:53 textureFetch (global 4-component vector of uint)
0:53 'g_tTex1du4' (uniform utexture1D)
0:53 vector swizzle (temp int)
0:53 'c2' (uniform 2-component vector of int)
0:53 Sequence
0:53 Constant:
0:53 0 (const int)
0:53 direct index (temp int)
0:53 'c2' (uniform 2-component vector of int)
0:53 Constant:
0:53 1 (const int)
0:56 textureFetch (global 4-component vector of float)
0:56 'g_tTex2df4' (uniform texture2D)
0:56 vector swizzle (temp 2-component vector of int)
0:56 'c3' (uniform 3-component vector of int)
0:56 Sequence
0:56 Constant:
0:56 0 (const int)
0:56 Constant:
0:56 1 (const int)
0:56 direct index (temp int)
0:56 'c3' (uniform 3-component vector of int)
0:56 Constant:
0:56 2 (const int)
0:57 textureFetch (global 4-component vector of int)
0:57 'g_tTex2di4' (uniform itexture2D)
0:57 vector swizzle (temp 2-component vector of int)
0:57 'c3' (uniform 3-component vector of int)
0:57 Sequence
0:57 Constant:
0:57 0 (const int)
0:57 Constant:
0:57 1 (const int)
0:57 direct index (temp int)
0:57 'c3' (uniform 3-component vector of int)
0:57 Constant:
0:57 2 (const int)
0:58 textureFetch (global 4-component vector of uint)
0:58 'g_tTex2du4' (uniform utexture2D)
0:58 vector swizzle (temp 2-component vector of int)
0:58 'c3' (uniform 3-component vector of int)
0:58 Sequence
0:58 Constant:
0:58 0 (const int)
0:58 Constant:
0:58 1 (const int)
0:58 direct index (temp int)
0:58 'c3' (uniform 3-component vector of int)
0:58 Constant:
0:58 2 (const int)
0:61 textureFetch (global 4-component vector of float)
0:61 'g_tTex3df4' (uniform texture3D)
0:61 vector swizzle (temp 3-component vector of int)
0:61 'c4' (uniform 4-component vector of int)
0:61 Sequence
0:61 Constant:
0:61 0 (const int)
0:61 Constant:
0:61 1 (const int)
0:61 Constant:
0:61 2 (const int)
0:61 direct index (temp int)
0:61 'c4' (uniform 4-component vector of int)
0:61 Constant:
0:61 3 (const int)
0:62 textureFetch (global 4-component vector of int)
0:62 'g_tTex3di4' (uniform itexture3D)
0:62 vector swizzle (temp 3-component vector of int)
0:62 'c4' (uniform 4-component vector of int)
0:62 Sequence
0:62 Constant:
0:62 0 (const int)
0:62 Constant:
0:62 1 (const int)
0:62 Constant:
0:62 2 (const int)
0:62 direct index (temp int)
0:62 'c4' (uniform 4-component vector of int)
0:62 Constant:
0:62 3 (const int)
0:63 textureFetch (global 4-component vector of uint)
0:63 'g_tTex3du4' (uniform utexture3D)
0:63 vector swizzle (temp 3-component vector of int)
0:63 'c4' (uniform 4-component vector of int)
0:63 Sequence
0:63 Constant:
0:63 0 (const int)
0:63 Constant:
0:63 1 (const int)
0:63 Constant:
0:63 2 (const int)
0:63 direct index (temp int)
0:63 'c4' (uniform 4-component vector of int)
0:63 Constant:
0:63 3 (const int)
0:67 move second child to first child (temp 4-component vector of float)
0:67 Pos: direct index for structure (temp 4-component vector of float FragCoord)
0:67 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:67 Constant:
0:67 0 (const int)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:69 Branch: Return with expression
0:69 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:? Linker Objects
0:? 'g_sSamp' (uniform sampler)
0:? 'g_tTex1df4' (uniform texture1D)
0:? 'g_tTex1di4' (uniform itexture1D)
0:? 'g_tTex1du4' (uniform utexture1D)
0:? 'g_tTex2df4' (uniform texture2D)
0:? 'g_tTex2di4' (uniform itexture2D)
0:? 'g_tTex2du4' (uniform utexture2D)
0:? 'g_tTex3df4' (uniform texture3D)
0:? 'g_tTex3di4' (uniform itexture3D)
0:? 'g_tTex3du4' (uniform utexture3D)
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'g_tTex1df4a' (uniform texture1DArray)
0:? 'g_tTex1di4a' (uniform itexture1DArray)
0:? 'g_tTex1du4a' (uniform utexture1DArray)
0:? 'g_tTex2df4a' (uniform texture2DArray)
0:? 'g_tTex2di4a' (uniform itexture2DArray)
0:? 'g_tTex2du4a' (uniform utexture2DArray)
0:? 'g_tTexcdf4a' (uniform textureCubeArray)
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
0:? 'c1' (uniform int)
0:? 'c2' (uniform 2-component vector of int)
0:? 'c3' (uniform 3-component vector of int)
0:? 'c4' (uniform 4-component vector of int)
0:? 'o1' (uniform int)
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 160
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
Source HLSL 450
Name 4 "main"
Name 9 "g_tTex1df4"
Name 14 "c2"
Name 27 "g_tTex1di4"
Name 37 "g_tTex1du4"
Name 47 "g_tTex2df4"
Name 51 "c3"
Name 60 "g_tTex2di4"
Name 69 "g_tTex2du4"
Name 78 "g_tTex3df4"
Name 81 "c4"
Name 90 "g_tTex3di4"
Name 99 "g_tTex3du4"
Name 106 "VS_OUTPUT"
MemberName 106(VS_OUTPUT) 0 "Pos"
Name 108 "vsout"
Name 118 "g_sSamp"
Name 121 "g_tTexcdf4"
Name 124 "g_tTexcdi4"
Name 127 "g_tTexcdu4"
Name 130 "g_tTex1df4a"
Name 133 "g_tTex1di4a"
Name 136 "g_tTex1du4a"
Name 139 "g_tTex2df4a"
Name 142 "g_tTex2di4a"
Name 145 "g_tTex2du4a"
Name 148 "g_tTexcdf4a"
Name 151 "g_tTexcdi4a"
Name 154 "g_tTexcdu4a"
Name 155 "c1"
Name 156 "o1"
Name 157 "o2"
Name 158 "o3"
Name 159 "o4"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 27(g_tTex1di4) DescriptorSet 0
Decorate 37(g_tTex1du4) DescriptorSet 0
Decorate 47(g_tTex2df4) DescriptorSet 0
Decorate 60(g_tTex2di4) DescriptorSet 0
Decorate 69(g_tTex2du4) DescriptorSet 0
Decorate 78(g_tTex3df4) DescriptorSet 0
Decorate 90(g_tTex3di4) DescriptorSet 0
Decorate 99(g_tTex3du4) DescriptorSet 0
MemberDecorate 106(VS_OUTPUT) 0 BuiltIn FragCoord
Decorate 118(g_sSamp) DescriptorSet 0
Decorate 121(g_tTexcdf4) DescriptorSet 0
Decorate 124(g_tTexcdi4) DescriptorSet 0
Decorate 127(g_tTexcdu4) DescriptorSet 0
Decorate 130(g_tTex1df4a) DescriptorSet 0
Decorate 133(g_tTex1di4a) DescriptorSet 0
Decorate 136(g_tTex1du4a) DescriptorSet 0
Decorate 139(g_tTex2df4a) DescriptorSet 0
Decorate 142(g_tTex2di4a) DescriptorSet 0
Decorate 145(g_tTex2du4a) DescriptorSet 0
Decorate 148(g_tTexcdf4a) DescriptorSet 0
Decorate 151(g_tTexcdi4a) DescriptorSet 0
Decorate 154(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 1D sampled format:Unknown
8: TypePointer UniformConstant 7
9(g_tTex1df4): 8(ptr) Variable UniformConstant
11: TypeInt 32 1
12: TypeVector 11(int) 2
13: TypePointer UniformConstant 12(ivec2)
14(c2): 13(ptr) Variable UniformConstant
15: TypeInt 32 0
16: 15(int) Constant 0
17: TypePointer UniformConstant 11(int)
20: 15(int) Constant 1
23: TypeVector 6(float) 4
25: TypeImage 11(int) 1D sampled format:Unknown
26: TypePointer UniformConstant 25
27(g_tTex1di4): 26(ptr) Variable UniformConstant
33: TypeVector 11(int) 4
35: TypeImage 15(int) 1D sampled format:Unknown
36: TypePointer UniformConstant 35
37(g_tTex1du4): 36(ptr) Variable UniformConstant
43: TypeVector 15(int) 4
45: TypeImage 6(float) 2D sampled format:Unknown
46: TypePointer UniformConstant 45
47(g_tTex2df4): 46(ptr) Variable UniformConstant
49: TypeVector 11(int) 3
50: TypePointer UniformConstant 49(ivec3)
51(c3): 50(ptr) Variable UniformConstant
54: 15(int) Constant 2
58: TypeImage 11(int) 2D sampled format:Unknown
59: TypePointer UniformConstant 58
60(g_tTex2di4): 59(ptr) Variable UniformConstant
67: TypeImage 15(int) 2D sampled format:Unknown
68: TypePointer UniformConstant 67
69(g_tTex2du4): 68(ptr) Variable UniformConstant
76: TypeImage 6(float) 3D sampled format:Unknown
77: TypePointer UniformConstant 76
78(g_tTex3df4): 77(ptr) Variable UniformConstant
80: TypePointer UniformConstant 33(ivec4)
81(c4): 80(ptr) Variable UniformConstant
84: 15(int) Constant 3
88: TypeImage 11(int) 3D sampled format:Unknown
89: TypePointer UniformConstant 88
90(g_tTex3di4): 89(ptr) Variable UniformConstant
97: TypeImage 15(int) 3D sampled format:Unknown
98: TypePointer UniformConstant 97
99(g_tTex3du4): 98(ptr) Variable UniformConstant
106(VS_OUTPUT): TypeStruct 23(fvec4)
107: TypePointer Function 106(VS_OUTPUT)
109: 11(int) Constant 0
110: 6(float) Constant 0
111: 23(fvec4) ConstantComposite 110 110 110 110
112: TypePointer Function 23(fvec4)
116: TypeSampler
117: TypePointer UniformConstant 116
118(g_sSamp): 117(ptr) Variable UniformConstant
119: TypeImage 6(float) Cube sampled format:Unknown
120: TypePointer UniformConstant 119
121(g_tTexcdf4): 120(ptr) Variable UniformConstant
122: TypeImage 11(int) Cube sampled format:Unknown
123: TypePointer UniformConstant 122
124(g_tTexcdi4): 123(ptr) Variable UniformConstant
125: TypeImage 15(int) Cube sampled format:Unknown
126: TypePointer UniformConstant 125
127(g_tTexcdu4): 126(ptr) Variable UniformConstant
128: TypeImage 6(float) 1D array sampled format:Unknown
129: TypePointer UniformConstant 128
130(g_tTex1df4a): 129(ptr) Variable UniformConstant
131: TypeImage 11(int) 1D array sampled format:Unknown
132: TypePointer UniformConstant 131
133(g_tTex1di4a): 132(ptr) Variable UniformConstant
134: TypeImage 15(int) 1D array sampled format:Unknown
135: TypePointer UniformConstant 134
136(g_tTex1du4a): 135(ptr) Variable UniformConstant
137: TypeImage 6(float) 2D array sampled format:Unknown
138: TypePointer UniformConstant 137
139(g_tTex2df4a): 138(ptr) Variable UniformConstant
140: TypeImage 11(int) 2D array sampled format:Unknown
141: TypePointer UniformConstant 140
142(g_tTex2di4a): 141(ptr) Variable UniformConstant
143: TypeImage 15(int) 2D array sampled format:Unknown
144: TypePointer UniformConstant 143
145(g_tTex2du4a): 144(ptr) Variable UniformConstant
146: TypeImage 6(float) Cube array sampled format:Unknown
147: TypePointer UniformConstant 146
148(g_tTexcdf4a): 147(ptr) Variable UniformConstant
149: TypeImage 11(int) Cube array sampled format:Unknown
150: TypePointer UniformConstant 149
151(g_tTexcdi4a): 150(ptr) Variable UniformConstant
152: TypeImage 15(int) Cube array sampled format:Unknown
153: TypePointer UniformConstant 152
154(g_tTexcdu4a): 153(ptr) Variable UniformConstant
155(c1): 17(ptr) Variable UniformConstant
156(o1): 17(ptr) Variable UniformConstant
157(o2): 13(ptr) Variable UniformConstant
158(o3): 50(ptr) Variable UniformConstant
159(o4): 80(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
108(vsout): 107(ptr) Variable Function
10: 7 Load 9(g_tTex1df4)
18: 17(ptr) AccessChain 14(c2) 16
19: 11(int) Load 18
21: 17(ptr) AccessChain 14(c2) 20
22: 11(int) Load 21
24: 23(fvec4) ImageFetch 10 19 Lod 22
28: 25 Load 27(g_tTex1di4)
29: 17(ptr) AccessChain 14(c2) 16
30: 11(int) Load 29
31: 17(ptr) AccessChain 14(c2) 20
32: 11(int) Load 31
34: 33(ivec4) ImageFetch 28 30 Lod 32
38: 35 Load 37(g_tTex1du4)
39: 17(ptr) AccessChain 14(c2) 16
40: 11(int) Load 39
41: 17(ptr) AccessChain 14(c2) 20
42: 11(int) Load 41
44: 43(ivec4) ImageFetch 38 40 Lod 42
48: 45 Load 47(g_tTex2df4)
52: 49(ivec3) Load 51(c3)
53: 12(ivec2) VectorShuffle 52 52 0 1
55: 17(ptr) AccessChain 51(c3) 54
56: 11(int) Load 55
57: 23(fvec4) ImageFetch 48 53 Lod 56
61: 58 Load 60(g_tTex2di4)
62: 49(ivec3) Load 51(c3)
63: 12(ivec2) VectorShuffle 62 62 0 1
64: 17(ptr) AccessChain 51(c3) 54
65: 11(int) Load 64
66: 33(ivec4) ImageFetch 61 63 Lod 65
70: 67 Load 69(g_tTex2du4)
71: 49(ivec3) Load 51(c3)
72: 12(ivec2) VectorShuffle 71 71 0 1
73: 17(ptr) AccessChain 51(c3) 54
74: 11(int) Load 73
75: 43(ivec4) ImageFetch 70 72 Lod 74
79: 76 Load 78(g_tTex3df4)
82: 33(ivec4) Load 81(c4)
83: 49(ivec3) VectorShuffle 82 82 0 1 2
85: 17(ptr) AccessChain 81(c4) 84
86: 11(int) Load 85
87: 23(fvec4) ImageFetch 79 83 Lod 86
91: 88 Load 90(g_tTex3di4)
92: 33(ivec4) Load 81(c4)
93: 49(ivec3) VectorShuffle 92 92 0 1 2
94: 17(ptr) AccessChain 81(c4) 84
95: 11(int) Load 94
96: 33(ivec4) ImageFetch 91 93 Lod 95
100: 97 Load 99(g_tTex3du4)
101: 33(ivec4) Load 81(c4)
102: 49(ivec3) VectorShuffle 101 101 0 1 2
103: 17(ptr) AccessChain 81(c4) 84
104: 11(int) Load 103
105: 43(ivec4) ImageFetch 100 102 Lod 104
113: 112(ptr) AccessChain 108(vsout) 109
Store 113 111
114:106(VS_OUTPUT) Load 108(vsout)
ReturnValue 114
FunctionEnd

View File

@ -28,6 +28,14 @@ TextureCubeArray <float4> g_tTexcdf4a;
TextureCubeArray <int4> g_tTexcdi4a;
TextureCubeArray <uint4> g_tTexcdu4a;
Texture2DMS <float4> g_tTex2dmsf4;
Texture2DMS <int4> g_tTex2dmsi4;
Texture2DMS <uint4> g_tTex2dmsu4;
Texture2DMSArray <float4> g_tTex2dmsf4a;
Texture2DMSArray <int4> g_tTex2dmsi4a;
Texture2DMSArray <uint4> g_tTex2dmsu4a;
struct PS_OUTPUT
{
float4 Color : SV_Target0;
@ -137,6 +145,23 @@ PS_OUTPUT main()
g_tTexcdu4a . GetDimensions(WidthU, HeightU, ElementsU);
g_tTexcdu4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
// 2DMS, float tx, uint params
g_tTex2dmsf4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
// 2DMS, int tx, uint params
g_tTex2dmsi4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
// 2DMS, uint tx, uint params
g_tTex2dmsu4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
// 2DMSArray, float tx, uint params
g_tTex2dmsf4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
// 2DMSArray, int tx, uint params
g_tTex2dmsi4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
// 2DMSArray, uint tx, uint params
g_tTex2dmsu4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
// TODO: ***************************************************
// Change this to 1 to enable float overloads when the HLSL
@ -228,6 +253,24 @@ PS_OUTPUT main()
// Cubearray, uint, float params
g_tTexcdu4a . GetDimensions(WidthF, HeightF, ElementsF);
g_tTexcdu4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
// 2DMS, float tx, uint params
g_tTex2dmsf4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
// 2DMS, int tx, uint params
g_tTex2dmsi4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
// 2DMS, uint tx, uint params
g_tTex2dmsu4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
// 2DMSArray, float tx, uint params
g_tTex2dmsf4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
// 2DMSArray, int tx, uint params
g_tTex2dmsi4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
// 2DMSArray, uint tx, uint params
g_tTex2dmsu4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
#endif // OVERLOAD_FIX
psout.Color = 1.0;

View File

@ -0,0 +1,56 @@
SamplerState g_sSamp : register(s0);
Texture2DMS <float4> g_tTex2dmsf4;
Texture2DMS <int4> g_tTex2dmsi4;
Texture2DMS <uint4> g_tTex2dmsu4;
Texture2DMSArray <float4> g_tTex2dmsf4a;
Texture2DMSArray <int4> g_tTex2dmsi4a;
Texture2DMSArray <uint4> g_tTex2dmsu4a;
struct PS_OUTPUT
{
float4 Color : SV_Target0;
float Depth : SV_Depth;
};
uniform int c1;
uniform int2 c2;
uniform int3 c3;
uniform int4 c4;
uniform int o1;
uniform int2 o2;
uniform int3 o3;
uniform int4 o4;
PS_OUTPUT main()
{
PS_OUTPUT psout;
// 2DMS, no offset
g_tTex2dmsf4.Load(c2, 3);
g_tTex2dmsi4.Load(c2, 3);
g_tTex2dmsu4.Load(c2, 3);
// 2DMS, offset
g_tTex2dmsf4.Load(c2, 3, o2);
g_tTex2dmsi4.Load(c2, 3, o2);
g_tTex2dmsu4.Load(c2, 3, o2);
// 2DMSArray, no offset
g_tTex2dmsf4a.Load(c3, 3);
g_tTex2dmsi4a.Load(c3, 3);
g_tTex2dmsu4a.Load(c3, 3);
// 2DMSArray, offset
g_tTex2dmsf4a.Load(c3, 3, o2);
g_tTex2dmsi4a.Load(c3, 3, o2);
g_tTex2dmsu4a.Load(c3, 3, o2);
psout.Color = 1.0;
psout.Depth = 1.0;
return psout;
}

View File

@ -0,0 +1,70 @@
SamplerState g_sSamp : register(s0);
uniform Texture1D <float4> g_tTex1df4 : register(t0);
Texture1D <int4> g_tTex1di4;
Texture1D <uint4> g_tTex1du4;
Texture2D <float4> g_tTex2df4;
Texture2D <int4> g_tTex2di4;
Texture2D <uint4> g_tTex2du4;
Texture3D <float4> g_tTex3df4;
Texture3D <int4> g_tTex3di4;
Texture3D <uint4> g_tTex3du4;
TextureCube <float4> g_tTexcdf4;
TextureCube <int4> g_tTexcdi4;
TextureCube <uint4> g_tTexcdu4;
Texture1DArray <float4> g_tTex1df4a;
Texture1DArray <int4> g_tTex1di4a;
Texture1DArray <uint4> g_tTex1du4a;
Texture2DArray <float4> g_tTex2df4a;
Texture2DArray <int4> g_tTex2di4a;
Texture2DArray <uint4> g_tTex2du4a;
TextureCubeArray <float4> g_tTexcdf4a;
TextureCubeArray <int4> g_tTexcdi4a;
TextureCubeArray <uint4> g_tTexcdu4a;
struct VS_OUTPUT
{
float4 Pos : SV_Position;
};
uniform int c1;
uniform int2 c2;
uniform int3 c3;
uniform int4 c4;
uniform int o1;
uniform int2 o2;
uniform int3 o3;
uniform int4 o4;
VS_OUTPUT main()
{
VS_OUTPUT vsout;
// 1D
g_tTex1df4.Load(c2);
g_tTex1di4.Load(c2);
g_tTex1du4.Load(c2);
// 2D
g_tTex2df4.Load(c3);
g_tTex2di4.Load(c3);
g_tTex2du4.Load(c3);
// 3D
g_tTex3df4.Load(c4);
g_tTex3di4.Load(c4);
g_tTex3du4.Load(c4);
// Offset has no Cube or CubeArray forms
vsout.Pos = float4(0,0,0,0);
return vsout;
}

View File

@ -102,8 +102,10 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.intrinsics.negative.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.negative.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.negative.vert", "VertexShaderFunction"},
{"hlsl.load.2dms.dx10.frag", "main"},
{"hlsl.load.array.dx10.frag", "main"},
{"hlsl.load.basic.dx10.frag", "main"},
{"hlsl.load.basic.dx10.vert", "main"},
{"hlsl.load.offset.dx10.frag", "main"},
{"hlsl.load.offsetarray.dx10.frag", "main"},
{"hlsl.pp.line.frag", "main"},

View File

@ -1007,7 +1007,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
++numDims;
// Establish whether we're querying mip levels
const bool mipQuery = numArgs > (numDims + 1);
const bool mipQuery = (numArgs > (numDims + 1)) && (!texSampler.isMultiSample());
// AST assumes integer return. Will be converted to float if required.
TIntermAggregate* sizeQuery = new TIntermAggregate(EOpTextureQuerySize);
@ -1063,6 +1063,19 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
compoundStatement = intermediate.growAggregate(compoundStatement, compAssign);
}
// 2DMS formats query # samples, which needs a different query op
if (texSampler.isMultiSample()) {
TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + numDims]->getAsTyped();
TIntermAggregate* samplesQuery = new TIntermAggregate(EOpImageQuerySamples);
samplesQuery->getSequence().push_back(argTex);
samplesQuery->setType(TType(EbtUint, EvqTemporary, 1));
samplesQuery->setLoc(loc);
TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, samplesQuery, loc);
compoundStatement = intermediate.growAggregate(compoundStatement, compAssign);
}
compoundStatement->setOperator(EOpSequence);
compoundStatement->setLoc(loc);
compoundStatement->setType(TType(EbtVoid));
@ -1146,7 +1159,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
// Last component of coordinate is the mip level, for non-MS. we separate them here:
if (isMS) {
// MS has no LOD
coordSwizzle = argTex;
coordSwizzle = argCoord;
} else {
// Extract coordinate
TVectorFields coordFields(0,1,2,3);
@ -1164,12 +1177,6 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
const int numArgs = argAggregate->getSequence().size();
const bool hasOffset = ((!isMS && numArgs == 3) || (isMS && numArgs == 4));
// Obtain offset arg, if there is one.
if (hasOffset) {
const int offsetPos = (isMS ? 3 : 2);
argOffset = argAggregate->getSequence()[offsetPos]->getAsTyped();
}
// Create texel fetch
const TOperator fetchOp = (hasOffset ? EOpTextureFetchOffset : EOpTextureFetch);
TIntermAggregate* txfetch = new TIntermAggregate(fetchOp);
@ -1177,18 +1184,26 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
const TSamplerDim dim = argTex->getType().getSampler().dim;
if (dim == EsdBuffer) // TODO: buffers
assert(0);
if (isMS) // TODO: 2DMS sample number
assert(0);
// Build up the fetch
txfetch->getSequence().push_back(argTex);
txfetch->getSequence().push_back(coordSwizzle);
if (!isMS) // MS has no LOD
if (isMS) {
// add 2DMS sample index
TIntermTyped* argSampleIdx = argAggregate->getSequence()[2]->getAsTyped();
txfetch->getSequence().push_back(argSampleIdx);
} else {
// 2DMS has no LOD, but everything else does.
txfetch->getSequence().push_back(lodComponent);
}
if (hasOffset)
// Obtain offset arg, if there is one.
if (hasOffset) {
const int offsetPos = (isMS ? 3 : 2);
argOffset = argAggregate->getSequence()[offsetPos]->getAsTyped();
txfetch->getSequence().push_back(argOffset);
}
txfetch->setType(node->getType());
txfetch->setLoc(loc);

View File

@ -67,17 +67,17 @@ const char* BaseTypeName(const char argOrder, const char* scalarName, const char
}
}
bool IsTextureType(const char argOrder) { return argOrder == '%' || argOrder == '@'; }
bool IsSamplerType(const char argType) { return argType == 'S' || argType == 's'; }
bool IsTextureArrayed(const char argOrder) { return argOrder == '@'; }
// bool IsTextureMS(const char /*argOrder*/) { return false; } // TODO: ...
bool IsTextureArrayed(const char argOrder) { return argOrder == '@' || argOrder == '&'; }
bool IsTextureMS(const char argOrder) { return argOrder == '$' || argOrder == '&'; }
bool IsTextureType(const char argOrder) { return argOrder == '%' || argOrder == '@' || IsTextureMS(argOrder); }
// Reject certain combinations that are illegal sample methods. For example,
// 3D arrays.
bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim0)
{
const bool isArrayed = IsTextureArrayed(*argOrder);
// const bool isMS = IsTextureMS(*argOrder);
const bool isMS = IsTextureMS(*argOrder);
// there are no 3D arrayed textures, or 3D SampleCmp(LevelZero)
if (dim0 == 3 && (isArrayed || name == "SampleCmp" || name == "SampleCmpLevelZero"))
@ -108,6 +108,10 @@ bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim
if (name == "Load" && dim0 == 4)
return true; // Load does not support any cubemaps, arrayed or not.
// Multisample formats are only 2D and 2Darray
if (isMS && dim0 != 2)
return true;
return false;
}
@ -123,9 +127,9 @@ int CoordinateArgPos(const glslang::TString& name, bool isTexture)
}
// Some texture methods use an addition coordinate dimension for the mip
bool HasMipInCoord(const glslang::TString& name)
bool HasMipInCoord(const glslang::TString& name, bool isMS)
{
return name == "Load";
return name == "Load" && !isMS;
}
// Handle IO params marked with > or <
@ -151,6 +155,27 @@ void HandleRepeatArg(const char*& arg, const char*& prev, const char* current)
prev = current;
}
// Return true for the end of a single argument key, which can be the end of the string, or
// the comma separator.
inline bool IsEndOfArg(const char* arg)
{
return arg == nullptr || *arg == '\0' || *arg == ',';
}
// If this is a fixed vector size, such as V3, return the size. Else return 0.
int FixedVecSize(const char* arg)
{
while (!IsEndOfArg(arg)) {
if (isdigit(*arg))
return *arg - '0';
++arg;
}
return 0; // none found.
}
// Create and return a type name. This is done in GLSL, not HLSL conventions, until such
// time as builtins are parsed using the HLSL parser.
//
@ -165,7 +190,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
const bool isTexture = IsTextureType(argOrder[0]);
const bool isArrayed = IsTextureArrayed(argOrder[0]);
const bool isSampler = IsSamplerType(argType[0]);
//const bool isMS = IsTextureMS(argOrder[0]);
const bool isMS = IsTextureMS(argOrder[0]);
char type = *argType;
@ -182,7 +207,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
type = 'u';
}
while (!isalpha(*argOrder))
if (isTranspose || isMatMul)
++argOrder;
char order = *argOrder;
@ -226,7 +251,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
}
// handle fixed vector sizes, such as float3, and only ever 3.
const int fixedVecSize = isdigit(argOrder[1]) ? (argOrder[1] - '0') : 0;
const int fixedVecSize = FixedVecSize(argOrder);
if (fixedVecSize != 0)
dim0 = dim1 = fixedVecSize;
@ -234,11 +259,11 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
if (isSampler || isTexture) {
if (order == 'V' || isTexture) {
switch (dim0) {
case 1: s += "1D"; break;
case 2: s += "2D"; break;
case 3: s += "3D"; break;
case 4: s += "Cube"; break;
default: s += "UNKNOWN_SAMPLER"; break;
case 1: s += "1D"; break;
case 2: s += (isMS ? "2DMS" : "2D"); break;
case 3: s += "3D"; break;
case 4: s += "Cube"; break;
default: s += "UNKNOWN_SAMPLER"; break;
}
}
} else {
@ -263,6 +288,8 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
s += ('0' + char(dim1));
break;
}
default:
break;
}
}
@ -305,14 +332,6 @@ inline bool IsValidGlsl(const char* cname, char retOrder, char retType, char arg
}
// Return true for the end of a single argument key, which can be the end of the string, or
// the comma separator.
inline bool IsEndOfArg(const char* arg)
{
return arg == nullptr || *arg == '\0' || *arg == ',';
}
// return position of end of argument specifier
inline const char* FindEndOfArg(const char* arg)
{
@ -322,19 +341,6 @@ inline const char* FindEndOfArg(const char* arg)
return *arg == '\0' ? nullptr : arg;
}
// If this is a fixed vector size, such as V3, return the size. Else return 0.
int FixedVecSize(const char* arg)
{
while (!IsEndOfArg(arg)) {
if (isdigit(*arg))
return *arg - '0';
++arg;
}
return 0; // none found.
}
// Return pointer to beginning of Nth argument specifier in the string.
inline const char* NthArg(const char* arg, int n)
{
@ -429,6 +435,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
// '#' as first letter of order sets rows=cols for mats
// '%' as first letter of order creates texture of given F/I/U type (texture, itexture, etc)
// '@' as first letter of order creates arrayed texture of given type
// '$' / '&' as first letter of order creates 2DMS / 2DMSArray textures
static const struct {
const char* name; // intrinsic name
@ -619,9 +626,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "Load", /*!O*/ "V4", nullptr, "%@,V", "FIU,I", EShLangAll },
{ "Load", /* O*/ "V4", nullptr, "%@,V,V", "FIU,I,I", EShLangAll },
// TODO: MS variants of Load
// { "Load", /* +sampleidex*/ "V4", nullptr, "$V,V,S", "FIU,I,I", EShLangAll },
// { "Load", /* +samplindex, offset*/ "V4", nullptr, "$V,V,S,V", "FIU,I,I,I", EShLangAll },
{ "Load", /* +sampleidex*/ "V4", nullptr, "$&,V,S", "FIU,I,I", EShLangAll },
{ "Load", /* +samplindex, offset*/ "V4", nullptr, "$&,V,S,V", "FIU,I,I,I", EShLangAll },
{ "Gather", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangVSPSGS },
{ "Gather", /* O*/ "V4", nullptr, "%@,S,V,V", "FIU,S,F,I", EShLangVSPSGS },
@ -677,9 +683,12 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "GetDimensions", /* CubeArray */ "-", "-", "@4,S,>S,,,", "FUI,U,,,,", EShLangAll },
{ "GetDimensions", /* CubeArray */ "-", "-", "@4,S,>S,,,", "FUI,U,F,,,", EShLangAll },
// TODO: GetDimensions for Texture2DMS, Texture2DMSArray
// UINT Width, UINT Height, UINT Samples
// UINT Width, UINT Height, UINT Elements, UINT Samples
{ "GetDimensions", /* 2DMS */ "-", "-", "$2,>S,,", "FUI,U,,", EShLangAll },
{ "GetDimensions", /* 2DMS */ "-", "-", "$2,>S,,", "FUI,U,,", EShLangAll },
{ "GetDimensions", /* 2DMSArray */ "-", "-", "&2,>S,,,", "FUI,U,,,", EShLangAll },
{ "GetDimensions", /* 2DMSArray */ "-", "-", "&2,>S,,,", "FUI,U,,,", EShLangAll },
// Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet.
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 },
@ -703,7 +712,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
for (const char* argOrder = intrinsic.argOrder; !IsEndOfArg(argOrder); ++argOrder) { // for each order...
const bool isTexture = IsTextureType(*argOrder);
const bool isArrayed = IsTextureArrayed(*argOrder);
const bool mipInCoord = HasMipInCoord(intrinsic.name);
const bool isMS = IsTextureMS(*argOrder);
const bool mipInCoord = HasMipInCoord(intrinsic.name, isMS);
const int fixedVecSize = FixedVecSize(argOrder);
const int coordArg = CoordinateArgPos(intrinsic.name, isTexture);