Updated glslang.
This commit is contained in:
parent
e8658ce369
commit
9a3d580f01
10
3rdparty/glslang/SPIRV/SpvTools.cpp
vendored
10
3rdparty/glslang/SPIRV/SpvTools.cpp
vendored
@ -152,6 +152,13 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
|
||||
out << std::endl;
|
||||
});
|
||||
|
||||
// If debug (specifically source line info) is being generated, propagate
|
||||
// line information into all SPIR-V instructions. This avoids loss of
|
||||
// information when instructions are deleted or moved. Later, remove
|
||||
// redundant information to minimize final SPRIR-V size.
|
||||
if (options->generateDebugInfo) {
|
||||
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
|
||||
}
|
||||
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
|
||||
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
|
||||
@ -180,6 +187,9 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
|
||||
}
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
|
||||
if (options->generateDebugInfo) {
|
||||
optimizer.RegisterPass(spvtools::CreateRedundantLineInfoElimPass());
|
||||
}
|
||||
|
||||
optimizer.Run(spirv.data(), spirv.size(), &spirv);
|
||||
}
|
||||
|
146
3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out
vendored
Normal file
146
3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
hlsl.pp.line4.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 115
|
||||
|
||||
Capability Shader
|
||||
2: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 5 "MainPs" 70 74
|
||||
ExecutionMode 5 OriginUpperLeft
|
||||
1: String "hlsl.pp.line4.frag"
|
||||
17: String "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
|
||||
32: String "C:\\Users\\Greg\\shaders\\line\\u1.h"
|
||||
Source HLSL 500 1 "// OpModuleProcessed auto-map-locations
|
||||
// OpModuleProcessed auto-map-bindings
|
||||
// OpModuleProcessed entry-point MainPs
|
||||
// OpModuleProcessed client vulkan100
|
||||
// OpModuleProcessed target-env vulkan1.0
|
||||
// OpModuleProcessed keep-uncalled
|
||||
// OpModuleProcessed hlsl-offsets
|
||||
#line 1
|
||||
#line 1 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
|
||||
Texture2D g_tColor [ 128 ] ;
|
||||
|
||||
layout ( push_constant ) cbuffer PerViewConstantBuffer_t
|
||||
{
|
||||
uint g_nDataIdx ;
|
||||
uint g_nDataIdx2 ;
|
||||
bool g_B ;
|
||||
} ;
|
||||
|
||||
#line 12
|
||||
SamplerState g_sAniso ;
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 vTextureCoords : TEXCOORD2 ;
|
||||
} ;
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 vColor : SV_Target0 ;
|
||||
} ;
|
||||
|
||||
PS_OUTPUT MainPs ( PS_INPUT i )
|
||||
{
|
||||
PS_OUTPUT ps_output ;
|
||||
|
||||
uint u ;
|
||||
if ( g_B )
|
||||
|
||||
|
||||
#line 1 "C:\\Users\\Greg\\shaders\\line\\u1.h"
|
||||
u = g_nDataIdx ;
|
||||
|
||||
|
||||
#line 31 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
|
||||
else
|
||||
u = g_nDataIdx2 ;
|
||||
ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ) ;
|
||||
return ps_output ;
|
||||
}
|
||||
|
||||
"
|
||||
Name 5 "MainPs"
|
||||
Name 19 "PerViewConstantBuffer_t"
|
||||
MemberName 19(PerViewConstantBuffer_t) 0 "g_nDataIdx"
|
||||
MemberName 19(PerViewConstantBuffer_t) 1 "g_nDataIdx2"
|
||||
MemberName 19(PerViewConstantBuffer_t) 2 "g_B"
|
||||
Name 21 ""
|
||||
Name 48 "g_tColor"
|
||||
Name 55 "g_sAniso"
|
||||
Name 70 "i.vTextureCoords"
|
||||
Name 74 "@entryPointOutput.vColor"
|
||||
MemberDecorate 19(PerViewConstantBuffer_t) 0 Offset 0
|
||||
MemberDecorate 19(PerViewConstantBuffer_t) 1 Offset 4
|
||||
MemberDecorate 19(PerViewConstantBuffer_t) 2 Offset 8
|
||||
Decorate 19(PerViewConstantBuffer_t) Block
|
||||
Decorate 48(g_tColor) DescriptorSet 0
|
||||
Decorate 48(g_tColor) Binding 0
|
||||
Decorate 55(g_sAniso) DescriptorSet 0
|
||||
Decorate 55(g_sAniso) Binding 0
|
||||
Decorate 70(i.vTextureCoords) Location 0
|
||||
Decorate 74(@entryPointOutput.vColor) Location 0
|
||||
3: TypeVoid
|
||||
4: TypeFunction 3
|
||||
7: TypeFloat 32
|
||||
8: TypeVector 7(float) 2
|
||||
11: TypeVector 7(float) 4
|
||||
18: TypeInt 32 0
|
||||
19(PerViewConstantBuffer_t): TypeStruct 18(int) 18(int) 18(int)
|
||||
20: TypePointer PushConstant 19(PerViewConstantBuffer_t)
|
||||
21: 20(ptr) Variable PushConstant
|
||||
22: TypeInt 32 1
|
||||
23: 22(int) Constant 2
|
||||
24: TypePointer PushConstant 18(int)
|
||||
27: TypeBool
|
||||
28: 18(int) Constant 0
|
||||
35: 22(int) Constant 0
|
||||
39: 22(int) Constant 1
|
||||
44: TypeImage 7(float) 2D sampled format:Unknown
|
||||
45: 18(int) Constant 128
|
||||
46: TypeArray 44 45
|
||||
47: TypePointer UniformConstant 46
|
||||
48(g_tColor): 47(ptr) Variable UniformConstant
|
||||
50: TypePointer UniformConstant 44
|
||||
53: TypeSampler
|
||||
54: TypePointer UniformConstant 53
|
||||
55(g_sAniso): 54(ptr) Variable UniformConstant
|
||||
57: TypeSampledImage 44
|
||||
69: TypePointer Input 8(fvec2)
|
||||
70(i.vTextureCoords): 69(ptr) Variable Input
|
||||
73: TypePointer Output 11(fvec4)
|
||||
74(@entryPointOutput.vColor): 73(ptr) Variable Output
|
||||
5(MainPs): 3 Function None 4
|
||||
6: Label
|
||||
Line 17 25 0
|
||||
71: 8(fvec2) Load 70(i.vTextureCoords)
|
||||
Line 17 29 0
|
||||
82: 24(ptr) AccessChain 21 23
|
||||
83: 18(int) Load 82
|
||||
84: 27(bool) INotEqual 83 28
|
||||
SelectionMerge 85 None
|
||||
BranchConditional 84 86 87
|
||||
86: Label
|
||||
Line 32 1 0
|
||||
88: 24(ptr) AccessChain 21 35
|
||||
89: 18(int) Load 88
|
||||
Branch 85
|
||||
87: Label
|
||||
Line 17 32 0
|
||||
90: 24(ptr) AccessChain 21 39
|
||||
91: 18(int) Load 90
|
||||
Branch 85
|
||||
85: Label
|
||||
114: 18(int) Phi 89 86 91 87
|
||||
Line 17 33 0
|
||||
93: 50(ptr) AccessChain 48(g_tColor) 114
|
||||
94: 44 Load 93
|
||||
95: 53 Load 55(g_sAniso)
|
||||
96: 57 SampledImage 94 95
|
||||
99: 11(fvec4) ImageSampleImplicitLod 96 71
|
||||
Line 17 25 0
|
||||
Store 74(@entryPointOutput.vColor) 99
|
||||
Return
|
||||
FunctionEnd
|
@ -1,8 +1,7 @@
|
||||
spv.memoryScopeSemantics.comp
|
||||
Validation failed
|
||||
// Module Version 10000
|
||||
// Module Version 10300
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 142
|
||||
// Id's are bound by 143
|
||||
|
||||
Capability Shader
|
||||
Capability Int64
|
||||
@ -40,36 +39,36 @@ Validation failed
|
||||
Name 98 "BufferK"
|
||||
MemberName 98(BufferK) 0 "x"
|
||||
Name 100 "bufferk"
|
||||
Name 109 "imagej"
|
||||
Name 121 "samp"
|
||||
Name 132 "atomu64"
|
||||
Name 137 "atomi64"
|
||||
Name 110 "imagej"
|
||||
Name 122 "samp"
|
||||
Name 133 "atomu64"
|
||||
Name 138 "atomi64"
|
||||
Decorate 36(imagei) DescriptorSet 0
|
||||
Decorate 36(imagei) Binding 1
|
||||
Decorate 45(imageu) DescriptorSet 0
|
||||
Decorate 45(imageu) Binding 0
|
||||
MemberDecorate 65(BufferU) 0 Offset 0
|
||||
Decorate 65(BufferU) BufferBlock
|
||||
Decorate 65(BufferU) Block
|
||||
Decorate 67(bufferu) DescriptorSet 0
|
||||
Decorate 67(bufferu) Binding 2
|
||||
MemberDecorate 77(BufferI) 0 Offset 0
|
||||
Decorate 77(BufferI) BufferBlock
|
||||
Decorate 77(BufferI) Block
|
||||
Decorate 79(bufferi) DescriptorSet 0
|
||||
Decorate 79(bufferi) Binding 3
|
||||
Decorate 82 ArrayStride 4
|
||||
MemberDecorate 83(A) 0 Offset 0
|
||||
MemberDecorate 84(BufferJ) 0 Offset 0
|
||||
Decorate 84(BufferJ) BufferBlock
|
||||
Decorate 84(BufferJ) Block
|
||||
Decorate 87(bufferj) DescriptorSet 0
|
||||
Decorate 87(bufferj) Binding 4
|
||||
MemberDecorate 98(BufferK) 0 Offset 0
|
||||
Decorate 98(BufferK) Block
|
||||
Decorate 100(bufferk) DescriptorSet 0
|
||||
Decorate 100(bufferk) Binding 7
|
||||
Decorate 109(imagej) DescriptorSet 0
|
||||
Decorate 109(imagej) Binding 5
|
||||
Decorate 121(samp) DescriptorSet 0
|
||||
Decorate 121(samp) Binding 6
|
||||
Decorate 110(imagej) DescriptorSet 0
|
||||
Decorate 110(imagej) Binding 5
|
||||
Decorate 122(samp) DescriptorSet 0
|
||||
Decorate 122(samp) Binding 6
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
@ -111,47 +110,48 @@ Validation failed
|
||||
61: 15(int) Constant 10
|
||||
63: 15(int) Constant 322
|
||||
65(BufferU): TypeStruct 15(int)
|
||||
66: TypePointer Uniform 65(BufferU)
|
||||
67(bufferu): 66(ptr) Variable Uniform
|
||||
68: TypePointer Uniform 15(int)
|
||||
66: TypePointer StorageBuffer 65(BufferU)
|
||||
67(bufferu): 66(ptr) Variable StorageBuffer
|
||||
68: TypePointer StorageBuffer 15(int)
|
||||
70: 15(int) Constant 1
|
||||
77(BufferI): TypeStruct 15(int)
|
||||
78: TypePointer Uniform 77(BufferI)
|
||||
79(bufferi): 78(ptr) Variable Uniform
|
||||
78: TypePointer StorageBuffer 77(BufferI)
|
||||
79(bufferi): 78(ptr) Variable StorageBuffer
|
||||
82: TypeArray 15(int) 26
|
||||
83(A): TypeStruct 82
|
||||
84(BufferJ): TypeStruct 83(A)
|
||||
85: TypeArray 84(BufferJ) 26
|
||||
86: TypePointer Uniform 85
|
||||
87(bufferj): 86(ptr) Variable Uniform
|
||||
94: TypePointer Uniform 83(A)
|
||||
86: TypePointer StorageBuffer 85
|
||||
87(bufferj): 86(ptr) Variable StorageBuffer
|
||||
94: TypePointer StorageBuffer 83(A)
|
||||
98(BufferK): TypeStruct 15(int)
|
||||
99: TypePointer Uniform 98(BufferK)
|
||||
100(bufferk): 99(ptr) Variable Uniform
|
||||
105: TypeVector 6(int) 4
|
||||
107: TypeArray 34 26
|
||||
108: TypePointer UniformConstant 107
|
||||
109(imagej): 108(ptr) Variable UniformConstant
|
||||
115: 105(ivec4) ConstantComposite 38 38 38 38
|
||||
116: TypeFloat 32
|
||||
117: TypeImage 116(float) 2D sampled format:Unknown
|
||||
118: TypeSampledImage 117
|
||||
119: TypeArray 118 26
|
||||
120: TypePointer UniformConstant 119
|
||||
121(samp): 120(ptr) Variable UniformConstant
|
||||
122: TypePointer UniformConstant 118
|
||||
125: TypeVector 116(float) 2
|
||||
126: 116(float) Constant 0
|
||||
127: 125(fvec2) ConstantComposite 126 126
|
||||
128: TypeVector 116(float) 4
|
||||
130: TypeInt 64 0
|
||||
131: TypePointer Workgroup 130(int64_t)
|
||||
132(atomu64): 131(ptr) Variable Workgroup
|
||||
133:130(int64_t) Constant 7 0
|
||||
135: TypeInt 64 1
|
||||
136: TypePointer Workgroup 135(int64_t)
|
||||
137(atomi64): 136(ptr) Variable Workgroup
|
||||
138:135(int64_t) Constant 10 0
|
||||
101: TypePointer Uniform 15(int)
|
||||
106: TypeVector 6(int) 4
|
||||
108: TypeArray 34 26
|
||||
109: TypePointer UniformConstant 108
|
||||
110(imagej): 109(ptr) Variable UniformConstant
|
||||
116: 106(ivec4) ConstantComposite 38 38 38 38
|
||||
117: TypeFloat 32
|
||||
118: TypeImage 117(float) 2D sampled format:Unknown
|
||||
119: TypeSampledImage 118
|
||||
120: TypeArray 119 26
|
||||
121: TypePointer UniformConstant 120
|
||||
122(samp): 121(ptr) Variable UniformConstant
|
||||
123: TypePointer UniformConstant 119
|
||||
126: TypeVector 117(float) 2
|
||||
127: 117(float) Constant 0
|
||||
128: 126(fvec2) ConstantComposite 127 127
|
||||
129: TypeVector 117(float) 4
|
||||
131: TypeInt 64 0
|
||||
132: TypePointer Workgroup 131(int64_t)
|
||||
133(atomu64): 132(ptr) Variable Workgroup
|
||||
134:131(int64_t) Constant 7 0
|
||||
136: TypeInt 64 1
|
||||
137: TypePointer Workgroup 136(int64_t)
|
||||
138(atomi64): 137(ptr) Variable Workgroup
|
||||
139:136(int64_t) Constant 10 0
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(origi): 7(ptr) Variable Function
|
||||
@ -216,25 +216,25 @@ Validation failed
|
||||
96: 83(A) Load 95 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 46
|
||||
97: 94(ptr) AccessChain 87(bufferj) 38 38
|
||||
Store 97 96 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 46
|
||||
101: 68(ptr) AccessChain 100(bufferk) 38
|
||||
102: 15(int) Load 101 NonPrivatePointerKHR
|
||||
103: 68(ptr) AccessChain 79(bufferi) 38
|
||||
Store 103 102 MakePointerAvailableKHR NonPrivatePointerKHR 16
|
||||
104: 34 Load 36(imagei)
|
||||
106: 105(ivec4) ImageRead 104 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16
|
||||
110: 35(ptr) AccessChain 109(imagej) 38
|
||||
111: 34 Load 110
|
||||
112: 105(ivec4) ImageRead 111 39 NonPrivateTexelKHR
|
||||
113: 35(ptr) AccessChain 109(imagej) 12
|
||||
114: 34 Load 113
|
||||
ImageWrite 114 39 115 NonPrivateTexelKHR
|
||||
123: 122(ptr) AccessChain 121(samp) 38
|
||||
124: 118 Load 123
|
||||
129: 128(fvec4) ImageSampleExplicitLod 124 127 Lod NonPrivateTexelKHR 126
|
||||
134:130(int64_t) AtomicUMax 132(atomu64) 12 17 133
|
||||
Store 132(atomu64) 134 MakePointerAvailableKHR NonPrivatePointerKHR 26
|
||||
139:130(int64_t) Load 132(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26
|
||||
140:135(int64_t) Bitcast 139
|
||||
141:135(int64_t) AtomicCompareExchange 137(atomi64) 12 63 63 140 138
|
||||
102: 101(ptr) AccessChain 100(bufferk) 38
|
||||
103: 15(int) Load 102 NonPrivatePointerKHR
|
||||
104: 68(ptr) AccessChain 79(bufferi) 38
|
||||
Store 104 103 MakePointerAvailableKHR NonPrivatePointerKHR 16
|
||||
105: 34 Load 36(imagei)
|
||||
107: 106(ivec4) ImageRead 105 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16
|
||||
111: 35(ptr) AccessChain 110(imagej) 38
|
||||
112: 34 Load 111
|
||||
113: 106(ivec4) ImageRead 112 39 NonPrivateTexelKHR
|
||||
114: 35(ptr) AccessChain 110(imagej) 12
|
||||
115: 34 Load 114
|
||||
ImageWrite 115 39 116 NonPrivateTexelKHR
|
||||
124: 123(ptr) AccessChain 122(samp) 38
|
||||
125: 119 Load 124
|
||||
130: 129(fvec4) ImageSampleExplicitLod 125 128 Lod NonPrivateTexelKHR 127
|
||||
135:131(int64_t) AtomicUMax 133(atomu64) 12 17 134
|
||||
Store 133(atomu64) 135 MakePointerAvailableKHR NonPrivatePointerKHR 26
|
||||
140:131(int64_t) Load 133(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26
|
||||
141:136(int64_t) Bitcast 140
|
||||
142:136(int64_t) AtomicCompareExchange 138(atomi64) 12 63 63 141 139
|
||||
Return
|
||||
FunctionEnd
|
||||
|
42
3rdparty/glslang/Test/hlsl.pp.line4.frag
vendored
Normal file
42
3rdparty/glslang/Test/hlsl.pp.line4.frag
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
#line 1 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
|
||||
Texture2D g_tColor [ 128 ] ;
|
||||
|
||||
layout ( push_constant ) cbuffer PerViewConstantBuffer_t
|
||||
{
|
||||
uint g_nDataIdx ;
|
||||
uint g_nDataIdx2 ;
|
||||
bool g_B ;
|
||||
} ;
|
||||
|
||||
#line 12
|
||||
SamplerState g_sAniso ;
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 vTextureCoords : TEXCOORD2 ;
|
||||
} ;
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 vColor : SV_Target0 ;
|
||||
} ;
|
||||
|
||||
PS_OUTPUT MainPs ( PS_INPUT i )
|
||||
{
|
||||
PS_OUTPUT ps_output ;
|
||||
|
||||
uint u ;
|
||||
if ( g_B )
|
||||
|
||||
|
||||
#line 1 "C:\\Users\\Greg\\shaders\\line\\u1.h"
|
||||
u = g_nDataIdx ;
|
||||
|
||||
|
||||
#line 31 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
|
||||
else
|
||||
u = g_nDataIdx2 ;
|
||||
ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ) ;
|
||||
return ps_output ;
|
||||
}
|
||||
|
@ -759,13 +759,13 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setDConst(unionArray[i].getU8Const()); break;
|
||||
|
||||
case EOpConvInt16ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getI16Const())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getI16Const())); break;
|
||||
case EOpConvInt16ToInt:
|
||||
newConstArray[i].setIConst(unionArray[i].getI16Const()); break;
|
||||
case EOpConvInt16ToInt64:
|
||||
newConstArray[i].setI64Const(unionArray[i].getI16Const()); break;
|
||||
case EOpConvInt16ToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getI16Const())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getI16Const())); break;
|
||||
case EOpConvInt16ToUint16:
|
||||
newConstArray[i].setU16Const(unionArray[i].getI16Const()); break;
|
||||
case EOpConvInt16ToUint:
|
||||
@ -773,7 +773,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpConvInt16ToUint64:
|
||||
newConstArray[i].setU64Const(unionArray[i].getI16Const()); break;
|
||||
case EOpConvUint16ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getU16Const())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getU16Const())); break;
|
||||
case EOpConvUint16ToInt16:
|
||||
newConstArray[i].setI16Const(unionArray[i].getU16Const()); break;
|
||||
case EOpConvUint16ToInt:
|
||||
@ -781,7 +781,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpConvUint16ToInt64:
|
||||
newConstArray[i].setI64Const(unionArray[i].getU16Const()); break;
|
||||
case EOpConvUint16ToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getU16Const())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getU16Const())); break;
|
||||
|
||||
case EOpConvUint16ToUint:
|
||||
newConstArray[i].setUConst(unionArray[i].getU16Const()); break;
|
||||
@ -842,33 +842,33 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpConvUintToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||
case EOpConvInt64ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<int16_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToInt:
|
||||
newConstArray[i].setIConst(static_cast<int32_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<uint16_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToUint:
|
||||
newConstArray[i].setUConst(static_cast<uint32_t>(unionArray[i].getI64Const())); break;
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToUint64:
|
||||
newConstArray[i].setU64Const(unionArray[i].getI64Const()); break;
|
||||
case EOpConvUint64ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvUint64ToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<int16_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvUint64ToInt:
|
||||
newConstArray[i].setIConst(static_cast<int32_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvUint64ToInt64:
|
||||
newConstArray[i].setI64Const(unionArray[i].getU64Const()); break;
|
||||
case EOpConvUint64ToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvUint64ToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<uint16_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvUint64ToUint:
|
||||
newConstArray[i].setUConst(static_cast<uint32_t>(unionArray[i].getU64Const())); break;
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvInt64ToFloat16:
|
||||
newConstArray[i].setDConst(static_cast<double>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToFloat:
|
||||
@ -882,61 +882,61 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpConvUint64ToDouble:
|
||||
newConstArray[i].setDConst(static_cast<double>(unionArray[i].getU64Const())); break;
|
||||
case EOpConvFloat16ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<int16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToInt:
|
||||
newConstArray[i].setIConst(static_cast<int32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToInt64:
|
||||
newConstArray[i].setI64Const(static_cast<int64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<uint16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToUint:
|
||||
newConstArray[i].setUConst(static_cast<uint32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToUint64:
|
||||
newConstArray[i].setU64Const(static_cast<uint64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloat16ToFloat:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvFloat16ToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvFloatToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<int16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt:
|
||||
newConstArray[i].setIConst(static_cast<int32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt64:
|
||||
newConstArray[i].setI64Const(static_cast<int64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<uint16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint:
|
||||
newConstArray[i].setUConst(static_cast<uint32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint64:
|
||||
newConstArray[i].setU64Const(static_cast<uint64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvFloatToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvDoubleToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<int8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<int16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt:
|
||||
newConstArray[i].setIConst(static_cast<int32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt64:
|
||||
newConstArray[i].setI64Const(static_cast<int64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<uint8_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<uint16_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint:
|
||||
newConstArray[i].setUConst(static_cast<uint32_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint64:
|
||||
newConstArray[i].setU64Const(static_cast<uint64_t>(unionArray[i].getDConst())); break;
|
||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvDoubleToFloat:
|
||||
|
@ -2,10 +2,20 @@ add_library(OSDependent STATIC ossource.cpp ../osinclude.h)
|
||||
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
|
||||
set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# Link pthread
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
target_link_libraries(OSDependent Threads::Threads)
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
||||
# Needed as long as we support CMake 2.8 for Ubuntu 14.04,
|
||||
# which does not support the recommended Threads::Threads target.
|
||||
# https://cmake.org/cmake/help/v2.8.12/cmake.html#module:FindThreads
|
||||
find_package(Threads)
|
||||
target_link_libraries(OSDependent ${CMAKE_THREAD_LIBS_INIT})
|
||||
else()
|
||||
# This is the recommended way, so we use it for 3.1+.
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
target_link_libraries(OSDependent Threads::Threads)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GLSLANG_INSTALL)
|
||||
install(TARGETS OSDependent
|
||||
|
22
3rdparty/glslang/gtests/Hlsl.FromFile.cpp
vendored
22
3rdparty/glslang/gtests/Hlsl.FromFile.cpp
vendored
@ -63,6 +63,7 @@ using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameE
|
||||
using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
|
||||
using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
|
||||
using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
|
||||
using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
|
||||
|
||||
// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected
|
||||
// to successfully generate both AST and SPIR-V.
|
||||
@ -115,6 +116,17 @@ TEST_P(HlslDX9CompatibleTest, FromFile)
|
||||
EShMessages::EShMsgHlslDX9Compatible);
|
||||
}
|
||||
|
||||
// Compiling HLSL to legalized SPIR-V with debug instructions. Expected to
|
||||
// successfully generate SPIR-V with debug instructions preserved through
|
||||
// legalization, particularly line info.
|
||||
TEST_P(HlslLegalDebugTest, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
|
||||
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
|
||||
Target::Spv, true, GetParam().entryPoint,
|
||||
"/baseResults/", true, true);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
ToSpirv, HlslCompileTest,
|
||||
@ -474,6 +486,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
}),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
ToSpirv, HlslLegalDebugTest,
|
||||
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
|
||||
{"hlsl.pp.line4.frag", "MainPs"}
|
||||
}),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
// clang-format on
|
||||
|
||||
} // anonymous namespace
|
||||
|
4
3rdparty/glslang/gtests/Spv.FromFile.cpp
vendored
4
3rdparty/glslang/gtests/Spv.FromFile.cpp
vendored
@ -304,8 +304,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"spv.matrix.frag",
|
||||
"spv.matrix2.frag",
|
||||
"spv.memoryQualifier.frag",
|
||||
"spv.memoryScopeSemantics.comp",
|
||||
"spv.memoryScopeSemantics_Error.comp",
|
||||
"spv.merge-unreachable.frag",
|
||||
"spv.multiStruct.comp",
|
||||
"spv.multiStructFuncall.frag",
|
||||
@ -404,6 +402,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"spv.explicittypes.frag",
|
||||
"spv.float32.frag",
|
||||
"spv.float64.frag",
|
||||
"spv.memoryScopeSemantics.comp",
|
||||
"spv.memoryScopeSemantics_Error.comp",
|
||||
"spv.multiView.frag",
|
||||
"spv.RayGenShader11.rgen",
|
||||
"spv.subgroup.frag",
|
||||
|
Loading…
x
Reference in New Issue
Block a user