2 // Copyright (C) 2016 Google, Inc.
3 // Copyright (C) 2019 ARM Limited.
4 // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
6 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
15 // Redistributions in binary form must reproduce the above
16 // copyright notice, this list of conditions and the following
17 // disclaimer in the documentation and/or other materials provided
18 // with the distribution.
20 // Neither the name of Google Inc. nor the names of its
21 // contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 // POSSIBILITY OF SUCH DAMAGE.
39 #include <gtest/gtest.h>
41 #include "TestFixture.h"
43 namespace glslangtest {
48 const char* entryPoint;
49 int baseSamplerBinding;
50 int baseTextureBinding;
58 std::string FileNameAsCustomTestSuffixIoMap(
59 const ::testing::TestParamInfo<IoMapData>& info) {
60 std::string name = info.param.fileName;
61 // A valid test case suffix cannot have '.' and '-' inside.
62 std::replace(name.begin(), name.end(), '.', '_');
63 std::replace(name.begin(), name.end(), '-', '_');
67 using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
68 using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
69 using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
70 using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
71 using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
72 using CompileToSpirv16Test = GlslangTest<::testing::TestWithParam<std::string>>;
73 using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
74 using VulkanSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
75 using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
76 using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
77 using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
78 using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
79 using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
80 using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
81 using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
82 using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
84 // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
86 TEST_P(CompileVulkanToSpirvTest, FromFile)
88 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
89 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
93 TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
95 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
96 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
100 // Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
101 // to successfully generate SPIR-V.
102 TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
104 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
105 Source::GLSL, Semantics::Vulkan,
106 glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
107 Target::Spv, true, "",
108 "/baseResults/", false, true);
112 TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
114 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
115 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
119 TEST_P(CompileToSpirv14Test, FromFile)
121 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
122 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
126 TEST_P(CompileToSpirv16Test, FromFile)
128 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
129 Source::GLSL, Semantics::Vulkan, glslang::EShTargetUniversal, glslang::EShTargetSpv_1_6,
133 // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully
135 TEST_P(CompileOpenGLToSpirvTest, FromFile)
137 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
138 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
142 // GLSL-level Vulkan semantics test. Expected to error out before generating
144 TEST_P(VulkanSemantics, FromFile)
146 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
147 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
151 // GLSL-level Vulkan semantics test. Expected to error out before generating
153 TEST_P(OpenGLSemantics, FromFile)
155 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
156 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
160 // GLSL-level Vulkan semantics test that need to see the AST for validation.
161 TEST_P(VulkanAstSemantics, FromFile)
163 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
164 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
168 // HLSL-level Vulkan semantics tests.
169 TEST_P(HlslIoMap, FromFile)
171 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
172 Source::HLSL, Semantics::Vulkan,
173 Target::Spv, GetParam().entryPoint,
174 GetParam().baseSamplerBinding,
175 GetParam().baseTextureBinding,
176 GetParam().baseImageBinding,
177 GetParam().baseUboBinding,
178 GetParam().baseSsboBinding,
179 GetParam().autoMapBindings,
180 GetParam().flattenUniforms);
183 // GLSL-level Vulkan semantics tests.
184 TEST_P(GlslIoMap, FromFile)
186 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
187 Source::GLSL, Semantics::Vulkan,
188 Target::Spv, GetParam().entryPoint,
189 GetParam().baseSamplerBinding,
190 GetParam().baseTextureBinding,
191 GetParam().baseImageBinding,
192 GetParam().baseUboBinding,
193 GetParam().baseSsboBinding,
194 GetParam().autoMapBindings,
195 GetParam().flattenUniforms);
198 // Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
199 // Expected to successfully generate SPIR-V.
200 TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
202 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
203 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
207 // Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
208 // Expected to successfully generate SPIR-V.
209 TEST_P(CompileVulkanToSpirvTestNV, FromFile)
211 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
212 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
216 TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
218 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
219 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
223 TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
225 loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
233 INSTANTIATE_TEST_SUITE_P(
234 Glsl, CompileVulkanToSpirvTest,
235 ::testing::ValuesIn(std::vector<std::string>({
236 // Test looping constructs.
237 // No tests yet for making sure break and continue from a nested loop
238 // goes to the innermost target.
240 "spv.do-simple.vert",
241 "spv.do-while-continue-break.vert",
242 "spv.for-complex-condition.vert",
243 "spv.for-continue-break.vert",
244 "spv.for-simple.vert",
245 "spv.for-notest.vert",
246 "spv.for-nobody.vert",
247 "spv.while-continue-break.vert",
248 "spv.while-simple.vert",
249 // vulkan-specific tests
251 "rayQuery-no-cse.rgen",
252 "rayQuery-initialize.rgen",
253 "rayQuery-allOps.rgen",
254 "rayQuery-allOps.Error.rgen",
255 "rayQuery-committed.Error.rgen",
256 "rayQuery-allOps.comp",
257 "rayQuery-allOps.frag",
258 "rayQuery-initialization.Error.comp",
259 "rayQuery-global.rgen",
260 "rayQuery-types.comp",
268 "spv.16bitstorage.frag",
269 "spv.16bitstorage_Error.frag",
270 "spv.16bitstorage-int.frag",
271 "spv.16bitstorage_Error-int.frag",
272 "spv.16bitstorage-uint.frag",
273 "spv.16bitstorage_Error-uint.frag",
274 "spv.300BuiltIns.vert",
275 "spv.300layout.frag",
276 "spv.300layout.vert",
277 "spv.300layoutp.vert",
279 "spv.310.bitcast.frag",
289 "spv.450.noRedecl.tesc",
290 "spv.8bitstorage-int.frag",
291 "spv.8bitstorage_Error-int.frag",
292 "spv.8bitstorage-uint.frag",
293 "spv.8bitstorage_Error-uint.frag",
294 "spv.8bitstorage-ubo.vert",
295 "spv.8bitstorage-ssbo.vert",
296 "spv.8bit-16bit-construction.frag",
297 "spv.accessChain.frag",
299 "spv.always-discard.frag",
300 "spv.always-discard2.frag",
301 "spv.arbPostDepthCoverage.frag",
302 "spv.arbPostDepthCoverage_Error.frag",
303 "spv.atomicCounter.comp",
306 "spv.boolInBlock.frag",
307 "spv.branch-return.vert",
308 "spv.bufferhandle1.frag",
309 "spv.bufferhandle10.frag",
310 "spv.bufferhandle11.frag",
311 "spv.bufferhandle12.frag",
312 "spv.bufferhandle13.frag",
313 "spv.bufferhandle14.frag",
314 "spv.bufferhandle15.frag",
315 "spv.bufferhandle16.frag",
316 "spv.bufferhandle17_Errors.frag",
317 "spv.bufferhandle18.frag",
318 "spv.bufferhandle19_Errors.frag",
319 "spv.bufferhandle2.frag",
320 "spv.bufferhandle3.frag",
321 "spv.bufferhandle4.frag",
322 "spv.bufferhandle5.frag",
323 "spv.bufferhandle6.frag",
324 "spv.bufferhandle7.frag",
325 "spv.bufferhandle8.frag",
326 "spv.bufferhandle9.frag",
327 "spv.bufferhandleUvec2.frag",
328 "spv.bufferhandle_Error.frag",
329 "spv.builtInXFB.vert",
330 "spv.conditionalDemote.frag",
331 "spv.conditionalDiscard.frag",
332 "spv.constructComposite.comp",
333 "spv.constStruct.vert",
334 "spv.constConstruct.vert",
335 "spv.controlFlowAttributes.frag",
336 "spv.conversion.frag",
338 "spv.coopmat_Error.comp",
340 "spv.dataOutIndirect.frag",
341 "spv.dataOutIndirect.vert",
342 "spv.debugPrintf.frag",
343 "spv.debugPrintf_Error.frag",
344 "spv.demoteDisabled.frag",
345 "spv.deepRvalue.frag",
347 "spv.depthUnchanged.frag",
348 "spv.discard-dce.frag",
349 "spv.doWhileLoop.frag",
350 "spv.earlyReturnDiscard.frag",
351 "spv.extPostDepthCoverage.frag",
352 "spv.extPostDepthCoverage_Error.frag",
353 "spv.float16convertonlyarith.comp",
354 "spv.float16convertonlystorage.comp",
355 "spv.flowControl.frag",
357 "spv.forwardFun.frag",
358 "spv.fragmentDensity.frag",
359 "spv.fragmentDensity.vert",
360 "spv.fragmentDensity-es.frag",
361 "spv.fragmentDensity-neg.frag",
363 "spv.fsi_Error.frag",
364 "spv.fullyCovered.frag",
365 "spv.functionCall.frag",
366 "spv.functionNestedOpaque.vert",
367 "spv.functionSemantics.frag",
368 "spv.functionParameterTypes.frag",
369 "spv.GeometryShaderPassthrough.geom",
370 "spv.funcall.array.frag",
371 "spv.load.bool.array.interface.block.frag",
372 "spv.interpOps.frag",
374 "spv.intcoopmat.comp",
376 "spv.intrinsicsSpirvByReference.vert",
377 "spv.intrinsicsSpirvDecorate.frag",
378 "spv.intrinsicsSpirvExecutionMode.frag",
379 "spv.intrinsicsSpirvInstruction.vert",
380 "spv.intrinsicsSpirvLiteral.vert",
381 "spv.intrinsicsSpirvStorageClass.rchit",
382 "spv.intrinsicsSpirvType.rgen",
383 "spv.intrinsicsSpirvTypeLocalVar.vert",
384 "spv.invariantAll.vert",
386 "spv.layoutNested.vert",
388 "spv.localAggregates.frag",
390 "spv.loopsArtificial.frag",
394 "spv.memoryQualifier.frag",
395 "spv.merge-unreachable.frag",
396 "spv.multiStruct.comp",
397 "spv.multiStructFuncall.frag",
398 "spv.newTexture.frag",
399 "spv.noDeadDecorations.vert",
400 "spv.nonSquare.vert",
401 "spv.nonuniform.frag",
402 "spv.nonuniform2.frag",
403 "spv.nonuniform3.frag",
404 "spv.nonuniform4.frag",
405 "spv.nonuniform5.frag",
406 "spv.noWorkgroup.comp",
409 "spv.Operations.frag",
410 "spv.paramMemory.frag",
411 "spv.paramMemory.420.frag",
412 "spv.precision.frag",
413 "spv.precisionArgs.frag",
414 "spv.precisionNonESSamp.frag",
415 "spv.precisionTexture.frag",
417 "spv.privateVariableTypes.frag",
418 "spv.qualifiers.vert",
421 "spv.samplePosition.frag",
422 "spv.sampleMaskOverrideCoverage.frag",
423 "spv.scalarlayout.frag",
424 "spv.scalarlayoutfloat16.frag",
425 "spv.shaderBallot.comp",
426 "spv.shaderDrawParams.vert",
427 "spv.shaderGroupVote.comp",
428 "spv.shaderStencilExport.frag",
430 "spv.simpleFunctionCall.frag",
431 "spv.simpleMat.vert",
432 "spv.sparseTexture.frag",
433 "spv.sparseTextureClamp.frag",
434 "spv.structAssignment.frag",
435 "spv.structDeref.frag",
436 "spv.structure.frag",
439 "spv.swizzleInversion.frag",
444 "spv.textureBuffer.vert",
446 "spv.imageAtomic64.frag",
449 "spv.uniformArray.frag",
450 "spv.variableArrayIndex.frag",
451 "spv.varyingArray.frag",
452 "spv.varyingArrayIndirect.frag",
453 "spv.vecMatConstruct.frag",
454 "spv.voidFunction.frag",
455 "spv.whileLoop.frag",
459 "spv.shortCircuit.frag",
460 "spv.pushConstant.vert",
461 "spv.pushConstantAnon.vert",
463 "spv.specConstant.vert",
464 "spv.specConstant.comp",
465 "spv.specConstantComposite.vert",
466 "spv.specConstantOperations.vert",
467 "spv.specConstant.float16.comp",
468 "spv.specConstant.int16.comp",
469 "spv.specConstant.int8.comp",
470 "spv.storageBuffer.vert",
471 "spv.terminate.frag",
472 "spv.subgroupUniformControlFlow.vert",
475 "spv.viewportindex.tese",
476 "spv.volatileAtomic.comp",
477 "spv.vulkan100.subgroupArithmetic.comp",
478 "spv.vulkan100.subgroupPartitioned.comp",
482 "spv.samplerlessTextureFunctions.frag",
483 "spv.smBuiltins.vert",
484 "spv.smBuiltins.frag",
485 "spv.builtin.PrimitiveShadingRateEXT.vert",
486 "spv.builtin.ShadingRateEXT.frag",
487 "spv.atomicAdd.bufferReference.comp"
489 FileNameAsCustomTestSuffix
492 // Cases with deliberately unreachable code.
493 // By default the compiler will aggressively eliminate
494 // unreachable merges and continues.
495 INSTANTIATE_TEST_SUITE_P(
496 GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
497 ::testing::ValuesIn(std::vector<std::string>({
498 "spv.dead-after-continue.vert",
499 "spv.dead-after-discard.frag",
500 "spv.dead-after-return.vert",
501 "spv.dead-after-loop-break.vert",
502 "spv.dead-after-switch-break.vert",
503 "spv.dead-complex-continue-after-return.vert",
504 "spv.dead-complex-merge-after-return.vert",
506 FileNameAsCustomTestSuffix
510 INSTANTIATE_TEST_SUITE_P(
511 Glsl, CompileVulkanToDebugSpirvTest,
512 ::testing::ValuesIn(std::vector<std::string>({
515 FileNameAsCustomTestSuffix
519 INSTANTIATE_TEST_SUITE_P(
520 Glsl, CompileVulkan1_1ToSpirvTest,
521 ::testing::ValuesIn(std::vector<std::string>({
522 "spv.1.3.8bitstorage-ubo.vert",
523 "spv.1.3.8bitstorage-ssbo.vert",
524 "spv.1.3.coopmat.comp",
525 "spv.deviceGroup.frag",
526 "spv.drawParams.vert",
528 "spv.vulkan110.int16.frag",
530 "spv.explicittypes.frag",
533 "spv.memoryScopeSemantics.comp",
534 "spv.memoryScopeSemantics_Error.comp",
535 "spv.multiView.frag",
536 "spv.queueFamilyScope.comp",
537 "spv.RayGenShader11.rgen",
543 "spv.subgroupArithmetic.comp",
544 "spv.subgroupBasic.comp",
545 "spv.subgroupBallot.comp",
546 "spv.subgroupBallotNeg.comp",
547 "spv.subgroupClustered.comp",
548 "spv.subgroupClusteredNeg.comp",
549 "spv.subgroupPartitioned.comp",
550 "spv.subgroupShuffle.comp",
551 "spv.subgroupShuffleRelative.comp",
552 "spv.subgroupQuad.comp",
553 "spv.subgroupVote.comp",
554 "spv.subgroupExtendedTypesArithmetic.comp",
555 "spv.subgroupExtendedTypesArithmeticNeg.comp",
556 "spv.subgroupExtendedTypesBallot.comp",
557 "spv.subgroupExtendedTypesBallotNeg.comp",
558 "spv.subgroupExtendedTypesClustered.comp",
559 "spv.subgroupExtendedTypesClusteredNeg.comp",
560 "spv.subgroupExtendedTypesPartitioned.comp",
561 "spv.subgroupExtendedTypesPartitionedNeg.comp",
562 "spv.subgroupExtendedTypesShuffle.comp",
563 "spv.subgroupExtendedTypesShuffleNeg.comp",
564 "spv.subgroupExtendedTypesShuffleRelative.comp",
565 "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
566 "spv.subgroupExtendedTypesQuad.comp",
567 "spv.subgroupExtendedTypesQuadNeg.comp",
568 "spv.subgroupExtendedTypesVote.comp",
569 "spv.subgroupExtendedTypesVoteNeg.comp",
570 "spv.vulkan110.storageBuffer.vert",
572 FileNameAsCustomTestSuffix
576 INSTANTIATE_TEST_SUITE_P(
577 Glsl, CompileToSpirv14Test,
578 ::testing::ValuesIn(std::vector<std::string>({
579 "spv.1.4.LoopControl.frag",
580 "spv.1.4.NonWritable.frag",
581 "spv.1.4.OpEntryPoint.frag",
582 "spv.1.4.OpEntryPoint.opaqueParams.vert",
583 "spv.1.4.OpSelect.frag",
584 "spv.1.4.OpCopyLogical.comp",
585 "spv.1.4.OpCopyLogicalBool.comp",
586 "spv.1.4.OpCopyLogical.funcall.frag",
587 "spv.1.4.funcall.array.frag",
588 "spv.1.4.load.bool.array.interface.block.frag",
589 "spv.1.4.image.frag",
590 "spv.1.4.sparseTexture.frag",
591 "spv.1.4.texture.frag",
592 "spv.1.4.constructComposite.comp",
593 "spv.ext.AnyHitShader.rahit",
594 "spv.ext.AnyHitShader_Errors.rahit",
595 "spv.ext.ClosestHitShader.rchit",
596 "spv.ext.ClosestHitShader_Subgroup.rchit",
597 "spv.ext.ClosestHitShader_Errors.rchit",
598 "spv.ext.IntersectShader.rint",
599 "spv.ext.IntersectShader_Errors.rint",
600 "spv.ext.MissShader.rmiss",
601 "spv.ext.MissShader_Errors.rmiss",
602 "spv.ext.RayPrimCull_Errors.rgen",
603 "spv.ext.RayCallable.rcall",
604 "spv.ext.RayCallable_Errors.rcall",
605 "spv.ext.RayConstants.rgen",
606 "spv.ext.RayGenShader.rgen",
607 "spv.ext.RayGenShader_Errors.rgen",
608 "spv.ext.RayGenShader11.rgen",
609 "spv.ext.RayGenShaderArray.rgen",
610 "spv.ext.RayGenSBTlayout.rgen",
611 "spv.ext.RayGenSBTlayout140.rgen",
612 "spv.ext.RayGenSBTlayout430.rgen",
613 "spv.ext.RayGenSBTlayoutscalar.rgen",
614 "spv.ext.World3x4.rahit",
615 "spv.ext.AccelDecl.frag",
616 "spv.ext.RayQueryDecl.frag",
618 // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
619 "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
620 "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
621 "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
622 "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
623 "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
624 "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
625 "spv.WorkgroupMemoryExplicitLayout.std140.comp",
626 "spv.WorkgroupMemoryExplicitLayout.std430.comp",
627 "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
629 FileNameAsCustomTestSuffix
633 INSTANTIATE_TEST_SUITE_P(
634 Glsl, CompileToSpirv16Test,
635 ::testing::ValuesIn(std::vector<std::string>({
636 "spv.1.6.conditionalDiscard.frag",
637 "spv.1.6.helperInvocation.frag",
638 "spv.1.6.specConstant.comp",
640 FileNameAsCustomTestSuffix
645 INSTANTIATE_TEST_SUITE_P(
647 ::testing::ValuesIn(std::vector<IoMapData>{
648 { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
649 { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
650 { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
651 { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
652 { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
653 { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
654 { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
655 { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
656 { "spv.register.autoassign.rangetest.frag", "main",
657 glslang::TQualifier::layoutBindingEnd-2,
658 glslang::TQualifier::layoutBindingEnd+5,
659 20, 30, true, false },
661 FileNameAsCustomTestSuffixIoMap
665 INSTANTIATE_TEST_SUITE_P(
667 ::testing::ValuesIn(std::vector<IoMapData>{
668 { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
669 { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
671 FileNameAsCustomTestSuffixIoMap
675 INSTANTIATE_TEST_SUITE_P(
676 Glsl, CompileOpenGLToSpirvTest,
677 ::testing::ValuesIn(std::vector<std::string>({
682 "spv.atomicFloat.comp",
683 "spv.atomicFloat_Error.comp",
684 "spv.glFragColor.frag",
685 "spv.rankShift.comp",
686 "spv.specConst.vert",
687 "spv.specTexture.frag",
688 "spv.OVR_multiview.vert",
689 "spv.uniformInitializer.frag",
690 "spv.uniformInitializerSpecConstant.frag",
691 "spv.uniformInitializerStruct.frag",
692 "spv.xfbOffsetOnBlockMembersAssignment.vert",
693 "spv.xfbOffsetOnStructMembersAssignment.vert",
694 "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
695 "spv.xfbStrideJustOnce.vert",
697 FileNameAsCustomTestSuffix
700 INSTANTIATE_TEST_SUITE_P(
701 Glsl, VulkanSemantics,
702 ::testing::ValuesIn(std::vector<std::string>({
706 "samplerlessTextureFunctions.frag",
707 "spv.specConstArrayCheck.vert",
709 FileNameAsCustomTestSuffix
712 INSTANTIATE_TEST_SUITE_P(
713 Glsl, OpenGLSemantics,
714 ::testing::ValuesIn(std::vector<std::string>({
715 "glspv.esversion.vert",
716 "glspv.version.frag",
717 "glspv.version.vert",
721 FileNameAsCustomTestSuffix
724 INSTANTIATE_TEST_SUITE_P(
725 Glsl, VulkanAstSemantics,
726 ::testing::ValuesIn(std::vector<std::string>({
729 FileNameAsCustomTestSuffix
732 INSTANTIATE_TEST_SUITE_P(
733 Glsl, CompileVulkanToSpirvTestAMD,
734 ::testing::ValuesIn(std::vector<std::string>({
737 "spv.float16Fetch.frag",
738 "spv.imageLoadStoreLod.frag",
740 "spv.int16.amd.frag",
741 "spv.shaderBallotAMD.comp",
742 "spv.shaderFragMaskAMD.frag",
743 "spv.textureGatherBiasLod.frag",
745 FileNameAsCustomTestSuffix
748 INSTANTIATE_TEST_SUITE_P(
749 Glsl, CompileVulkanToSpirvTestNV,
750 ::testing::ValuesIn(std::vector<std::string>({
751 "spv.sampleMaskOverrideCoverage.frag",
752 "spv.GeometryShaderPassthrough.geom",
753 "spv.viewportArray2.vert",
754 "spv.viewportArray2.tesc",
755 "spv.stereoViewRendering.vert",
756 "spv.stereoViewRendering.tesc",
757 "spv.multiviewPerViewAttributes.vert",
758 "spv.multiviewPerViewAttributes.tesc",
759 "spv.atomicInt64.comp",
760 "spv.atomicStoreInt64.comp",
761 "spv.shadingRate.frag",
762 "spv.RayGenShader.rgen",
763 "spv.RayGenShaderArray.rgen",
764 "spv.RayGenShader_Errors.rgen",
765 "spv.RayConstants.rgen",
766 "spv.IntersectShader.rint",
767 "spv.IntersectShader_Errors.rint",
768 "spv.AnyHitShader.rahit",
769 "spv.AnyHitShader_Errors.rahit",
770 "spv.ClosestHitShader.rchit",
771 "spv.ClosestHitShader_Errors.rchit",
772 "spv.MissShader.rmiss",
773 "spv.MissShader_Errors.rmiss",
774 "spv.RayCallable.rcall",
775 "spv.RayCallable_Errors.rcall",
776 "spv.fragmentShaderBarycentric.frag",
777 "spv.fragmentShaderBarycentric2.frag",
778 "spv.computeShaderDerivatives.comp",
779 "spv.computeShaderDerivatives2.comp",
780 "spv.shaderImageFootprint.frag",
781 "spv.meshShaderBuiltins.mesh",
782 "spv.meshShaderUserDefined.mesh",
783 "spv.meshShaderPerViewBuiltins.mesh",
784 "spv.meshShaderPerViewUserDefined.mesh",
785 "spv.meshShaderPerView_Errors.mesh",
786 "spv.meshShaderSharedMem.mesh",
787 "spv.meshShaderTaskMem.mesh",
788 "spv.320.meshShaderUserDefined.mesh",
789 "spv.meshShaderRedeclBuiltins.mesh",
790 "spv.meshShaderRedeclPerViewBuiltins.mesh",
791 "spv.meshTaskShader.task",
792 "spv.perprimitiveNV.frag",
794 FileNameAsCustomTestSuffix
797 INSTANTIATE_TEST_SUITE_P(
798 Glsl, CompileVulkanToSpirv14TestNV,
799 ::testing::ValuesIn(std::vector<std::string>({
800 "spv.RayGenShaderMotion.rgen",
801 "spv.IntersectShaderMotion.rint",
802 "spv.AnyHitShaderMotion.rahit",
803 "spv.ClosestHitShaderMotion.rchit",
804 "spv.MissShaderMotion.rmiss",
806 FileNameAsCustomTestSuffix
808 INSTANTIATE_TEST_SUITE_P(
809 Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
810 ::testing::ValuesIn(std::vector<std::string>({
811 "spv.texture.sampler.transform.frag",
813 FileNameAsCustomTestSuffix
817 } // anonymous namespace
818 } // namespace glslangtest