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.intrinsicsSpecConst.vert",
369 "spv.intrinsicsSpirvByReference.vert",
370 "spv.intrinsicsSpirvDecorate.frag",
371 "spv.intrinsicsSpirvExecutionMode.frag",
372 "spv.intrinsicsSpirvInstruction.vert",
373 "spv.intrinsicsSpirvLiteral.vert",
374 "spv.intrinsicsSpirvStorageClass.rchit",
375 "spv.intrinsicsSpirvType.rgen",
376 "spv.intrinsicsSpirvTypeLocalVar.vert",
377 "spv.invariantAll.vert",
379 "spv.layoutNested.vert",
381 "spv.localAggregates.frag",
383 "spv.loopsArtificial.frag",
387 "spv.memoryQualifier.frag",
388 "spv.merge-unreachable.frag",
389 "spv.multiStruct.comp",
390 "spv.multiStructFuncall.frag",
391 "spv.newTexture.frag",
392 "spv.noDeadDecorations.vert",
393 "spv.nonSquare.vert",
394 "spv.nonuniform.frag",
395 "spv.nonuniform2.frag",
396 "spv.nonuniform3.frag",
397 "spv.nonuniform4.frag",
398 "spv.nonuniform5.frag",
399 "spv.noWorkgroup.comp",
402 "spv.Operations.frag",
403 "spv.paramMemory.frag",
404 "spv.paramMemory.420.frag",
405 "spv.precision.frag",
406 "spv.precisionArgs.frag",
407 "spv.precisionNonESSamp.frag",
408 "spv.precisionTexture.frag",
410 "spv.privateVariableTypes.frag",
411 "spv.qualifiers.vert",
414 "spv.samplePosition.frag",
415 "spv.sampleMaskOverrideCoverage.frag",
416 "spv.scalarlayout.frag",
417 "spv.scalarlayoutfloat16.frag",
418 "spv.shaderBallot.comp",
419 "spv.shaderDrawParams.vert",
420 "spv.shaderGroupVote.comp",
421 "spv.shaderStencilExport.frag",
423 "spv.simpleFunctionCall.frag",
424 "spv.simpleMat.vert",
425 "spv.sparseTexture.frag",
426 "spv.sparseTextureClamp.frag",
427 "spv.structAssignment.frag",
428 "spv.structDeref.frag",
429 "spv.structure.frag",
432 "spv.swizzleInversion.frag",
437 "spv.textureBuffer.vert",
439 "spv.imageAtomic64.frag",
442 "spv.uniformArray.frag",
443 "spv.variableArrayIndex.frag",
444 "spv.varyingArray.frag",
445 "spv.varyingArrayIndirect.frag",
446 "spv.vecMatConstruct.frag",
447 "spv.voidFunction.frag",
448 "spv.whileLoop.frag",
452 "spv.shortCircuit.frag",
453 "spv.pushConstant.vert",
454 "spv.pushConstantAnon.vert",
456 "spv.specConstant.vert",
457 "spv.specConstant.comp",
458 "spv.specConstantComposite.vert",
459 "spv.specConstantOperations.vert",
460 "spv.specConstant.float16.comp",
461 "spv.specConstant.int16.comp",
462 "spv.specConstant.int8.comp",
463 "spv.storageBuffer.vert",
464 "spv.terminate.frag",
465 "spv.subgroupUniformControlFlow.vert",
468 "spv.viewportindex.tese",
469 "spv.volatileAtomic.comp",
470 "spv.vulkan100.subgroupArithmetic.comp",
471 "spv.vulkan100.subgroupPartitioned.comp",
475 "spv.samplerlessTextureFunctions.frag",
476 "spv.smBuiltins.vert",
477 "spv.smBuiltins.frag",
478 "spv.builtin.PrimitiveShadingRateEXT.vert",
479 "spv.builtin.ShadingRateEXT.frag",
480 "spv.atomicAdd.bufferReference.comp"
482 FileNameAsCustomTestSuffix
485 // Cases with deliberately unreachable code.
486 // By default the compiler will aggressively eliminate
487 // unreachable merges and continues.
488 INSTANTIATE_TEST_SUITE_P(
489 GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
490 ::testing::ValuesIn(std::vector<std::string>({
491 "spv.dead-after-continue.vert",
492 "spv.dead-after-discard.frag",
493 "spv.dead-after-return.vert",
494 "spv.dead-after-loop-break.vert",
495 "spv.dead-after-switch-break.vert",
496 "spv.dead-complex-continue-after-return.vert",
497 "spv.dead-complex-merge-after-return.vert",
499 FileNameAsCustomTestSuffix
503 INSTANTIATE_TEST_SUITE_P(
504 Glsl, CompileVulkanToDebugSpirvTest,
505 ::testing::ValuesIn(std::vector<std::string>({
508 FileNameAsCustomTestSuffix
512 INSTANTIATE_TEST_SUITE_P(
513 Glsl, CompileVulkan1_1ToSpirvTest,
514 ::testing::ValuesIn(std::vector<std::string>({
515 "spv.1.3.8bitstorage-ubo.vert",
516 "spv.1.3.8bitstorage-ssbo.vert",
517 "spv.1.3.coopmat.comp",
518 "spv.deviceGroup.frag",
519 "spv.drawParams.vert",
521 "spv.vulkan110.int16.frag",
523 "spv.explicittypes.frag",
526 "spv.memoryScopeSemantics.comp",
527 "spv.memoryScopeSemantics_Error.comp",
528 "spv.multiView.frag",
529 "spv.queueFamilyScope.comp",
530 "spv.RayGenShader11.rgen",
536 "spv.subgroupArithmetic.comp",
537 "spv.subgroupBasic.comp",
538 "spv.subgroupBallot.comp",
539 "spv.subgroupBallotNeg.comp",
540 "spv.subgroupClustered.comp",
541 "spv.subgroupClusteredNeg.comp",
542 "spv.subgroupPartitioned.comp",
543 "spv.subgroupShuffle.comp",
544 "spv.subgroupShuffleRelative.comp",
545 "spv.subgroupQuad.comp",
546 "spv.subgroupVote.comp",
547 "spv.subgroupExtendedTypesArithmetic.comp",
548 "spv.subgroupExtendedTypesArithmeticNeg.comp",
549 "spv.subgroupExtendedTypesBallot.comp",
550 "spv.subgroupExtendedTypesBallotNeg.comp",
551 "spv.subgroupExtendedTypesClustered.comp",
552 "spv.subgroupExtendedTypesClusteredNeg.comp",
553 "spv.subgroupExtendedTypesPartitioned.comp",
554 "spv.subgroupExtendedTypesPartitionedNeg.comp",
555 "spv.subgroupExtendedTypesShuffle.comp",
556 "spv.subgroupExtendedTypesShuffleNeg.comp",
557 "spv.subgroupExtendedTypesShuffleRelative.comp",
558 "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
559 "spv.subgroupExtendedTypesQuad.comp",
560 "spv.subgroupExtendedTypesQuadNeg.comp",
561 "spv.subgroupExtendedTypesVote.comp",
562 "spv.subgroupExtendedTypesVoteNeg.comp",
563 "spv.vulkan110.storageBuffer.vert",
565 FileNameAsCustomTestSuffix
569 INSTANTIATE_TEST_SUITE_P(
570 Glsl, CompileToSpirv14Test,
571 ::testing::ValuesIn(std::vector<std::string>({
572 "spv.1.4.LoopControl.frag",
573 "spv.1.4.NonWritable.frag",
574 "spv.1.4.OpEntryPoint.frag",
575 "spv.1.4.OpEntryPoint.opaqueParams.vert",
576 "spv.1.4.OpSelect.frag",
577 "spv.1.4.OpCopyLogical.comp",
578 "spv.1.4.OpCopyLogicalBool.comp",
579 "spv.1.4.OpCopyLogical.funcall.frag",
580 "spv.1.4.funcall.array.frag",
581 "spv.1.4.load.bool.array.interface.block.frag",
582 "spv.1.4.image.frag",
583 "spv.1.4.sparseTexture.frag",
584 "spv.1.4.texture.frag",
585 "spv.1.4.constructComposite.comp",
586 "spv.ext.AnyHitShader.rahit",
587 "spv.ext.AnyHitShader_Errors.rahit",
588 "spv.ext.ClosestHitShader.rchit",
589 "spv.ext.ClosestHitShader_Subgroup.rchit",
590 "spv.ext.ClosestHitShader_Errors.rchit",
591 "spv.ext.IntersectShader.rint",
592 "spv.ext.IntersectShader_Errors.rint",
593 "spv.ext.MissShader.rmiss",
594 "spv.ext.MissShader_Errors.rmiss",
595 "spv.ext.RayPrimCull_Errors.rgen",
596 "spv.ext.RayCallable.rcall",
597 "spv.ext.RayCallable_Errors.rcall",
598 "spv.ext.RayConstants.rgen",
599 "spv.ext.RayGenShader.rgen",
600 "spv.ext.RayGenShader_Errors.rgen",
601 "spv.ext.RayGenShader11.rgen",
602 "spv.ext.RayGenShaderArray.rgen",
603 "spv.ext.RayGenSBTlayout.rgen",
604 "spv.ext.RayGenSBTlayout140.rgen",
605 "spv.ext.RayGenSBTlayout430.rgen",
606 "spv.ext.RayGenSBTlayoutscalar.rgen",
607 "spv.ext.World3x4.rahit",
608 "spv.ext.AccelDecl.frag",
609 "spv.ext.RayQueryDecl.frag",
611 // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
612 "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
613 "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
614 "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
615 "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
616 "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
617 "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
618 "spv.WorkgroupMemoryExplicitLayout.std140.comp",
619 "spv.WorkgroupMemoryExplicitLayout.std430.comp",
620 "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
622 FileNameAsCustomTestSuffix
626 INSTANTIATE_TEST_SUITE_P(
628 ::testing::ValuesIn(std::vector<IoMapData>{
629 { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
630 { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
631 { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
632 { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
633 { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
634 { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
635 { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
636 { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
637 { "spv.register.autoassign.rangetest.frag", "main",
638 glslang::TQualifier::layoutBindingEnd-2,
639 glslang::TQualifier::layoutBindingEnd+5,
640 20, 30, true, false },
642 FileNameAsCustomTestSuffixIoMap
646 INSTANTIATE_TEST_SUITE_P(
648 ::testing::ValuesIn(std::vector<IoMapData>{
649 { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
650 { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
652 FileNameAsCustomTestSuffixIoMap
656 INSTANTIATE_TEST_SUITE_P(
657 Glsl, CompileOpenGLToSpirvTest,
658 ::testing::ValuesIn(std::vector<std::string>({
663 "spv.atomicFloat.comp",
664 "spv.atomicFloat_Error.comp",
665 "spv.glFragColor.frag",
666 "spv.rankShift.comp",
667 "spv.specConst.vert",
668 "spv.specTexture.frag",
669 "spv.OVR_multiview.vert",
670 "spv.uniformInitializer.frag",
671 "spv.uniformInitializerSpecConstant.frag",
672 "spv.uniformInitializerStruct.frag",
673 "spv.xfbOffsetOnBlockMembersAssignment.vert",
674 "spv.xfbOffsetOnStructMembersAssignment.vert",
675 "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
676 "spv.xfbStrideJustOnce.vert",
678 FileNameAsCustomTestSuffix
681 INSTANTIATE_TEST_SUITE_P(
682 Glsl, VulkanSemantics,
683 ::testing::ValuesIn(std::vector<std::string>({
687 "samplerlessTextureFunctions.frag",
688 "spv.specConstArrayCheck.vert",
690 FileNameAsCustomTestSuffix
693 INSTANTIATE_TEST_SUITE_P(
694 Glsl, OpenGLSemantics,
695 ::testing::ValuesIn(std::vector<std::string>({
696 "glspv.esversion.vert",
697 "glspv.version.frag",
698 "glspv.version.vert",
702 FileNameAsCustomTestSuffix
705 INSTANTIATE_TEST_SUITE_P(
706 Glsl, VulkanAstSemantics,
707 ::testing::ValuesIn(std::vector<std::string>({
710 FileNameAsCustomTestSuffix
713 INSTANTIATE_TEST_SUITE_P(
714 Glsl, CompileVulkanToSpirvTestAMD,
715 ::testing::ValuesIn(std::vector<std::string>({
718 "spv.float16Fetch.frag",
719 "spv.imageLoadStoreLod.frag",
721 "spv.int16.amd.frag",
722 "spv.shaderBallotAMD.comp",
723 "spv.shaderFragMaskAMD.frag",
724 "spv.textureGatherBiasLod.frag",
726 FileNameAsCustomTestSuffix
729 INSTANTIATE_TEST_SUITE_P(
730 Glsl, CompileVulkanToSpirvTestNV,
731 ::testing::ValuesIn(std::vector<std::string>({
732 "spv.sampleMaskOverrideCoverage.frag",
733 "spv.GeometryShaderPassthrough.geom",
734 "spv.viewportArray2.vert",
735 "spv.viewportArray2.tesc",
736 "spv.stereoViewRendering.vert",
737 "spv.stereoViewRendering.tesc",
738 "spv.multiviewPerViewAttributes.vert",
739 "spv.multiviewPerViewAttributes.tesc",
740 "spv.atomicInt64.comp",
741 "spv.atomicStoreInt64.comp",
742 "spv.shadingRate.frag",
743 "spv.RayGenShader.rgen",
744 "spv.RayGenShaderArray.rgen",
745 "spv.RayGenShader_Errors.rgen",
746 "spv.RayConstants.rgen",
747 "spv.IntersectShader.rint",
748 "spv.IntersectShader_Errors.rint",
749 "spv.AnyHitShader.rahit",
750 "spv.AnyHitShader_Errors.rahit",
751 "spv.ClosestHitShader.rchit",
752 "spv.ClosestHitShader_Errors.rchit",
753 "spv.MissShader.rmiss",
754 "spv.MissShader_Errors.rmiss",
755 "spv.RayCallable.rcall",
756 "spv.RayCallable_Errors.rcall",
757 "spv.fragmentShaderBarycentric.frag",
758 "spv.fragmentShaderBarycentric2.frag",
759 "spv.computeShaderDerivatives.comp",
760 "spv.computeShaderDerivatives2.comp",
761 "spv.shaderImageFootprint.frag",
762 "spv.meshShaderBuiltins.mesh",
763 "spv.meshShaderUserDefined.mesh",
764 "spv.meshShaderPerViewBuiltins.mesh",
765 "spv.meshShaderPerViewUserDefined.mesh",
766 "spv.meshShaderPerView_Errors.mesh",
767 "spv.meshShaderSharedMem.mesh",
768 "spv.meshShaderTaskMem.mesh",
769 "spv.320.meshShaderUserDefined.mesh",
770 "spv.meshShaderRedeclBuiltins.mesh",
771 "spv.meshShaderRedeclPerViewBuiltins.mesh",
772 "spv.meshTaskShader.task",
773 "spv.perprimitiveNV.frag",
775 FileNameAsCustomTestSuffix
778 INSTANTIATE_TEST_SUITE_P(
779 Glsl, CompileVulkanToSpirv14TestNV,
780 ::testing::ValuesIn(std::vector<std::string>({
781 "spv.RayGenShaderMotion.rgen",
782 "spv.IntersectShaderMotion.rint",
783 "spv.AnyHitShaderMotion.rahit",
784 "spv.ClosestHitShaderMotion.rchit",
785 "spv.MissShaderMotion.rmiss",
787 FileNameAsCustomTestSuffix
789 INSTANTIATE_TEST_SUITE_P(
790 Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
791 ::testing::ValuesIn(std::vector<std::string>({
792 "spv.texture.sampler.transform.frag",
794 FileNameAsCustomTestSuffix
798 } // anonymous namespace
799 } // namespace glslangtest