Merge branch 'ClemensRognerSD-dx9-sampler'

This commit is contained in:
John Kessenich 2018-12-07 18:40:14 -07:00
commit dc4fe2d648
13 changed files with 1060 additions and 8 deletions

View File

@ -160,6 +160,7 @@ const char* sourceEntryPointName = nullptr;
const char* shaderStageName = nullptr; const char* shaderStageName = nullptr;
const char* variableName = nullptr; const char* variableName = nullptr;
bool HlslEnable16BitTypes = false; bool HlslEnable16BitTypes = false;
bool HlslDX9compatible = false;
std::vector<std::string> IncludeDirectoryList; std::vector<std::string> IncludeDirectoryList;
// Source environment // Source environment
@ -509,6 +510,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Options |= EOptionHlslIoMapping; Options |= EOptionHlslIoMapping;
} else if (lowerword == "hlsl-enable-16bit-types") { } else if (lowerword == "hlsl-enable-16bit-types") {
HlslEnable16BitTypes = true; HlslEnable16BitTypes = true;
} else if (lowerword == "hlsl-dx9-compatible") {
HlslDX9compatible = true;
} else if (lowerword == "invert-y" || // synonyms } else if (lowerword == "invert-y" || // synonyms
lowerword == "iy") { lowerword == "iy") {
Options |= EOptionInvertY; Options |= EOptionInvertY;
@ -815,6 +818,8 @@ void SetMessageOptions(EShMessages& messages)
messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes); messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes);
if ((Options & EOptionOptimizeDisable) || !ENABLE_OPT) if ((Options & EOptionOptimizeDisable) || !ENABLE_OPT)
messages = (EShMessages)(messages | EShMsgHlslLegalization); messages = (EShMessages)(messages | EShMsgHlslLegalization);
if (HlslDX9compatible)
messages = (EShMessages)(messages | EShMsgHlslDX9Compatible);
} }
// //
@ -1509,6 +1514,7 @@ void usage()
" works independently of source language\n" " works independently of source language\n"
" --hlsl-iomap perform IO mapping in HLSL register space\n" " --hlsl-iomap perform IO mapping in HLSL register space\n"
" --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n" " --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n"
" --hlsl-dx9-compatible interprets sampler declarations as a texture/sampler combo like DirectX9 would."
" --invert-y | --iy invert position.Y output in vertex shader\n" " --invert-y | --iy invert position.Y output in vertex shader\n"
" --keep-uncalled | --ku don't eliminate uncalled functions\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n"
" --no-storage-format | --nsf use Unknown image format\n" " --no-storage-format | --nsf use Unknown image format\n"

View File

