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 CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
82 // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
84 TEST_P(CompileVulkanToSpirvTest, FromFile)
86 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
87 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
91 TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
93 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
94 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
98 // Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
99 // to successfully generate SPIR-V.
100 TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
102 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
103 Source::GLSL, Semantics::Vulkan,
104 glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
105 Target::Spv, true, "",
106 "/baseResults/", false, true);
110 TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
112 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
113 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
117 TEST_P(CompileToSpirv14Test, FromFile)
119 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
120 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
124 // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully
126 TEST_P(CompileOpenGLToSpirvTest, FromFile)
128 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
129 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
133 // GLSL-level Vulkan semantics test. Expected to error out before generating
135 TEST_P(VulkanSemantics, FromFile)
137 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
138 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
142 // GLSL-level Vulkan semantics test. Expected to error out before generating
144 TEST_P(OpenGLSemantics, FromFile)
146 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
147 Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
151 // GLSL-level Vulkan semantics test that need to see the AST for validation.
152 TEST_P(VulkanAstSemantics, FromFile)
154 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
155 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
159 // HLSL-level Vulkan semantics tests.
160 TEST_P(HlslIoMap, FromFile)
162 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
163 Source::HLSL, Semantics::Vulkan,
164 Target::Spv, GetParam().entryPoint,
165 GetParam().baseSamplerBinding,
166 GetParam().baseTextureBinding,
167 GetParam().baseImageBinding,
168 GetParam().baseUboBinding,
169 GetParam().baseSsboBinding,
170 GetParam().autoMapBindings,
171 GetParam().flattenUniforms);
174 // GLSL-level Vulkan semantics tests.
175 TEST_P(GlslIoMap, FromFile)
177 loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
178 Source::GLSL, Semantics::Vulkan,
179 Target::Spv, GetParam().entryPoint,
180 GetParam().baseSamplerBinding,
181 GetParam().baseTextureBinding,
182 GetParam().baseImageBinding,
183 GetParam().baseUboBinding,
184 GetParam().baseSsboBinding,
185 GetParam().autoMapBindings,
186 GetParam().flattenUniforms);
189 // Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
190 // Expected to successfully generate SPIR-V.
191 TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
193 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
194 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
198 // Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
199 // Expected to successfully generate SPIR-V.
200 TEST_P(CompileVulkanToSpirvTestNV, FromFile)
202 loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
203 Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
207 TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
209 loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
217 INSTANTIATE_TEST_SUITE_P(
218 Glsl, CompileVulkanToSpirvTest,
219 ::testing::ValuesIn(std::vector<std::string>({
220 // Test looping constructs.
221 // No tests yet for making sure break and continue from a nested loop
222 // goes to the innermost target.
224 "spv.do-simple.vert",
225 "spv.do-while-continue-break.vert",
226 "spv.for-complex-condition.vert",
227 "spv.for-continue-break.vert",
228 "spv.for-simple.vert",
229 "spv.for-notest.vert",
230 "spv.for-nobody.vert",
231 "spv.while-continue-break.vert",
232 "spv.while-simple.vert",
233 // vulkan-specific tests
235 "rayQuery-no-cse.rgen",
236 "rayQuery-initialize.rgen",
237 "rayQuery-allOps.rgen",
238 "rayQuery-allOps.Error.rgen",
239 "rayQuery-committed.Error.rgen",
240 "rayQuery-allOps.comp",
241 "rayQuery-allOps.frag",
242 "rayQuery-initialization.Error.comp",
243 "rayQuery-global.rgen",
244 "rayQuery-types.comp",
252 "spv.16bitstorage.frag",
253 "spv.16bitstorage_Error.frag",
254 "spv.16bitstorage-int.frag",
255 "spv.16bitstorage_Error-int.frag",
256 "spv.16bitstorage-uint.frag",
257 "spv.16bitstorage_Error-uint.frag",
258 "spv.300BuiltIns.vert",
259 "spv.300layout.frag",
260 "spv.300layout.vert",
261 "spv.300layoutp.vert",
263 "spv.310.bitcast.frag",
273 "spv.450.noRedecl.tesc",
274 "spv.8bitstorage-int.frag",
275 "spv.8bitstorage_Error-int.frag",
276 "spv.8bitstorage-uint.frag",
277 "spv.8bitstorage_Error-uint.frag",
278 "spv.8bitstorage-ubo.vert",
279 "spv.8bitstorage-ssbo.vert",
280 "spv.8bit-16bit-construction.frag",
281 "spv.accessChain.frag",
283 "spv.always-discard.frag",
284 "spv.always-discard2.frag",
285 "spv.arbPostDepthCoverage.frag",
286 "spv.arbPostDepthCoverage_Error.frag",
287 "spv.atomicCounter.comp",
290 "spv.boolInBlock.frag",
291 "spv.branch-return.vert",
292 "spv.bufferhandle1.frag",
293 "spv.bufferhandle10.frag",
294 "spv.bufferhandle11.frag",
295 "spv.bufferhandle12.frag",
296 "spv.bufferhandle13.frag",
297 "spv.bufferhandle14.frag",
298 "spv.bufferhandle15.frag",
299 "spv.bufferhandle16.frag",
300 "spv.bufferhandle17_Errors.frag",
301 "spv.bufferhandle18.frag",
302 "spv.bufferhandle19_Errors.frag",
303 "spv.bufferhandle2.frag",
304 "spv.bufferhandle3.frag",
305 "spv.bufferhandle4.frag",
306 "spv.bufferhandle5.frag",
307 "spv.bufferhandle6.frag",
308 "spv.bufferhandle7.frag",
309 "spv.bufferhandle8.frag",
310 "spv.bufferhandle9.frag",
311 "spv.bufferhandleUvec2.frag",
312 "spv.bufferhandle_Error.frag",
313 "spv.builtInXFB.vert",
314 "spv.conditionalDemote.frag",
315 "spv.conditionalDiscard.frag",
316 "spv.constructComposite.comp",
317 "spv.constStruct.vert",
318 "spv.constConstruct.vert",
319 "spv.controlFlowAttributes.frag",
320 "spv.conversion.frag",
322 "spv.coopmat_Error.comp",
324 "spv.dataOutIndirect.frag",
325 "spv.dataOutIndirect.vert",
326 "spv.debugPrintf.frag",
327 "spv.debugPrintf_Error.frag",
328 "spv.demoteDisabled.frag",
329 "spv.deepRvalue.frag",
331 "spv.depthUnchanged.frag",
332 "spv.discard-dce.frag",
333 "spv.doWhileLoop.frag",
334 "spv.earlyReturnDiscard.frag",
335 "spv.extPostDepthCoverage.frag",
336 "spv.extPostDepthCoverage_Error.frag",
337 "spv.float16convertonlyarith.comp",
338 "spv.float16convertonlystorage.comp",
339 "spv.flowControl.frag",
341 "spv.forwardFun.frag",
342 "spv.fragmentDensity.frag",
343 "spv.fragmentDensity.vert",
344 "spv.fragmentDensity-es.frag",
345 "spv.fragmentDensity-neg.frag",
347 "spv.fsi_Error.frag",
348 "spv.fullyCovered.frag",
349 "spv.functionCall.frag",
350 "spv.functionNestedOpaque.vert",
351 "spv.functionSemantics.frag",
352 "spv.functionParameterTypes.frag",
353 "spv.GeometryShaderPassthrough.geom",
354 "spv.funcall.array.frag",
355 "spv.load.bool.array.interface.block.frag",
356 "spv.interpOps.frag",
358 "spv.intcoopmat.comp",
360 "spv.intrinsicsSpirvByReference.vert",
361 "spv.intrinsicsSpirvDecorate.frag",
362 "spv.intrinsicsSpirvExecutionMode.frag",
363 "spv.intrinsicsSpirvInstruction.vert",
364 "spv.intrinsicsSpirvLiteral.vert",
365 "spv.intrinsicsSpirvStorageClass.rchit",
366 "spv.intrinsicsSpirvType.rgen",
367 "spv.invariantAll.vert",
369 "spv.layoutNested.vert",
371 "spv.localAggregates.frag",
373 "spv.loopsArtificial.frag",
377 "spv.memoryQualifier.frag",
378 "spv.merge-unreachable.frag",
379 "spv.multiStruct.comp",
380 "spv.multiStructFuncall.frag",
381 "spv.newTexture.frag",
382 "spv.noDeadDecorations.vert",
383 "spv.nonSquare.vert",
384 "spv.nonuniform.frag",
385 "spv.nonuniform2.frag",
386 "spv.nonuniform3.frag",
387 "spv.nonuniform4.frag",
388 "spv.nonuniform5.frag",
389 "spv.noWorkgroup.comp",
392 "spv.Operations.frag",
393 "spv.paramMemory.frag",
394 "spv.paramMemory.420.frag",
395 "spv.precision.frag",
396 "spv.precisionArgs.frag",
397 "spv.precisionNonESSamp.frag",
398 "spv.precisionTexture.frag",
400 "spv.privateVariableTypes.frag",
401 "spv.qualifiers.vert",
404 "spv.samplePosition.frag",
405 "spv.sampleMaskOverrideCoverage.frag",
406 "spv.scalarlayout.frag",
407 "spv.scalarlayoutfloat16.frag",
408 "spv.shaderBallot.comp",
409 "spv.shaderDrawParams.vert",
410 "spv.shaderGroupVote.comp",
411 "spv.shaderStencilExport.frag",
413 "spv.simpleFunctionCall.frag",
414 "spv.simpleMat.vert",
415 "spv.sparseTexture.frag",
416 "spv.sparseTextureClamp.frag",
417 "spv.structAssignment.frag",
418 "spv.structDeref.frag",
419 "spv.structure.frag",
422 "spv.swizzleInversion.frag",
427 "spv.textureBuffer.vert",
429 "spv.imageAtomic64.frag",
432 "spv.uniformArray.frag",
433 "spv.variableArrayIndex.frag",
434 "spv.varyingArray.frag",
435 "spv.varyingArrayIndirect.frag",
436 "spv.vecMatConstruct.frag",
437 "spv.voidFunction.frag",
438 "spv.whileLoop.frag",
442 "spv.shortCircuit.frag",
443 "spv.pushConstant.vert",
444 "spv.pushConstantAnon.vert",
446 "spv.specConstant.vert",
447 "spv.specConstant.comp",
448 "spv.specConstantComposite.vert",
449 "spv.specConstantOperations.vert",
450 "spv.specConstant.float16.comp",
451 "spv.specConstant.int16.comp",
452 "spv.specConstant.int8.comp",
453 "spv.storageBuffer.vert",
454 "spv.terminate.frag",
455 "spv.subgroupUniformControlFlow.vert",
458 "spv.viewportindex.tese",
459 "spv.volatileAtomic.comp",
460 "spv.vulkan100.subgroupArithmetic.comp",
461 "spv.vulkan100.subgroupPartitioned.comp",
465 "spv.samplerlessTextureFunctions.frag",
466 "spv.smBuiltins.vert",
467 "spv.smBuiltins.frag",
468 "spv.builtin.PrimitiveShadingRateEXT.vert",
469 "spv.builtin.ShadingRateEXT.frag",
470 "spv.atomicAdd.bufferReference.comp"
472 FileNameAsCustomTestSuffix
475 // Cases with deliberately unreachable code.
476 // By default the compiler will aggressively eliminate
477 // unreachable merges and continues.
478 INSTANTIATE_TEST_SUITE_P(
479 GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
480 ::testing::ValuesIn(std::vector<std::string>({
481 "spv.dead-after-continue.vert",
482 "spv.dead-after-discard.frag",
483 "spv.dead-after-return.vert",
484 "spv.dead-after-loop-break.vert",
485 "spv.dead-after-switch-break.vert",
486 "spv.dead-complex-continue-after-return.vert",
487 "spv.dead-complex-merge-after-return.vert",
489 FileNameAsCustomTestSuffix
493 INSTANTIATE_TEST_SUITE_P(
494 Glsl, CompileVulkanToDebugSpirvTest,
495 ::testing::ValuesIn(std::vector<std::string>({
498 FileNameAsCustomTestSuffix
502 INSTANTIATE_TEST_SUITE_P(
503 Glsl, CompileVulkan1_1ToSpirvTest,
504 ::testing::ValuesIn(std::vector<std::string>({
505 "spv.1.3.8bitstorage-ubo.vert",
506 "spv.1.3.8bitstorage-ssbo.vert",
507 "spv.1.3.coopmat.comp",
508 "spv.deviceGroup.frag",
509 "spv.drawParams.vert",
511 "spv.vulkan110.int16.frag",
513 "spv.explicittypes.frag",
516 "spv.memoryScopeSemantics.comp",
517 "spv.memoryScopeSemantics_Error.comp",
518 "spv.multiView.frag",
519 "spv.queueFamilyScope.comp",
520 "spv.RayGenShader11.rgen",
526 "spv.subgroupArithmetic.comp",
527 "spv.subgroupBasic.comp",
528 "spv.subgroupBallot.comp",
529 "spv.subgroupBallotNeg.comp",
530 "spv.subgroupClustered.comp",
531 "spv.subgroupClusteredNeg.comp",
532 "spv.subgroupPartitioned.comp",
533 "spv.subgroupShuffle.comp",
534 "spv.subgroupShuffleRelative.comp",
535 "spv.subgroupQuad.comp",
536 "spv.subgroupVote.comp",
537 "spv.subgroupExtendedTypesArithmetic.comp",
538 "spv.subgroupExtendedTypesArithmeticNeg.comp",
539 "spv.subgroupExtendedTypesBallot.comp",
540 "spv.subgroupExtendedTypesBallotNeg.comp",
541 "spv.subgroupExtendedTypesClustered.comp",
542 "spv.subgroupExtendedTypesClusteredNeg.comp",
543 "spv.subgroupExtendedTypesPartitioned.comp",
544 "spv.subgroupExtendedTypesPartitionedNeg.comp",
545 "spv.subgroupExtendedTypesShuffle.comp",
546 "spv.subgroupExtendedTypesShuffleNeg.comp",
547 "spv.subgroupExtendedTypesShuffleRelative.comp",
548 "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
549 "spv.subgroupExtendedTypesQuad.comp",
550 "spv.subgroupExtendedTypesQuadNeg.comp",
551 "spv.subgroupExtendedTypesVote.comp",
552 "spv.subgroupExtendedTypesVoteNeg.comp",
553 "spv.vulkan110.storageBuffer.vert",
555 FileNameAsCustomTestSuffix
559 INSTANTIATE_TEST_SUITE_P(
560 Glsl, CompileToSpirv14Test,
561 ::testing::ValuesIn(std::vector<std::string>({
562 "spv.1.4.LoopControl.frag",
563 "spv.1.4.NonWritable.frag",
564 "spv.1.4.OpEntryPoint.frag",
565 "spv.1.4.OpEntryPoint.opaqueParams.vert",
566 "spv.1.4.OpSelect.frag",
567 "spv.1.4.OpCopyLogical.comp",
568 "spv.1.4.OpCopyLogicalBool.comp",
569 "spv.1.4.OpCopyLogical.funcall.frag",
570 "spv.1.4.funcall.array.frag",
571 "spv.1.4.load.bool.array.interface.block.frag",
572 "spv.1.4.image.frag",
573 "spv.1.4.sparseTexture.frag",
574 "spv.1.4.texture.frag",
575 "spv.1.4.constructComposite.comp",
576 "spv.ext.AnyHitShader.rahit",
577 "spv.ext.AnyHitShader_Errors.rahit",
578 "spv.ext.ClosestHitShader.rchit",
579 "spv.ext.ClosestHitShader_Subgroup.rchit",
580 "spv.ext.ClosestHitShader_Errors.rchit",
581 "spv.ext.IntersectShader.rint",
582 "spv.ext.IntersectShader_Errors.rint",
583 "spv.ext.MissShader.rmiss",
584 "spv.ext.MissShader_Errors.rmiss",
585 "spv.ext.RayPrimCull_Errors.rgen",
586 "spv.ext.RayCallable.rcall",
587 "spv.ext.RayCallable_Errors.rcall",
588 "spv.ext.RayConstants.rgen",
589 "spv.ext.RayGenShader.rgen",
590 "spv.ext.RayGenShader_Errors.rgen",
591 "spv.ext.RayGenShader11.rgen",
592 "spv.ext.RayGenShaderArray.rgen",
593 "spv.ext.RayGenSBTlayout.rgen",
594 "spv.ext.RayGenSBTlayout140.rgen",
595 "spv.ext.RayGenSBTlayout430.rgen",
596 "spv.ext.RayGenSBTlayoutscalar.rgen",
597 "spv.ext.World3x4.rahit",
598 "spv.ext.AccelDecl.frag",
599 "spv.ext.RayQueryDecl.frag",
601 // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
602 "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
603 "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
604 "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
605 "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
606 "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
607 "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
608 "spv.WorkgroupMemoryExplicitLayout.std140.comp",
609 "spv.WorkgroupMemoryExplicitLayout.std430.comp",
610 "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
612 FileNameAsCustomTestSuffix
616 INSTANTIATE_TEST_SUITE_P(
618 ::testing::ValuesIn(std::vector<IoMapData>{
619 { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
620 { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
621 { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
622 { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
623 { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
624 { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
625 { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
626 { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
627 { "spv.register.autoassign.rangetest.frag", "main",
628 glslang::TQualifier::layoutBindingEnd-2,
629 glslang::TQualifier::layoutBindingEnd+5,
630 20, 30, true, false },
632 FileNameAsCustomTestSuffixIoMap
636 INSTANTIATE_TEST_SUITE_P(
638 ::testing::ValuesIn(std::vector<IoMapData>{
639 { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
640 { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
642 FileNameAsCustomTestSuffixIoMap
646 INSTANTIATE_TEST_SUITE_P(
647 Glsl, CompileOpenGLToSpirvTest,
648 ::testing::ValuesIn(std::vector<std::string>({
653 "spv.atomicFloat.comp",
654 "spv.atomicFloat_Error.comp",
655 "spv.glFragColor.frag",
656 "spv.rankShift.comp",
657 "spv.specConst.vert",
658 "spv.specTexture.frag",
659 "spv.OVR_multiview.vert",
660 "spv.uniformInitializer.frag",
661 "spv.uniformInitializerSpecConstant.frag",
662 "spv.uniformInitializerStruct.frag",
663 "spv.xfbOffsetOnBlockMembersAssignment.vert",
664 "spv.xfbOffsetOnStructMembersAssignment.vert",
665 "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
666 "spv.xfbStrideJustOnce.vert",
668 FileNameAsCustomTestSuffix
671 INSTANTIATE_TEST_SUITE_P(
672 Glsl, VulkanSemantics,
673 ::testing::ValuesIn(std::vector<std::string>({
677 "samplerlessTextureFunctions.frag",
678 "spv.specConstArrayCheck.vert",
680 FileNameAsCustomTestSuffix
683 INSTANTIATE_TEST_SUITE_P(
684 Glsl, OpenGLSemantics,
685 ::testing::ValuesIn(std::vector<std::string>({
686 "glspv.esversion.vert",
687 "glspv.version.frag",
688 "glspv.version.vert",
692 FileNameAsCustomTestSuffix
695 INSTANTIATE_TEST_SUITE_P(
696 Glsl, VulkanAstSemantics,
697 ::testing::ValuesIn(std::vector<std::string>({
700 FileNameAsCustomTestSuffix
703 INSTANTIATE_TEST_SUITE_P(
704 Glsl, CompileVulkanToSpirvTestAMD,
705 ::testing::ValuesIn(std::vector<std::string>({
708 "spv.float16Fetch.frag",
709 "spv.imageLoadStoreLod.frag",
711 "spv.int16.amd.frag",
712 "spv.shaderBallotAMD.comp",
713 "spv.shaderFragMaskAMD.frag",
714 "spv.textureGatherBiasLod.frag",
716 FileNameAsCustomTestSuffix
719 INSTANTIATE_TEST_SUITE_P(
720 Glsl, CompileVulkanToSpirvTestNV,
721 ::testing::ValuesIn(std::vector<std::string>({
722 "spv.sampleMaskOverrideCoverage.frag",
723 "spv.GeometryShaderPassthrough.geom",
724 "spv.viewportArray2.vert",
725 "spv.viewportArray2.tesc",
726 "spv.stereoViewRendering.vert",
727 "spv.stereoViewRendering.tesc",
728 "spv.multiviewPerViewAttributes.vert",
729 "spv.multiviewPerViewAttributes.tesc",
730 "spv.atomicInt64.comp",
731 "spv.atomicStoreInt64.comp",
732 "spv.shadingRate.frag",
733 "spv.RayGenShader.rgen",
734 "spv.RayGenShaderArray.rgen",
735 "spv.RayGenShader_Errors.rgen",
736 "spv.RayConstants.rgen",
737 "spv.IntersectShader.rint",
738 "spv.IntersectShader_Errors.rint",
739 "spv.AnyHitShader.rahit",
740 "spv.AnyHitShader_Errors.rahit",
741 "spv.ClosestHitShader.rchit",
742 "spv.ClosestHitShader_Errors.rchit",
743 "spv.MissShader.rmiss",
744 "spv.MissShader_Errors.rmiss",
745 "spv.RayCallable.rcall",
746 "spv.RayCallable_Errors.rcall",
747 "spv.fragmentShaderBarycentric.frag",
748 "spv.fragmentShaderBarycentric2.frag",
749 "spv.computeShaderDerivatives.comp",
750 "spv.computeShaderDerivatives2.comp",
751 "spv.shaderImageFootprint.frag",
752 "spv.meshShaderBuiltins.mesh",
753 "spv.meshShaderUserDefined.mesh",
754 "spv.meshShaderPerViewBuiltins.mesh",
755 "spv.meshShaderPerViewUserDefined.mesh",
756 "spv.meshShaderPerView_Errors.mesh",
757 "spv.meshShaderSharedMem.mesh",
758 "spv.meshShaderTaskMem.mesh",
759 "spv.320.meshShaderUserDefined.mesh",
760 "spv.meshShaderRedeclBuiltins.mesh",
761 "spv.meshShaderRedeclPerViewBuiltins.mesh",
762 "spv.meshTaskShader.task",
763 "spv.perprimitiveNV.frag",
765 FileNameAsCustomTestSuffix
768 INSTANTIATE_TEST_SUITE_P(
769 Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
770 ::testing::ValuesIn(std::vector<std::string>({
771 "spv.texture.sampler.transform.frag",
773 FileNameAsCustomTestSuffix
777 } // anonymous namespace
778 } // namespace glslangtest