Spv.FromFile.cpp 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  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.nullInit.comp",
  460. "spv.offsets.frag",
  461. "spv.Operations.frag",
  462. "spv.paramMemory.frag",
  463. "spv.paramMemory.420.frag",
  464. "spv.precision.frag",
  465. "spv.precisionArgs.frag",
  466. "spv.precisionNonESSamp.frag",
  467. "spv.precisionTexture.frag",
  468. "spv.prepost.frag",
  469. "spv.privateVariableTypes.frag",
  470. "spv.qualifiers.vert",
  471. "spv.sample.frag",
  472. "spv.sampleId.frag",
  473. "spv.samplePosition.frag",
  474. "spv.sampleMaskOverrideCoverage.frag",
  475. "spv.scalarlayout.frag",
  476. "spv.scalarlayoutfloat16.frag",
  477. "spv.shaderBallot.comp",
  478. "spv.shaderDrawParams.vert",
  479. "spv.shaderGroupVote.comp",
  480. "spv.shaderStencilExport.frag",
  481. "spv.shiftOps.frag",
  482. "spv.simpleFunctionCall.frag",
  483. "spv.simpleMat.vert",
  484. "spv.sparseTexture.frag",
  485. "spv.sparseTextureClamp.frag",
  486. "spv.structAssignment.frag",
  487. "spv.structCopy.comp",
  488. "spv.structDeref.frag",
  489. "spv.structure.frag",
  490. "spv.switch.frag",
  491. "spv.swizzle.frag",
  492. "spv.swizzleInversion.frag",
  493. "spv.test.frag",
  494. "spv.test.vert",
  495. "spv.texture.frag",
  496. "spv.texture.vert",
  497. "spv.textureBuffer.vert",
  498. "spv.image.frag",
  499. "spv.imageAtomic64.frag",
  500. "spv.imageAtomic64.comp",
  501. "spv.types.frag",
  502. "spv.uint.frag",
  503. "spv.uniformArray.frag",
  504. "spv.variableArrayIndex.frag",
  505. "spv.varyingArray.frag",
  506. "spv.varyingArrayIndirect.frag",
  507. "spv.vecMatConstruct.frag",
  508. "spv.voidFunction.frag",
  509. "spv.whileLoop.frag",
  510. "spv.AofA.frag",
  511. "spv.queryL.frag",
  512. "spv.separate.frag",
  513. "spv.shortCircuit.frag",
  514. "spv.pushConstant.vert",
  515. "spv.pushConstantAnon.vert",
  516. "spv.subpass.frag",
  517. "spv.specConstant.vert",
  518. "spv.specConstant.comp",
  519. "spv.specConstantComposite.vert",
  520. "spv.specConstantOperations.vert",
  521. "spv.specConstant.float16.comp",
  522. "spv.specConstant.int16.comp",
  523. "spv.specConstant.int8.comp",
  524. "spv.specConstantOp.int16.comp",
  525. "spv.specConstantOp.int8.comp",
  526. "spv.specConstantOp.float16.comp",
  527. "spv.storageBuffer.vert",
  528. "spv.terminate.frag",
  529. "spv.subgroupUniformControlFlow.vert",
  530. "spv.subgroupSizeARB.frag",
  531. "spv.precise.tese",
  532. "spv.precise.tesc",
  533. "spv.viewportindex.tese",
  534. "spv.volatileAtomic.comp",
  535. "spv.vulkan100.subgroupArithmetic.comp",
  536. "spv.vulkan100.subgroupPartitioned.comp",
  537. "spv.xfb.vert",
  538. "spv.xfb2.vert",
  539. "spv.xfb3.vert",
  540. "spv.samplerlessTextureFunctions.frag",
  541. "spv.smBuiltins.vert",
  542. "spv.smBuiltins.frag",
  543. "spv.ARMCoreBuiltIns.vert",
  544. "spv.ARMCoreBuiltIns.frag",
  545. "spv.builtin.PrimitiveShadingRateEXT.vert",
  546. "spv.builtin.ShadingRateEXT.frag",
  547. "spv.fragmentShaderBarycentric3.frag",
  548. "spv.fragmentShaderBarycentric4.frag",
  549. "spv.ext.textureShadowLod.frag",
  550. "spv.ext.textureShadowLod.error.frag",
  551. "spv.floatFetch.frag",
  552. "spv.atomicRvalue.error.vert",
  553. "spv.sampledImageBlock.frag",
  554. "spv.multiple.var.same.const.frag",
  555. "spv.textureoffset_non_const.vert",
  556. "spv.sparsetextureoffset_non_const.vert",
  557. "spv.sparsetextureoffset_non_const_fail.vert",
  558. "spv.tensorARM.access_qualifiers.comp",
  559. "spv.tensorARM.all_accesses.comp",
  560. "spv.tensorARM.array.comp",
  561. "spv.tensorARM.declare.comp",
  562. "spv.tensorARM.frag",
  563. "spv.tensorARM.invalid_access.comp",
  564. "spv.tensorARM.invalid_declare.comp",
  565. "spv.tensorARM.invalid_operands.comp",
  566. "spv.tensorARM.invalid_params.comp",
  567. "spv.tensorARM.invalid_size.comp",
  568. "spv.tensorARM.invalid_tensor_type.comp",
  569. "spv.tensorARM.params.comp",
  570. "spv.tensorARM.read.comp",
  571. "spv.tensorARM.size.comp",
  572. })),
  573. FileNameAsCustomTestSuffix
  574. );
  575. INSTANTIATE_TEST_SUITE_P(
  576. Glsl, CompileVulkanToSpirvTestNoLink,
  577. ::testing::ValuesIn(std::vector<std::string>({
  578. "spv.exportFunctions.comp",
  579. })),
  580. FileNameAsCustomTestSuffix
  581. );
  582. // Cases with deliberately unreachable code.
  583. // By default the compiler will aggressively eliminate
  584. // unreachable merges and continues.
  585. INSTANTIATE_TEST_SUITE_P(
  586. GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
  587. ::testing::ValuesIn(std::vector<std::string>({
  588. "spv.dead-after-continue.vert",
  589. "spv.dead-after-discard.frag",
  590. "spv.dead-after-return.vert",
  591. "spv.dead-after-loop-break.vert",
  592. "spv.dead-after-switch-break.vert",
  593. "spv.dead-complex-continue-after-return.vert",
  594. "spv.dead-complex-merge-after-return.vert",
  595. })),
  596. FileNameAsCustomTestSuffix
  597. );
  598. // clang-format off
  599. INSTANTIATE_TEST_SUITE_P(
  600. Glsl, CompileVulkan1_1ToSpirvTest,
  601. ::testing::ValuesIn(std::vector<std::string>({
  602. "spv.1.3.8bitstorage-ubo.vert",
  603. "spv.1.3.8bitstorage-ssbo.vert",
  604. "spv.1.3.coopmat.comp",
  605. "spv.deviceGroup.frag",
  606. "spv.drawParams.vert",
  607. "spv.int8.frag",
  608. "spv.vulkan110.int16.frag",
  609. "spv.int32.frag",
  610. "spv.explicittypes.frag",
  611. "spv.float16NoRelaxed.vert",
  612. "spv.float32.frag",
  613. "spv.float64.frag",
  614. "spv.memoryScopeSemantics.comp",
  615. "spv.memoryScopeSemantics_Error.comp",
  616. "spv.multiView.frag",
  617. "spv.queueFamilyScope.comp",
  618. "spv.RayGenShader11.rgen",
  619. "spv.subgroup.frag",
  620. "spv.subgroup.geom",
  621. "spv.subgroup.tesc",
  622. "spv.subgroup.tese",
  623. "spv.subgroup.vert",
  624. "spv.subgroupArithmetic.comp",
  625. "spv.subgroupBasic.comp",
  626. "spv.subgroupBallot.comp",
  627. "spv.subgroupBallotNeg.comp",
  628. "spv.subgroupClustered.comp",
  629. "spv.subgroupClusteredNeg.comp",
  630. "spv.subgroupPartitioned.comp",
  631. "spv.subgroupRotate.comp",
  632. "spv.subgroupShuffle.comp",
  633. "spv.subgroupShuffleRelative.comp",
  634. "spv.subgroupQuad.comp",
  635. "spv.subgroupVote.comp",
  636. "spv.subgroupExtendedTypesArithmetic.comp",
  637. "spv.subgroupExtendedTypesArithmeticNeg.comp",
  638. "spv.subgroupExtendedTypesBallot.comp",
  639. "spv.subgroupExtendedTypesBallotNeg.comp",
  640. "spv.subgroupExtendedTypesClustered.comp",
  641. "spv.subgroupExtendedTypesClusteredNeg.comp",
  642. "spv.subgroupExtendedTypesPartitioned.comp",
  643. "spv.subgroupExtendedTypesPartitionedNeg.comp",
  644. "spv.subgroupExtendedTypesRotate.comp",
  645. "spv.subgroupExtendedTypesRotateNeg.comp",
  646. "spv.subgroupExtendedTypesShuffle.comp",
  647. "spv.subgroupExtendedTypesShuffleNeg.comp",
  648. "spv.subgroupExtendedTypesShuffleRelative.comp",
  649. "spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
  650. "spv.subgroupExtendedTypesQuad.comp",
  651. "spv.subgroupExtendedTypesQuadNeg.comp",
  652. "spv.subgroupExtendedTypesVote.comp",
  653. "spv.subgroupExtendedTypesVoteNeg.comp",
  654. "spv.vulkan110.storageBuffer.vert",
  655. // These tests use the Vulkan memory model.
  656. "spv.bfloat16.comp",
  657. "spv.bfloat16_error.comp",
  658. "spv.bfloat16_error.frag",
  659. "spv.bufferhandle1.frag",
  660. "spv.bufferhandle10.frag",
  661. "spv.coopmat.comp",
  662. "spv.coopmat_Error.comp",
  663. "spv.coopmatKHR.comp",
  664. "spv.coopmat_armlayout.comp",
  665. "spv.coopmatKHR_arithmetic.comp",
  666. "spv.coopmatKHR_arithmeticError.comp",
  667. "spv.coopmatKHR_Error.comp",
  668. "spv.coopmatKHR_constructor.comp",
  669. "spv.coopmatKHR_constructorError.comp",
  670. "spv.coopmatKHR_matmuladd_Error.comp",
  671. "spv.coopvec.comp",
  672. "spv.coopvec2.comp",
  673. "spv.coopvecloadstore.comp",
  674. "spv.coopvec_Error.comp",
  675. "spv.coopvecloadstore_Error.comp",
  676. "spv.coopvecStoreLocal.comp",
  677. "spv.coopvecTraining.comp",
  678. "spv.coopvecTraining_Error.comp",
  679. "spv.intcoopmat.comp",
  680. "spv.intrinsicsInteractWithCoopMat.comp",
  681. "spv.replicate.comp",
  682. "spv.replicatespec.comp",
  683. "spv.atomicAdd.bufferReference.comp",
  684. "spv.nontemporalbuffer.frag",
  685. "spv.atomicFloat.comp",
  686. })),
  687. FileNameAsCustomTestSuffix
  688. );
  689. // clang-format off
  690. INSTANTIATE_TEST_SUITE_P(
  691. Glsl, CompileToSpirv14Test,
  692. ::testing::ValuesIn(std::vector<std::string>({
  693. "spv.1.4.LoopControl.frag",
  694. "spv.1.4.NonWritable.frag",
  695. "spv.1.4.OpEntryPoint.frag",
  696. "spv.1.4.OpEntryPoint.opaqueParams.vert",
  697. "spv.1.4.OpSelect.frag",
  698. "spv.1.4.OpCopyLogical.comp",
  699. "spv.1.4.OpCopyLogicalBool.comp",
  700. "spv.1.4.OpCopyLogical.funcall.frag",
  701. "spv.1.4.funcall.array.frag",
  702. "spv.1.4.load.bool.array.interface.block.frag",
  703. "spv.1.4.image.frag",
  704. "spv.1.4.sparseTexture.frag",
  705. "spv.1.4.texture.frag",
  706. "spv.1.4.constructComposite.comp",
  707. "spv.ext.AnyHitShader.rahit",
  708. "spv.ext.AnyHitShader_Errors.rahit",
  709. "spv.ext.ClosestHitShader.rchit",
  710. "spv.ext.ClosestHitShader_Subgroup.rchit",
  711. "spv.ext.ClosestHitShader_Errors.rchit",
  712. "spv.ext.IntersectShader.rint",
  713. "spv.ext.IntersectShader_Errors.rint",
  714. "spv.ext.MissShader.rmiss",
  715. "spv.ext.MissShader_Errors.rmiss",
  716. "spv.ext.RayPrimCull_Errors.rgen",
  717. "spv.ext.RayCallable.rcall",
  718. "spv.ext.RayCallable_Errors.rcall",
  719. "spv.ext.RayConstants.rgen",
  720. "spv.ext.RayGenShader.rgen",
  721. "spv.ext.RayGenShader_Errors.rgen",
  722. "spv.ext.RayGenShader11.rgen",
  723. "spv.ext.RayGenShaderArray.rgen",
  724. "spv.ext.RayGenSBTlayout.rgen",
  725. "spv.ext.RayGenSBTlayout140.rgen",
  726. "spv.ext.RayGenSBTlayout430.rgen",
  727. "spv.ext.RayGenSBTlayoutscalar.rgen",
  728. "spv.ext.World3x4.rahit",
  729. "spv.ext.AccelDecl.frag",
  730. "spv.ext.RayQueryDecl.frag",
  731. // SPV_KHR_workgroup_memory_explicit_layout depends on SPIR-V 1.4.
  732. "spv.WorkgroupMemoryExplicitLayout.SingleBlock.comp",
  733. "spv.WorkgroupMemoryExplicitLayout.MultiBlock.comp",
  734. "spv.WorkgroupMemoryExplicitLayout.8BitAccess.comp",
  735. "spv.WorkgroupMemoryExplicitLayout.16BitAccess.comp",
  736. "spv.WorkgroupMemoryExplicitLayout.NonBlock.comp",
  737. "spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp",
  738. "spv.WorkgroupMemoryExplicitLayout.std140.comp",
  739. "spv.WorkgroupMemoryExplicitLayout.std430.comp",
  740. "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
  741. // SPV_EXT_mesh_shader
  742. "spv.ext.meshShaderBuiltins.mesh",
  743. "spv.ext.meshShaderBuiltinsShadingRate.mesh",
  744. "spv.ext.meshShaderRedeclBuiltins.mesh",
  745. "spv.ext.meshShaderTaskMem.mesh",
  746. "spv.ext.meshShaderUserDefined.mesh",
  747. "spv.ext.meshTaskShader.task",
  748. "spv.atomiAddEXT.error.mesh",
  749. "spv.atomiAddEXT.task",
  750. "spv.460.subgroupEXT.task",
  751. "spv.460.subgroupEXT.mesh",
  752. // SPV_NV_shader_execution_reorder
  753. "spv.nv.hitobject-errors.rgen",
  754. "spv.nv.hitobject-allops.rgen",
  755. "spv.nv.hitobject-allops.rchit",
  756. "spv.nv.hitobject-allops.rmiss",
  757. // SPV_EXT_shader_execution_reorder
  758. "spv.ext.hitobject-errors.rgen",
  759. "spv.ext.hitobject-allops.rgen",
  760. "spv.ext.hitobject-allops.rchit",
  761. "spv.ext.hitobject-allops.rmiss",
  762. // SPV_NV_displacment_micromap
  763. "spv.nv.dmm-allops.rgen",
  764. "spv.nv.dmm-allops.rchit",
  765. "spv.nv.dmm-allops.rahit",
  766. "spv.nv.dmm-allops.mesh",
  767. "spv.nv.dmm-allops.comp",
  768. // SPV_NV_cluster_acceleration_structure
  769. "spv.nv.cluster-allops.rgen",
  770. "spv.nv.cluster-allops.rchit",
  771. "spv.nv.cluster-allops.rmiss",
  772. "spv.nv.cluster-allops.rahit",
  773. "spv.nv.cluster-allops.frag",
  774. // SPV_NV_linear_swept_spheres
  775. "spv.nv.lss-allops.rgen",
  776. "spv.nv.lss-allops.rchit",
  777. "spv.nv.lss-allops.rmiss",
  778. "spv.nv.lss-allops.frag",
  779. "spv.nv.lss-spheregeomcap.rgen",
  780. "spv.nv.lss-lssgeomcap.rgen",
  781. })),
  782. FileNameAsCustomTestSuffix
  783. );
  784. // clang-format off
  785. INSTANTIATE_TEST_SUITE_P(
  786. Glsl, CompileToSpirv16Test,
  787. ::testing::ValuesIn(std::vector<std::string>({
  788. "spv.1.6.conditionalDiscard.frag",
  789. "spv.1.6.helperInvocation.frag",
  790. "spv.1.6.helperInvocation.memmodel.frag",
  791. "spv.1.6.specConstant.comp",
  792. "spv.1.6.samplerBuffer.frag",
  793. "spv.1.6.separate.frag",
  794. "spv.1.6.quad.frag",
  795. "spv.64bit_indexing.comp",
  796. "spv.64bit_indexing_error.comp",
  797. "spv.coopmat2_constructor.comp",
  798. "spv.coopmat2_error.comp",
  799. "spv.coopmat2_tensor.comp",
  800. "spv.1.6.nontemporalimage.frag",
  801. "spv.noexplicitlayout.comp",
  802. "spv.floate4m3.comp",
  803. "spv.floate4m3.const.comp",
  804. "spv.floate4m3_error.comp",
  805. "spv.floate5m2.comp",
  806. "spv.floate5m2.const.comp",
  807. "spv.floate5m2_error.comp",
  808. "spv.promote_uint32_indices.comp",
  809. })),
  810. FileNameAsCustomTestSuffix
  811. );
  812. // clang-format off
  813. INSTANTIATE_TEST_SUITE_P(
  814. Hlsl, HlslIoMap,
  815. ::testing::ValuesIn(std::vector<IoMapData>{
  816. { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
  817. { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
  818. { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
  819. { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true },
  820. { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
  821. { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
  822. { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
  823. { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
  824. { "spv.register.autoassign.rangetest.frag", "main",
  825. glslang::TQualifier::layoutBindingEnd-2,
  826. glslang::TQualifier::layoutBindingEnd+5,
  827. 0, 20, 30, true, false },
  828. }),
  829. FileNameAsCustomTestSuffixIoMap
  830. );
  831. // clang-format off
  832. INSTANTIATE_TEST_SUITE_P(
  833. Hlsl, GlslIoMap,
  834. ::testing::ValuesIn(std::vector<IoMapData>{
  835. { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
  836. { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
  837. }),
  838. FileNameAsCustomTestSuffixIoMap
  839. );
  840. // clang-format off
  841. INSTANTIATE_TEST_SUITE_P(
  842. Glsl, CompileOpenGLToSpirvTest,
  843. ::testing::ValuesIn(std::vector<std::string>({
  844. "spv.460.frag",
  845. "spv.460.vert",
  846. "spv.460.comp",
  847. "spv.atomic.comp",
  848. "spv.atomicFloat_Error.comp",
  849. "spv.glFragColor.frag",
  850. "spv.rankShift.comp",
  851. "spv.specConst.vert",
  852. "spv.specTexture.frag",
  853. "spv.OVR_multiview.vert",
  854. "spv.uniformInitializer.frag",
  855. "spv.uniformInitializerSpecConstant.frag",
  856. "spv.uniformInitializerStruct.frag",
  857. "spv.xfbOffsetOnBlockMembersAssignment.vert",
  858. "spv.xfbOffsetOnStructMembersAssignment.vert",
  859. "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
  860. "spv.xfbStrideJustOnce.vert",
  861. })),
  862. FileNameAsCustomTestSuffix
  863. );
  864. INSTANTIATE_TEST_SUITE_P(
  865. Glsl, VulkanSemantics,
  866. ::testing::ValuesIn(std::vector<std::string>({
  867. "vulkan.frag",
  868. "vulkan.vert",
  869. "vulkan.comp",
  870. "samplerlessTextureFunctions.frag",
  871. "spv.intrinsicsFakeEnable.vert",
  872. "spv.specConstArrayCheck.vert",
  873. })),
  874. FileNameAsCustomTestSuffix
  875. );
  876. INSTANTIATE_TEST_SUITE_P(
  877. Glsl, OpenGLSemantics,
  878. ::testing::ValuesIn(std::vector<std::string>({
  879. "glspv.esversion.vert",
  880. "glspv.version.frag",
  881. "glspv.version.vert",
  882. "glspv.frag",
  883. "glspv.vert",
  884. })),
  885. FileNameAsCustomTestSuffix
  886. );
  887. INSTANTIATE_TEST_SUITE_P(
  888. Glsl, VulkanAstSemantics,
  889. ::testing::ValuesIn(std::vector<std::string>({
  890. "vulkan.ast.vert",
  891. })),
  892. FileNameAsCustomTestSuffix
  893. );
  894. INSTANTIATE_TEST_SUITE_P(
  895. Glsl, CompileVulkanToSpirvTestQCOM,
  896. ::testing::ValuesIn(std::vector<std::string>({
  897. "spv.qcom.tileShading.0.comp",
  898. "spv.qcom.tileShading.1.comp",
  899. "spv.qcom.es.tileShading.0.comp",
  900. "spv.qcom.es.tileShading.1.comp",
  901. "spv.qcom.es.tileShading.2.comp",
  902. "spv.qcom.tileShading.0.frag",
  903. "spv.qcom.tileShading.1.frag",
  904. "spv.qcom.es.tileShading.0.frag",
  905. "spv.qcom.es.tileShading.1.frag",
  906. })),
  907. FileNameAsCustomTestSuffix
  908. );
  909. INSTANTIATE_TEST_SUITE_P(
  910. Glsl, CompileVulkanToSpirv13TestQCOM,
  911. ::testing::ValuesIn(std::vector<std::string>({
  912. "spv.qcom.coopmatConversion.1.comp",
  913. "spv.qcom.coopmatConversion.2.comp",
  914. })),
  915. FileNameAsCustomTestSuffix
  916. );
  917. INSTANTIATE_TEST_SUITE_P(
  918. Glsl, CompileVulkanToSpirv14TestQCOM,
  919. ::testing::ValuesIn(std::vector<std::string>({
  920. "spv.tpipSampleWeighted.frag",
  921. "spv.tpipBoxFilter.frag",
  922. "spv.tpipBlockMatchSSD.frag",
  923. "spv.tpipBlockMatchSAD.frag",
  924. "spv.tpipTextureArrays.frag",
  925. "spv.tpipBlockMatchGatherSAD.frag",
  926. "spv.tpipBlockMatchGatherSSD.frag",
  927. "spv.tpipBlockMatchWindowSAD.frag",
  928. "spv.tpipBlockMatchWindowSSD.frag",
  929. })),
  930. FileNameAsCustomTestSuffix
  931. );
  932. INSTANTIATE_TEST_SUITE_P(
  933. Glsl, CompileVulkanToSpirvTestAMD,
  934. ::testing::ValuesIn(std::vector<std::string>({
  935. "spv.16bitxfb.vert",
  936. "spv.float16.frag",
  937. "spv.float16Fetch.frag",
  938. "spv.imageLoadStoreLod.frag",
  939. "spv.int16.frag",
  940. "spv.int16.amd.frag",
  941. "spv.shaderBallotAMD.comp",
  942. "spv.shaderFragMaskAMD.frag",
  943. "spv.textureGatherBiasLod.frag",
  944. })),
  945. FileNameAsCustomTestSuffix
  946. );
  947. INSTANTIATE_TEST_SUITE_P(
  948. Glsl, CompileVulkanToSpirvTestNV,
  949. ::testing::ValuesIn(std::vector<std::string>({
  950. "spv.sampleMaskOverrideCoverage.frag",
  951. "spv.GeometryShaderPassthrough.geom",
  952. "spv.viewportArray2.vert",
  953. "spv.viewportArray2.tesc",
  954. "spv.stereoViewRendering.vert",
  955. "spv.stereoViewRendering.tesc",
  956. "spv.multiviewPerViewAttributes.vert",
  957. "spv.multiviewPerViewAttributes.tesc",
  958. "spv.atomicInt64.comp",
  959. "spv.atomicStoreInt64.comp",
  960. "spv.shadingRate.frag",
  961. "spv.RayGenShader.rgen",
  962. "spv.RayGenShaderArray.rgen",
  963. "spv.RayGenShader_Errors.rgen",
  964. "spv.RayConstants.rgen",
  965. "spv.IntersectShader.rint",
  966. "spv.IntersectShader_Errors.rint",
  967. "spv.AnyHitShader.rahit",
  968. "spv.AnyHitShader_Errors.rahit",
  969. "spv.ClosestHitShader.rchit",
  970. "spv.ClosestHitShader_Errors.rchit",
  971. "spv.MissShader.rmiss",
  972. "spv.MissShader_Errors.rmiss",
  973. "spv.RayCallable.rcall",
  974. "spv.RayCallable_Errors.rcall",
  975. "spv.fragmentShaderBarycentric.frag",
  976. "spv.fragmentShaderBarycentric2.frag",
  977. "spv.computeShaderDerivatives.comp",
  978. "spv.computeShaderDerivatives2.comp",
  979. "spv.computeShaderDerivativesSpec.comp",
  980. "spv.computeShaderDerivativesSpec2.comp",
  981. "spv.shaderImageFootprint.frag",
  982. "spv.meshShaderBuiltins.mesh",
  983. "spv.meshShaderUserDefined.mesh",
  984. "spv.meshShaderPerViewBuiltins.mesh",
  985. "spv.meshShaderPerViewUserDefined.mesh",
  986. "spv.meshShaderPerView_Errors.mesh",
  987. "spv.meshShaderSharedMem.mesh",
  988. "spv.meshShaderTaskMem.mesh",
  989. "spv.320.meshShaderUserDefined.mesh",
  990. "spv.meshShaderRedeclBuiltins.mesh",
  991. "spv.meshShaderRedeclPerViewBuiltins.mesh",
  992. "spv.meshTaskShader.task",
  993. "spv.perprimitiveNV.frag",
  994. "spv.nvgpushader5.frag"
  995. })),
  996. FileNameAsCustomTestSuffix
  997. );
  998. INSTANTIATE_TEST_SUITE_P(
  999. Glsl, CompileVulkanToSpirv14TestNV,
  1000. ::testing::ValuesIn(std::vector<std::string>({
  1001. "spv.RayGenShaderMotion.rgen",
  1002. "spv.IntersectShaderMotion.rint",
  1003. "spv.AnyHitShaderMotion.rahit",
  1004. "spv.ClosestHitShaderMotion.rchit",
  1005. "spv.MissShaderMotion.rmiss",
  1006. })),
  1007. FileNameAsCustomTestSuffix
  1008. );
  1009. INSTANTIATE_TEST_SUITE_P(
  1010. Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
  1011. ::testing::ValuesIn(std::vector<std::string>({
  1012. "spv.texture.sampler.transform.frag",
  1013. })),
  1014. FileNameAsCustomTestSuffix
  1015. );
  1016. INSTANTIATE_TEST_SUITE_P(
  1017. Glsl, GlslSpirvDebugInfoTest,
  1018. ::testing::ValuesIn(std::vector<std::string>({
  1019. "spv.pp.line.frag",
  1020. })),
  1021. FileNameAsCustomTestSuffix
  1022. );
  1023. INSTANTIATE_TEST_SUITE_P(
  1024. Glsl, GlslNonSemanticShaderDebugInfoTest,
  1025. ::testing::ValuesIn(std::vector<std::string>({
  1026. "spv.debuginfo.glsl.vert",
  1027. "spv.debuginfo.glsl.frag",
  1028. "spv.debuginfo.glsl.comp",
  1029. "spv.debuginfo.glsl.geom",
  1030. "spv.debuginfo.glsl.tesc",
  1031. "spv.debuginfo.glsl.tese",
  1032. "spv.debuginfo.bufferref.glsl.frag",
  1033. "spv.debuginfo.const_params.glsl.comp",
  1034. "spv.debuginfo.scalar_types.glsl.frag",
  1035. "spv.debuginfo.include.glsl.frag",
  1036. "spv.debuginfo.multiline.glsl.frag",
  1037. "spv.debuginfo.implicit_br.glsl.frag",
  1038. "spv.debuginfo.non_ascii.glsl.frag",
  1039. "spv.debuginfo.continued.glsl.vert",
  1040. "spv.debuginfo.interface_bool.glsl.comp",
  1041. "spv.debuginfo.sampler_type.glsl.frag",
  1042. "spv.debuginfo.const_variables.glsl.frag",
  1043. "spv.debuginfo.ubo.glsl.frag",
  1044. "spv.debuginfo.declaration.glsl.frag",
  1045. })),
  1046. FileNameAsCustomTestSuffix
  1047. );
  1048. INSTANTIATE_TEST_SUITE_P(
  1049. Glsl, GlslNonSemanticShaderDebugInfoSpirv13Test,
  1050. ::testing::ValuesIn(std::vector<std::string>({
  1051. "spv.debuginfo.coopmatKHR.comp",
  1052. })),
  1053. FileNameAsCustomTestSuffix
  1054. );
  1055. INSTANTIATE_TEST_SUITE_P(
  1056. Glsl, GlslNonSemanticShaderDebugInfoVulkanLatestTest,
  1057. ::testing::ValuesIn(std::vector<std::string>({
  1058. "spv.debuginfo.rt_types.glsl.rgen",
  1059. "spv.debuginfo.rt_nv_builtins.glsl.rahit",
  1060. "spv.debuginfo.rt_ext_builtins.glsl.rahit",
  1061. })),
  1062. FileNameAsCustomTestSuffix
  1063. );
  1064. // clang-format on
  1065. } // anonymous namespace
  1066. } // namespace glslangtest