@ -0,0 +1,592 @@
hlsl.sample.dx9.frag
Shader version: 500
gl_FragCoord origin is upper left
using depth_any
0:? Sequence
0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters:
0:? Sequence
0:18 Sequence
0:18 move second child to first child ( temp 4-component vector of float)
0:18 'ColorOut' ( temp 4-component vector of float)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:20 add second child into first child ( temp 4-component vector of float)
0:20 'ColorOut' ( temp 4-component vector of float)
0:20 texture ( temp 4-component vector of float)
0:20 'g_sam' (layout( binding=0) uniform sampler2D)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:21 add second child into first child ( temp 4-component vector of float)
0:21 'ColorOut' ( temp 4-component vector of float)
0:21 texture ( temp 4-component vector of float)
0:21 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:21 Constant:
0:21 0.500000
0:22 add second child into first child ( temp 4-component vector of float)
0:22 'ColorOut' ( temp 4-component vector of float)
0:22 texture ( temp 4-component vector of float)
0:22 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:23 add second child into first child ( temp 4-component vector of float)
0:23 'ColorOut' ( temp 4-component vector of float)
0:23 texture ( temp 4-component vector of float)
0:23 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:24 add second child into first child ( temp 4-component vector of float)
0:24 'ColorOut' ( temp 4-component vector of float)
0:24 texture ( temp 4-component vector of float)
0:24 'g_samCube' (layout( binding=4) uniform samplerCube)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:26 add second child into first child ( temp 4-component vector of float)
0:26 'ColorOut' ( temp 4-component vector of float)
0:26 textureLod ( temp 4-component vector of float)
0:26 'g_sam' (layout( binding=0) uniform sampler2D)
0:26 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:? 0.000000
0:? 0.000000
0:26 direct index ( temp float)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:? 0.000000
0:? 0.000000
0:26 Constant:
0:26 3 (const int)
0:27 add second child into first child ( temp 4-component vector of float)
0:27 'ColorOut' ( temp 4-component vector of float)
0:27 textureLod ( temp 4-component vector of float)
0:27 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:27 Construct float ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:27 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:27 Constant:
0:27 3 (const int)
0:28 add second child into first child ( temp 4-component vector of float)
0:28 'ColorOut' ( temp 4-component vector of float)
0:28 textureLod ( temp 4-component vector of float)
0:28 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:28 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 0.000000
0:28 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 0.000000
0:28 Constant:
0:28 3 (const int)
0:29 add second child into first child ( temp 4-component vector of float)
0:29 'ColorOut' ( temp 4-component vector of float)
0:29 textureLod ( temp 4-component vector of float)
0:29 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:29 Construct vec3 ( temp 3-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:29 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:29 Constant:
0:29 3 (const int)
0:30 add second child into first child ( temp 4-component vector of float)
0:30 'ColorOut' ( temp 4-component vector of float)
0:30 textureLod ( temp 4-component vector of float)
0:30 'g_samCube' (layout( binding=4) uniform samplerCube)
0:30 Construct vec3 ( temp 3-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:30 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:30 Constant:
0:30 3 (const int)
0:32 move second child to first child ( temp 4-component vector of float)
0:32 Color: direct index for structure ( temp 4-component vector of float)
0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:32 Constant:
0:32 0 (const int)
0:32 divide ( temp 4-component vector of float)
0:32 'ColorOut' ( temp 4-component vector of float)
0:32 Constant:
0:32 10.000000
0:33 move second child to first child ( temp float)
0:33 Depth: direct index for structure ( temp float)
0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Branch: Return with expression
0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Definition: main( ( temp void)
0:15 Function Parameters:
0:? Sequence
0:15 Sequence
0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
0:15 Color: direct index for structure ( temp 4-component vector of float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant:
0:15 0 (const int)
0:15 move second child to first child ( temp float)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:15 Depth: direct index for structure ( temp float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant:
0:15 1 (const int)
0:? Linker Objects
0:? 'g_sam' (layout( binding=0) uniform sampler2D)
0:? 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:? 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:? 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:? 'g_samCube' (layout( binding=4) uniform samplerCube)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
using depth_any
0:? Sequence
0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters:
0:? Sequence
0:18 Sequence
0:18 move second child to first child ( temp 4-component vector of float)
0:18 'ColorOut' ( temp 4-component vector of float)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:20 add second child into first child ( temp 4-component vector of float)
0:20 'ColorOut' ( temp 4-component vector of float)
0:20 texture ( temp 4-component vector of float)
0:20 'g_sam' (layout( binding=0) uniform sampler2D)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:21 add second child into first child ( temp 4-component vector of float)
0:21 'ColorOut' ( temp 4-component vector of float)
0:21 texture ( temp 4-component vector of float)
0:21 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:21 Constant:
0:21 0.500000
0:22 add second child into first child ( temp 4-component vector of float)
0:22 'ColorOut' ( temp 4-component vector of float)
0:22 texture ( temp 4-component vector of float)
0:22 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:23 add second child into first child ( temp 4-component vector of float)
0:23 'ColorOut' ( temp 4-component vector of float)
0:23 texture ( temp 4-component vector of float)
0:23 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:24 add second child into first child ( temp 4-component vector of float)
0:24 'ColorOut' ( temp 4-component vector of float)
0:24 texture ( temp 4-component vector of float)
0:24 'g_samCube' (layout( binding=4) uniform samplerCube)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:26 add second child into first child ( temp 4-component vector of float)
0:26 'ColorOut' ( temp 4-component vector of float)
0:26 textureLod ( temp 4-component vector of float)
0:26 'g_sam' (layout( binding=0) uniform sampler2D)
0:26 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:? 0.000000
0:? 0.000000
0:26 direct index ( temp float)
0:? Constant:
0:? 0.400000
0:? 0.300000
0:? 0.000000
0:? 0.000000
0:26 Constant:
0:26 3 (const int)
0:27 add second child into first child ( temp 4-component vector of float)
0:27 'ColorOut' ( temp 4-component vector of float)
0:27 textureLod ( temp 4-component vector of float)
0:27 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:27 Construct float ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:27 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:27 Constant:
0:27 3 (const int)
0:28 add second child into first child ( temp 4-component vector of float)
0:28 'ColorOut' ( temp 4-component vector of float)
0:28 textureLod ( temp 4-component vector of float)
0:28 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:28 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 0.000000
0:28 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 0.000000
0:28 Constant:
0:28 3 (const int)
0:29 add second child into first child ( temp 4-component vector of float)
0:29 'ColorOut' ( temp 4-component vector of float)
0:29 textureLod ( temp 4-component vector of float)
0:29 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:29 Construct vec3 ( temp 3-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:29 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:29 Constant:
0:29 3 (const int)
0:30 add second child into first child ( temp 4-component vector of float)
0:30 'ColorOut' ( temp 4-component vector of float)
0:30 textureLod ( temp 4-component vector of float)
0:30 'g_samCube' (layout( binding=4) uniform samplerCube)
0:30 Construct vec3 ( temp 3-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:30 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.400000
0:? 0.000000
0:30 Constant:
0:30 3 (const int)
0:32 move second child to first child ( temp 4-component vector of float)
0:32 Color: direct index for structure ( temp 4-component vector of float)
0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:32 Constant:
0:32 0 (const int)
0:32 divide ( temp 4-component vector of float)
0:32 'ColorOut' ( temp 4-component vector of float)
0:32 Constant:
0:32 10.000000
0:33 move second child to first child ( temp float)
0:33 Depth: direct index for structure ( temp float)
0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Branch: Return with expression
0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Definition: main( ( temp void)
0:15 Function Parameters:
0:? Sequence
0:15 Sequence
0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
0:15 Color: direct index for structure ( temp 4-component vector of float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant:
0:15 0 (const int)
0:15 move second child to first child ( temp float)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:15 Depth: direct index for structure ( temp float)
0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
0:15 Constant:
0:15 1 (const int)
0:? Linker Objects
0:? 'g_sam' (layout( binding=0) uniform sampler2D)
0:? 'g_sam1D' (layout( binding=1) uniform sampler1D)
0:? 'g_sam2D' (layout( binding=2) uniform sampler2D)
0:? 'g_sam3D' (layout( binding=3) uniform sampler3D)
0:? 'g_samCube' (layout( binding=4) uniform samplerCube)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 135
Capability Shader
Capability Sampled1D
2: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 5 "main" 128 132
ExecutionMode 5 OriginUpperLeft
ExecutionMode 5 DepthReplacing
1: String ""
Source HLSL 500 1 "// OpModuleProcessed auto-map-locations
// OpModuleProcessed auto-map-bindings
// OpModuleProcessed entry-point main
// OpModuleProcessed client vulkan100
// OpModuleProcessed target-env vulkan1.0
// OpModuleProcessed keep-uncalled
// OpModuleProcessed hlsl-offsets
#line 1
"
Name 5 "main"
Name 9 "PS_OUTPUT"
MemberName 9(PS_OUTPUT) 0 "Color"
MemberName 9(PS_OUTPUT) 1 "Depth"
Name 11 "@main("
Name 14 "ColorOut"
Name 20 "g_sam"
Name 32 "g_sam1D"
Name 38 "g_sam2D"
Name 48 "g_sam3D"
Name 58 "g_samCube"
Name 110 "psout"
Name 125 "flattenTemp"
Name 128 "@entryPointOutput.Color"
Name 132 "@entryPointOutput.Depth"
Decorate 20(g_sam) DescriptorSet 0
Decorate 20(g_sam) Binding 0
Decorate 32(g_sam1D) DescriptorSet 0
Decorate 32(g_sam1D) Binding 1
Decorate 38(g_sam2D) DescriptorSet 0
Decorate 38(g_sam2D) Binding 2
Decorate 48(g_sam3D) DescriptorSet 0
Decorate 48(g_sam3D) Binding 3
Decorate 58(g_samCube) DescriptorSet 0
Decorate 58(g_samCube) Binding 4
Decorate 128(@entryPointOutput.Color) Location 0
Decorate 132(@entryPointOutput.Depth) BuiltIn FragDepth
3: TypeVoid
4: TypeFunction 3
7: TypeFloat 32
8: TypeVector 7(float) 4
9(PS_OUTPUT): TypeStruct 8(fvec4) 7(float)
10: TypeFunction 9(PS_OUTPUT)
13: TypePointer Function 8(fvec4)
15: 7(float) Constant 0
16: 8(fvec4) ConstantComposite 15 15 15 15
17: TypeImage 7(float) 2D sampled format:Unknown
18: TypeSampledImage 17
19: TypePointer UniformConstant 18
20(g_sam): 19(ptr) Variable UniformConstant
22: TypeVector 7(float) 2
23: 7(float) Constant 1053609165
24: 7(float) Constant 1050253722
25: 22(fvec2) ConstantComposite 23 24
29: TypeImage 7(float) 1D sampled format:Unknown
30: TypeSampledImage 29
31: TypePointer UniformConstant 30
32(g_sam1D): 31(ptr) Variable UniformConstant
34: 7(float) Constant 1056964608
38(g_sam2D): 19(ptr) Variable UniformConstant
40: 7(float) Constant 1058642330
41: 22(fvec2) ConstantComposite 34 40
45: TypeImage 7(float) 3D sampled format:Unknown
46: TypeSampledImage 45
47: TypePointer UniformConstant 46
48(g_sam3D): 47(ptr) Variable UniformConstant
50: TypeVector 7(float) 3
51: 50(fvec3) ConstantComposite 34 40 23
55: TypeImage 7(float) Cube sampled format:Unknown
56: TypeSampledImage 55
57: TypePointer UniformConstant 56
58(g_samCube): 57(ptr) Variable UniformConstant
64: 8(fvec4) ConstantComposite 23 24 15 15
68: TypeInt 32 0
69: 68(int) Constant 3
75: 8(fvec4) ConstantComposite 34 15 15 15
82: 8(fvec4) ConstantComposite 34 40 15 15
91: 8(fvec4) ConstantComposite 34 40 23 15
109: TypePointer Function 9(PS_OUTPUT)
111: TypeInt 32 1
112: 111(int) Constant 0
114: 7(float) Constant 1092616192
118: 111(int) Constant 1
119: 7(float) Constant 1065353216
120: TypePointer Function 7(float)
127: TypePointer Output 8(fvec4)
128(@entryPointOutput.Color): 127(ptr) Variable Output
131: TypePointer Output 7(float)
132(@entryPointOutput.Depth): 131(ptr) Variable Output
5(main): 3 Function None 4
6: Label
125(flattenTemp): 109(ptr) Variable Function
Line 1 15 0
126:9(PS_OUTPUT) FunctionCall 11(@main()
Store 125(flattenTemp) 126
129: 13(ptr) AccessChain 125(flattenTemp) 112
130: 8(fvec4) Load 129
Store 128(@entryPointOutput.Color) 130
133: 120(ptr) AccessChain 125(flattenTemp) 118
134: 7(float) Load 133
Store 132(@entryPointOutput.Depth) 134
Return
FunctionEnd
11(@main():9(PS_OUTPUT) Function None 10
12: Label
14(ColorOut): 13(ptr) Variable Function
110(psout): 109(ptr) Variable Function
Line 1 18 0
Store 14(ColorOut) 16
Line 1 20 0
21: 18 Load 20(g_sam)
26: 8(fvec4) ImageSampleImplicitLod 21 25
27: 8(fvec4) Load 14(ColorOut)
28: 8(fvec4) FAdd 27 26
Store 14(ColorOut) 28
Line 1 21 0
33: 30 Load 32(g_sam1D)
35: 8(fvec4) ImageSampleImplicitLod 33 34
36: 8(fvec4) Load 14(ColorOut)
37: 8(fvec4) FAdd 36 35
Store 14(ColorOut) 37
Line 1 22 0
39: 18 Load 38(g_sam2D)
42: 8(fvec4) ImageSampleImplicitLod 39 41
43: 8(fvec4) Load 14(ColorOut)
44: 8(fvec4) FAdd 43 42
Store 14(ColorOut) 44
Line 1 23 0
49: 46 Load 48(g_sam3D)
52: 8(fvec4) ImageSampleImplicitLod 49 51
53: 8(fvec4) Load 14(ColorOut)
54: 8(fvec4) FAdd 53 52
Store 14(ColorOut) 54
Line 1 24 0
59: 56 Load 58(g_samCube)
60: 8(fvec4) ImageSampleImplicitLod 59 51
61: 8(fvec4) Load 14(ColorOut)
62: 8(fvec4) FAdd 61 60
Store 14(ColorOut) 62
Line 1 26 0
63: 18 Load 20(g_sam)
65: 7(float) CompositeExtract 64 0
66: 7(float) CompositeExtract 64 1
67: 22(fvec2) CompositeConstruct 65 66
70: 7(float) CompositeExtract 64 3
71: 8(fvec4) ImageSampleExplicitLod 63 67 Lod 70
72: 8(fvec4) Load 14(ColorOut)
73: 8(fvec4) FAdd 72 71
Store 14(ColorOut) 73
Line 1 27 0
74: 30 Load 32(g_sam1D)
76: 7(float) CompositeExtract 75 0
77: 7(float) CompositeExtract 75 3
78: 8(fvec4) ImageSampleExplicitLod 74 76 Lod 77
79: 8(fvec4) Load 14(ColorOut)
80: 8(fvec4) FAdd 79 78
Store 14(ColorOut) 80
Line 1 28 0
81: 18 Load 38(g_sam2D)
83: 7(float) CompositeExtract 82 0
84: 7(float) CompositeExtract 82 1
85: 22(fvec2) CompositeConstruct 83 84
86: 7(float) CompositeExtract 82 3
87: 8(fvec4) ImageSampleExplicitLod 81 85 Lod 86
88: 8(fvec4) Load 14(ColorOut)
89: 8(fvec4) FAdd 88 87
Store 14(ColorOut) 89
Line 1 29 0
90: 46 Load 48(g_sam3D)
92: 7(float) CompositeExtract 91 0
93: 7(float) CompositeExtract 91 1
94: 7(float) CompositeExtract 91 2
95: 50(fvec3) CompositeConstruct 92 93 94
96: 7(float) CompositeExtract 91 3
97: 8(fvec4) ImageSampleExplicitLod 90 95 Lod 96
98: 8(fvec4) Load 14(ColorOut)
99: 8(fvec4) FAdd 98 97
Store 14(ColorOut) 99
Line 1 30 0
100: 56 Load 58(g_samCube)
101: 7(float) CompositeExtract 91 0
102: 7(float) CompositeExtract 91 1
103: 7(float) CompositeExtract 91 2
104: 50(fvec3) CompositeConstruct 101 102 103
105: 7(float) CompositeExtract 91 3
106: 8(fvec4) ImageSampleExplicitLod 100 104 Lod 105
107: 8(fvec4) Load 14(ColorOut)
108: 8(fvec4) FAdd 107 106
Store 14(ColorOut) 108
Line 1 32 0
113: 8(fvec4) Load 14(ColorOut)
115: 8(fvec4) CompositeConstruct 114 114 114 114
116: 8(fvec4) FDiv 113 115
117: 13(ptr) AccessChain 110(psout) 112
Store 117 116
Line 1 33 0
121: 120(ptr) AccessChain 110(psout) 118
Store 121 119
Line 1 35 0
122:9(PS_OUTPUT) Load 110(psout)
ReturnValue 122
FunctionEnd

View File

@ -0,0 +1,261 @@
hlsl.sample.dx9.vert
Shader version: 500
0:? Sequence
0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos})
0:11 Function Parameters:
0:? Sequence
0:14 Sequence
0:14 move second child to first child ( temp 4-component vector of float)
0:14 'PosOut' ( temp 4-component vector of float)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:16 add second child into first child ( temp 4-component vector of float)
0:16 'PosOut' ( temp 4-component vector of float)
0:16 textureLod ( temp 4-component vector of float)
0:16 'g_sam' (layout( binding=0) uniform sampler2D)
0:16 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.300000
0:? 0.400000
0:? 0.000000
0:? 1.000000
0:16 direct index ( temp float)
0:? Constant:
0:? 0.300000
0:? 0.400000
0:? 0.000000
0:? 1.000000
0:16 Constant:
0:16 3 (const int)
0:17 add second child into first child ( temp 4-component vector of float)
0:17 'PosOut' ( temp 4-component vector of float)
0:17 textureLod ( temp 4-component vector of float)
0:17 'g_sam2D' (layout( binding=1) uniform sampler2D)
0:17 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 1.000000
0:17 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 1.000000
0:17 Constant:
0:17 3 (const int)
0:19 move second child to first child ( temp 4-component vector of float)
0:19 Pos: direct index for structure ( temp 4-component vector of float)
0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos})
0:19 Constant:
0:19 0 (const int)
0:19 divide ( temp 4-component vector of float)
0:19 'PosOut' ( temp 4-component vector of float)
0:19 Constant:
0:19 2.000000
0:21 Branch: Return with expression
0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
0:11 Pos: direct index for structure ( temp 4-component vector of float)
0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos})
0:11 Constant:
0:11 0 (const int)
0:? Linker Objects
0:? 'g_sam' (layout( binding=0) uniform sampler2D)
0:? 'g_sam2D' (layout( binding=1) uniform sampler2D)
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos})
0:11 Function Parameters:
0:? Sequence
0:14 Sequence
0:14 move second child to first child ( temp 4-component vector of float)
0:14 'PosOut' ( temp 4-component vector of float)
0:? Constant:
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:16 add second child into first child ( temp 4-component vector of float)
0:16 'PosOut' ( temp 4-component vector of float)
0:16 textureLod ( temp 4-component vector of float)
0:16 'g_sam' (layout( binding=0) uniform sampler2D)
0:16 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.300000
0:? 0.400000
0:? 0.000000
0:? 1.000000
0:16 direct index ( temp float)
0:? Constant:
0:? 0.300000
0:? 0.400000
0:? 0.000000
0:? 1.000000
0:16 Constant:
0:16 3 (const int)
0:17 add second child into first child ( temp 4-component vector of float)
0:17 'PosOut' ( temp 4-component vector of float)
0:17 textureLod ( temp 4-component vector of float)
0:17 'g_sam2D' (layout( binding=1) uniform sampler2D)
0:17 Construct vec2 ( temp 2-component vector of float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 1.000000
0:17 direct index ( temp float)
0:? Constant:
0:? 0.500000
0:? 0.600000
0:? 0.000000
0:? 1.000000
0:17 Constant:
0:17 3 (const int)
0:19 move second child to first child ( temp 4-component vector of float)
0:19 Pos: direct index for structure ( temp 4-component vector of float)
0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos})
0:19 Constant:
0:19 0 (const int)
0:19 divide ( temp 4-component vector of float)
0:19 'PosOut' ( temp 4-component vector of float)
0:19 Constant:
0:19 2.000000
0:21 Branch: Return with expression
0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
0:11 Pos: direct index for structure ( temp 4-component vector of float)
0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos})
0:11 Constant:
0:11 0 (const int)
0:? Linker Objects
0:? 'g_sam' (layout( binding=0) uniform sampler2D)
0:? 'g_sam2D' (layout( binding=1) uniform sampler2D)
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 64
Capability Shader
2: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 5 "main" 61
1: String ""
Source HLSL 500 1 "// OpModuleProcessed auto-map-locations
// OpModuleProcessed auto-map-bindings
// OpModuleProcessed entry-point main
// OpModuleProcessed client vulkan100
// OpModuleProcessed target-env vulkan1.0
// OpModuleProcessed keep-uncalled
// OpModuleProcessed hlsl-offsets
#line 1
"
Name 5 "main"
Name 9 "VS_OUTPUT"
MemberName 9(VS_OUTPUT) 0 "Pos"
Name 11 "@main("
Name 14 "PosOut"
Name 20 "g_sam"
Name 36 "g_sam2D"
Name 49 "vsout"
Name 61 "@entryPointOutput.Pos"
Decorate 20(g_sam) DescriptorSet 0
Decorate 20(g_sam) Binding 0
Decorate 36(g_sam2D) DescriptorSet 0
Decorate 36(g_sam2D) Binding 1
Decorate 61(@entryPointOutput.Pos) BuiltIn Position
3: TypeVoid
4: TypeFunction 3
7: TypeFloat 32
8: TypeVector 7(float) 4
9(VS_OUTPUT): TypeStruct 8(fvec4)
10: TypeFunction 9(VS_OUTPUT)
13: TypePointer Function 8(fvec4)
15: 7(float) Constant 0
16: 8(fvec4) ConstantComposite 15 15 15 15
17: TypeImage 7(float) 2D sampled format:Unknown
18: TypeSampledImage 17
19: TypePointer UniformConstant 18
20(g_sam): 19(ptr) Variable UniformConstant
22: 7(float) Constant 1050253722
23: 7(float) Constant 1053609165
24: 7(float) Constant 1065353216
25: 8(fvec4) ConstantComposite 22 23 15 24
26: TypeVector 7(float) 2
30: TypeInt 32 0
31: 30(int) Constant 3
36(g_sam2D): 19(ptr) Variable UniformConstant
38: 7(float) Constant 1056964608
39: 7(float) Constant 1058642330
40: 8(fvec4) ConstantComposite 38 39 15 24
48: TypePointer Function 9(VS_OUTPUT)
50: TypeInt 32 1
51: 50(int) Constant 0
53: 7(float) Constant 1073741824
60: TypePointer Output 8(fvec4)
61(@entryPointOutput.Pos): 60(ptr) Variable Output
5(main): 3 Function None 4
6: Label
Line 1 11 0
62:9(VS_OUTPUT) FunctionCall 11(@main()
63: 8(fvec4) CompositeExtract 62 0
Store 61(@entryPointOutput.Pos) 63
Return
FunctionEnd
11(@main():9(VS_OUTPUT) Function None 10
12: Label
14(PosOut): 13(ptr) Variable Function
49(vsout): 48(ptr) Variable Function
Line 1 14 0
Store 14(PosOut) 16
Line 1 16 0
21: 18 Load 20(g_sam)
27: 7(float) CompositeExtract 25 0
28: 7(float) CompositeExtract 25 1
29: 26(fvec2) CompositeConstruct 27 28
32: 7(float) CompositeExtract 25 3
33: 8(fvec4) ImageSampleExplicitLod 21 29 Lod 32
34: 8(fvec4) Load 14(PosOut)
35: 8(fvec4) FAdd 34 33
Store 14(PosOut) 35
Line 1 17 0
37: 18 Load 36(g_sam2D)
41: 7(float) CompositeExtract 40 0
42: 7(float) CompositeExtract 40 1
43: 26(fvec2) CompositeConstruct 41 42
44: 7(float) CompositeExtract 40 3
45: 8(fvec4) ImageSampleExplicitLod 37 43 Lod 44
46: 8(fvec4) Load 14(PosOut)
47: 8(fvec4) FAdd 46 45
Store 14(PosOut) 47
Line 1 19 0
52: 8(fvec4) Load 14(PosOut)
54: 8(fvec4) CompositeConstruct 53 53 53 53
55: 8(fvec4) FDiv 52 54
56: 13(ptr) AccessChain 49(vsout) 51
Store 56 55
Line 1 21 0
57:9(VS_OUTPUT) Load 49(vsout)
ReturnValue 57
FunctionEnd

36
Test/hlsl.sample.dx9.frag Normal file
View File

@ -0,0 +1,36 @@
sampler g_sam : register(t0);
sampler1D g_sam1D : register(t1);
sampler2D g_sam2D : register(t2);
sampler3D g_sam3D : register(t3);
samplerCube g_samCube : register(t4);
struct PS_OUTPUT
{
float4 Color : SV_Target0;
float Depth : SV_Depth;
};
PS_OUTPUT main()
{
PS_OUTPUT psout;
float4 ColorOut = float4(0,0,0,0);
ColorOut += tex2D( g_sam , float2(0.4,0.3));
ColorOut += tex1D( g_sam1D, 0.5);
ColorOut += tex2D( g_sam2D, float2(0.5,0.6));
ColorOut += tex3D( g_sam3D, float3(0.5,0.6,0.4));
ColorOut += texCUBE( g_samCube, float3(0.5,0.6,0.4));
ColorOut += tex2Dlod( g_sam , float4(0.4,0.3,0.0,0.0));
ColorOut += tex1Dlod( g_sam1D, float4(0.5,0.0,0.0,0.0));
ColorOut += tex2Dlod( g_sam2D, float4(0.5,0.6,0.0,0.0));
ColorOut += tex3Dlod( g_sam3D, float4(0.5,0.6,0.4,0.0));
ColorOut += texCUBElod( g_samCube, float4(0.5,0.6,0.4,0.0));
psout.Color = ColorOut / 10.0f;
psout.Depth = 1.0;
return psout;
}

22
Test/hlsl.sample.dx9.vert Normal file
View File

@ -0,0 +1,22 @@
sampler g_sam : register(t0);
sampler2D g_sam2D : register(t1);
struct VS_OUTPUT
{
float4 Pos : SV_Position;
};
VS_OUTPUT main()
{
VS_OUTPUT vsout;
float4 PosOut = float4(0,0,0,0);
PosOut += tex2Dlod( g_sam , float4(0.3f, 0.4f, 0.0f, 1.0f));
PosOut += tex2Dlod( g_sam2D, float4(0.5f, 0.6f, 0.0f, 1.0f));
vsout.Pos = PosOut / 2.0f;
return vsout;
}

View File

@ -130,6 +130,7 @@ public:
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; } bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; } bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; }
bool hlslDX9Compatible() const { return (messages & EShMsgHlslDX9Compatible) != 0; }
TInfoSink& infoSink; TInfoSink& infoSink;

