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::EShTargetVulkan_1_3, 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",
488 "spv.fragmentShaderBarycentric3.frag",
489 "spv.fragmentShaderBarycentric4.frag",
491 FileNameAsCustomTestSuffix
494 // Cases with deliberately unreachable code.
495 // By default the compiler will aggressively eliminate
496 // unreachable merges and continues.
497 INSTANTIATE_TEST_SUITE_P(
498 GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
499 ::testing::ValuesIn(std::vector<std::string>({
500 "spv.dead-after-continue.vert",
501 "spv.dead-after-discard.frag",
502 "spv.dead-after-return.vert",
503 "spv.dead-after-loop-break.vert",
504 "spv.dead-after-switch-break.vert",
505 "spv.dead-complex-continue-after-return.vert",
506 "spv.dead-complex-merge-after-return.vert",
508 FileNameAsCustomTestSuffix
512 INSTANTIATE_TEST_SUITE_P(
513 Glsl, CompileVulkanToDebugSpirvTest,
514 ::testing::ValuesIn(std::vector<std::string>({
517 FileNameAsCustomTestSuffix
521 INSTANTIATE_TEST_SUITE_P(
522 Glsl, CompileVulkan1_1ToSpirvTest,
523 ::testing::ValuesIn(std::vector<std::string>({
524 "spv.1.3.8bitstorage-ubo.vert",
525 "spv.1.3.8bitstorage-ssbo.vert",
526 "spv.1.3.coopmat.comp",
527 "spv.deviceGroup.frag",
528 "spv.drawParams.vert",
530 "spv.vulkan110.int16.frag",
532 "spv.explicittypes.frag",
533 "spv.float16NoRelaxed.vert",
536 "spv.memoryScopeSemantics.comp",
537 "spv.memoryScopeSemantics_Error.comp",
538 "spv.multiView.frag",
539 "spv.queueFamilyScope.comp",
540 "spv.RayGenShader11.rgen",
546 "spv.subgroupArithmetic.comp",
547 "spv.subgroupBasic.comp",
548 "spv.subgroupBallot.comp",
549 "spv.subgroupBallotNeg.comp",
550 "spv.subgroupClustered.comp",
551 "spv.subgroupClusteredNeg.comp",
552 "spv.subgroupPartitioned.comp",
553 "spv.subgroupShuffle.comp",
554 "spv.subgroupShuffleRelative.comp",
555 "spv.subgroupQuad.comp",
556 "spv.subgroupVote.comp",
557 "spv.subgroupExtendedTypesArithmetic.comp",
558 "spv.subgroupExtendedTypesArithmeticNeg.comp",
559 "spv.subgroupExtendedTypesBallot.comp",
560 "spv.subgroupExtendedTypesBallotNeg.comp",
561 "spv.subgroupExtendedTypesClustered.comp",
562 "spv.subgroupExtendedTypesClusteredNeg.comp",
563 "spv.subgroupExtendedTypesPartitioned.comp",
564 "spv.subgroupExtendedTypesPartitionedNeg.comp",
565 "spv.subgroupExtendedTypesShuffle.comp",
566 "spv.subgroupExtendedTypesShuffleNeg.comp",
567 "spv.subgroupExtendedTypesShuffleRelative.comp",
568 "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
569 "spv.subgroupExtendedTypesQuad.comp",
570 "spv.subgroupExtendedTypesQuadNeg.comp",
571 "spv.subgroupExtendedTypesVote.comp",
572 "spv.subgroupExtendedTypesVoteNeg.comp",
573 "spv.vulkan110.storageBuffer.vert",
575 FileNameAsCustomTestSuffix
579 INSTANTIATE_TEST_SUITE_P(
580 Glsl, CompileToSpirv14Test,
581 ::testing::ValuesIn(std::vector<std::string>({
582 "spv.1.4.LoopControl.frag",
583 "spv.1.4.NonWritable.frag",
584 "spv.1.4.OpEntryPoint.frag",
585 "spv.1.4.OpEntryPoint.opaqueParams.vert",
586 "spv.1.4.OpSelect.frag",
587 "spv.1.4.OpCopyLogical.comp",
588 "spv.1.4.OpCopyLogicalBool.comp",
589 "spv.1.4.OpCopyLogical.funcall.frag",
590 "spv.1.4.funcall.array.frag",
591 "spv.1.4.load.bool.array.interface.block.frag",
592 "spv.1.4.image.frag",
593 "spv.1.4.sparseTexture.frag",
594 "spv.1.4.texture.frag",
595 "spv.1.4.constructComposite.comp",
596 "spv.ext.AnyHitShader.rahit",
597 "spv.ext.AnyHitShader_Errors.rahit",
598 "spv.ext.ClosestHitShader.rchit",
599 "spv.ext.ClosestHitShader_Subgroup.rchit",
600 "spv.ext.ClosestHitShader_Errors.rchit",
601 "spv.ext.IntersectShader.rint",
602 "spv.ext.IntersectShader_Errors.rint",
603 "spv.ext.MissShader.rmiss",
604 "spv.ext.MissShader_Errors.rmiss",
605 "spv.ext.RayPrimCull_Errors.rgen",
606 "spv.ext.RayCallable.rcall",
607 "spv.ext.RayCallable_Errors.rcall",
608 "spv.ext.RayConstants.rgen",
609 "spv.ext.RayGenShader.rgen",
610 "spv.ext.RayGenShader_Errors.rgen",
611 "spv.ext.RayGenShader11.rgen",
612 "spv.ext.RayGenShaderArray.rgen",
613 "spv.ext.RayGenSBTlayout.rgen",
614 "spv.ext.RayGenSBTlayout140.rgen",
615 "spv.ext.RayGenSBTlayout430.rgen",
616 "spv.ext.RayGenSBTlayoutscalar.rgen",
617 "spv.ext.World3x4.rahit",
618 "spv.ext.AccelDecl.frag",
619 "spv.ext.RayQueryDecl.frag",
621 // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
622 "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
623 "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
624 "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
625 "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
626 "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
627 "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
628 "spv.WorkgroupMemoryExplicitLayout.std140.comp",
629 "spv.WorkgroupMemoryExplicitLayout.std430.comp",
630 "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
632 FileNameAsCustomTestSuffix
636 INSTANTIATE_TEST_SUITE_P(
637 Glsl, CompileToSpirv16Test,
638 ::testing::ValuesIn(std::vector<std::string>({
639 "spv.1.6.conditionalDiscard.frag",
640 "spv.1.6.helperInvocation.frag",
641 "spv.1.6.specConstant.comp",
642 "spv.1.6.samplerBuffer.frag",
643 "spv.1.6.separate.frag",
645 FileNameAsCustomTestSuffix
650 INSTANTIATE_TEST_SUITE_P(
652 ::testing::ValuesIn(std::vector<IoMapData>{
653 { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
654 { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
655 { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
656 { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
657 { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
658 { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
659 { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
660 { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
661 { "spv.register.autoassign.rangetest.frag", "main",
662 glslang::TQualifier::layoutBindingEnd-2,
663 glslang::TQualifier::layoutBindingEnd+5,
664 20, 30, true, false },
666 FileNameAsCustomTestSuffixIoMap
670 INSTANTIATE_TEST_SUITE_P(
672 ::testing::ValuesIn(std::vector<IoMapData>{
673 { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
674 { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
676 FileNameAsCustomTestSuffixIoMap
680 INSTANTIATE_TEST_SUITE_P(
681 Glsl, CompileOpenGLToSpirvTest,
682 ::testing::ValuesIn(std::vector<std::string>({
687 "spv.atomicFloat.comp",
688 "spv.atomicFloat_Error.comp",
689 "spv.glFragColor.frag",
690 "spv.rankShift.comp",
691 "spv.specConst.vert",
692 "spv.specTexture.frag",
693 "spv.OVR_multiview.vert",
694 "spv.uniformInitializer.frag",
695 "spv.uniformInitializerSpecConstant.frag",
696 "spv.uniformInitializerStruct.frag",
697 "spv.xfbOffsetOnBlockMembersAssignment.vert",
698 "spv.xfbOffsetOnStructMembersAssignment.vert",
699 "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
700 "spv.xfbStrideJustOnce.vert",
702 FileNameAsCustomTestSuffix
705 INSTANTIATE_TEST_SUITE_P(
706 Glsl, VulkanSemantics,
707 ::testing::ValuesIn(std::vector<std::string>({
711 "samplerlessTextureFunctions.frag",
712 "spv.specConstArrayCheck.vert",
714 FileNameAsCustomTestSuffix
717 INSTANTIATE_TEST_SUITE_P(
718 Glsl, OpenGLSemantics,
719 ::testing::ValuesIn(std::vector<std::string>({
720 "glspv.esversion.vert",
721 "glspv.version.frag",
722 "glspv.version.vert",
726 FileNameAsCustomTestSuffix
729 INSTANTIATE_TEST_SUITE_P(
730 Glsl, VulkanAstSemantics,
731 ::testing::ValuesIn(std::vector<std::string>({
734 FileNameAsCustomTestSuffix
737 INSTANTIATE_TEST_SUITE_P(
738 Glsl, CompileVulkanToSpirvTestAMD,
739 ::testing::ValuesIn(std::vector<std::string>({
742 "spv.float16Fetch.frag",
743 "spv.imageLoadStoreLod.frag",
745 "spv.int16.amd.frag",
746 "spv.shaderBallotAMD.comp",
747 "spv.shaderFragMaskAMD.frag",
748 "spv.textureGatherBiasLod.frag",
750 FileNameAsCustomTestSuffix
753 INSTANTIATE_TEST_SUITE_P(
754 Glsl, CompileVulkanToSpirvTestNV,
755 ::testing::ValuesIn(std::vector<std::string>({
756 "spv.sampleMaskOverrideCoverage.frag",
757 "spv.GeometryShaderPassthrough.geom",
758 "spv.viewportArray2.vert",
759 "spv.viewportArray2.tesc",
760 "spv.stereoViewRendering.vert",
761 "spv.stereoViewRendering.tesc",
762 "spv.multiviewPerViewAttributes.vert",
763 "spv.multiviewPerViewAttributes.tesc",
764 "spv.atomicInt64.comp",
765 "spv.atomicStoreInt64.comp",
766 "spv.shadingRate.frag",
767 "spv.RayGenShader.rgen",
768 "spv.RayGenShaderArray.rgen",
769 "spv.RayGenShader_Errors.rgen",
770 "spv.RayConstants.rgen",
771 "spv.IntersectShader.rint",
772 "spv.IntersectShader_Errors.rint",
773 "spv.AnyHitShader.rahit",
774 "spv.AnyHitShader_Errors.rahit",
775 "spv.ClosestHitShader.rchit",
776 "spv.ClosestHitShader_Errors.rchit",
777 "spv.MissShader.rmiss",
778 "spv.MissShader_Errors.rmiss",
779 "spv.RayCallable.rcall",
780 "spv.RayCallable_Errors.rcall",
781 "spv.fragmentShaderBarycentric.frag",
782 "spv.fragmentShaderBarycentric2.frag",
783 "spv.computeShaderDerivatives.comp",
784 "spv.computeShaderDerivatives2.comp",
785 "spv.shaderImageFootprint.frag",
786 "spv.meshShaderBuiltins.mesh",
787 "spv.meshShaderUserDefined.mesh",
788 "spv.meshShaderPerViewBuiltins.mesh",
789 "spv.meshShaderPerViewUserDefined.mesh",
790 "spv.meshShaderPerView_Errors.mesh",
791 "spv.meshShaderSharedMem.mesh",
792 "spv.meshShaderTaskMem.mesh",
793 "spv.320.meshShaderUserDefined.mesh",
794 "spv.meshShaderRedeclBuiltins.mesh",
795 "spv.meshShaderRedeclPerViewBuiltins.mesh",
796 "spv.meshTaskShader.task",
797 "spv.perprimitiveNV.frag",
799 FileNameAsCustomTestSuffix
802 INSTANTIATE_TEST_SUITE_P(
803 Glsl, CompileVulkanToSpirv14TestNV,
804 ::testing::ValuesIn(std::vector<std::string>({
805 "spv.RayGenShaderMotion.rgen",
806 "spv.IntersectShaderMotion.rint",
807 "spv.AnyHitShaderMotion.rahit",
808 "spv.ClosestHitShaderMotion.rchit",
809 "spv.MissShaderMotion.rmiss",
811 FileNameAsCustomTestSuffix
813 INSTANTIATE_TEST_SUITE_P(
814 Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
815 ::testing::ValuesIn(std::vector<std::string>({
816 "spv.texture.sampler.transform.frag",
818 FileNameAsCustomTestSuffix
822 } // anonymous namespace
823 } // namespace glslangtest