2 // Copyright (C) 2016 Google, Inc.
3 // Copyright (C) 2016 LunarG, Inc.
5 // All rights reserved.
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
11 // Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
14 // Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following
16 // disclaimer in the documentation and/or other materials provided
17 // with the distribution.
19 // Neither the name of Google Inc. nor the names of its
20 // contributors may be used to endorse or promote products derived
21 // from this software without specific prior written permission.
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 // POSSIBILITY OF SUCH DAMAGE.
36 #include <gtest/gtest.h>
38 #include "TestFixture.h"
40 namespace glslangtest {
43 struct FileNameEntryPointPair {
45 const char* entryPoint;
48 // We are using FileNameEntryPointPair objects as parameters for instantiating
49 // the template, so the global FileNameAsCustomTestSuffix() won't work since
50 // it assumes std::string as parameters. Thus, an overriding one here.
51 std::string FileNameAsCustomTestSuffix(
52 const ::testing::TestParamInfo<FileNameEntryPointPair>& info) {
53 std::string name = info.param.fileName;
54 // A valid test case suffix cannot have '.' and '-' inside.
55 std::replace(name.begin(), name.end(), '.', '_');
56 std::replace(name.begin(), name.end(), '-', '_');
60 using HlslCompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
61 using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
62 using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
63 using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
64 using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
65 using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
66 using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
68 // Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected
69 // to successfully generate both AST and SPIR-V.
70 TEST_P(HlslCompileTest, FromFile)
72 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
73 Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
74 Target::BothASTAndSpv, true, GetParam().entryPoint);
77 TEST_P(HlslVulkan1_1CompileTest, FromFile)
79 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
80 Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
81 Target::BothASTAndSpv, true, GetParam().entryPoint);
84 TEST_P(HlslCompileAndFlattenTest, FromFile)
86 loadFileCompileFlattenUniformsAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
87 Source::HLSL, Semantics::Vulkan,
88 Target::BothASTAndSpv, GetParam().entryPoint);
91 // Compiling HLSL to legal SPIR-V under Vulkan semantics. Expected to
92 // successfully generate SPIR-V.
93 TEST_P(HlslLegalizeTest, FromFile)
95 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
96 Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
97 Target::Spv, true, GetParam().entryPoint,
98 "/baseLegalResults/", true);
101 // Compiling HLSL to pre-legalized SPIR-V. Expected to successfully generate
102 // SPIR-V with debug instructions, particularly line info.
103 TEST_P(HlslDebugTest, FromFile)
105 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
106 Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
107 Target::Spv, true, GetParam().entryPoint,
108 "/baseResults/", false, true);
111 TEST_P(HlslDX9CompatibleTest, FromFile)
113 loadFileCompileAndCheckWithOptions(GlobalTestSettings.testRoot, GetParam().fileName, Source::HLSL,
114 Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
115 Target::BothASTAndSpv, true,
116 GetParam().entryPoint, "/baseResults/",
117 EShMessages::EShMsgHlslDX9Compatible);
120 // Compiling HLSL to legalized SPIR-V with debug instructions. Expected to
121 // successfully generate SPIR-V with debug instructions preserved through
122 // legalization, particularly line info.
123 TEST_P(HlslLegalDebugTest, FromFile)
125 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
126 Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
127 Target::Spv, true, GetParam().entryPoint,
128 "/baseResults/", true, true);
132 INSTANTIATE_TEST_CASE_P(
133 ToSpirv, HlslCompileTest,
134 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
135 {"hlsl.amend.frag", "f1"},
136 {"hlsl.aliasOpaque.frag", "main"},
137 {"hlsl.array.frag", "PixelShaderFunction"},
138 {"hlsl.array.implicit-size.frag", "PixelShaderFunction"},
139 {"hlsl.array.multidim.frag", "main"},
140 {"hlsl.assoc.frag", "PixelShaderFunction"},
141 {"hlsl.attribute.frag", "PixelShaderFunction"},
142 {"hlsl.attribute.expression.comp", "main"},
143 {"hlsl.attributeC11.frag", "main"},
144 {"hlsl.attributeGlobalBuffer.frag", "main"},
145 {"hlsl.basic.comp", "main"},
146 {"hlsl.basic.geom", "main"},
147 {"hlsl.boolConv.vert", "main"},
148 {"hlsl.buffer.frag", "PixelShaderFunction"},
149 {"hlsl.calculatelod.dx10.frag", "main"},
150 {"hlsl.calculatelodunclamped.dx10.frag", "main"},
151 {"hlsl.cast.frag", "PixelShaderFunction"},
152 {"hlsl.cbuffer-identifier.vert", "main"},
153 {"hlsl.charLit.vert", "main"},
154 {"hlsl.clip.frag", "main"},
155 {"hlsl.clipdistance-1.frag", "main"},
156 {"hlsl.clipdistance-1.geom", "main"},
157 {"hlsl.clipdistance-1.vert", "main"},
158 {"hlsl.clipdistance-2.frag", "main"},
159 {"hlsl.clipdistance-2.geom", "main"},
160 {"hlsl.clipdistance-2.vert", "main"},
161 {"hlsl.clipdistance-3.frag", "main"},
162 {"hlsl.clipdistance-3.geom", "main"},
163 {"hlsl.clipdistance-3.vert", "main"},
164 {"hlsl.clipdistance-4.frag", "main"},
165 {"hlsl.clipdistance-4.geom", "main"},
166 {"hlsl.clipdistance-4.vert", "main"},
167 {"hlsl.clipdistance-5.frag", "main"},
168 {"hlsl.clipdistance-5.vert", "main"},
169 {"hlsl.clipdistance-6.frag", "main"},
170 {"hlsl.clipdistance-6.vert", "main"},
171 {"hlsl.clipdistance-7.frag", "main"},
172 {"hlsl.clipdistance-7.vert", "main"},
173 {"hlsl.clipdistance-8.frag", "main"},
174 {"hlsl.clipdistance-8.vert", "main"},
175 {"hlsl.clipdistance-9.frag", "main"},
176 {"hlsl.clipdistance-9.vert", "main"},
177 {"hlsl.color.hull.tesc", "main"},
178 {"hlsl.comparison.vec.frag", "main"},
179 {"hlsl.conditional.frag", "PixelShaderFunction"},
180 {"hlsl.constantbuffer.frag", "main"},
181 {"hlsl.constructArray.vert", "main"},
182 {"hlsl.constructexpr.frag", "main"},
183 {"hlsl.constructimat.frag", "main"},
184 {"hlsl.coverage.frag", "main"},
185 {"hlsl.depthGreater.frag", "PixelShaderFunction"},
186 {"hlsl.depthLess.frag", "PixelShaderFunction"},
187 {"hlsl.discard.frag", "PixelShaderFunction"},
188 {"hlsl.doLoop.frag", "PixelShaderFunction"},
189 {"hlsl.earlydepthstencil.frag", "main"},
190 {"hlsl.emptystructreturn.frag", "main"},
191 {"hlsl.emptystructreturn.vert", "main"},
192 {"hlsl.emptystruct.init.vert", "main"},
193 {"hlsl.entry-in.frag", "PixelShaderFunction"},
194 {"hlsl.entry-out.frag", "PixelShaderFunction"},
195 {"hlsl.fraggeom.frag", "main"},
196 {"hlsl.float1.frag", "PixelShaderFunction"},
197 {"hlsl.float4.frag", "PixelShaderFunction"},
198 {"hlsl.flatten.return.frag", "main"},
199 {"hlsl.flattenOpaque.frag", "main"},
200 {"hlsl.flattenOpaqueInit.vert", "main"},
201 {"hlsl.flattenOpaqueInitMix.vert", "main"},
202 {"hlsl.flattenSubset.frag", "main"},
203 {"hlsl.flattenSubset2.frag", "main"},
204 {"hlsl.forLoop.frag", "PixelShaderFunction"},
205 {"hlsl.gather.array.dx10.frag", "main"},
206 {"hlsl.gather.basic.dx10.frag", "main"},
207 {"hlsl.gather.basic.dx10.vert", "main"},
208 {"hlsl.gather.offset.dx10.frag", "main"},
209 {"hlsl.gather.offsetarray.dx10.frag", "main"},
210 {"hlsl.gathercmpRGBA.offset.dx10.frag", "main"},
211 {"hlsl.gatherRGBA.array.dx10.frag", "main"},
212 {"hlsl.gatherRGBA.basic.dx10.frag", "main"},
213 {"hlsl.gatherRGBA.offset.dx10.frag", "main"},
214 {"hlsl.gatherRGBA.offsetarray.dx10.frag", "main"},
215 {"hlsl.getdimensions.dx10.frag", "main"},
216 {"hlsl.getdimensions.rw.dx10.frag", "main"},
217 {"hlsl.getdimensions.dx10.vert", "main"},
218 {"hlsl.getsampleposition.dx10.frag", "main"},
219 {"hlsl.global-const-init.frag", "main"},
220 {"hlsl.gs-hs-mix.tesc", "HSMain"},
221 {"hlsl.domain.1.tese", "main"},
222 {"hlsl.domain.2.tese", "main"},
223 {"hlsl.domain.3.tese", "main"},
224 {"hlsl.function.frag", "main"},
225 {"hlsl.hull.1.tesc", "main"},
226 {"hlsl.hull.2.tesc", "main"},
227 {"hlsl.hull.3.tesc", "main"},
228 {"hlsl.hull.4.tesc", "main"},
229 {"hlsl.hull.5.tesc", "main"},
230 {"hlsl.hull.6.tesc", "main"},
231 {"hlsl.hull.void.tesc", "main"},
232 {"hlsl.hull.ctrlpt-1.tesc", "main"},
233 {"hlsl.hull.ctrlpt-2.tesc", "main"},
234 {"hlsl.format.rwtexture.frag", "main"},
235 {"hlsl.groupid.comp", "main"},
236 {"hlsl.identifier.sample.frag", "main"},
237 {"hlsl.if.frag", "PixelShaderFunction"},
238 {"hlsl.imagefetch-subvec4.comp", "main"},
239 {"hlsl.implicitBool.frag", "main"},
240 {"hlsl.inf.vert", "main"},
241 {"hlsl.inoutquals.frag", "main"},
242 {"hlsl.inoutquals.negative.frag", "main"},
243 {"hlsl.init.frag", "ShaderFunction"},
244 {"hlsl.init2.frag", "main"},
245 {"hlsl.isfinite.frag", "main"},
246 {"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"},
247 {"hlsl.intrinsics.comp", "ComputeShaderFunction"},
248 {"hlsl.intrinsics.evalfns.frag", "main"},
249 {"hlsl.intrinsics.d3dcolortoubyte4.frag", "main"},
250 {"hlsl.intrinsics.double.frag", "PixelShaderFunction"},
251 {"hlsl.intrinsics.f1632.frag", "main"},
252 {"hlsl.intrinsics.f3216.frag", "main"},
253 {"hlsl.intrinsics.frag", "main"},
254 {"hlsl.intrinsic.frexp.frag", "main"},
255 {"hlsl.intrinsics.lit.frag", "PixelShaderFunction"},
256 {"hlsl.intrinsics.negative.comp", "ComputeShaderFunction"},
257 {"hlsl.intrinsics.negative.frag", "PixelShaderFunction"},
258 {"hlsl.intrinsics.negative.vert", "VertexShaderFunction"},
259 {"hlsl.intrinsics.promote.frag", "main"},
260 {"hlsl.intrinsics.promote.down.frag", "main"},
261 {"hlsl.intrinsics.promote.outputs.frag", "main"},
262 {"hlsl.layout.frag", "main"},
263 {"hlsl.layoutOverride.vert", "main"},
264 {"hlsl.load.2dms.dx10.frag", "main"},
265 {"hlsl.load.array.dx10.frag", "main"},
266 {"hlsl.load.basic.dx10.frag", "main"},
267 {"hlsl.load.basic.dx10.vert", "main"},
268 {"hlsl.load.buffer.dx10.frag", "main"},
269 {"hlsl.load.buffer.float.dx10.frag", "main"},
270 {"hlsl.load.rwbuffer.dx10.frag", "main"},
271 {"hlsl.load.rwtexture.dx10.frag", "main"},
272 {"hlsl.load.rwtexture.array.dx10.frag", "main"},
273 {"hlsl.load.offset.dx10.frag", "main"},
274 {"hlsl.load.offsetarray.dx10.frag", "main"},
275 {"hlsl.localStructuredBuffer.comp", "main"},
276 {"hlsl.logical.binary.frag", "main"},
277 {"hlsl.logical.binary.vec.frag", "main"},
278 {"hlsl.logicalConvert.frag", "main"},
279 {"hlsl.logical.unary.frag", "main"},
280 {"hlsl.loopattr.frag", "main"},
281 {"hlsl.matpack-pragma.frag", "main"},
282 {"hlsl.mip.operator.frag", "main"},
283 {"hlsl.mip.negative.frag", "main"},
284 {"hlsl.mip.negative2.frag", "main"},
285 {"hlsl.namespace.frag", "main"},
286 {"hlsl.nonint-index.frag", "main"},
287 {"hlsl.matNx1.frag", "main"},
288 {"hlsl.matpack-1.frag", "main"},
289 {"hlsl.matrixSwizzle.vert", "ShaderFunction"},
290 {"hlsl.memberFunCall.frag", "main"},
291 {"hlsl.mintypes.frag", "main"},
292 {"hlsl.mul-truncate.frag", "main"},
293 {"hlsl.multiEntry.vert", "RealEntrypoint"},
294 {"hlsl.multiReturn.frag", "main"},
295 {"hlsl.matrixindex.frag", "main"},
296 {"hlsl.nonstaticMemberFunction.frag", "main"},
297 {"hlsl.numericsuffixes.frag", "main"},
298 {"hlsl.numthreads.comp", "main_aux2"},
299 {"hlsl.overload.frag", "PixelShaderFunction"},
300 {"hlsl.opaque-type-bug.frag", "main"},
301 {"hlsl.params.default.frag", "main"},
302 {"hlsl.params.default.negative.frag", "main"},
303 {"hlsl.partialInit.frag", "PixelShaderFunction"},
304 {"hlsl.partialFlattenLocal.vert", "main"},
305 {"hlsl.PointSize.geom", "main"},
306 {"hlsl.PointSize.vert", "main"},
307 {"hlsl.pp.vert", "main"},
308 {"hlsl.pp.line.frag", "main"},
309 {"hlsl.precise.frag", "main"},
310 {"hlsl.promote.atomic.frag", "main"},
311 {"hlsl.promote.binary.frag", "main"},
312 {"hlsl.promote.vec1.frag", "main"},
313 {"hlsl.promotions.frag", "main"},
314 {"hlsl.rw.atomics.frag", "main"},
315 {"hlsl.rw.bracket.frag", "main"},
316 {"hlsl.rw.register.frag", "main"},
317 {"hlsl.rw.scalar.bracket.frag", "main"},
318 {"hlsl.rw.swizzle.frag", "main"},
319 {"hlsl.rw.vec2.bracket.frag", "main"},
320 {"hlsl.sample.array.dx10.frag", "main"},
321 {"hlsl.sample.basic.dx10.frag", "main"},
322 {"hlsl.sample.offset.dx10.frag", "main"},
323 {"hlsl.sample.offsetarray.dx10.frag", "main"},
324 {"hlsl.samplebias.array.dx10.frag", "main"},
325 {"hlsl.samplebias.basic.dx10.frag", "main"},
326 {"hlsl.samplebias.offset.dx10.frag", "main"},
327 {"hlsl.samplebias.offsetarray.dx10.frag", "main"},
328 {"hlsl.samplecmp.array.dx10.frag", "main"},
329 {"hlsl.samplecmp.basic.dx10.frag", "main"},
330 {"hlsl.samplecmp.dualmode.frag", "main"},
331 {"hlsl.samplecmp.offset.dx10.frag", "main"},
332 {"hlsl.samplecmp.offsetarray.dx10.frag", "main"},
333 {"hlsl.samplecmp.negative.frag", "main"},
334 {"hlsl.samplecmp.negative2.frag", "main"},
335 {"hlsl.samplecmplevelzero.array.dx10.frag", "main"},
336 {"hlsl.samplecmplevelzero.basic.dx10.frag", "main"},
337 {"hlsl.samplecmplevelzero.offset.dx10.frag", "main"},
338 {"hlsl.samplecmplevelzero.offsetarray.dx10.frag", "main"},
339 {"hlsl.samplegrad.array.dx10.frag", "main"},
340 {"hlsl.samplegrad.basic.dx10.frag", "main"},
341 {"hlsl.samplegrad.basic.dx10.vert", "main"},
342 {"hlsl.samplegrad.offset.dx10.frag", "main"},
343 {"hlsl.samplegrad.offsetarray.dx10.frag", "main"},
344 {"hlsl.samplelevel.array.dx10.frag", "main"},
345 {"hlsl.samplelevel.basic.dx10.frag", "main"},
346 {"hlsl.samplelevel.basic.dx10.vert", "main"},
347 {"hlsl.samplelevel.offset.dx10.frag", "main"},
348 {"hlsl.samplelevel.offsetarray.dx10.frag", "main"},
349 {"hlsl.sample.sub-vec4.dx10.frag", "main"},
350 {"hlsl.scalar-length.frag", "main"},
351 {"hlsl.scalarCast.vert", "main"},
352 {"hlsl.semicolons.frag", "main"},
353 {"hlsl.shapeConv.frag", "main"},
354 {"hlsl.shapeConvRet.frag", "main"},
355 {"hlsl.singleArgIntPromo.vert", "main"},
356 {"hlsl.self_cast.frag", "main"},
357 {"hlsl.snorm.uav.comp", "main"},
358 {"hlsl.specConstant.frag", "main"},
359 {"hlsl.staticMemberFunction.frag", "main"},
360 {"hlsl.staticFuncInit.frag", "main"},
361 {"hlsl.store.rwbyteaddressbuffer.type.comp", "main"},
362 {"hlsl.stringtoken.frag", "main"},
363 {"hlsl.string.frag", "main"},
364 {"hlsl.struct.split-1.vert", "main"},
365 {"hlsl.struct.split.array.geom", "main"},
366 {"hlsl.struct.split.assign.frag", "main"},
367 {"hlsl.struct.split.call.vert", "main"},
368 {"hlsl.struct.split.nested.geom", "main"},
369 {"hlsl.struct.split.trivial.geom", "main"},
370 {"hlsl.struct.split.trivial.vert", "main"},
371 {"hlsl.structarray.flatten.frag", "main"},
372 {"hlsl.structarray.flatten.geom", "main"},
373 {"hlsl.structbuffer.frag", "main"},
374 {"hlsl.structbuffer.append.frag", "main"},
375 {"hlsl.structbuffer.append.fn.frag", "main"},
376 {"hlsl.structbuffer.atomics.frag", "main"},
377 {"hlsl.structbuffer.byte.frag", "main"},
378 {"hlsl.structbuffer.coherent.frag", "main"},
379 {"hlsl.structbuffer.floatidx.comp", "main"},
380 {"hlsl.structbuffer.incdec.frag", "main"},
381 {"hlsl.structbuffer.fn.frag", "main"},
382 {"hlsl.structbuffer.fn2.comp", "main"},
383 {"hlsl.structbuffer.rw.frag", "main"},
384 {"hlsl.structbuffer.rwbyte.frag", "main"},
385 {"hlsl.structin.vert", "main"},
386 {"hlsl.structIoFourWay.frag", "main"},
387 {"hlsl.structStructName.frag", "main"},
388 {"hlsl.subpass.frag", "main"},
389 {"hlsl.synthesizeInput.frag", "main"},
390 {"hlsl.texturebuffer.frag", "main"},
391 {"hlsl.texture.struct.frag", "main"},
392 {"hlsl.texture.subvec4.frag", "main"},
393 {"hlsl.this.frag", "main"},
394 {"hlsl.intrinsics.vert", "VertexShaderFunction"},
395 {"hlsl.intrinsic.frexp.vert", "VertexShaderFunction"},
396 {"hlsl.matType.frag", "PixelShaderFunction"},
397 {"hlsl.matType.bool.frag", "main"},
398 {"hlsl.matType.int.frag", "main"},
399 {"hlsl.max.frag", "PixelShaderFunction"},
400 {"hlsl.preprocessor.frag", "main"},
401 {"hlsl.precedence.frag", "PixelShaderFunction"},
402 {"hlsl.precedence2.frag", "PixelShaderFunction"},
403 {"hlsl.scalar2matrix.frag", "main"},
404 {"hlsl.semantic.geom", "main"},
405 {"hlsl.semantic.vert", "main"},
406 {"hlsl.semantic-1.vert", "main"},
407 {"hlsl.scope.frag", "PixelShaderFunction"},
408 {"hlsl.sin.frag", "PixelShaderFunction"},
409 {"hlsl.struct.frag", "PixelShaderFunction"},
410 {"hlsl.switch.frag", "PixelShaderFunction"},
411 {"hlsl.swizzle.frag", "PixelShaderFunction"},
412 {"hlsl.target.frag", "main"},
413 {"hlsl.targetStruct1.frag", "main"},
414 {"hlsl.targetStruct2.frag", "main"},
415 {"hlsl.templatetypes.frag", "PixelShaderFunction"},
416 {"hlsl.tristream-append.geom", "main"},
417 {"hlsl.tx.bracket.frag", "main"},
418 {"hlsl.tx.overload.frag", "main"},
419 {"hlsl.type.half.frag", "main"},
420 {"hlsl.type.identifier.frag", "main"},
421 {"hlsl.typeGraphCopy.vert", "main"},
422 {"hlsl.typedef.frag", "PixelShaderFunction"},
423 {"hlsl.whileLoop.frag", "PixelShaderFunction"},
424 {"hlsl.void.frag", "PixelShaderFunction"},
425 {"hlsl.type.type.conversion.all.frag", "main"}
427 FileNameAsCustomTestSuffix
432 INSTANTIATE_TEST_CASE_P(
433 ToSpirv, HlslVulkan1_1CompileTest,
434 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
435 {"hlsl.wavebroadcast.comp", "CSMain"},
436 {"hlsl.waveprefix.comp", "CSMain"},
437 {"hlsl.wavequad.comp", "CSMain"},
438 {"hlsl.wavequery.comp", "CSMain"},
439 {"hlsl.wavequery.frag", "PixelShaderFunction"},
440 {"hlsl.wavereduction.comp", "CSMain"},
441 {"hlsl.wavevote.comp", "CSMain"},
442 { "hlsl.type.type.conversion.valid.frag", "main" },
443 {"hlsl.int.dot.frag", "main"}
445 FileNameAsCustomTestSuffix
450 INSTANTIATE_TEST_CASE_P(
451 ToSpirv, HlslCompileAndFlattenTest,
452 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
453 {"hlsl.array.flatten.frag", "main"},
454 {"hlsl.partialFlattenMixed.vert", "main"},
456 FileNameAsCustomTestSuffix
462 INSTANTIATE_TEST_CASE_P(
463 ToSpirv, HlslLegalizeTest,
464 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
465 {"hlsl.aliasOpaque.frag", "main"},
466 {"hlsl.flattenOpaque.frag", "main"},
467 {"hlsl.flattenOpaqueInit.vert", "main"},
468 {"hlsl.flattenOpaqueInitMix.vert", "main"},
469 {"hlsl.flattenSubset.frag", "main"},
470 {"hlsl.flattenSubset2.frag", "main"},
471 {"hlsl.partialFlattenLocal.vert", "main"},
472 {"hlsl.partialFlattenMixed.vert", "main"}
474 FileNameAsCustomTestSuffix
480 INSTANTIATE_TEST_CASE_P(
481 ToSpirv, HlslDebugTest,
482 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
483 {"hlsl.pp.line2.frag", "MainPs"}
485 FileNameAsCustomTestSuffix
488 INSTANTIATE_TEST_CASE_P(
489 ToSpirv, HlslDX9CompatibleTest,
490 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
491 {"hlsl.sample.dx9.frag", "main"},
492 {"hlsl.sample.dx9.vert", "main"},
494 FileNameAsCustomTestSuffix
498 INSTANTIATE_TEST_CASE_P(
499 ToSpirv, HlslLegalDebugTest,
500 ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
501 {"hlsl.pp.line4.frag", "MainPs"}
503 FileNameAsCustomTestSuffix
508 } // anonymous namespace
509 } // namespace glslangtest