Spv.FromFile.cpp 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  1. //
  2. // Copyright (C) 2016 Google, Inc.
  3. // Copyright (C) 2019, 2022-2024 Arm Limited.
  4. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
  5. //
  6. // All rights reserved.
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. //
  12. // Redistributions of source code must retain the above copyright
  13. // notice, this list of conditions and the following disclaimer.
  14. //
  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.
  19. //
  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.
  23. //
  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.
  36. #include <algorithm>
  37. #include <gtest/gtest.h>
  38. #include "TestFixture.h"
  39. namespace glslangtest {
  40. namespace {
  41. struct IoMapData {
  42. const char* fileName;
  43. const char* entryPoint;
  44. int baseSamplerBinding;
  45. int baseTextureBinding;
  46. int baseImageBinding;
  47. int baseUboBinding;
  48. int baseSsboBinding;
  49. bool autoMapBindings;
  50. bool flattenUniforms;
  51. };
  52. std::string FileNameAsCustomTestSuffixIoMap(
  53. const ::testing::TestParamInfo<IoMapData>& info) {
  54. std::string name = info.param.fileName;
  55. // A valid test case suffix cannot have '.' and '-' inside.
  56. std::replace(name.begin(), name.end(), '.', '_');
  57. std::replace(name.begin(), name.end(), '-', '_');
  58. return name;
  59. }
  60. using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
  61. using CompileVulkanToSpirvTestNoLink = GlslangTest<::testing::TestWithParam<std::string>>;
  62. using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
  63. using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
  64. using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
  65. using CompileToSpirv16Test = GlslangTest<::testing::TestWithParam<std::string>>;
  66. using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
  67. using VulkanSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
  68. using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
  69. using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
  70. using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
  71. using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
  72. using CompileVulkanToSpirvTestQCOM = GlslangTest<::testing::TestWithParam<std::string>>;
  73. using CompileVulkanToSpirv13TestQCOM = GlslangTest<::testing::TestWithParam<std::string>>;
  74. using CompileVulkanToSpirv14TestQCOM = GlslangTest<::testing::TestWithParam<std::string>>;
  75. using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
  76. using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
  77. using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
  78. using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
  79. using GlslSpirvDebugInfoTest = GlslangTest<::testing::TestWithParam<std::string>>;
  80. using GlslNonSemanticShaderDebugInfoTest = GlslangTest<::testing::TestWithParam<std::string>>;
  81. using GlslNonSemanticShaderDebugInfoSpirv13Test = GlslangTest<::testing::TestWithParam<std::string>>;
  82. using GlslNonSemanticShaderDebugInfoVulkanLatestTest = GlslangTest<::testing::TestWithParam<std::string>>;
  83. // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
  84. // generate SPIR-V.
  85. TEST_P(CompileVulkanToSpirvTest, FromFile)
  86. {
  87. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  88. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  89. Target::Spv);
  90. }
  91. // Compiling GLSL to SPIR-V under Vulkan semantics without linking. Expected to successfully generate SPIR-V.
  92. TEST_P(CompileVulkanToSpirvTestNoLink, FromFile)
  93. {
  94. options().compileOnly = true;
  95. // NOTE: Vulkan 1.3 is currently required to use the linkage capability
  96. // TODO(ncesario) make sure this is actually necessary
  97. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
  98. glslang::EShTargetVulkan_1_3, glslang::EShTargetSpv_1_0, Target::Spv);
  99. }
  100. TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
  101. {
  102. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  103. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  104. Target::Spv);
  105. }
  106. TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
  107. {
  108. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  109. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
  110. Target::Spv);
  111. }
  112. TEST_P(CompileToSpirv14Test, FromFile)
  113. {
  114. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  115. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
  116. Target::Spv);
  117. }
  118. TEST_P(CompileToSpirv16Test, FromFileTargetVulkan1_3)
  119. {
  120. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  121. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_3, glslang::EShTargetSpv_1_6,
  122. Target::Spv);
  123. }
  124. TEST_P(CompileToSpirv16Test, FromFileTargetVulkan1_4)
  125. {
  126. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  127. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_4, glslang::EShTargetSpv_1_6,
  128. Target::Spv);
  129. }
  130. // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully
  131. // generate SPIR-V.
  132. TEST_P(CompileOpenGLToSpirvTest, FromFile)
  133. {
  134. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  135. Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  136. Target::Spv);
  137. }
  138. // GLSL-level Vulkan semantics test. Expected to error out before generating
  139. // SPIR-V.
  140. TEST_P(VulkanSemantics, FromFile)
  141. {
  142. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  143. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  144. Target::Spv, false);
  145. }
  146. // GLSL-level Vulkan semantics test. Expected to error out before generating
  147. // SPIR-V.
  148. TEST_P(OpenGLSemantics, FromFile)
  149. {
  150. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  151. Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  152. Target::Spv, false);
  153. }
  154. // GLSL-level Vulkan semantics test that need to see the AST for validation.
  155. TEST_P(VulkanAstSemantics, FromFile)
  156. {
  157. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  158. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  159. Target::AST);
  160. }
  161. // HLSL-level Vulkan semantics tests.
  162. TEST_P(HlslIoMap, FromFile)
  163. {
  164. loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
  165. Source::HLSL, Semantics::Vulkan,
  166. Target::Spv, GetParam().entryPoint,
  167. GetParam().baseSamplerBinding,
  168. GetParam().baseTextureBinding,
  169. GetParam().baseImageBinding,
  170. GetParam().baseUboBinding,
  171. GetParam().baseSsboBinding,
  172. GetParam().autoMapBindings,
  173. GetParam().flattenUniforms);
  174. }
  175. // GLSL-level Vulkan semantics tests.
  176. TEST_P(GlslIoMap, FromFile)
  177. {
  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);
  188. }
  189. // Compiling GLSL to SPIR-V under Vulkan semantics (QCOM extensions enabled).
  190. // Expected to successfully generate SPIR-V.
  191. TEST_P(CompileVulkanToSpirvTestQCOM, FromFile)
  192. {
  193. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  194. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  195. Target::Spv);
  196. }
  197. TEST_P(CompileVulkanToSpirv13TestQCOM, FromFile)
  198. {
  199. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  200. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
  201. Target::Spv);
  202. }
  203. TEST_P(CompileVulkanToSpirv14TestQCOM, FromFile)
  204. {
  205. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  206. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
  207. Target::Spv);
  208. }
  209. // Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
  210. // Expected to successfully generate SPIR-V.
  211. TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
  212. {
  213. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  214. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  215. Target::Spv);
  216. }
  217. // Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
  218. // Expected to successfully generate SPIR-V.
  219. TEST_P(CompileVulkanToSpirvTestNV, FromFile)
  220. {
  221. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  222. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
  223. Target::Spv);
  224. }
  225. TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
  226. {
  227. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
  228. Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
  229. Target::Spv);
  230. }
  231. TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
  232. {
  233. loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
  234. GetParam(),
  235. Source::GLSL,
  236. Semantics::Vulkan,
  237. Target::Spv);
  238. }
  239. TEST_P(GlslSpirvDebugInfoTest, FromFile)
  240. {
  241. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
  242. glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, Target::Spv, true, "",
  243. "/baseResults/", false, true, false);
  244. }
  245. TEST_P(GlslNonSemanticShaderDebugInfoTest, FromFile)
  246. {
  247. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
  248. glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, Target::Spv, true, "",
  249. "/baseResults/", false, true, true);
  250. }
  251. TEST_P(GlslNonSemanticShaderDebugInfoSpirv13Test, FromFile)
  252. {
  253. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
  254. glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3, Target::Spv, true, "",
  255. "/baseResults/", false, true, true);
  256. }
  257. TEST_P(GlslNonSemanticShaderDebugInfoVulkanLatestTest, FromFile)
  258. {
  259. loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
  260. glslang::EShTargetVulkan_1_4, glslang::EShTargetSpv_1_6, Target::Spv, true, "",
  261. "/baseResults/", false, true, true);
  262. }
  263. // clang-format off
  264. INSTANTIATE_TEST_SUITE_P(
  265. Glsl, CompileVulkanToSpirvTest,
  266. ::testing::ValuesIn(std::vector<std::string>({
  267. // Test looping constructs.
  268. // No tests yet for making sure break and continue from a nested loop
  269. // goes to the innermost target.
  270. "spv.barrier.vert",
  271. "spv.do-simple.vert",
  272. "spv.do-while-continue-break.vert",
  273. "spv.for-complex-condition.vert",
  274. "spv.for-continue-break.vert",
  275. "spv.for-simple.vert",
  276. "spv.for-notest.vert",
  277. "spv.for-nobody.vert",
  278. "spv.while-continue-break.vert",
  279. "spv.while-simple.vert",
  280. // vulkan-specific tests
  281. "rayQuery.rgen",
  282. "rayQuery-no-cse.rgen",
  283. "rayQuery-initialize.rgen",
  284. "rayQuery-allOps.rgen",
  285. "rayQuery-allOps.Error.rgen",
  286. "rayQuery-committed.Error.rgen",
  287. "rayQuery-allOps.comp",
  288. "rayQuery-allOps.frag",
  289. "rayQuery-initialization.Error.comp",
  290. "rayQuery-global.rgen",
  291. "rayQuery-types.comp",
  292. "rayQuery-OpConvertUToAccelerationStructureKHR.comp",
  293. "spv.set.vert",
  294. "spv.double.comp",
  295. "spv.100ops.frag",
  296. "spv.130.frag",
  297. "spv.140.frag",
  298. "spv.150.geom",
  299. "spv.150.vert",
  300. "spv.16bitstorage.frag",
  301. "spv.16bitstorage_Error.frag",
  302. "spv.16bitstorage-int.frag",
  303. "spv.16bitstorage_Error-int.frag",
  304. "spv.16bitstorage-uint.frag",
  305. "spv.16bitstorage_Error-uint.frag",
  306. "spv.300BuiltIns.vert",
  307. "spv.300layout.frag",
  308. "spv.300layout.vert",
  309. "spv.300layoutp.vert",
  310. "spv.310.comp",
  311. "spv.310.bitcast.frag",
  312. "spv.330.geom",
  313. "spv.400.frag",
  314. "spv.400.tesc",
  315. "spv.400.tese",
  316. "spv.420.geom",
  317. "spv.430.frag",
  318. "spv.430.vert",
  319. "spv.450.tesc",
  320. "spv.450.geom",
  321. "spv.450.noRedecl.tesc",
  322. "spv.8bitstorage-int.frag",
  323. "spv.8bitstorage_Error-int.frag",
  324. "spv.8bitstorage-uint.frag",
  325. "spv.8bitstorage_Error-uint.frag",
  326. "spv.8bitstorage-ubo.vert",
  327. "spv.8bitstorage-ssbo.vert",
  328. "spv.8bit-16bit-construction.frag",
  329. "spv.accessChain.frag",
  330. "spv.aggOps.frag",
  331. "spv.always-discard.frag",
  332. "spv.always-discard2.frag",
  333. "spv.arbPostDepthCoverage.frag",
  334. "spv.arbPostDepthCoverage_Error.frag",
  335. "spv.atomicCounter.comp",
  336. "spv.bitCast.frag",
  337. "spv.bool.vert",
  338. "spv.boolInBlock.frag",
  339. "spv.branch-return.vert",
  340. "spv.bufferhandle11.frag",
  341. "spv.bufferhandle12.frag",
  342. "spv.bufferhandle13.frag",
  343. "spv.bufferhandle14.frag",
  344. "spv.bufferhandle15.frag",
  345. "spv.bufferhandle16.frag",
  346. "spv.bufferhandle17_Errors.frag",
  347. "spv.bufferhandle18.frag",
  348. "spv.bufferhandle19_Errors.frag",
  349. "spv.bufferhandle2.frag",
  350. "spv.bufferhandle3_Errors.frag",
  351. "spv.bufferhandle4.frag",
  352. "spv.bufferhandle5.frag",
  353. "spv.bufferhandle6.frag",
  354. "spv.bufferhandle7.frag",
  355. "spv.bufferhandle8.frag",
  356. "spv.bufferhandle9.frag",
  357. "spv.bufferhandle20.frag",
  358. "spv.bufferhandle21.frag",
  359. "spv.bufferhandle22.frag",
  360. "spv.bufferhandle23.frag",
  361. "spv.bufferhandle24.frag",
  362. "spv.bufferhandle25.frag",
  363. "spv.bufferhandleRuntimeArray.frag",
  364. "spv.bufferhandleUvec2.frag",
  365. "spv.bufferhandle_Error.frag",
  366. "spv.builtInXFB.vert",
  367. "spv.conditionalDemote.frag",
  368. "spv.conditionalDiscard.frag",
  369. "spv.constructComposite.comp",
  370. "spv.constStruct.vert",
  371. "spv.constConstruct.vert",
  372. "spv.controlFlowAttributes.frag",
  373. "spv.conversion.frag",
  374. "spv.dataOut.frag",
  375. "spv.dataOutIndirect.frag",
  376. "spv.dataOutIndirect.vert",
  377. "spv.debugPrintf.frag",
  378. "spv.debugPrintf_Error.frag",
  379. "spv.demoteDisabled.frag",
  380. "spv.deepRvalue.frag",
  381. "spv.depthOut.frag",
  382. "spv.depthUnchanged.frag",
  383. "spv.discard-dce.frag",
  384. "spv.doWhileLoop.frag",
  385. "spv.earlyReturnDiscard.frag",
  386. "spv.expect_assume.assumeEXT.comp",
  387. "spv.expect_assume.expectEXT.comp",
  388. "spv.expect_assume.expectEXT.exttypes.comp",
  389. "spv.ext.ShaderTileImage.color.frag",
  390. "spv.ext.ShaderTileImage.depth_stencil.frag",
  391. "spv.ext.ShaderTileImage.subpassinput.frag",
  392. "spv.ext.ShaderTileImage.typemismatch.frag",
  393. "spv.ext.ShaderTileImage.overlap.frag",
  394. "spv.ext.ShaderTileImage.wronglayout.frag",
  395. "spv.extPostDepthCoverage.frag",
  396. "spv.extPostDepthCoverage_Error.frag",
  397. "spv.float16convertonlyarith.comp",
  398. "spv.float16convertonlystorage.comp",
  399. "spv.flowControl.frag",
  400. "spv.forLoop.frag",
  401. "spv.forwardFun.frag",
  402. "spv.fp8_error.frag",
  403. "spv.fragmentDensity.frag",
  404. "spv.fragmentDensity.vert",
  405. "spv.fragmentDensity-es.frag",
  406. "spv.fragmentDensity-neg.frag",
  407. "spv.fsi.frag",
  408. "spv.fsi_Error.frag",
  409. "spv.fullyCovered.frag",
  410. "spv.functionCall.frag",
  411. "spv.functionNestedOpaque.vert",
  412. "spv.functionSemantics.frag",
  413. "spv.functionParameterTypes.frag",
  414. "spv.GeometryShaderPassthrough.geom",
  415. "spv.funcall.array.frag",
  416. "spv.load.bool.array.interface.block.frag",
  417. "spv.int_dot.frag",
  418. "spv.int_dot_Error.frag",
  419. "spv.interpOps.frag",
  420. "spv.int64.frag",
  421. "spv.intOps.vert",
  422. "spv.intrinsicsDebugBreak.frag",
  423. "spv.intrinsicsSpirvByReference.vert",
  424. "spv.intrinsicsSpirvDecorate.frag",
  425. "spv.intrinsicsSpirvDecorateId.comp",
  426. "spv.intrinsicsSpirvDecorateString.comp",
  427. "spv.intrinsicsSpirvExecutionMode.frag",
  428. "spv.intrinsicsSpirvInstruction.vert",
  429. "spv.intrinsicsSpirvLiteral.vert",
  430. "spv.intrinsicsSpirvStorageClass.rchit",
  431. "spv.intrinsicsSpirvType.rgen",
  432. "spv.intrinsicsSpirvTypeLocalVar.vert",
  433. "spv.intrinsicsSpirvTypeWithTypeSpecifier.vert",
  434. "spv.invariantAll.vert",
  435. "spv.layer.tese",
  436. "spv.layoutNested.vert",
  437. "spv.length.frag",
  438. "spv.localAggregates.frag",
  439. "spv.loops.frag",
  440. "spv.loopsArtificial.frag",
  441. "spv.matFun.vert",
  442. "spv.matrix.frag",
  443. "spv.matrix2.frag",
  444. "spv.maximalReconvergence.vert",
  445. "spv.memoryQualifier.frag",
  446. "spv.merge-unreachable.frag",
  447. "spv.multiStruct.comp",
  448. "spv.multiStructFuncall.frag",
  449. "spv.newTexture.frag",
  450. "spv.noDeadDecorations.vert",
  451. "spv.nonSquare.vert",
  452. "spv.nonuniform.frag",
  453. "spv.nonuniform2.frag",
  454. "spv.nonuniform3.frag",
  455. "spv.nonuniform4.frag",
  456. "spv.nonuniform5.frag",
  457. "spv.noWorkgroup.comp",
  458. "spv.nvAtomicFp16Vec.frag",
  459. "spv.nv.explicittypecast.frag",
  460. "spv.nv.explicittypecast.error.vert",
  461. "spv.nullInit.comp",
  462. "spv.offsets.frag",
  463. "spv.Operations.frag",
  464. "spv.paramMemory.frag",
  465. "spv.paramMemory.420.frag",
  466. "spv.precision.frag",
  467. "spv.precisionArgs.frag",
  468. "spv.precisionNonESSamp.frag",
  469. "spv.precisionTexture.frag",
  470. "spv.prepost.frag",
  471. "spv.privateVariableTypes.frag",
  472. "spv.qualifiers.vert",
  473. "spv.sample.frag",
  474. "spv.sampleId.frag",
  475. "spv.samplePosition.frag",
  476. "spv.sampleMaskOverrideCoverage.frag",
  477. "spv.scalarlayout.frag",
  478. "spv.scalarlayoutfloat16.frag",
  479. "spv.shaderBallot.comp",
  480. "spv.shaderDrawParams.vert",
  481. "spv.shaderGroupVote.comp",
  482. "spv.shaderStencilExport.frag",
  483. "spv.shiftOps.frag",
  484. "spv.simpleFunctionCall.frag",
  485. "spv.simpleMat.vert",
  486. "spv.sparseTexture.frag",
  487. "spv.sparseTextureClamp.frag",
  488. "spv.structAssignment.frag",
  489. "spv.structCopy.comp",
  490. "spv.structDeref.frag",
  491. "spv.structure.frag",
  492. "spv.switch.frag",
  493. "spv.swizzle.frag",
  494. "spv.swizzleInversion.frag",
  495. "spv.test.frag",
  496. "spv.test.vert",
  497. "spv.texture.frag",
  498. "spv.texture.vert",
  499. "spv.textureBuffer.vert",
  500. "spv.image.frag",
  501. "spv.imageAtomic64.frag",
  502. "spv.imageAtomic64.comp",
  503. "spv.types.frag",
  504. "spv.uint.frag",
  505. "spv.uniformArray.frag",
  506. "spv.variableArrayIndex.frag",
  507. "spv.varyingArray.frag",
  508. "spv.varyingArrayIndirect.frag",
  509. "spv.vecMatConstruct.frag",
  510. "spv.voidFunction.frag",
  511. "spv.whileLoop.frag",
  512. "spv.AofA.frag",
  513. "spv.queryL.frag",
  514. "spv.separate.frag",
  515. "spv.shortCircuit.frag",
  516. "spv.pushConstant.vert",
  517. "spv.pushConstantAnon.vert",
  518. "spv.subpass.frag",
  519. "spv.specConstant.vert",
  520. "spv.specConstant.comp",
  521. "spv.specConstantComposite.vert",
  522. "spv.specConstantOperations.vert",
  523. "spv.specConstant.float16.comp",
  524. "spv.specConstant.int16.comp",
  525. "spv.specConstant.int8.comp",
  526. "spv.specConstantOp.int16.comp",
  527. "spv.specConstantOp.int8.comp",
  528. "spv.specConstantOp.float16.comp",
  529. "spv.storageBuffer.vert",
  530. "spv.terminate.frag",
  531. "spv.subgroupUniformControlFlow.vert",
  532. "spv.subgroupSizeARB.frag",
  533. "spv.precise.tese",
  534. "spv.precise.tesc",
  535. "spv.viewportindex.tese",
  536. "spv.volatileAtomic.comp",
  537. "spv.vulkan100.subgroupArithmetic.comp",
  538. "spv.vulkan100.subgroupPartitioned.comp",
  539. "spv.xfb.vert",
  540. "spv.xfb2.vert",
  541. "spv.xfb3.vert",
  542. "spv.samplerlessTextureFunctions.frag",
  543. "spv.smBuiltins.vert",
  544. "spv.smBuiltins.frag",
  545. "spv.ARMCoreBuiltIns.vert",
  546. "spv.ARMCoreBuiltIns.frag",
  547. "spv.builtin.PrimitiveShadingRateEXT.vert",
  548. "spv.builtin.ShadingRateEXT.frag",
  549. "spv.fragmentShaderBarycentric3.frag",
  550. "spv.fragmentShaderBarycentric4.frag",
  551. "spv.ext.textureShadowLod.frag",
  552. "spv.ext.textureShadowLod.error.frag",
  553. "spv.floatFetch.frag",
  554. "spv.atomicRvalue.error.vert",
  555. "spv.sampledImageBlock.frag",
  556. "spv.multiple.var.same.const.frag",
  557. "spv.textureoffset_non_const.vert",
  558. "spv.sparsetextureoffset_non_const.vert",
  559. "spv.sparsetextureoffset_non_const_fail.vert",
  560. "spv.tensorARM.access_qualifiers.comp",
  561. "spv.tensorARM.all_accesses.comp",
  562. "spv.tensorARM.array.comp",
  563. "spv.tensorARM.declare.comp",
  564. "spv.tensorARM.frag",
  565. "spv.tensorARM.invalid_access.comp",
  566. "spv.tensorARM.invalid_declare.comp",
  567. "spv.tensorARM.invalid_operands.comp",
  568. "spv.tensorARM.invalid_params.comp",
  569. "spv.tensorARM.invalid_size.comp",
  570. "spv.tensorARM.invalid_tensor_type.comp",
  571. "spv.tensorARM.params.comp",
  572. "spv.tensorARM.read.comp",
  573. "spv.tensorARM.size.comp",
  574. })),
  575. FileNameAsCustomTestSuffix
  576. );
  577. INSTANTIATE_TEST_SUITE_P(
  578. Glsl, CompileVulkanToSpirvTestNoLink,
  579. ::testing::ValuesIn(std::vector<std::string>({
  580. "spv.exportFunctions.comp",
  581. })),
  582. FileNameAsCustomTestSuffix
  583. );
  584. // Cases with deliberately unreachable code.
  585. // By default the compiler will aggressively eliminate
  586. // unreachable merges and continues.
  587. INSTANTIATE_TEST_SUITE_P(
  588. GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
  589. ::testing::ValuesIn(std::vector<std::string>({
  590. "spv.dead-after-continue.vert",
  591. "spv.dead-after-discard.frag",
  592. "spv.dead-after-return.vert",
  593. "spv.dead-after-loop-break.vert",
  594. "spv.dead-after-switch-break.vert",
  595. "spv.dead-complex-continue-after-return.vert",
  596. "spv.dead-complex-merge-after-return.vert",
  597. })),
  598. FileNameAsCustomTestSuffix
  599. );
  600. // clang-format off
  601. INSTANTIATE_TEST_SUITE_P(
  602. Glsl, CompileVulkan1_1ToSpirvTest,
  603. ::testing::ValuesIn(std::vector<std::string>({
  604. "spv.1.3.8bitstorage-ubo.vert",
  605. "spv.1.3.8bitstorage-ssbo.vert",
  606. "spv.1.3.coopmat.comp",
  607. "spv.deviceGroup.frag",
  608. "spv.drawParams.vert",
  609. "spv.int8.frag",
  610. "spv.vulkan110.int16.frag",
  611. "spv.int32.frag",
  612. "spv.explicittypes.frag",
  613. "spv.float16NoRelaxed.vert",
  614. "spv.float32.frag",
  615. "spv.float64.frag",
  616. "spv.memoryScopeSemantics.comp",
  617. "spv.memoryScopeSemantics_Error.comp",
  618. "spv.multiView.frag",
  619. "spv.queueFamilyScope.comp",
  620. "spv.RayGenShader11.rgen",
  621. "spv.subgroup.frag",
  622. "spv.subgroup.geom",
  623. "spv.subgroup.tesc",
  624. "spv.subgroup.tese",
  625. "spv.subgroup.vert",
  626. "spv.subgroupArithmetic.comp",
  627. "spv.subgroupBasic.comp",
  628. "spv.subgroupBallot.comp",
  629. "spv.subgroupBallotNeg.comp",
  630. "spv.subgroupClustered.comp",
  631. "spv.subgroupClusteredNeg.comp",
  632. "spv.subgroupPartitioned.comp",
  633. "spv.subgroupRotate.comp",
  634. "spv.subgroupShuffle.comp",
  635. "spv.subgroupShuffleRelative.comp",
  636. "spv.subgroupQuad.comp",
  637. "spv.subgroupVote.comp",
  638. "spv.subgroupExtendedTypesArithmetic.comp",
  639. "spv.subgroupExtendedTypesArithmeticNeg.comp",
  640. "spv.subgroupExtendedTypesBallot.comp",
  641. "spv.subgroupExtendedTypesBallotNeg.comp",
  642. "spv.subgroupExtendedTypesClustered.comp",
  643. "spv.subgroupExtendedTypesClusteredNeg.comp",
  644. "spv.subgroupExtendedTypesPartitioned.comp",
  645. "spv.subgroupExtendedTypesPartitionedNeg.comp",
  646. "spv.subgroupExtendedTypesRotate.comp",
  647. "spv.subgroupExtendedTypesRotateNeg.comp",
  648. "spv.subgroupExtendedTypesShuffle.comp",
  649. "spv.subgroupExtendedTypesShuffleNeg.comp",
  650. "spv.subgroupExtendedTypesShuffleRelative.comp",
  651. "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
  652. "spv.subgroupExtendedTypesQuad.comp",
  653. "spv.subgroupExtendedTypesQuadNeg.comp",
  654. "spv.subgroupExtendedTypesVote.comp",
  655. "spv.subgroupExtendedTypesVoteNeg.comp",
  656. "spv.vulkan110.storageBuffer.vert",
  657. // These tests use the Vulkan memory model.
  658. "spv.bfloat16.comp",
  659. "spv.bfloat16_error.comp",
  660. "spv.bfloat16_error.frag",
  661. "spv.bufferhandle1.frag",
  662. "spv.bufferhandle10.frag",
  663. "spv.coopmat.comp",
  664. "spv.coopmat_Error.comp",
  665. "spv.coopmatKHR.comp",
  666. "spv.coopmat_armlayout.comp",
  667. "spv.coopmatKHR_arithmetic.comp",
  668. "spv.coopmatKHR_arithmeticError.comp",
  669. "spv.coopmatKHR_Error.comp",
  670. "spv.coopmatKHR_constructor.comp",
  671. "spv.coopmatKHR_constructorError.comp",
  672. "spv.coopmatKHR_matmuladd_Error.comp",
  673. "spv.coopvec.comp",
  674. "spv.coopvec2.comp",
  675. "spv.coopvecloadstore.comp",
  676. "spv.coopvec_Error.comp",
  677. "spv.coopvecloadstore_Error.comp",
  678. "spv.coopvecStoreLocal.comp",
  679. "spv.coopvecTraining.comp",
  680. "spv.coopvecTraining_Error.comp",
  681. "spv.intcoopmat.comp",
  682. "spv.intrinsicsInteractWithCoopMat.comp",
  683. "spv.longVector.comp",
  684. "spv.longVectorMatMul.comp",
  685. "spv.longVectorNotReserved.comp",
  686. "spv.longVectorSpecConst.comp",
  687. "spv.longVectorOperators.comp",
  688. "spv.longVectorBuiltins.comp",
  689. "spv.longVectorBuiltinsfp16.comp",
  690. "spv.longVectorBuiltinsfp64.comp",
  691. "spv.longVectorBuiltinsint8.comp",
  692. "spv.longVectorBuiltinsint16.comp",
  693. "spv.longVectorBuiltinsint32.comp",
  694. "spv.longVectorBuiltinsint64.comp",
  695. "spv.longVectorBuiltinsuint8.comp",
  696. "spv.longVectorBuiltinsuint16.comp",
  697. "spv.longVectorBuiltinsuint32.comp",
  698. "spv.longVectorBuiltinsuint64.comp",
  699. "spv.longVectorBuiltinsBitcast.comp",
  700. "spv.longVectorBuiltinsError.comp",
  701. "spv.longVectorBuiltinsSpecConst.comp",
  702. "spv.longVectorBuiltinsSpecConstint32.comp",
  703. "spv.longVectorBuiltinsSubgroup.comp",
  704. "spv.longVectorBuiltins.frag",
  705. "spv.longVectorStorage.comp",
  706. "spv.replicate.comp",
  707. "spv.replicatespec.comp",
  708. "spv.atomicAdd.bufferReference.comp",
  709. "spv.nontemporalbuffer.frag",
  710. "spv.atomicFloat.comp",
  711. })),
  712. FileNameAsCustomTestSuffix
  713. );
  714. // clang-format off
  715. INSTANTIATE_TEST_SUITE_P(
  716. Glsl, CompileToSpirv14Test,
  717. ::testing::ValuesIn(std::vector<std::string>({
  718. "spv.1.4.LoopControl.frag",
  719. "spv.1.4.NonWritable.frag",
  720. "spv.1.4.OpEntryPoint.frag",
  721. "spv.1.4.OpEntryPoint.opaqueParams.vert",
  722. "spv.1.4.OpSelect.frag",
  723. "spv.1.4.OpCopyLogical.comp",
  724. "spv.1.4.OpCopyLogicalBool.comp",
  725. "spv.1.4.OpCopyLogical.funcall.frag",
  726. "spv.1.4.funcall.array.frag",
  727. "spv.1.4.load.bool.array.interface.block.frag",
  728. "spv.1.4.image.frag",
  729. "spv.1.4.sparseTexture.frag",
  730. "spv.1.4.texture.frag",
  731. "spv.1.4.constructComposite.comp",
  732. "spv.ext.AnyHitShader.rahit",
  733. "spv.ext.AnyHitShader_Errors.rahit",
  734. "spv.ext.ClosestHitShader.rchit",
  735. "spv.ext.ClosestHitShader_Subgroup.rchit",
  736. "spv.ext.ClosestHitShader_Errors.rchit",
  737. "spv.ext.IntersectShader.rint",
  738. "spv.ext.IntersectShader_Errors.rint",
  739. "spv.ext.MissShader.rmiss",
  740. "spv.ext.MissShader_Errors.rmiss",
  741. "spv.ext.RayPrimCull_Errors.rgen",
  742. "spv.ext.RayCallable.rcall",
  743. "spv.ext.RayCallable_Errors.rcall",
  744. "spv.ext.RayConstants.rgen",
  745. "spv.ext.RayGenShader.rgen",
  746. "spv.ext.RayGenShader_Errors.rgen",
  747. "spv.ext.RayGenShader11.rgen",
  748. "spv.ext.RayGenShaderArray.rgen",
  749. "spv.ext.RayGenSBTlayout.rgen",
  750. "spv.ext.RayGenSBTlayout140.rgen",
  751. "spv.ext.RayGenSBTlayout430.rgen",
  752. "spv.ext.RayGenSBTlayoutscalar.rgen",
  753. "spv.ext.World3x4.rahit",
  754. "spv.ext.AccelDecl.frag",
  755. "spv.ext.RayQueryDecl.frag",
  756. // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
  757. "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
  758. "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
  759. "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
  760. "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
  761. "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
  762. "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
  763. "spv.WorkgroupMemoryExplicitLayout.std140.comp",
  764. "spv.WorkgroupMemoryExplicitLayout.std430.comp",
  765. "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
  766. // SPV_EXT_mesh_shader
  767. "spv.ext.meshShaderBuiltins.mesh",
  768. "spv.ext.meshShaderBuiltinsShadingRate.mesh",
  769. "spv.ext.meshShaderRedeclBuiltins.mesh",
  770. "spv.ext.meshShaderTaskMem.mesh",
  771. "spv.ext.meshShaderUserDefined.mesh",
  772. "spv.ext.meshTaskShader.task",
  773. "spv.atomiAddEXT.error.mesh",
  774. "spv.atomiAddEXT.task",
  775. "spv.460.subgroupEXT.task",
  776. "spv.460.subgroupEXT.mesh",
  777. // SPV_NV_shader_execution_reorder
  778. "spv.nv.hitobject-errors.rgen",
  779. "spv.nv.hitobject-allops.rgen",
  780. "spv.nv.hitobject-allops.rchit",
  781. "spv.nv.hitobject-allops.rmiss",
  782. // SPV_EXT_shader_execution_reorder
  783. "spv.ext.hitobject-errors.rgen",
  784. "spv.ext.hitobject-allops.rgen",
  785. "spv.ext.hitobject-allops.rchit",
  786. "spv.ext.hitobject-allops.rmiss",
  787. // SPV_NV_displacment_micromap
  788. "spv.nv.dmm-allops.rgen",
  789. "spv.nv.dmm-allops.rchit",
  790. "spv.nv.dmm-allops.rahit",
  791. "spv.nv.dmm-allops.mesh",
  792. "spv.nv.dmm-allops.comp",
  793. // SPV_NV_cluster_acceleration_structure
  794. "spv.nv.cluster-allops.rgen",
  795. "spv.nv.cluster-allops.rchit",
  796. "spv.nv.cluster-allops.rmiss",
  797. "spv.nv.cluster-allops.rahit",
  798. "spv.nv.cluster-allops.frag",
  799. // SPV_NV_linear_swept_spheres
  800. "spv.nv.lss-allops.rgen",
  801. "spv.nv.lss-allops.rchit",
  802. "spv.nv.lss-allops.rmiss",
  803. "spv.nv.lss-allops.frag",
  804. "spv.nv.lss-spheregeomcap.rgen",
  805. "spv.nv.lss-lssgeomcap.rgen",
  806. // SPV_EXT_descriptor_heap
  807. "spv.descriptorHeap.AtomicImage.comp",
  808. "spv.descriptorHeap.AtomicImage.error.comp",
  809. "spv.descriptorHeap.Buffer.comp",
  810. "spv.descriptorHeap.DebugPrintf.comp",
  811. "spv.descriptorHeap.HeapNotArray.error.comp",
  812. "spv.descriptorHeap.HeapStrideNotHeap.error.comp",
  813. "spv.descriptorHeap.HeapStrideNotPow2.error.comp",
  814. "spv.descriptorHeap.PushConstant.comp",
  815. "spv.descriptorHeap.valid.frag",
  816. })),
  817. FileNameAsCustomTestSuffix
  818. );
  819. // clang-format off
  820. INSTANTIATE_TEST_SUITE_P(
  821. Glsl, CompileToSpirv16Test,
  822. ::testing::ValuesIn(std::vector<std::string>({
  823. "spv.1.6.conditionalDiscard.frag",
  824. "spv.1.6.helperInvocation.frag",
  825. "spv.1.6.helperInvocation.memmodel.frag",
  826. "spv.1.6.specConstant.comp",
  827. "spv.1.6.samplerBuffer.frag",
  828. "spv.1.6.separate.frag",
  829. "spv.1.6.quad.frag",
  830. "spv.64bit_indexing.comp",
  831. "spv.64bit_indexing_error.comp",
  832. "spv.coopmat2_constructor.comp",
  833. "spv.coopmat2_error.comp",
  834. "spv.coopmat2_tensor.comp",
  835. "spv.1.6.nontemporalimage.frag",
  836. "spv.noexplicitlayout.comp",
  837. "spv.floate4m3.comp",
  838. "spv.floate4m3.const.comp",
  839. "spv.floate4m3_error.comp",
  840. "spv.floate5m2.comp",
  841. "spv.floate5m2.const.comp",
  842. "spv.floate5m2_error.comp",
  843. "spv.promote_uint32_indices.comp",
  844. })),
  845. FileNameAsCustomTestSuffix
  846. );
  847. // clang-format off
  848. INSTANTIATE_TEST_SUITE_P(
  849. Hlsl, HlslIoMap,
  850. ::testing::ValuesIn(std::vector<IoMapData>{
  851. { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
  852. { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
  853. { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
  854. { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
  855. { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
  856. { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
  857. { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
  858. { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
  859. { "spv.register.autoassign.rangetest.frag", "main",
  860. glslang::TQualifier::layoutBindingEnd-2,
  861. glslang::TQualifier::layoutBindingEnd+5,
  862. 0, 20, 30, true, false },
  863. }),
  864. FileNameAsCustomTestSuffixIoMap
  865. );
  866. // clang-format off
  867. INSTANTIATE_TEST_SUITE_P(
  868. Hlsl, GlslIoMap,
  869. ::testing::ValuesIn(std::vector<IoMapData>{
  870. { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
  871. { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
  872. }),
  873. FileNameAsCustomTestSuffixIoMap
  874. );
  875. // clang-format off
  876. INSTANTIATE_TEST_SUITE_P(
  877. Glsl, CompileOpenGLToSpirvTest,
  878. ::testing::ValuesIn(std::vector<std::string>({
  879. "spv.460.frag",
  880. "spv.460.vert",
  881. "spv.460.comp",
  882. "spv.atomic.comp",
  883. "spv.atomicFloat_Error.comp",
  884. "spv.glFragColor.frag",
  885. "spv.rankShift.comp",
  886. "spv.specConst.vert",
  887. "spv.specTexture.frag",
  888. "spv.OVR_multiview.vert",
  889. "spv.uniformInitializer.frag",
  890. "spv.uniformInitializerSpecConstant.frag",
  891. "spv.uniformInitializerStruct.frag",
  892. "spv.xfbOffsetOnBlockMembersAssignment.vert",
  893. "spv.xfbOffsetOnStructMembersAssignment.vert",
  894. "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
  895. "spv.xfbStrideJustOnce.vert",
  896. })),
  897. FileNameAsCustomTestSuffix
  898. );
  899. INSTANTIATE_TEST_SUITE_P(
  900. Glsl, VulkanSemantics,
  901. ::testing::ValuesIn(std::vector<std::string>({
  902. "vulkan.frag",
  903. "vulkan.vert",
  904. "vulkan.comp",
  905. "samplerlessTextureFunctions.frag",
  906. "spv.intrinsicsFakeEnable.vert",
  907. "spv.specConstArrayCheck.vert",
  908. })),
  909. FileNameAsCustomTestSuffix
  910. );
  911. INSTANTIATE_TEST_SUITE_P(
  912. Glsl, OpenGLSemantics,
  913. ::testing::ValuesIn(std::vector<std::string>({
  914. "glspv.esversion.vert",
  915. "glspv.version.frag",
  916. "glspv.version.vert",
  917. "glspv.frag",
  918. "glspv.vert",
  919. })),
  920. FileNameAsCustomTestSuffix
  921. );
  922. INSTANTIATE_TEST_SUITE_P(
  923. Glsl, VulkanAstSemantics,
  924. ::testing::ValuesIn(std::vector<std::string>({
  925. "vulkan.ast.vert",
  926. })),
  927. FileNameAsCustomTestSuffix
  928. );
  929. INSTANTIATE_TEST_SUITE_P(
  930. Glsl, CompileVulkanToSpirvTestQCOM,
  931. ::testing::ValuesIn(std::vector<std::string>({
  932. "spv.qcom.tileShading.0.comp",
  933. "spv.qcom.tileShading.1.comp",
  934. "spv.qcom.es.tileShading.0.comp",
  935. "spv.qcom.es.tileShading.1.comp",
  936. "spv.qcom.es.tileShading.2.comp",
  937. "spv.qcom.tileShading.0.frag",
  938. "spv.qcom.tileShading.1.frag",
  939. "spv.qcom.es.tileShading.0.frag",
  940. "spv.qcom.es.tileShading.1.frag",
  941. })),
  942. FileNameAsCustomTestSuffix
  943. );
  944. INSTANTIATE_TEST_SUITE_P(
  945. Glsl, CompileVulkanToSpirv13TestQCOM,
  946. ::testing::ValuesIn(std::vector<std::string>({
  947. "spv.qcom.coopmatConversion.1.comp",
  948. "spv.qcom.coopmatConversion.2.comp",
  949. })),
  950. FileNameAsCustomTestSuffix
  951. );
  952. INSTANTIATE_TEST_SUITE_P(
  953. Glsl, CompileVulkanToSpirv14TestQCOM,
  954. ::testing::ValuesIn(std::vector<std::string>({
  955. "spv.tpipSampleWeighted.frag",
  956. "spv.tpipBoxFilter.frag",
  957. "spv.tpipBlockMatchSSD.frag",
  958. "spv.tpipBlockMatchSAD.frag",
  959. "spv.tpipTextureArrays.frag",
  960. "spv.tpipBlockMatchGatherSAD.frag",
  961. "spv.tpipBlockMatchGatherSSD.frag",
  962. "spv.tpipBlockMatchWindowSAD.frag",
  963. "spv.tpipBlockMatchWindowSSD.frag",
  964. })),
  965. FileNameAsCustomTestSuffix
  966. );
  967. INSTANTIATE_TEST_SUITE_P(
  968. Glsl, CompileVulkanToSpirvTestAMD,
  969. ::testing::ValuesIn(std::vector<std::string>({
  970. "spv.16bitxfb.vert",
  971. "spv.float16.frag",
  972. "spv.float16Fetch.frag",
  973. "spv.imageLoadStoreLod.frag",
  974. "spv.int16.frag",
  975. "spv.int16.amd.frag",
  976. "spv.shaderBallotAMD.comp",
  977. "spv.shaderFragMaskAMD.frag",
  978. "spv.textureGatherBiasLod.frag",
  979. })),
  980. FileNameAsCustomTestSuffix
  981. );
  982. INSTANTIATE_TEST_SUITE_P(
  983. Glsl, CompileVulkanToSpirvTestNV,
  984. ::testing::ValuesIn(std::vector<std::string>({
  985. "spv.sampleMaskOverrideCoverage.frag",
  986. "spv.GeometryShaderPassthrough.geom",
  987. "spv.viewportArray2.vert",
  988. "spv.viewportArray2.tesc",
  989. "spv.stereoViewRendering.vert",
  990. "spv.stereoViewRendering.tesc",
  991. "spv.multiviewPerViewAttributes.vert",
  992. "spv.multiviewPerViewAttributes.tesc",
  993. "spv.atomicInt64.comp",
  994. "spv.atomicStoreInt64.comp",
  995. "spv.shadingRate.frag",
  996. "spv.RayGenShader.rgen",
  997. "spv.RayGenShaderArray.rgen",
  998. "spv.RayGenShader_Errors.rgen",
  999. "spv.RayConstants.rgen",
  1000. "spv.IntersectShader.rint",
  1001. "spv.IntersectShader_Errors.rint",
  1002. "spv.AnyHitShader.rahit",
  1003. "spv.AnyHitShader_Errors.rahit",
  1004. "spv.ClosestHitShader.rchit",
  1005. "spv.ClosestHitShader_Errors.rchit",
  1006. "spv.MissShader.rmiss",
  1007. "spv.MissShader_Errors.rmiss",
  1008. "spv.RayCallable.rcall",
  1009. "spv.RayCallable_Errors.rcall",
  1010. "spv.fragmentShaderBarycentric.frag",
  1011. "spv.fragmentShaderBarycentric2.frag",
  1012. "spv.computeShaderDerivatives.comp",
  1013. "spv.computeShaderDerivatives2.comp",
  1014. "spv.computeShaderDerivativesSpec.comp",
  1015. "spv.computeShaderDerivativesSpec2.comp",
  1016. "spv.shaderImageFootprint.frag",
  1017. "spv.meshShaderBuiltins.mesh",
  1018. "spv.meshShaderUserDefined.mesh",
  1019. "spv.meshShaderPerViewBuiltins.mesh",
  1020. "spv.meshShaderPerViewUserDefined.mesh",
  1021. "spv.meshShaderPerView_Errors.mesh",
  1022. "spv.meshShaderSharedMem.mesh",
  1023. "spv.meshShaderTaskMem.mesh",
  1024. "spv.320.meshShaderUserDefined.mesh",
  1025. "spv.meshShaderRedeclBuiltins.mesh",
  1026. "spv.meshShaderRedeclPerViewBuiltins.mesh",
  1027. "spv.meshTaskShader.task",
  1028. "spv.perprimitiveNV.frag",
  1029. "spv.nvgpushader5.frag",
  1030. "spv.pushConstantBank.vert",
  1031. })),
  1032. FileNameAsCustomTestSuffix
  1033. );
  1034. INSTANTIATE_TEST_SUITE_P(
  1035. Glsl, CompileVulkanToSpirv14TestNV,
  1036. ::testing::ValuesIn(std::vector<std::string>({
  1037. "spv.RayGenShaderMotion.rgen",
  1038. "spv.IntersectShaderMotion.rint",
  1039. "spv.AnyHitShaderMotion.rahit",
  1040. "spv.ClosestHitShaderMotion.rchit",
  1041. "spv.MissShaderMotion.rmiss",
  1042. })),
  1043. FileNameAsCustomTestSuffix
  1044. );
  1045. INSTANTIATE_TEST_SUITE_P(
  1046. Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
  1047. ::testing::ValuesIn(std::vector<std::string>({
  1048. "spv.texture.sampler.transform.frag",
  1049. })),
  1050. FileNameAsCustomTestSuffix
  1051. );
  1052. INSTANTIATE_TEST_SUITE_P(
  1053. Glsl, GlslSpirvDebugInfoTest,
  1054. ::testing::ValuesIn(std::vector<std::string>({
  1055. "spv.pp.line.frag",
  1056. })),
  1057. FileNameAsCustomTestSuffix
  1058. );
  1059. INSTANTIATE_TEST_SUITE_P(
  1060. Glsl, GlslNonSemanticShaderDebugInfoTest,
  1061. ::testing::ValuesIn(std::vector<std::string>({
  1062. "spv.debuginfo.glsl.vert",
  1063. "spv.debuginfo.glsl.frag",
  1064. "spv.debuginfo.glsl.comp",
  1065. "spv.debuginfo.glsl.geom",
  1066. "spv.debuginfo.glsl.tesc",
  1067. "spv.debuginfo.glsl.tese",
  1068. "spv.debuginfo.bufferref.glsl.frag",
  1069. "spv.debuginfo.const_params.glsl.comp",
  1070. "spv.debuginfo.scalar_types.glsl.frag",
  1071. "spv.debuginfo.include.glsl.frag",
  1072. "spv.debuginfo.multiline.glsl.frag",
  1073. "spv.debuginfo.implicit_br.glsl.frag",
  1074. "spv.debuginfo.non_ascii.glsl.frag",
  1075. "spv.debuginfo.continued.glsl.vert",
  1076. "spv.debuginfo.interface_bool.glsl.comp",
  1077. "spv.debuginfo.sampler_type.glsl.frag",
  1078. "spv.debuginfo.const_variables.glsl.frag",
  1079. "spv.debuginfo.ubo.glsl.frag",
  1080. "spv.debuginfo.declaration.glsl.frag",
  1081. })),
  1082. FileNameAsCustomTestSuffix
  1083. );
  1084. INSTANTIATE_TEST_SUITE_P(
  1085. Glsl, GlslNonSemanticShaderDebugInfoSpirv13Test,
  1086. ::testing::ValuesIn(std::vector<std::string>({
  1087. "spv.debuginfo.coopmatKHR.comp",
  1088. })),
  1089. FileNameAsCustomTestSuffix
  1090. );
  1091. INSTANTIATE_TEST_SUITE_P(
  1092. Glsl, GlslNonSemanticShaderDebugInfoVulkanLatestTest,
  1093. ::testing::ValuesIn(std::vector<std::string>({
  1094. "spv.debuginfo.rt_types.glsl.rgen",
  1095. "spv.debuginfo.rt_nv_builtins.glsl.rahit",
  1096. "spv.debuginfo.rt_ext_builtins.glsl.rahit",
  1097. })),
  1098. FileNameAsCustomTestSuffix
  1099. );
  1100. // clang-format on
  1101. } // anonymous namespace
  1102. } // namespace glslangtest