bgfx/3rdparty/glslang/gtests/Hlsl.FromFile.cpp

503 lines
22 KiB
C++
Raw Normal View History

2016-12-16 01:19:54 +03:00
//
// Copyright (C) 2016 Google, Inc.
// Copyright (C) 2016 LunarG, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>
#include "TestFixture.h"
namespace glslangtest {
namespace {
struct FileNameEntryPointPair {
const char* fileName;
const char* entryPoint;
};
// We are using FileNameEntryPointPair objects as parameters for instantiating
// the template, so the global FileNameAsCustomTestSuffix() won't work since
// it assumes std::string as parameters. Thus, an overriding one here.
std::string FileNameAsCustomTestSuffix(
const ::testing::TestParamInfo<FileNameEntryPointPair>& info) {
std::string name = info.param.fileName;
// A valid test case suffix cannot have '.' and '-' inside.
std::replace(name.begin(), name.end(), '.', '_');
std::replace(name.begin(), name.end(), '-', '_');
return name;
}
using HlslCompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2018-03-11 02:03:31 +03:00
using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2016-12-16 01:19:54 +03:00
using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2017-09-30 07:22:46 +03:00
using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2018-12-09 03:38:05 +03:00
using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2018-12-23 05:40:47 +03:00
using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
2016-12-16 01:19:54 +03:00
2017-09-30 07:22:46 +03:00
// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected
// to successfully generate both AST and SPIR-V.
2016-12-16 01:19:54 +03:00
TEST_P(HlslCompileTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
2018-03-11 02:03:31 +03:00
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Target::BothASTAndSpv, true, GetParam().entryPoint);
}
TEST_P(HlslVulkan1_1CompileTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1,
2018-02-28 09:52:56 +03:00
Target::BothASTAndSpv, true, GetParam().entryPoint);
2016-12-16 01:19:54 +03:00
}
TEST_P(HlslCompileAndFlattenTest, FromFile)
{
loadFileCompileFlattenUniformsAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
Source::HLSL, Semantics::Vulkan,
Target::BothASTAndSpv, GetParam().entryPoint);
}
2017-09-30 07:22:46 +03:00
// Compiling HLSL to legal SPIR-V under Vulkan semantics. Expected to
// successfully generate SPIR-V.
TEST_P(HlslLegalizeTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
2018-03-11 02:03:31 +03:00
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
2018-02-28 09:52:56 +03:00
Target::Spv, true, GetParam().entryPoint,
2018-04-01 18:45:28 +03:00
"/baseLegalResults/", true);
2017-09-30 07:22:46 +03:00
}
2018-12-09 03:38:05 +03:00
// Compiling HLSL to pre-legalized SPIR-V. Expected to successfully generate
// SPIR-V with debug instructions, particularly line info.
TEST_P(HlslDebugTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Target::Spv, true, GetParam().entryPoint,
"/baseResults/", false, true);
}
TEST_P(HlslDX9CompatibleTest, FromFile)
{
loadFileCompileAndCheckWithOptions(GlobalTestSettings.testRoot, GetParam().fileName, Source::HLSL,
Semantics::Vulkan, glslang::EShTargetVulkan_1_0, Target::BothASTAndSpv, true,
GetParam().entryPoint, "/baseResults/",
EShMessages::EShMsgHlslDX9Compatible);
}
2018-12-23 05:40:47 +03:00
// Compiling HLSL to legalized SPIR-V with debug instructions. Expected to
// successfully generate SPIR-V with debug instructions preserved through
// legalization, particularly line info.
TEST_P(HlslLegalDebugTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Target::Spv, true, GetParam().entryPoint,
"/baseResults/", true, true);
}
2016-12-16 01:19:54 +03:00
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslCompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.amend.frag", "f1"},
2017-06-03 21:11:11 +03:00
{"hlsl.aliasOpaque.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.array.frag", "PixelShaderFunction"},
{"hlsl.array.implicit-size.frag", "PixelShaderFunction"},
{"hlsl.array.multidim.frag", "main"},
{"hlsl.assoc.frag", "PixelShaderFunction"},
{"hlsl.attribute.frag", "PixelShaderFunction"},
{"hlsl.attribute.expression.comp", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.attributeC11.frag", "main"},
2017-10-20 18:19:20 +03:00
{"hlsl.attributeGlobalBuffer.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.basic.comp", "main"},
{"hlsl.basic.geom", "main"},
2017-04-15 07:17:34 +03:00
{"hlsl.boolConv.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.buffer.frag", "PixelShaderFunction"},
{"hlsl.calculatelod.dx10.frag", "main"},
{"hlsl.calculatelodunclamped.dx10.frag", "main"},
{"hlsl.cast.frag", "PixelShaderFunction"},
2017-12-04 05:21:39 +03:00
{"hlsl.cbuffer-identifier.vert", "main"},
2017-04-15 07:17:34 +03:00
{"hlsl.charLit.vert", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.clip.frag", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-1.frag", "main"},
{"hlsl.clipdistance-1.geom", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.clipdistance-1.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-2.frag", "main"},
{"hlsl.clipdistance-2.geom", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.clipdistance-2.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-3.frag", "main"},
2017-09-02 05:08:30 +03:00
{"hlsl.clipdistance-3.geom", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.clipdistance-3.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-4.frag", "main"},
2017-09-02 05:08:30 +03:00
{"hlsl.clipdistance-4.geom", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.clipdistance-4.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-5.frag", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.clipdistance-5.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-6.frag", "main"},
2017-07-30 05:59:42 +03:00
{"hlsl.clipdistance-6.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-7.frag", "main"},
2017-07-30 05:59:42 +03:00
{"hlsl.clipdistance-7.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-8.frag", "main"},
2017-07-30 05:59:42 +03:00
{"hlsl.clipdistance-8.vert", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.clipdistance-9.frag", "main"},
2017-07-30 05:59:42 +03:00
{"hlsl.clipdistance-9.vert", "main"},
2017-12-10 00:50:23 +03:00
{"hlsl.color.hull.tesc", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.comparison.vec.frag", "main"},
{"hlsl.conditional.frag", "PixelShaderFunction"},
2017-04-29 22:09:05 +03:00
{"hlsl.constantbuffer.frag", "main"},
2017-06-17 05:16:50 +03:00
{"hlsl.constructArray.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.constructexpr.frag", "main"},
2017-05-27 19:40:00 +03:00
{"hlsl.constructimat.frag", "main"},
2018-05-19 19:38:04 +03:00
{"hlsl.coverage.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.depthGreater.frag", "PixelShaderFunction"},
{"hlsl.depthLess.frag", "PixelShaderFunction"},
{"hlsl.discard.frag", "PixelShaderFunction"},
{"hlsl.doLoop.frag", "PixelShaderFunction"},
2017-03-25 06:03:12 +03:00
{"hlsl.emptystructreturn.frag", "main"},
{"hlsl.emptystructreturn.vert", "main"},
2017-04-29 22:09:05 +03:00
{"hlsl.emptystruct.init.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.entry-in.frag", "PixelShaderFunction"},
{"hlsl.entry-out.frag", "PixelShaderFunction"},
2017-05-20 06:23:01 +03:00
{"hlsl.fraggeom.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.float1.frag", "PixelShaderFunction"},
{"hlsl.float4.frag", "PixelShaderFunction"},
{"hlsl.flatten.return.frag", "main"},
2017-06-03 21:11:11 +03:00
{"hlsl.flattenOpaque.frag", "main"},
2017-07-16 19:57:18 +03:00
{"hlsl.flattenOpaqueInit.vert", "main"},
{"hlsl.flattenOpaqueInitMix.vert", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.flattenSubset.frag", "main"},
{"hlsl.flattenSubset2.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.forLoop.frag", "PixelShaderFunction"},
{"hlsl.gather.array.dx10.frag", "main"},
{"hlsl.gather.basic.dx10.frag", "main"},
{"hlsl.gather.basic.dx10.vert", "main"},
{"hlsl.gather.offset.dx10.frag", "main"},
{"hlsl.gather.offsetarray.dx10.frag", "main"},
2017-03-12 00:55:30 +03:00
{"hlsl.gathercmpRGBA.offset.dx10.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.gatherRGBA.array.dx10.frag", "main"},
{"hlsl.gatherRGBA.basic.dx10.frag", "main"},
{"hlsl.gatherRGBA.offset.dx10.frag", "main"},
{"hlsl.gatherRGBA.offsetarray.dx10.frag", "main"},
{"hlsl.getdimensions.dx10.frag", "main"},
{"hlsl.getdimensions.rw.dx10.frag", "main"},
{"hlsl.getdimensions.dx10.vert", "main"},
{"hlsl.getsampleposition.dx10.frag", "main"},
2017-07-16 19:57:18 +03:00
{"hlsl.global-const-init.frag", "main"},
2017-11-20 00:01:01 +03:00
{"hlsl.gs-hs-mix.tesc", "HSMain"},
2017-04-01 05:51:51 +03:00
{"hlsl.domain.1.tese", "main"},
2017-04-08 06:11:36 +03:00
{"hlsl.domain.2.tese", "main"},
{"hlsl.domain.3.tese", "main"},
2017-05-27 19:40:00 +03:00
{"hlsl.function.frag", "main"},
2017-02-11 07:27:07 +03:00
{"hlsl.hull.1.tesc", "main"},
{"hlsl.hull.2.tesc", "main"},
2017-07-01 05:37:56 +03:00
{"hlsl.hull.3.tesc", "main"},
2017-09-16 06:46:49 +03:00
{"hlsl.hull.4.tesc", "main"},
{"hlsl.hull.5.tesc", "main"},
2017-02-11 07:27:07 +03:00
{"hlsl.hull.void.tesc", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.hull.ctrlpt-1.tesc", "main"},
2017-04-08 06:11:36 +03:00
{"hlsl.hull.ctrlpt-2.tesc", "main"},
2018-05-19 19:38:04 +03:00
{"hlsl.groupid.comp", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.identifier.sample.frag", "main"},
{"hlsl.if.frag", "PixelShaderFunction"},
2018-02-28 09:52:56 +03:00
{"hlsl.imagefetch-subvec4.comp", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.implicitBool.frag", "main"},
2017-04-15 07:17:34 +03:00
{"hlsl.inf.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.inoutquals.frag", "main"},
{"hlsl.init.frag", "ShaderFunction"},
{"hlsl.init2.frag", "main"},
2017-04-08 06:11:36 +03:00
{"hlsl.isfinite.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.evalfns.frag", "main"},
2017-01-05 07:34:04 +03:00
{"hlsl.intrinsics.d3dcolortoubyte4.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.intrinsics.double.frag", "PixelShaderFunction"},
2017-03-04 07:12:06 +03:00
{"hlsl.intrinsics.f1632.frag", "main"},
{"hlsl.intrinsics.f3216.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.intrinsics.frag", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.intrinsic.frexp.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.intrinsics.lit.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.negative.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.negative.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.negative.vert", "VertexShaderFunction"},
2016-12-17 23:38:22 +03:00
{"hlsl.intrinsics.promote.frag", "main"},
{"hlsl.intrinsics.promote.down.frag", "main"},
{"hlsl.intrinsics.promote.outputs.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.layout.frag", "main"},
2017-12-10 00:50:23 +03:00
{"hlsl.layoutOverride.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.load.2dms.dx10.frag", "main"},
{"hlsl.load.array.dx10.frag", "main"},
{"hlsl.load.basic.dx10.frag", "main"},
{"hlsl.load.basic.dx10.vert", "main"},
{"hlsl.load.buffer.dx10.frag", "main"},
{"hlsl.load.buffer.float.dx10.frag", "main"},
{"hlsl.load.rwbuffer.dx10.frag", "main"},
{"hlsl.load.rwtexture.dx10.frag", "main"},
{"hlsl.load.rwtexture.array.dx10.frag", "main"},
{"hlsl.load.offset.dx10.frag", "main"},
{"hlsl.load.offsetarray.dx10.frag", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.localStructuredBuffer.comp", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.logical.binary.frag", "main"},
{"hlsl.logical.binary.vec.frag", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.logicalConvert.frag", "main"},
{"hlsl.logical.unary.frag", "main"},
2017-05-06 10:12:46 +03:00
{"hlsl.loopattr.frag", "main"},
2017-08-12 05:58:06 +03:00
{"hlsl.matpack-pragma.frag", "main"},
2017-05-20 06:23:01 +03:00
{"hlsl.mip.operator.frag", "main"},
{"hlsl.mip.negative.frag", "main"},
{"hlsl.mip.negative2.frag", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.namespace.frag", "main"},
2017-04-08 06:11:36 +03:00
{"hlsl.nonint-index.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.matNx1.frag", "main"},
2017-08-12 05:58:06 +03:00
{"hlsl.matpack-1.frag", "main"},
2017-01-20 22:14:16 +03:00
{"hlsl.matrixSwizzle.vert", "ShaderFunction"},
2017-05-20 06:23:01 +03:00
{"hlsl.memberFunCall.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.mintypes.frag", "main"},
2017-12-04 05:21:39 +03:00
{"hlsl.mul-truncate.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.multiEntry.vert", "RealEntrypoint"},
{"hlsl.multiReturn.frag", "main"},
{"hlsl.matrixindex.frag", "main"},
2017-03-25 06:03:12 +03:00
{"hlsl.nonstaticMemberFunction.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.numericsuffixes.frag", "main"},
2018-02-03 06:03:03 +03:00
{"hlsl.numthreads.comp", "main_aux2"},
2016-12-16 01:19:54 +03:00
{"hlsl.overload.frag", "PixelShaderFunction"},
2017-09-11 07:36:21 +03:00
{"hlsl.opaque-type-bug.frag", "main"},
2017-01-05 07:34:04 +03:00
{"hlsl.params.default.frag", "main"},
{"hlsl.params.default.negative.frag", "main"},
2016-12-17 23:38:22 +03:00
{"hlsl.partialInit.frag", "PixelShaderFunction"},
2017-10-20 18:19:20 +03:00
{"hlsl.partialFlattenLocal.vert", "main"},
2017-12-10 00:50:23 +03:00
{"hlsl.PointSize.geom", "main"},
{"hlsl.PointSize.vert", "main"},
2017-06-11 06:51:54 +03:00
{"hlsl.pp.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.pp.line.frag", "main"},
{"hlsl.precise.frag", "main"},
2016-12-17 23:38:22 +03:00
{"hlsl.promote.atomic.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.promote.binary.frag", "main"},
{"hlsl.promote.vec1.frag", "main"},
{"hlsl.promotions.frag", "main"},
{"hlsl.rw.atomics.frag", "main"},
{"hlsl.rw.bracket.frag", "main"},
{"hlsl.rw.register.frag", "main"},
{"hlsl.rw.scalar.bracket.frag", "main"},
2017-01-12 07:33:31 +03:00
{"hlsl.rw.swizzle.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.rw.vec2.bracket.frag", "main"},
{"hlsl.sample.array.dx10.frag", "main"},
{"hlsl.sample.basic.dx10.frag", "main"},
{"hlsl.sample.offset.dx10.frag", "main"},
{"hlsl.sample.offsetarray.dx10.frag", "main"},
{"hlsl.samplebias.array.dx10.frag", "main"},
{"hlsl.samplebias.basic.dx10.frag", "main"},
{"hlsl.samplebias.offset.dx10.frag", "main"},
{"hlsl.samplebias.offsetarray.dx10.frag", "main"},
{"hlsl.samplecmp.array.dx10.frag", "main"},
{"hlsl.samplecmp.basic.dx10.frag", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.samplecmp.dualmode.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.samplecmp.offset.dx10.frag", "main"},
{"hlsl.samplecmp.offsetarray.dx10.frag", "main"},
2017-04-22 10:26:44 +03:00
{"hlsl.samplecmp.negative.frag", "main"},
{"hlsl.samplecmp.negative2.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.samplecmplevelzero.array.dx10.frag", "main"},
{"hlsl.samplecmplevelzero.basic.dx10.frag", "main"},
{"hlsl.samplecmplevelzero.offset.dx10.frag", "main"},
{"hlsl.samplecmplevelzero.offsetarray.dx10.frag", "main"},
{"hlsl.samplegrad.array.dx10.frag", "main"},
{"hlsl.samplegrad.basic.dx10.frag", "main"},
{"hlsl.samplegrad.basic.dx10.vert", "main"},
{"hlsl.samplegrad.offset.dx10.frag", "main"},
{"hlsl.samplegrad.offsetarray.dx10.frag", "main"},
{"hlsl.samplelevel.array.dx10.frag", "main"},
{"hlsl.samplelevel.basic.dx10.frag", "main"},
{"hlsl.samplelevel.basic.dx10.vert", "main"},
{"hlsl.samplelevel.offset.dx10.frag", "main"},
{"hlsl.samplelevel.offsetarray.dx10.frag", "main"},
{"hlsl.sample.sub-vec4.dx10.frag", "main"},
2017-04-01 05:51:51 +03:00
{"hlsl.scalar-length.frag", "main"},
2017-04-08 06:11:36 +03:00
{"hlsl.scalarCast.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.semicolons.frag", "main"},
{"hlsl.shapeConv.frag", "main"},
{"hlsl.shapeConvRet.frag", "main"},
2018-05-26 18:40:25 +03:00
{"hlsl.self_cast.frag", "main"},
2017-11-20 00:01:01 +03:00
{"hlsl.snorm.uav.comp", "main"},
2017-03-12 00:55:30 +03:00
{"hlsl.staticMemberFunction.frag", "main"},
2018-07-14 19:26:19 +03:00
{"hlsl.staticFuncInit.frag", "main"},
2017-12-04 05:21:39 +03:00
{"hlsl.store.rwbyteaddressbuffer.type.comp", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.stringtoken.frag", "main"},
{"hlsl.string.frag", "main"},
2017-01-05 07:34:04 +03:00
{"hlsl.struct.split-1.vert", "main"},
{"hlsl.struct.split.array.geom", "main"},
2017-01-20 22:14:16 +03:00
{"hlsl.struct.split.assign.frag", "main"},
2017-01-05 07:34:04 +03:00
{"hlsl.struct.split.call.vert", "main"},
{"hlsl.struct.split.nested.geom", "main"},
{"hlsl.struct.split.trivial.geom", "main"},
{"hlsl.struct.split.trivial.vert", "main"},
2016-12-17 23:38:22 +03:00
{"hlsl.structarray.flatten.frag", "main"},
{"hlsl.structarray.flatten.geom", "main"},
2017-02-25 06:28:48 +03:00
{"hlsl.structbuffer.frag", "main"},
2017-04-22 10:26:44 +03:00
{"hlsl.structbuffer.append.frag", "main"},
2017-05-20 06:23:01 +03:00
{"hlsl.structbuffer.append.fn.frag", "main"},
2017-02-25 06:28:48 +03:00
{"hlsl.structbuffer.atomics.frag", "main"},
{"hlsl.structbuffer.byte.frag", "main"},
{"hlsl.structbuffer.coherent.frag", "main"},
2017-04-22 10:26:44 +03:00
{"hlsl.structbuffer.floatidx.comp", "main"},
{"hlsl.structbuffer.incdec.frag", "main"},
2017-03-04 07:12:06 +03:00
{"hlsl.structbuffer.fn.frag", "main"},
2017-04-22 10:26:44 +03:00
{"hlsl.structbuffer.fn2.comp", "main"},
2017-02-25 06:28:48 +03:00
{"hlsl.structbuffer.rw.frag", "main"},
{"hlsl.structbuffer.rwbyte.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.structin.vert", "main"},
2017-02-11 07:27:07 +03:00
{"hlsl.structIoFourWay.frag", "main"},
2017-03-04 07:12:06 +03:00
{"hlsl.structStructName.frag", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.subpass.frag", "main"},
2017-06-25 21:06:36 +03:00
{"hlsl.synthesizeInput.frag", "main"},
2017-11-20 00:01:01 +03:00
{"hlsl.texturebuffer.frag", "main"},
2017-08-26 05:42:26 +03:00
{"hlsl.texture.struct.frag", "main"},
2017-06-11 06:51:54 +03:00
{"hlsl.texture.subvec4.frag", "main"},
2017-03-25 06:03:12 +03:00
{"hlsl.this.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.intrinsics.vert", "VertexShaderFunction"},
2017-04-01 05:51:51 +03:00
{"hlsl.intrinsic.frexp.vert", "VertexShaderFunction"},
2016-12-16 01:19:54 +03:00
{"hlsl.matType.frag", "PixelShaderFunction"},
{"hlsl.matType.bool.frag", "main"},
{"hlsl.matType.int.frag", "main"},
{"hlsl.max.frag", "PixelShaderFunction"},
2017-09-02 05:08:30 +03:00
{"hlsl.preprocessor.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.precedence.frag", "PixelShaderFunction"},
{"hlsl.precedence2.frag", "PixelShaderFunction"},
2017-06-17 05:16:50 +03:00
{"hlsl.scalar2matrix.frag", "main"},
2017-03-12 00:55:30 +03:00
{"hlsl.semantic.geom", "main"},
{"hlsl.semantic.vert", "main"},
2017-09-02 05:08:30 +03:00
{"hlsl.semantic-1.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.scope.frag", "PixelShaderFunction"},
{"hlsl.sin.frag", "PixelShaderFunction"},
{"hlsl.struct.frag", "PixelShaderFunction"},
{"hlsl.switch.frag", "PixelShaderFunction"},
{"hlsl.swizzle.frag", "PixelShaderFunction"},
2017-07-01 05:37:56 +03:00
{"hlsl.target.frag", "main"},
{"hlsl.targetStruct1.frag", "main"},
{"hlsl.targetStruct2.frag", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.templatetypes.frag", "PixelShaderFunction"},
2018-05-19 19:38:04 +03:00
{"hlsl.tristream-append.geom", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.tx.bracket.frag", "main"},
2017-05-27 19:40:00 +03:00
{"hlsl.tx.overload.frag", "main"},
2017-01-05 07:34:04 +03:00
{"hlsl.type.half.frag", "main"},
{"hlsl.type.identifier.frag", "main"},
2017-02-11 07:27:07 +03:00
{"hlsl.typeGraphCopy.vert", "main"},
2016-12-16 01:19:54 +03:00
{"hlsl.typedef.frag", "PixelShaderFunction"},
{"hlsl.whileLoop.frag", "PixelShaderFunction"},
2018-11-17 11:09:17 +03:00
{"hlsl.void.frag", "PixelShaderFunction"},
{"hlsl.type.type.conversion.all.frag", "main"}
2016-12-16 01:19:54 +03:00
}),
2018-03-11 02:03:31 +03:00
FileNameAsCustomTestSuffix
);
// clang-format on
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslVulkan1_1CompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.wavebroadcast.comp", "CSMain"},
{"hlsl.waveprefix.comp", "CSMain"},
{"hlsl.wavequad.comp", "CSMain"},
{"hlsl.wavequery.comp", "CSMain"},
{"hlsl.wavequery.frag", "PixelShaderFunction"},
{"hlsl.wavereduction.comp", "CSMain"},
{"hlsl.wavevote.comp", "CSMain"},
2018-11-17 11:09:17 +03:00
{ "hlsl.type.type.conversion.valid.frag", "main" },
{"hlsl.int.dot.frag", "main"}
2018-03-11 02:03:31 +03:00
}),
2016-12-16 01:19:54 +03:00
FileNameAsCustomTestSuffix
);
// clang-format on
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslCompileAndFlattenTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.array.flatten.frag", "main"},
2017-10-20 18:19:20 +03:00
{"hlsl.partialFlattenMixed.vert", "main"},
2016-12-16 01:19:54 +03:00
}),
FileNameAsCustomTestSuffix
);
2017-09-30 07:22:46 +03:00
// clang-format on
2016-12-16 01:19:54 +03:00
2018-04-01 18:45:28 +03:00
#if ENABLE_OPT
2017-09-30 07:22:46 +03:00
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslLegalizeTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.aliasOpaque.frag", "main"},
{"hlsl.flattenOpaque.frag", "main"},
{"hlsl.flattenOpaqueInit.vert", "main"},
2017-10-07 10:52:44 +03:00
{"hlsl.flattenOpaqueInitMix.vert", "main"},
2017-11-20 00:01:01 +03:00
{"hlsl.flattenSubset.frag", "main"},
{"hlsl.flattenSubset2.frag", "main"},
{"hlsl.partialFlattenLocal.vert", "main"},
{"hlsl.partialFlattenMixed.vert", "main"}
2017-09-30 07:22:46 +03:00
}),
FileNameAsCustomTestSuffix
);
2016-12-16 01:19:54 +03:00
// clang-format on
2017-09-30 07:22:46 +03:00
#endif
2018-12-09 03:38:05 +03:00
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslDebugTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.pp.line2.frag", "MainPs"}
}),
FileNameAsCustomTestSuffix
);
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslDX9CompatibleTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.sample.dx9.frag", "main"},
{"hlsl.sample.dx9.vert", "main"},
}),
FileNameAsCustomTestSuffix
);
2018-12-23 05:40:47 +03:00
// clang-format off
INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslLegalDebugTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.pp.line4.frag", "MainPs"}
}),
FileNameAsCustomTestSuffix
);
2018-12-09 03:38:05 +03:00
// clang-format on
2016-12-16 01:19:54 +03:00
} // anonymous namespace
} // namespace glslangtest