yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
2fbed5e1
main
1// 2// Copyright (C) 2016 Google, Inc. 3// Copyright (C) 2016 LunarG, Inc. 4// 5// All rights reserved. 6// 7// Redistribution and use in source and binary forms, with or without 8// modification, are permitted provided that the following conditions 9// are met: 10// 11// Redistributions of source code must retain the above copyright 12// notice, this list of conditions and the following disclaimer. 13// 14// Redistributions in binary form must reproduce the above 15// copyright notice, this list of conditions and the following 16// disclaimer in the documentation and/or other materials provided 17// with the distribution. 18// 19// Neither the name of Google Inc. nor the names of its 20// contributors may be used to endorse or promote products derived 21// from this software without specific prior written permission. 22// 23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 27// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 29// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 33// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34// POSSIBILITY OF SUCH DAMAGE. 35 36#include <gtest/gtest.h> 37 38#include "TestFixture.h" 39 40namespace glslangtest { 41namespace { 42 43struct FileNameEntryPointPair { 44const char * fileName ; 45const char * entryPoint ; 46}; 47 48// We are using FileNameEntryPointPair objects as parameters for instantiating 49// the template, so the global FileNameAsCustomTestSuffix() won't work since 50// it assumes std::string as parameters. Thus, an overriding one here. 51std::string FileNameAsCustomTestSuffix ( 52const ::testing::TestParamInfo < FileNameEntryPointPair >& info ) { 53 std::string name = info .param .fileName ; 54// A valid test case suffix cannot have '.' and '-' inside. 55 std::replace (name .begin (),name .end (),'.' ,'_' ); 56 std::replace (name .begin (),name .end (),'-' ,'_' ); 57return name ; 58} 59 60using HlslCompileTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 61using HlslVulkan1_1CompileTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 62using HlslVulkan1_2CompileTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 63using HlslSpv1_6CompileTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 64using HlslCompileAndFlattenTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 65using HlslLegalizeTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 66using HlslDebugTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 67using HlslDX9CompatibleTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 68using HlslLegalDebugTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 69using HlslNonSemanticShaderDebugInfoTest = GlslangTest < ::testing::TestWithParam < FileNameEntryPointPair >> ; 70 71// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected 72// to successfully generate both AST and SPIR-V. 73TEST_P (HlslCompileTest ,FromFile ) 74{ 75loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 76Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 77Target ::BothASTAndSpv , true,GetParam ().entryPoint ); 78} 79 80TEST_P (HlslVulkan1_1CompileTest ,FromFile ) 81{ 82loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 83Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_1 , glslang::EShTargetSpv_1_3 , 84Target ::BothASTAndSpv , true,GetParam ().entryPoint ); 85} 86 87TEST_P (HlslVulkan1_2CompileTest ,FromFile ) 88{ 89loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName ,Source ::HLSL ,Semantics ::Vulkan , 90 glslang::EShTargetVulkan_1_2 , glslang::EShTargetSpv_1_4 ,Target ::BothASTAndSpv , true, 91GetParam ().entryPoint ); 92} 93 94TEST_P (HlslSpv1_6CompileTest ,FromFile ) 95{ 96loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 97Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_3 , glslang::EShTargetSpv_1_6 , 98Target ::BothASTAndSpv , true,GetParam ().entryPoint ); 99} 100 101TEST_P (HlslCompileAndFlattenTest ,FromFile ) 102{ 103loadFileCompileFlattenUniformsAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 104Source ::HLSL ,Semantics ::Vulkan , 105Target ::BothASTAndSpv ,GetParam ().entryPoint ); 106} 107 108// Compiling HLSL to legal SPIR-V under Vulkan semantics. Expected to 109// successfully generate SPIR-V. 110TEST_P (HlslLegalizeTest ,FromFile ) 111{ 112loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 113Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 114Target ::Spv , true,GetParam ().entryPoint , 115"/baseLegalResults/" , true); 116} 117 118// Compiling HLSL to pre-legalized SPIR-V. Expected to successfully generate 119// SPIR-V with debug instructions, particularly line info. 120TEST_P (HlslDebugTest ,FromFile ) 121{ 122loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 123Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 124Target ::Spv , true,GetParam ().entryPoint , 125"/baseResults/" , false, true); 126} 127 128TEST_P (HlslDX9CompatibleTest ,FromFile ) 129{ 130loadFileCompileAndCheckWithOptions (GlobalTestSettings .testRoot ,GetParam ().fileName ,Source ::HLSL , 131Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 132Target ::BothASTAndSpv , true, 133GetParam ().entryPoint ,"/baseResults/" , 134EShMessages ::EShMsgHlslDX9Compatible ); 135} 136 137// Compiling HLSL to legalized SPIR-V with debug instructions. Expected to 138// successfully generate SPIR-V with debug instructions preserved through 139// legalization, particularly line info. 140TEST_P (HlslLegalDebugTest ,FromFile ) 141{ 142loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 143Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 144Target ::Spv , true,GetParam ().entryPoint , 145"/baseResults/" , true, true); 146} 147 148TEST_P (HlslNonSemanticShaderDebugInfoTest ,FromFile ) 149{ 150loadFileCompileAndCheck (GlobalTestSettings .testRoot ,GetParam ().fileName , 151Source ::HLSL ,Semantics ::Vulkan , glslang::EShTargetVulkan_1_0 , glslang::EShTargetSpv_1_0 , 152Target ::Spv , true,GetParam ().entryPoint ,"/baseResults/" , false, true, true); 153} 154 155// clang-format off 156INSTANTIATE_TEST_SUITE_P ( 157ToSpirv ,HlslCompileTest , 158 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 159 {"hlsl.amend.frag" ,"f1" }, 160 {"hlsl.aliasOpaque.frag" ,"main" }, 161 {"hlsl.array.frag" ,"PixelShaderFunction" }, 162 {"hlsl.array.implicit-size.frag" ,"PixelShaderFunction" }, 163 {"hlsl.array.malformedParam.negative.geom" ,"main" }, 164 {"hlsl.array.multidim.frag" ,"main" }, 165 {"hlsl.assoc.frag" ,"PixelShaderFunction" }, 166 {"hlsl.attribute.frag" ,"PixelShaderFunction" }, 167 {"hlsl.attribute.nonident.negative.frag" ,"f" }, 168 {"hlsl.attribute.expression.comp" ,"main" }, 169 {"hlsl.attributeC11.frag" ,"main" }, 170 {"hlsl.attributeGlobalBuffer.frag" ,"main" }, 171 {"hlsl.basic.comp" ,"main" }, 172 {"hlsl.basic.geom" ,"main" }, 173 {"hlsl.buffer.interlocked.error.frag" ,"main" }, 174 {"hlsl.buffer.load.error.frag" ,"main" }, 175 {"hlsl.buffer.load2.error.frag" ,"main" }, 176 {"hlsl.buffer.load3.error.frag" ,"main" }, 177 {"hlsl.buffer.load4.error.frag" ,"main" }, 178 {"hlsl.buffer.store.error.frag" ,"main" }, 179 {"hlsl.buffer.store2.error.frag" ,"main" }, 180 {"hlsl.buffer.store3.error.frag" ,"main" }, 181 {"hlsl.buffer.store4.error.frag" ,"main" }, 182 {"hlsl.boolConv.vert" ,"main" }, 183 {"hlsl.buffer.frag" ,"PixelShaderFunction" }, 184 {"hlsl.buffer-offsets.comp" ,"main" }, 185 {"hlsl.calculatelod.dx10.frag" ,"main" }, 186 {"hlsl.calculatelodunclamped.dx10.frag" ,"main" }, 187 {"hlsl.cast.frag" ,"PixelShaderFunction" }, 188 {"hlsl.cbuffer-identifier.vert" ,"main" }, 189 {"hlsl.cbuffer-offsets.comp" ,"main" }, 190 {"hlsl.charLit.vert" ,"main" }, 191 {"hlsl.clip.frag" ,"main" }, 192 {"hlsl.clipdistance-1.frag" ,"main" }, 193 {"hlsl.clipdistance-1.geom" ,"main" }, 194 {"hlsl.clipdistance-1.vert" ,"main" }, 195 {"hlsl.clipdistance-2.frag" ,"main" }, 196 {"hlsl.clipdistance-2.geom" ,"main" }, 197 {"hlsl.clipdistance-2.vert" ,"main" }, 198 {"hlsl.clipdistance-3.frag" ,"main" }, 199 {"hlsl.clipdistance-3.geom" ,"main" }, 200 {"hlsl.clipdistance-3.vert" ,"main" }, 201 {"hlsl.clipdistance-4.frag" ,"main" }, 202 {"hlsl.clipdistance-4.geom" ,"main" }, 203 {"hlsl.clipdistance-4.vert" ,"main" }, 204 {"hlsl.clipdistance-5.frag" ,"main" }, 205 {"hlsl.clipdistance-5.vert" ,"main" }, 206 {"hlsl.clipdistance-6.frag" ,"main" }, 207 {"hlsl.clipdistance-6.vert" ,"main" }, 208 {"hlsl.clipdistance-7.frag" ,"main" }, 209 {"hlsl.clipdistance-7.vert" ,"main" }, 210 {"hlsl.clipdistance-8.frag" ,"main" }, 211 {"hlsl.clipdistance-8.vert" ,"main" }, 212 {"hlsl.clipdistance-9.frag" ,"main" }, 213 {"hlsl.clipdistance-9.vert" ,"main" }, 214 {"hlsl.color.hull.tesc" ,"main" }, 215 {"hlsl.comparison.vec.frag" ,"main" }, 216 {"hlsl.conditional.frag" ,"PixelShaderFunction" }, 217 {"hlsl.constantbuffer.frag" ,"main" }, 218 {"hlsl.constantfold.matrix.frag" ,"main" }, 219 {"hlsl.constructArray.vert" ,"main" }, 220 {"hlsl.constructexpr.frag" ,"main" }, 221 {"hlsl.constructimat.frag" ,"main" }, 222 {"hlsl.coverage.frag" ,"main" }, 223 {"hlsl.depthGreater.frag" ,"PixelShaderFunction" }, 224 {"hlsl.depthLess.frag" ,"PixelShaderFunction" }, 225 {"hlsl.discard.frag" ,"PixelShaderFunction" }, 226 {"hlsl.doLoop.frag" ,"PixelShaderFunction" }, 227 {"hlsl.earlydepthstencil.frag" ,"main" }, 228 {"hlsl.emptystructreturn.frag" ,"main" }, 229 {"hlsl.emptystructreturn.vert" ,"main" }, 230 {"hlsl.emptystructreturn.tesc" ,"main" }, 231 {"hlsl.emptystruct.init.vert" ,"main" }, 232 {"hlsl.entry-in.frag" ,"PixelShaderFunction" }, 233 {"hlsl.entry-inout.vert" ,"main" }, 234 {"hlsl.entry-out.frag" ,"PixelShaderFunction" }, 235 {"hlsl.fraggeom.frag" ,"main" }, 236 {"hlsl.float1.frag" ,"PixelShaderFunction" }, 237 {"hlsl.float4.frag" ,"PixelShaderFunction" }, 238 {"hlsl.flatten.return.frag" ,"main" }, 239 {"hlsl.flattenOpaque.frag" ,"main" }, 240 {"hlsl.flattenOpaqueInit.vert" ,"main" }, 241 {"hlsl.flattenOpaqueInitMix.vert" ,"main" }, 242 {"hlsl.flattenSubset.frag" ,"main" }, 243 {"hlsl.flattenSubset2.frag" ,"main" }, 244 {"hlsl.forLoop.frag" ,"PixelShaderFunction" }, 245 {"hlsl.gather.array.dx10.frag" ,"main" }, 246 {"hlsl.gather.basic.dx10.frag" ,"main" }, 247 {"hlsl.gather.basic.dx10.vert" ,"main" }, 248 {"hlsl.gather.offset.dx10.frag" ,"main" }, 249 {"hlsl.gather.offsetarray.dx10.frag" ,"main" }, 250 {"hlsl.gathercmpRGBA.offset.dx10.frag" ,"main" }, 251 {"hlsl.gatherRGBA.array.dx10.frag" ,"main" }, 252 {"hlsl.gatherRGBA.basic.dx10.frag" ,"main" }, 253 {"hlsl.gatherRGBA.offset.dx10.frag" ,"main" }, 254 {"hlsl.gatherRGBA.offsetarray.dx10.frag" ,"main" }, 255 {"hlsl.getdimensions.dx10.frag" ,"main" }, 256 {"hlsl.getdimensions.rw.dx10.frag" ,"main" }, 257 {"hlsl.getdimensions.dx10.vert" ,"main" }, 258 {"hlsl.getsampleposition.dx10.frag" ,"main" }, 259 {"hlsl.global-const-init.frag" ,"main" }, 260 {"hlsl.gs-hs-mix.tesc" ,"HSMain" }, 261 {"hlsl.do.nested.error.frag" ,"main" }, 262 {"hlsl.domain.1.tese" ,"main" }, 263 {"hlsl.domain.2.tese" ,"main" }, 264 {"hlsl.domain.3.tese" ,"main" }, 265 {"hlsl.function.frag" ,"main" }, 266 {"hlsl.hull.1.tesc" ,"main" }, 267 {"hlsl.hull.2.tesc" ,"main" }, 268 {"hlsl.hull.3.tesc" ,"main" }, 269 {"hlsl.hull.4.tesc" ,"main" }, 270 {"hlsl.hull.5.tesc" ,"main" }, 271 {"hlsl.hull.6.tesc" ,"main" }, 272 {"hlsl.hull.void.tesc" ,"main" }, 273 {"hlsl.hull.ctrlpt-1.tesc" ,"main" }, 274 {"hlsl.hull.ctrlpt-2.tesc" ,"main" }, 275 {"hlsl.for.nested.error.frag" ,"main" }, 276 {"hlsl.format.rwtexture.frag" ,"main" }, 277 {"hlsl.groupid.comp" ,"main" }, 278 {"hlsl.identifier.sample.frag" ,"main" }, 279 {"hlsl.if.frag" ,"PixelShaderFunction" }, 280 {"hlsl.if.nested.error.frag" ,"main" }, 281 {"hlsl.imageload-subvec4.comp" ,"main" }, 282 {"hlsl.imagefetch-subvec4.comp" ,"main" }, 283 {"hlsl.implicitBool.frag" ,"main" }, 284 {"hlsl.inf.vert" ,"main" }, 285 {"hlsl.inoutquals.frag" ,"main" }, 286 {"hlsl.inoutquals.negative.frag" ,"main" }, 287 {"hlsl.inoutquals.nonident.negative.frag" ,"main" }, 288 {"hlsl.init.frag" ,"ShaderFunction" }, 289 {"hlsl.init2.frag" ,"main" }, 290 {"hlsl.isfinite.frag" ,"main" }, 291 {"hlsl.intrinsics.barriers.comp" ,"ComputeShaderFunction" }, 292 {"hlsl.intrinsics.comp" ,"ComputeShaderFunction" }, 293 {"hlsl.intrinsics.d3dcolortoubyte4.frag" ,"main" }, 294 {"hlsl.intrinsics.double.frag" ,"PixelShaderFunction" }, 295 {"hlsl.intrinsics.f1632.frag" ,"main" }, 296 {"hlsl.intrinsics.f3216.frag" ,"main" }, 297 {"hlsl.intrinsics.frag" ,"main" }, 298 {"hlsl.intrinsic.frexp.frag" ,"main" }, 299 {"hlsl.intrinsics.lit.frag" ,"PixelShaderFunction" }, 300 {"hlsl.intrinsics.negative.comp" ,"ComputeShaderFunction" }, 301 {"hlsl.intrinsics.negative.frag" ,"PixelShaderFunction" }, 302 {"hlsl.intrinsics.negative.vert" ,"VertexShaderFunction" }, 303 {"hlsl.intrinsics.promote.frag" ,"main" }, 304 {"hlsl.intrinsics.promote.down.frag" ,"main" }, 305 {"hlsl.intrinsics.promote.outputs.frag" ,"main" }, 306 {"hlsl.layout.frag" ,"main" }, 307 {"hlsl.layoutOverride.vert" ,"main" }, 308 {"hlsl.load.2dms.dx10.frag" ,"main" }, 309 {"hlsl.load.array.dx10.frag" ,"main" }, 310 {"hlsl.load.basic.dx10.frag" ,"main" }, 311 {"hlsl.load.basic.dx10.vert" ,"main" }, 312 {"hlsl.load.buffer.dx10.frag" ,"main" }, 313 {"hlsl.load.buffer.float.dx10.frag" ,"main" }, 314 {"hlsl.load.rwbuffer.dx10.frag" ,"main" }, 315 {"hlsl.load.rwtexture.dx10.frag" ,"main" }, 316 {"hlsl.load.rwtexture.array.dx10.frag" ,"main" }, 317 {"hlsl.load.offset.dx10.frag" ,"main" }, 318 {"hlsl.load.offsetarray.dx10.frag" ,"main" }, 319 {"hlsl.localStructuredBuffer.comp" ,"main" }, 320 {"hlsl.logical.binary.frag" ,"main" }, 321 {"hlsl.logical.binary.vec.frag" ,"main" }, 322 {"hlsl.logicalConvert.frag" ,"main" }, 323 {"hlsl.logical.unary.frag" ,"main" }, 324 {"hlsl.loopattr.frag" ,"main" }, 325 {"hlsl.matpack-pragma.frag" ,"main" }, 326 {"hlsl.matpack-pragma-global.frag" ,"main" }, 327 {"hlsl.mip.operator.frag" ,"main" }, 328 {"hlsl.mip.negative.frag" ,"main" }, 329 {"hlsl.mip.negative2.frag" ,"main" }, 330 {"hlsl.namespace.frag" ,"main" }, 331 {"hlsl.nonint-index.frag" ,"main" }, 332 {"hlsl.matNx1.frag" ,"main" }, 333 {"hlsl.matpack-1.frag" ,"main" }, 334 {"hlsl.matrixSwizzle.vert" ,"ShaderFunction" }, 335 {"hlsl.memberFunCall.frag" ,"main" }, 336 {"hlsl.mintypes.frag" ,"main" }, 337 {"hlsl.mul-truncate.frag" ,"main" }, 338 {"hlsl.multiEntry.vert" ,"RealEntrypoint" }, 339 {"hlsl.multiReturn.frag" ,"main" }, 340 {"hlsl.multiView.frag" ,"main" }, 341 {"hlsl.matrixindex.frag" ,"main" }, 342 {"hlsl.nested.name.error.frag" ,"main" }, 343 {"hlsl.nonstaticMemberFunction.frag" ,"main" }, 344 {"hlsl.numericsuffixes.frag" ,"main" }, 345 {"hlsl.numericsuffixes.negative.frag" ,"main" }, 346 {"hlsl.numthreads.comp" ,"main_aux2" }, 347 {"hlsl.numthreads.negative.comp" ,"main" }, 348 {"hlsl.numthreads.nonconst.comp" ,"main" }, 349 {"hlsl.overload.frag" ,"PixelShaderFunction" }, 350 {"hlsl.opaque-type-bug.frag" ,"main" }, 351 {"hlsl.params.default.frag" ,"main" }, 352 {"hlsl.params.default.negative.frag" ,"main" }, 353 {"hlsl.params.default.nonident.negative.frag" ,"main" }, 354 {"hlsl.partialInit.frag" ,"PixelShaderFunction" }, 355 {"hlsl.partialFlattenLocal.vert" ,"main" }, 356 {"hlsl.PointSize.geom" ,"main" }, 357 {"hlsl.PointSize.vert" ,"main" }, 358 {"hlsl.postfix.nonlvalue.negative.frag" ,"main" }, 359 {"hlsl.pp.vert" ,"main" }, 360 {"hlsl.pp.line.frag" ,"main" }, 361 {"hlsl.precise.frag" ,"main" }, 362 {"hlsl.printf.comp" ,"main" }, 363 {"hlsl.promote.atomic.frag" ,"main" }, 364 {"hlsl.promote.binary.frag" ,"main" }, 365 {"hlsl.promote.vec1.frag" ,"main" }, 366 {"hlsl.promotions.frag" ,"main" }, 367 {"hlsl.round.dx10.frag" ,"main" }, 368 {"hlsl.rw.atomics.frag" ,"main" }, 369 {"hlsl.rw.bracket.frag" ,"main" }, 370 {"hlsl.rw.register.frag" ,"main" }, 371 {"hlsl.rw.scalar.bracket.frag" ,"main" }, 372 {"hlsl.rw.swizzle.frag" ,"main" }, 373 {"hlsl.rw.vec2.bracket.frag" ,"main" }, 374 {"hlsl.sample.array.dx10.frag" ,"main" }, 375 {"hlsl.sample.basic.dx10.frag" ,"main" }, 376 {"hlsl.sample.offset.dx10.frag" ,"main" }, 377 {"hlsl.sample.offsetarray.dx10.frag" ,"main" }, 378 {"hlsl.samplebias.array.dx10.frag" ,"main" }, 379 {"hlsl.samplebias.basic.dx10.frag" ,"main" }, 380 {"hlsl.samplebias.offset.dx10.frag" ,"main" }, 381 {"hlsl.samplebias.offsetarray.dx10.frag" ,"main" }, 382 {"hlsl.samplecmp.array.dx10.frag" ,"main" }, 383 {"hlsl.samplecmp.basic.dx10.frag" ,"main" }, 384 {"hlsl.samplecmp.dualmode.frag" ,"main" }, 385 {"hlsl.samplecmp.offset.dx10.frag" ,"main" }, 386 {"hlsl.samplecmp.offsetarray.dx10.frag" ,"main" }, 387 {"hlsl.samplecmp.negative.frag" ,"main" }, 388 {"hlsl.samplecmp.negative2.frag" ,"main" }, 389 {"hlsl.samplecmplevelzero.array.dx10.frag" ,"main" }, 390 {"hlsl.samplecmplevelzero.basic.dx10.frag" ,"main" }, 391 {"hlsl.samplecmplevelzero.offset.dx10.frag" ,"main" }, 392 {"hlsl.samplecmplevelzero.offsetarray.dx10.frag" ,"main" }, 393 {"hlsl.samplegrad.array.dx10.frag" ,"main" }, 394 {"hlsl.samplegrad.basic.dx10.frag" ,"main" }, 395 {"hlsl.samplegrad.basic.dx10.vert" ,"main" }, 396 {"hlsl.samplegrad.offset.dx10.frag" ,"main" }, 397 {"hlsl.samplegrad.offsetarray.dx10.frag" ,"main" }, 398 {"hlsl.samplelevel.array.dx10.frag" ,"main" }, 399 {"hlsl.samplelevel.basic.dx10.frag" ,"main" }, 400 {"hlsl.samplelevel.basic.dx10.vert" ,"main" }, 401 {"hlsl.samplelevel.offset.dx10.frag" ,"main" }, 402 {"hlsl.samplelevel.offsetarray.dx10.frag" ,"main" }, 403 {"hlsl.sample.sub-vec4.dx10.frag" ,"main" }, 404 {"hlsl.scalar-length.frag" ,"main" }, 405 {"hlsl.scalarCast.vert" ,"main" }, 406 {"hlsl.semicolons.frag" ,"main" }, 407 {"hlsl.shapeConv.frag" ,"main" }, 408 {"hlsl.shapeConvRet.frag" ,"main" }, 409 {"hlsl.singleArgIntPromo.vert" ,"main" }, 410 {"hlsl.self_cast.frag" ,"main" }, 411 {"hlsl.snorm.uav.comp" ,"main" }, 412 {"hlsl.specConstant.frag" ,"main" }, 413 {"hlsl.staticMemberFunction.frag" ,"main" }, 414 {"hlsl.staticFuncInit.frag" ,"main" }, 415 {"hlsl.store.rwbyteaddressbuffer.type.comp" ,"main" }, 416 {"hlsl.stringtoken.frag" ,"main" }, 417 {"hlsl.string.frag" ,"main" }, 418 {"hlsl.struct.split-1.vert" ,"main" }, 419 {"hlsl.struct.split.array.geom" ,"main" }, 420 {"hlsl.struct.split.assign.frag" ,"main" }, 421 {"hlsl.struct.split.call.vert" ,"main" }, 422 {"hlsl.struct.split.nested.geom" ,"main" }, 423 {"hlsl.struct.split.trivial.geom" ,"main" }, 424 {"hlsl.struct.split.trivial.vert" ,"main" }, 425 {"hlsl.structarray.flatten.frag" ,"main" }, 426 {"hlsl.structarray.flatten.geom" ,"main" }, 427 {"hlsl.structbuffer.frag" ,"main" }, 428 {"hlsl.structbuffer.append.frag" ,"main" }, 429 {"hlsl.structbuffer.append.fn.frag" ,"main" }, 430 {"hlsl.structbuffer.atomics.frag" ,"main" }, 431 {"hlsl.structbuffer.byte.frag" ,"main" }, 432 {"hlsl.structbuffer.coherent.frag" ,"main" }, 433 {"hlsl.structbuffer.floatidx.comp" ,"main" }, 434 {"hlsl.structbuffer.incdec.frag" ,"main" }, 435 {"hlsl.structbuffer.store.args.error.frag" ,"main" }, 436 {"hlsl.structbuffer.fn.frag" ,"main" }, 437 {"hlsl.structbuffer.fn2.comp" ,"main" }, 438 {"hlsl.structbuffer.rw.frag" ,"main" }, 439 {"hlsl.structbuffer.rwbyte.frag" ,"main" }, 440 {"hlsl.structbuffer.rwbyte2.comp" ,"main" }, 441 {"hlsl.structcopy.comp" ,"main" }, 442 {"hlsl.structin.vert" ,"main" }, 443 {"hlsl.structIoFourWay.frag" ,"main" }, 444 {"hlsl.structStructName.frag" ,"main" }, 445 {"hlsl.subpass.frag" ,"main" }, 446 {"hlsl.swizzle.vec1.comp" ,"main" }, 447 {"hlsl.synthesizeInput.frag" ,"main" }, 448 {"hlsl.ternary.conversion.frag" ,"main" }, 449 {"hlsl.ternary.simple.frag" ,"main" }, 450 {"hlsl.ternary.error.frag" ,"main" }, 451 {"hlsl.texturebuffer.frag" ,"main" }, 452 {"hlsl.texture.struct.frag" ,"main" }, 453 {"hlsl.texture.subvec4.frag" ,"main" }, 454 {"hlsl.this.frag" ,"main" }, 455 {"hlsl.intrinsics.vert" ,"VertexShaderFunction" }, 456 {"hlsl.intrinsic.frexp.vert" ,"VertexShaderFunction" }, 457 {"hlsl.matType.frag" ,"PixelShaderFunction" }, 458 {"hlsl.matType.bool.frag" ,"main" }, 459 {"hlsl.matType.int.frag" ,"main" }, 460 {"hlsl.max.frag" ,"PixelShaderFunction" }, 461 {"hlsl.nested-runtimeArray.frag" ,"main" }, 462 {"hlsl.preprocessor.frag" ,"main" }, 463 {"hlsl.precedence.frag" ,"PixelShaderFunction" }, 464 {"hlsl.precedence2.frag" ,"PixelShaderFunction" }, 465 {"hlsl.scalar2matrix.frag" ,"main" }, 466 {"hlsl.semantic.geom" ,"main" }, 467 {"hlsl.semantic.vert" ,"main" }, 468 {"hlsl.semantic-1.vert" ,"main" }, 469 {"hlsl.scope.frag" ,"PixelShaderFunction" }, 470 {"hlsl.sin.frag" ,"PixelShaderFunction" }, 471 {"hlsl.struct.frag" ,"PixelShaderFunction" }, 472 {"hlsl.switch.frag" ,"PixelShaderFunction" }, 473 {"hlsl.swizzle.frag" ,"PixelShaderFunction" }, 474 {"hlsl.target.frag" ,"main" }, 475 {"hlsl.targetStruct1.frag" ,"main" }, 476 {"hlsl.targetStruct2.frag" ,"main" }, 477 {"hlsl.templatetypes.frag" ,"PixelShaderFunction" }, 478 {"hlsl.tristream-append.geom" ,"main" }, 479 {"hlsl.tx.bracket.frag" ,"main" }, 480 {"hlsl.tx.overload.frag" ,"main" }, 481 {"hlsl.type.half.frag" ,"main" }, 482 {"hlsl.type.identifier.frag" ,"main" }, 483 {"hlsl.typeGraphCopy.vert" ,"main" }, 484 {"hlsl.typedef.frag" ,"PixelShaderFunction" }, 485 {"hlsl.whileLoop.frag" ,"PixelShaderFunction" }, 486 {"hlsl.void.frag" ,"PixelShaderFunction" }, 487 {"hlsl.type.type.conversion.all.frag" ,"main" }, 488 {"hlsl.instance.geom" ,"GeometryShader" }, 489 {"hlsl.while.nested.error.frag" ,"main" }, 490 }), 491FileNameAsCustomTestSuffix 492); 493// clang-format on 494 495// clang-format off 496INSTANTIATE_TEST_SUITE_P ( 497ToSpirv ,HlslVulkan1_1CompileTest , 498 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 499 {"hlsl.wavebroadcast.comp" ,"CSMain" }, 500 {"hlsl.waveprefix.comp" ,"CSMain" }, 501 {"hlsl.wavequad.comp" ,"CSMain" }, 502 {"hlsl.wavequery.comp" ,"CSMain" }, 503 {"hlsl.wavequery.frag" ,"PixelShaderFunction" }, 504 {"hlsl.wavereduction.comp" ,"CSMain" }, 505 {"hlsl.wavevote.comp" ,"CSMain" }, 506 {"hlsl.type.type.conversion.valid.frag" ,"main" }, 507 {"hlsl.int.dot.frag" ,"main" } 508 }), 509FileNameAsCustomTestSuffix 510); 511 512INSTANTIATE_TEST_SUITE_P ( 513ToSpirv ,HlslVulkan1_2CompileTest , 514 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 515 {"hlsl.buffer_ref_parameter.comp" ,"main" }, 516 }), 517FileNameAsCustomTestSuffix 518); 519// clang-format on 520 521// clang-format off 522INSTANTIATE_TEST_SUITE_P ( 523ToSpirv ,HlslSpv1_6CompileTest , 524 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 525 {"hlsl.spv.1.6.discard.frag" ,"PixelShaderFunction" }, 526 {"hlsl.structcopylogical.comp" ,"main" }, 527 }), 528FileNameAsCustomTestSuffix 529); 530// clang-format on 531 532// clang-format off 533INSTANTIATE_TEST_SUITE_P ( 534ToSpirv ,HlslCompileAndFlattenTest , 535 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 536 {"hlsl.array.flatten.frag" ,"main" }, 537 {"hlsl.partialFlattenMixed.vert" ,"main" }, 538 }), 539FileNameAsCustomTestSuffix 540); 541// clang-format on 542 543#if ENABLE_OPT 544// clang-format off 545INSTANTIATE_TEST_SUITE_P ( 546ToSpirv ,HlslLegalizeTest , 547 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 548 {"hlsl.aliasOpaque.frag" ,"main" }, 549 {"hlsl.flattenOpaque.frag" ,"main" }, 550 {"hlsl.flattenOpaqueInit.vert" ,"main" }, 551 {"hlsl.flattenOpaqueInitMix.vert" ,"main" }, 552 {"hlsl.flattenSubset.frag" ,"main" }, 553 {"hlsl.flattenSubset2.frag" ,"main" }, 554 {"hlsl.intrinsics.evalfns.frag" ,"main" }, 555 {"hlsl.partialFlattenLocal.vert" ,"main" }, 556 {"hlsl.partialFlattenMixed.vert" ,"main" } 557 }), 558FileNameAsCustomTestSuffix 559); 560// clang-format on 561#endif 562 563// clang-format off 564INSTANTIATE_TEST_SUITE_P ( 565ToSpirv ,HlslDebugTest , 566 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 567 {"hlsl.pp.line2.frag" ,"MainPs" } 568 }), 569FileNameAsCustomTestSuffix 570); 571 572INSTANTIATE_TEST_SUITE_P ( 573ToSpirv ,HlslDX9CompatibleTest , 574 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 575 {"hlsl.round.dx9.frag" ,"main" }, 576 {"hlsl.sample.dx9.frag" ,"main" }, 577 {"hlsl.sample.dx9.vert" ,"main" }, 578 }), 579FileNameAsCustomTestSuffix 580); 581 582// clang-format off 583INSTANTIATE_TEST_SUITE_P ( 584ToSpirv ,HlslLegalDebugTest , 585 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 586 {"hlsl.pp.line4.frag" ,"MainPs" } 587 }), 588FileNameAsCustomTestSuffix 589); 590// clang-format on 591 592// clang-format off 593INSTANTIATE_TEST_SUITE_P ( 594ToSpirv ,HlslNonSemanticShaderDebugInfoTest , 595 ::testing::ValuesIn (std::vector < FileNameEntryPointPair > { 596 {"spv.debuginfo.hlsl.vert" ,"main" }, 597 {"spv.debuginfo.hlsl.frag" ,"main" }, 598 {"spv.debuginfo.hlsl.comp" ,"main" }, 599 {"spv.debuginfo.hlsl.geom" ,"main" }, 600 {"spv.debuginfo.hlsl.tesc" ,"main" }, 601 {"spv.debuginfo.hlsl.tese" ,"main" }, 602 }), 603FileNameAsCustomTestSuffix 604); 605// clang-format on 606 607}// anonymous namespace 608}// namespace glslangtest