View File

@ -235,6 +235,7 @@ enum EShMessages {
EShMsgDebugInfo = (1 << 10), // save debug information EShMsgDebugInfo = (1 << 10), // save debug information
EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL
EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages
EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (right now only for samplers)
}; };
// //

18
gtests/Hlsl.FromFile.cpp Normal file → Executable file
View File

@ -62,6 +62,7 @@ using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam<FileNameEn
using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>; using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>; using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>; using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected // Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected
// to successfully generate both AST and SPIR-V. // to successfully generate both AST and SPIR-V.
@ -106,6 +107,14 @@ TEST_P(HlslDebugTest, FromFile)
"/baseResults/", false, true); "/baseResults/", false, true);
} }
TEST_P(HlslDX9CompatibleTest, FromFile)
{
loadFileCompileAndCheckWithOptions(GlobalTestSettings.testRoot, GetParam().fileName, Source::HLSL,
Semantics::Vulkan, glslang::EShTargetVulkan_1_0, Target::BothASTAndSpv, true,
GetParam().entryPoint, "/baseResults/",
EShMessages::EShMsgHlslDX9Compatible);
}
// clang-format off // clang-format off
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslCompileTest, ToSpirv, HlslCompileTest,
@ -457,6 +466,15 @@ INSTANTIATE_TEST_CASE_P(
FileNameAsCustomTestSuffix FileNameAsCustomTestSuffix
); );
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslDX9CompatibleTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.sample.dx9.frag", "main"},
{"hlsl.sample.dx9.vert", "main"},
}),
FileNameAsCustomTestSuffix
);
// clang-format on // clang-format on
} // anonymous namespace } // anonymous namespace
} // namespace glslangtest } // namespace glslangtest

