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 CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
73 using VulkanSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
74 using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
75 using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
76 using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
77 using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
78 using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
79 using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
80 using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
81 using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
83 // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
85 TEST_P(CompileVulkanToSpirvTest, FromFile)
87 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
88 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
92 TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
94 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
95 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
99 // Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
100 // to successfully generate SPIR-V.
101 TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
103 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
104 Source::GLSL, Semantics::Vulkan,
105 glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
106 Target::Spv, true, "",
107 "/baseResults/", false, true);
111 TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
113 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
114 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
118 TEST_P(CompileToSpirv14Test, FromFile)
120 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
121 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
125 // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully
127 TEST_P(CompileOpenGLToSpirvTest, FromFile)
129 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
130 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
134 // GLSL-level Vulkan semantics test. Expected to error out before generating
136 TEST_P(VulkanSemantics, FromFile)
138 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
139 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
143 // GLSL-level Vulkan semantics test. Expected to error out before generating
145 TEST_P(OpenGLSemantics, FromFile)
147 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
148 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
152 // GLSL-level Vulkan semantics test that need to see the AST for validation.
153 TEST_P(VulkanAstSemantics, FromFile)
155 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
156 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
160 // HLSL-level Vulkan semantics tests.
161 TEST_P(HlslIoMap, FromFile)
163 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
164 Source::HLSL, Semantics::Vulkan,
165 Target::Spv, GetParam().entryPoint,
166 GetParam().baseSamplerBinding,
167 GetParam().baseTextureBinding,
168 GetParam().baseImageBinding,
169 GetParam().baseUboBinding,
170 GetParam().baseSsboBinding,
171 GetParam().autoMapBindings,
172 GetParam().flattenUniforms);
175 // GLSL-level Vulkan semantics tests.
176 TEST_P(GlslIoMap, FromFile)
178 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
179 Source::GLSL, Semantics::Vulkan,
180 Target::Spv, GetParam().entryPoint,
181 GetParam().baseSamplerBinding,
182 GetParam().baseTextureBinding,
183 GetParam().baseImageBinding,
184 GetParam().baseUboBinding,
185 GetParam().baseSsboBinding,
186 GetParam().autoMapBindings,
187 GetParam().flattenUniforms);
190 // Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
191 // Expected to successfully generate SPIR-V.
192 TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
194 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
195 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
199 // Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
200 // Expected to successfully generate SPIR-V.
201 TEST_P(CompileVulkanToSpirvTestNV, FromFile)
203 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
204 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
208 TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
210 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
211 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
215 TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
217 loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
225 INSTANTIATE_TEST_SUITE_P(
226 Glsl, CompileVulkanToSpirvTest,
227 ::testing::ValuesIn(std::vector<std::string>({
228 // Test looping constructs.
229 // No tests yet for making sure break and continue from a nested loop
230 // goes to the innermost target.
232 "spv.do-simple.vert",
233 "spv.do-while-continue-break.vert",
234 "spv.for-complex-condition.vert",
235 "spv.for-continue-break.vert",
236 "spv.for-simple.vert",
237 "spv.for-notest.vert",
238 "spv.for-nobody.vert",
239 "spv.while-continue-break.vert",
240 "spv.while-simple.vert",
241 // vulkan-specific tests
243 "rayQuery-no-cse.rgen",
244 "rayQuery-initialize.rgen",
245 "rayQuery-allOps.rgen",
246 "rayQuery-allOps.Error.rgen",
247 "rayQuery-committed.Error.rgen",
248 "rayQuery-allOps.comp",
249 "rayQuery-allOps.frag",
250 "rayQuery-initialization.Error.comp",
251 "rayQuery-global.rgen",
252 "rayQuery-types.comp",
260 "spv.16bitstorage.frag",
261 "spv.16bitstorage_Error.frag",
262 "spv.16bitstorage-int.frag",
263 "spv.16bitstorage_Error-int.frag",
264 "spv.16bitstorage-uint.frag",
265 "spv.16bitstorage_Error-uint.frag",
266 "spv.300BuiltIns.vert",
267 "spv.300layout.frag",
268 "spv.300layout.vert",
269 "spv.300layoutp.vert",
271 "spv.310.bitcast.frag",
281 "spv.450.noRedecl.tesc",
282 "spv.8bitstorage-int.frag",
283 "spv.8bitstorage_Error-int.frag",
284 "spv.8bitstorage-uint.frag",
285 "spv.8bitstorage_Error-uint.frag",
286 "spv.8bitstorage-ubo.vert",
287 "spv.8bitstorage-ssbo.vert",
288 "spv.8bit-16bit-construction.frag",
289 "spv.accessChain.frag",
291 "spv.always-discard.frag",
292 "spv.always-discard2.frag",
293 "spv.arbPostDepthCoverage.frag",
294 "spv.arbPostDepthCoverage_Error.frag",
295 "spv.atomicCounter.comp",
298 "spv.boolInBlock.frag",
299 "spv.branch-return.vert",
300 "spv.bufferhandle1.frag",
301 "spv.bufferhandle10.frag",
302 "spv.bufferhandle11.frag",
303 "spv.bufferhandle12.frag",
304 "spv.bufferhandle13.frag",
305 "spv.bufferhandle14.frag",
306 "spv.bufferhandle15.frag",
307 "spv.bufferhandle16.frag",
308 "spv.bufferhandle17_Errors.frag",
309 "spv.bufferhandle18.frag",
310 "spv.bufferhandle19_Errors.frag",
311 "spv.bufferhandle2.frag",
312 "spv.bufferhandle3.frag",
313 "spv.bufferhandle4.frag",
314 "spv.bufferhandle5.frag",
315 "spv.bufferhandle6.frag",
316 "spv.bufferhandle7.frag",
317 "spv.bufferhandle8.frag",
318 "spv.bufferhandle9.frag",
319 "spv.bufferhandleUvec2.frag",
320 "spv.bufferhandle_Error.frag",
321 "spv.builtInXFB.vert",
322 "spv.conditionalDemote.frag",
323 "spv.conditionalDiscard.frag",
324 "spv.constructComposite.comp",
325 "spv.constStruct.vert",
326 "spv.constConstruct.vert",
327 "spv.controlFlowAttributes.frag",
328 "spv.conversion.frag",
330 "spv.coopmat_Error.comp",
332 "spv.dataOutIndirect.frag",
333 "spv.dataOutIndirect.vert",
334 "spv.debugPrintf.frag",
335 "spv.debugPrintf_Error.frag",
336 "spv.demoteDisabled.frag",
337 "spv.deepRvalue.frag",
339 "spv.depthUnchanged.frag",
340 "spv.discard-dce.frag",
341 "spv.doWhileLoop.frag",
342 "spv.earlyReturnDiscard.frag",
343 "spv.extPostDepthCoverage.frag",
344 "spv.extPostDepthCoverage_Error.frag",
345 "spv.float16convertonlyarith.comp",
346 "spv.float16convertonlystorage.comp",
347 "spv.flowControl.frag",
349 "spv.forwardFun.frag",
350 "spv.fragmentDensity.frag",
351 "spv.fragmentDensity.vert",
352 "spv.fragmentDensity-es.frag",
353 "spv.fragmentDensity-neg.frag",
355 "spv.fsi_Error.frag",
356 "spv.fullyCovered.frag",
357 "spv.functionCall.frag",
358 "spv.functionNestedOpaque.vert",
359 "spv.functionSemantics.frag",
360 "spv.functionParameterTypes.frag",
361 "spv.GeometryShaderPassthrough.geom",
362 "spv.funcall.array.frag",
363 "spv.load.bool.array.interface.block.frag",
364 "spv.interpOps.frag",
366 "spv.intcoopmat.comp",
368 "spv.intrinsicsSpirvByReference.vert",
369 "spv.intrinsicsSpirvDecorate.frag",
370 "spv.intrinsicsSpirvExecutionMode.frag",
371 "spv.intrinsicsSpirvInstruction.vert",
372 "spv.intrinsicsSpirvLiteral.vert",
373 "spv.intrinsicsSpirvStorageClass.rchit",
374 "spv.intrinsicsSpirvType.rgen",
375 "spv.intrinsicsSpirvTypeLocalVar.vert",
376 "spv.invariantAll.vert",
378 "spv.layoutNested.vert",
380 "spv.localAggregates.frag",
382 "spv.loopsArtificial.frag",
386 "spv.memoryQualifier.frag",
387 "spv.merge-unreachable.frag",
388 "spv.multiStruct.comp",
389 "spv.multiStructFuncall.frag",
390 "spv.newTexture.frag",
391 "spv.noDeadDecorations.vert",
392 "spv.nonSquare.vert",
393 "spv.nonuniform.frag",
394 "spv.nonuniform2.frag",
395 "spv.nonuniform3.frag",
396 "spv.nonuniform4.frag",
397 "spv.nonuniform5.frag",
398 "spv.noWorkgroup.comp",
401 "spv.Operations.frag",
402 "spv.paramMemory.frag",
403 "spv.paramMemory.420.frag",
404 "spv.precision.frag",
405 "spv.precisionArgs.frag",
406 "spv.precisionNonESSamp.frag",
407 "spv.precisionTexture.frag",
409 "spv.privateVariableTypes.frag",
410 "spv.qualifiers.vert",
413 "spv.samplePosition.frag",
414 "spv.sampleMaskOverrideCoverage.frag",
415 "spv.scalarlayout.frag",
416 "spv.scalarlayoutfloat16.frag",
417 "spv.shaderBallot.comp",
418 "spv.shaderDrawParams.vert",
419 "spv.shaderGroupVote.comp",
420 "spv.shaderStencilExport.frag",
422 "spv.simpleFunctionCall.frag",
423 "spv.simpleMat.vert",
424 "spv.sparseTexture.frag",
425 "spv.sparseTextureClamp.frag",
426 "spv.structAssignment.frag",
427 "spv.structDeref.frag",
428 "spv.structure.frag",
431 "spv.swizzleInversion.frag",
436 "spv.textureBuffer.vert",
438 "spv.imageAtomic64.frag",
441 "spv.uniformArray.frag",
442 "spv.variableArrayIndex.frag",
443 "spv.varyingArray.frag",
444 "spv.varyingArrayIndirect.frag",
445 "spv.vecMatConstruct.frag",
446 "spv.voidFunction.frag",
447 "spv.whileLoop.frag",
451 "spv.shortCircuit.frag",
452 "spv.pushConstant.vert",
453 "spv.pushConstantAnon.vert",
455 "spv.specConstant.vert",
456 "spv.specConstant.comp",
457 "spv.specConstantComposite.vert",
458 "spv.specConstantOperations.vert",
459 "spv.specConstant.float16.comp",
460 "spv.specConstant.int16.comp",
461 "spv.specConstant.int8.comp",
462 "spv.storageBuffer.vert",
463 "spv.terminate.frag",
464 "spv.subgroupUniformControlFlow.vert",
467 "spv.viewportindex.tese",
468 "spv.volatileAtomic.comp",
469 "spv.vulkan100.subgroupArithmetic.comp",
470 "spv.vulkan100.subgroupPartitioned.comp",
474 "spv.samplerlessTextureFunctions.frag",
475 "spv.smBuiltins.vert",
476 "spv.smBuiltins.frag",
477 "spv.builtin.PrimitiveShadingRateEXT.vert",
478 "spv.builtin.ShadingRateEXT.frag",
479 "spv.atomicAdd.bufferReference.comp"
481 FileNameAsCustomTestSuffix
484 // Cases with deliberately unreachable code.
485 // By default the compiler will aggressively eliminate
486 // unreachable merges and continues.
487 INSTANTIATE_TEST_SUITE_P(
488 GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
489 ::testing::ValuesIn(std::vector<std::string>({
490 "spv.dead-after-continue.vert",
491 "spv.dead-after-discard.frag",
492 "spv.dead-after-return.vert",
493 "spv.dead-after-loop-break.vert",
494 "spv.dead-after-switch-break.vert",
495 "spv.dead-complex-continue-after-return.vert",
496 "spv.dead-complex-merge-after-return.vert",
498 FileNameAsCustomTestSuffix
502 INSTANTIATE_TEST_SUITE_P(
503 Glsl, CompileVulkanToDebugSpirvTest,
504 ::testing::ValuesIn(std::vector<std::string>({
507 FileNameAsCustomTestSuffix
511 INSTANTIATE_TEST_SUITE_P(
512 Glsl, CompileVulkan1_1ToSpirvTest,
513 ::testing::ValuesIn(std::vector<std::string>({
514 "spv.1.3.8bitstorage-ubo.vert",
515 "spv.1.3.8bitstorage-ssbo.vert",
516 "spv.1.3.coopmat.comp",
517 "spv.deviceGroup.frag",
518 "spv.drawParams.vert",
520 "spv.vulkan110.int16.frag",
522 "spv.explicittypes.frag",
525 "spv.memoryScopeSemantics.comp",
526 "spv.memoryScopeSemantics_Error.comp",
527 "spv.multiView.frag",
528 "spv.queueFamilyScope.comp",
529 "spv.RayGenShader11.rgen",
535 "spv.subgroupArithmetic.comp",
536 "spv.subgroupBasic.comp",
537 "spv.subgroupBallot.comp",
538 "spv.subgroupBallotNeg.comp",
539 "spv.subgroupClustered.comp",
540 "spv.subgroupClusteredNeg.comp",
541 "spv.subgroupPartitioned.comp",
542 "spv.subgroupShuffle.comp",
543 "spv.subgroupShuffleRelative.comp",
544 "spv.subgroupQuad.comp",
545 "spv.subgroupVote.comp",
546 "spv.subgroupExtendedTypesArithmetic.comp",
547 "spv.subgroupExtendedTypesArithmeticNeg.comp",
548 "spv.subgroupExtendedTypesBallot.comp",
549 "spv.subgroupExtendedTypesBallotNeg.comp",
550 "spv.subgroupExtendedTypesClustered.comp",
551 "spv.subgroupExtendedTypesClusteredNeg.comp",
552 "spv.subgroupExtendedTypesPartitioned.comp",
553 "spv.subgroupExtendedTypesPartitionedNeg.comp",
554 "spv.subgroupExtendedTypesShuffle.comp",
555 "spv.subgroupExtendedTypesShuffleNeg.comp",
556 "spv.subgroupExtendedTypesShuffleRelative.comp",
557 "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
558 "spv.subgroupExtendedTypesQuad.comp",
559 "spv.subgroupExtendedTypesQuadNeg.comp",
560 "spv.subgroupExtendedTypesVote.comp",
561 "spv.subgroupExtendedTypesVoteNeg.comp",
562 "spv.vulkan110.storageBuffer.vert",
564 FileNameAsCustomTestSuffix
568 INSTANTIATE_TEST_SUITE_P(
569 Glsl, CompileToSpirv14Test,
570 ::testing::ValuesIn(std::vector<std::string>({
571 "spv.1.4.LoopControl.frag",
572 "spv.1.4.NonWritable.frag",
573 "spv.1.4.OpEntryPoint.frag",
574 "spv.1.4.OpEntryPoint.opaqueParams.vert",
575 "spv.1.4.OpSelect.frag",
576 "spv.1.4.OpCopyLogical.comp",
577 "spv.1.4.OpCopyLogicalBool.comp",
578 "spv.1.4.OpCopyLogical.funcall.frag",
579 "spv.1.4.funcall.array.frag",
580 "spv.1.4.load.bool.array.interface.block.frag",
581 "spv.1.4.image.frag",
582 "spv.1.4.sparseTexture.frag",
583 "spv.1.4.texture.frag",
584 "spv.1.4.constructComposite.comp",
585 "spv.ext.AnyHitShader.rahit",
586 "spv.ext.AnyHitShader_Errors.rahit",
587 "spv.ext.ClosestHitShader.rchit",
588 "spv.ext.ClosestHitShader_Subgroup.rchit",
589 "spv.ext.ClosestHitShader_Errors.rchit",
590 "spv.ext.IntersectShader.rint",
591 "spv.ext.IntersectShader_Errors.rint",
592 "spv.ext.MissShader.rmiss",
593 "spv.ext.MissShader_Errors.rmiss",
594 "spv.ext.RayPrimCull_Errors.rgen",
595 "spv.ext.RayCallable.rcall",
596 "spv.ext.RayCallable_Errors.rcall",
597 "spv.ext.RayConstants.rgen",
598 "spv.ext.RayGenShader.rgen",
599 "spv.ext.RayGenShader_Errors.rgen",
600 "spv.ext.RayGenShader11.rgen",
601 "spv.ext.RayGenShaderArray.rgen",
602 "spv.ext.RayGenSBTlayout.rgen",
603 "spv.ext.RayGenSBTlayout140.rgen",
604 "spv.ext.RayGenSBTlayout430.rgen",
605 "spv.ext.RayGenSBTlayoutscalar.rgen",
606 "spv.ext.World3x4.rahit",
607 "spv.ext.AccelDecl.frag",
608 "spv.ext.RayQueryDecl.frag",
610 // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
611 "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
612 "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
613 "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
614 "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
615 "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
616 "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
617 "spv.WorkgroupMemoryExplicitLayout.std140.comp",
618 "spv.WorkgroupMemoryExplicitLayout.std430.comp",
619 "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
621 FileNameAsCustomTestSuffix
625 INSTANTIATE_TEST_SUITE_P(
627 ::testing::ValuesIn(std::vector<IoMapData>{
628 { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
629 { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
630 { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
631 { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
632 { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
633 { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
634 { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
635 { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
636 { "spv.register.autoassign.rangetest.frag", "main",
637 glslang::TQualifier::layoutBindingEnd-2,
638 glslang::TQualifier::layoutBindingEnd+5,
639 20, 30, true, false },
641 FileNameAsCustomTestSuffixIoMap
645 INSTANTIATE_TEST_SUITE_P(
647 ::testing::ValuesIn(std::vector<IoMapData>{
648 { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
649 { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
651 FileNameAsCustomTestSuffixIoMap
655 INSTANTIATE_TEST_SUITE_P(
656 Glsl, CompileOpenGLToSpirvTest,
657 ::testing::ValuesIn(std::vector<std::string>({
662 "spv.atomicFloat.comp",
663 "spv.atomicFloat_Error.comp",
664 "spv.glFragColor.frag",
665 "spv.rankShift.comp",
666 "spv.specConst.vert",
667 "spv.specTexture.frag",
668 "spv.OVR_multiview.vert",
669 "spv.uniformInitializer.frag",
670 "spv.uniformInitializerSpecConstant.frag",
671 "spv.uniformInitializerStruct.frag",
672 "spv.xfbOffsetOnBlockMembersAssignment.vert",
673 "spv.xfbOffsetOnStructMembersAssignment.vert",
674 "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
675 "spv.xfbStrideJustOnce.vert",
677 FileNameAsCustomTestSuffix
680 INSTANTIATE_TEST_SUITE_P(
681 Glsl, VulkanSemantics,
682 ::testing::ValuesIn(std::vector<std::string>({
686 "samplerlessTextureFunctions.frag",
687 "spv.specConstArrayCheck.vert",
689 FileNameAsCustomTestSuffix
692 INSTANTIATE_TEST_SUITE_P(
693 Glsl, OpenGLSemantics,
694 ::testing::ValuesIn(std::vector<std::string>({
695 "glspv.esversion.vert",
696 "glspv.version.frag",
697 "glspv.version.vert",
701 FileNameAsCustomTestSuffix
704 INSTANTIATE_TEST_SUITE_P(
705 Glsl, VulkanAstSemantics,
706 ::testing::ValuesIn(std::vector<std::string>({
709 FileNameAsCustomTestSuffix
712 INSTANTIATE_TEST_SUITE_P(
713 Glsl, CompileVulkanToSpirvTestAMD,
714 ::testing::ValuesIn(std::vector<std::string>({
717 "spv.float16Fetch.frag",
718 "spv.imageLoadStoreLod.frag",
720 "spv.int16.amd.frag",
721 "spv.shaderBallotAMD.comp",
722 "spv.shaderFragMaskAMD.frag",
723 "spv.textureGatherBiasLod.frag",
725 FileNameAsCustomTestSuffix
728 INSTANTIATE_TEST_SUITE_P(
729 Glsl, CompileVulkanToSpirvTestNV,
730 ::testing::ValuesIn(std::vector<std::string>({
731 "spv.sampleMaskOverrideCoverage.frag",
732 "spv.GeometryShaderPassthrough.geom",
733 "spv.viewportArray2.vert",
734 "spv.viewportArray2.tesc",
735 "spv.stereoViewRendering.vert",
736 "spv.stereoViewRendering.tesc",
737 "spv.multiviewPerViewAttributes.vert",
738 "spv.multiviewPerViewAttributes.tesc",
739 "spv.atomicInt64.comp",
740 "spv.atomicStoreInt64.comp",
741 "spv.shadingRate.frag",
742 "spv.RayGenShader.rgen",
743 "spv.RayGenShaderArray.rgen",
744 "spv.RayGenShader_Errors.rgen",
745 "spv.RayConstants.rgen",
746 "spv.IntersectShader.rint",
747 "spv.IntersectShader_Errors.rint",
748 "spv.AnyHitShader.rahit",
749 "spv.AnyHitShader_Errors.rahit",
750 "spv.ClosestHitShader.rchit",
751 "spv.ClosestHitShader_Errors.rchit",
752 "spv.MissShader.rmiss",
753 "spv.MissShader_Errors.rmiss",
754 "spv.RayCallable.rcall",
755 "spv.RayCallable_Errors.rcall",
756 "spv.fragmentShaderBarycentric.frag",
757 "spv.fragmentShaderBarycentric2.frag",
758 "spv.computeShaderDerivatives.comp",
759 "spv.computeShaderDerivatives2.comp",
760 "spv.shaderImageFootprint.frag",
761 "spv.meshShaderBuiltins.mesh",
762 "spv.meshShaderUserDefined.mesh",
763 "spv.meshShaderPerViewBuiltins.mesh",
764 "spv.meshShaderPerViewUserDefined.mesh",
765 "spv.meshShaderPerView_Errors.mesh",
766 "spv.meshShaderSharedMem.mesh",
767 "spv.meshShaderTaskMem.mesh",
768 "spv.320.meshShaderUserDefined.mesh",
769 "spv.meshShaderRedeclBuiltins.mesh",
770 "spv.meshShaderRedeclPerViewBuiltins.mesh",
771 "spv.meshTaskShader.task",
772 "spv.perprimitiveNV.frag",
774 FileNameAsCustomTestSuffix
777 INSTANTIATE_TEST_SUITE_P(
778 Glsl, CompileVulkanToSpirv14TestNV,
779 ::testing::ValuesIn(std::vector<std::string>({
780 "spv.RayGenShaderMotion.rgen",
781 "spv.IntersectShaderMotion.rint",
782 "spv.AnyHitShaderMotion.rahit",
783 "spv.ClosestHitShaderMotion.rchit",
784 "spv.MissShaderMotion.rmiss",
786 FileNameAsCustomTestSuffix
788 INSTANTIATE_TEST_SUITE_P(
789 Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
790 ::testing::ValuesIn(std::vector<std::string>({
791 "spv.texture.sampler.transform.frag",
793 FileNameAsCustomTestSuffix
797 } // anonymous namespace
798 } // namespace glslangtest