View File

@ -460,6 +460,34 @@ public:
expectedOutputFname, result.spirvWarningsErrors); expectedOutputFname, result.spirvWarningsErrors);
} }
void loadFileCompileAndCheckWithOptions(const std::string &testDir,
const std::string &testName,
Source source,
Semantics semantics,
glslang::EShTargetClientVersion clientTargetVersion,
Target target, bool automap = true, const std::string &entryPointName = "",
const std::string &baseDir = "/baseResults/",
const EShMessages additionalOptions = EShMessages::EShMsgDefault)
{
const std::string inputFname = testDir + "/" + testName;
const std::string expectedOutputFname = testDir + baseDir + testName + ".out";
std::string input, expectedOutput;
tryLoadFile(inputFname, "input", &input);
tryLoadFile(expectedOutputFname, "expected output", &expectedOutput);
EShMessages controls = DeriveOptions(source, semantics, target);
controls = static_cast<EShMessages>(controls | additionalOptions);
GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false,
EShTexSampTransKeep, false, automap);
// Generate the hybrid output in the way of glslangValidator.
std::ostringstream stream;
outputResultToStream(&stream, result, controls);
checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname);
}
void loadFileCompileFlattenUniformsAndCheck(const std::string& testDir, void loadFileCompileFlattenUniformsAndCheck(const std::string& testDir,
const std::string& testName, const std::string& testName,
Source source, Source source,

View File

@ -1163,6 +1163,49 @@ bool HlslGrammar::acceptSubpassInputType(TType& type)
return true; return true;
} }
// sampler_type for DX9 compatibility
// : SAMPLER
// | SAMPLER1D
// | SAMPLER2D
// | SAMPLER3D
// | SAMPLERCUBE
bool HlslGrammar::acceptSamplerTypeDX9(TType &type)
{
// read sampler type
const EHlslTokenClass samplerType = peek();
TSamplerDim dim = EsdNone;
TType txType(EbtFloat, EvqUniform, 4); // default type is float4
bool isShadow = false;
switch (samplerType)
{
case EHTokSampler: dim = Esd2D; break;
case EHTokSampler1d: dim = Esd1D; break;
case EHTokSampler2d: dim = Esd2D; break;
case EHTokSampler3d: dim = Esd3D; break;
case EHTokSamplerCube: dim = EsdCube; break;
default:
return false; // not a dx9 sampler declaration
}
advanceToken(); // consume the sampler type keyword
TArraySizes *arraySizes = nullptr; // TODO: array
TSampler sampler;
sampler.set(txType.getBasicType(), dim, false, isShadow, false);
if (!parseContext.setTextureReturnType(sampler, txType, token.loc))
return false;
type.shallowCopy(TType(sampler, EvqUniform, arraySizes));
type.getQualifier().layoutFormat = ElfNone;
return true;
}
// sampler_type // sampler_type
// : SAMPLER // : SAMPLER
// | SAMPLER1D // | SAMPLER1D
@ -1445,7 +1488,13 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
case EHTokSampler2d: // ... case EHTokSampler2d: // ...
case EHTokSampler3d: // ... case EHTokSampler3d: // ...
case EHTokSamplerCube: // ... case EHTokSamplerCube: // ...
case EHTokSamplerState: // ... if (parseContext.hlslDX9Compatible())
return acceptSamplerTypeDX9(type);
else
return acceptSamplerType(type);
break;
case EHTokSamplerState: // fall through
case EHTokSamplerComparisonState: // ... case EHTokSamplerComparisonState: // ...
return acceptSamplerType(type); return acceptSamplerType(type);
break; break;

View File

@ -84,6 +84,7 @@ namespace glslang {
bool acceptStreamOutTemplateType(TType&, TLayoutGeometry&); bool acceptStreamOutTemplateType(TType&, TLayoutGeometry&);
bool acceptOutputPrimitiveGeometry(TLayoutGeometry&); bool acceptOutputPrimitiveGeometry(TLayoutGeometry&);
bool acceptAnnotations(TQualifier&); bool acceptAnnotations(TQualifier&);
bool acceptSamplerTypeDX9(TType &);
bool acceptSamplerType(TType&); bool acceptSamplerType(TType&);
bool acceptTextureType(TType&); bool acceptTextureType(TType&);
bool acceptSubpassInputType(TType&); bool acceptSubpassInputType(TType&);

View File

@ -3770,6 +3770,43 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
break; break;
} }
case EOpTextureLod: //is almost EOpTextureBias (only args & operations are different)
{
TIntermTyped *argSamp = argAggregate->getSequence()[0]->getAsTyped(); // sampler
TIntermTyped *argCoord = argAggregate->getSequence()[1]->getAsTyped(); // coord
assert(argCoord->getVectorSize() == 4);
TIntermTyped *w = intermediate.addConstantUnion(3, loc, true);
TIntermTyped *argLod = intermediate.addIndex(EOpIndexDirect, argCoord, w, loc);
TOperator constructOp = EOpNull;
const TSampler &sampler = argSamp->getType().getSampler();
int coordSize = 0;
switch (sampler.dim)
{
case Esd1D: constructOp = EOpConstructFloat; coordSize = 1; break; // 1D
case Esd2D: constructOp = EOpConstructVec2; coordSize = 2; break; // 2D
case Esd3D: constructOp = EOpConstructVec3; coordSize = 3; break; // 3D
case EsdCube: constructOp = EOpConstructVec3; coordSize = 3; break; // also 3D
default:
break;
}
TIntermAggregate *constructCoord = new TIntermAggregate(constructOp);
constructCoord->getSequence().push_back(argCoord);
constructCoord->setLoc(loc);
constructCoord->setType(TType(argCoord->getBasicType(), EvqTemporary, coordSize));
TIntermAggregate *tex = new TIntermAggregate(EOpTextureLod);
tex->getSequence().push_back(argSamp); // sampler
tex->getSequence().push_back(constructCoord); // coordinate
tex->getSequence().push_back(argLod); // lod
node = convertReturn(tex, sampler);
break;
}
case EOpTextureBias: case EOpTextureBias:
{ {

View File

@ -698,17 +698,17 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "step", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, { "step", nullptr, nullptr, "SVM,", "F,", EShLangAll, false },
{ "tan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "tan", nullptr, nullptr, "SVM", "F", EShLangAll, false },
{ "tanh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "tanh", nullptr, nullptr, "SVM", "F", EShLangAll, false },
{ "tex1D", "V4", "F", "V1,S", "S,F", EShLangPS, false }, { "tex1D", "V4", "F", "S,S", "S,F", EShLangPS, false },
{ "tex1D", "V4", "F", "V1,S,V1,", "S,F,,", EShLangPS, false }, { "tex1D", "V4", "F", "S,S,V1,", "S,F,,", EShLangPS, false },
{ "tex1Dbias", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, { "tex1Dbias", "V4", "F", "S,V4", "S,F", EShLangPS, false },
{ "tex1Dgrad", "V4", "F", "V1,,,", "S,F,,", EShLangPS, false }, { "tex1Dgrad", "V4", "F", "S,,,", "S,F,,", EShLangPS, false },
{ "tex1Dlod", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, { "tex1Dlod", "V4", "F", "S,V4", "S,F", EShLangPS, false },
{ "tex1Dproj", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, { "tex1Dproj", "V4", "F", "S,V4", "S,F", EShLangPS, false },
{ "tex2D", "V4", "F", "V2,", "S,F", EShLangPS, false }, { "tex2D", "V4", "F", "V2,", "S,F", EShLangPS, false },
{ "tex2D", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, { "tex2D", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false },
{ "tex2Dbias", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, { "tex2Dbias", "V4", "F", "V2,V4", "S,F", EShLangPS, false },
{ "tex2Dgrad", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, { "tex2Dgrad", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false },
{ "tex2Dlod", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, { "tex2Dlod", "V4", "F", "V2,V4", "S,F", EShLangAll, false },
{ "tex2Dproj", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, { "tex2Dproj", "V4", "F", "V2,V4", "S,F", EShLangPS, false },
{ "tex3D", "V4", "F", "V3,", "S,F", EShLangPS, false }, { "tex3D", "V4", "F", "V3,", "S,F", EShLangPS, false },
{ "tex3D", "V4", "F", "V3,,,", "S,F,,", EShLangPS, false }, { "tex3D", "V4", "F", "V3,,,", "S,F,,", EShLangPS, false },