Merge branch 'master' into textureQueryLOD
This commit is contained in:
@@ -285,6 +285,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
"atomicAdd.comp",
|
||||
"GL_ARB_gpu_shader5.u2i.vert",
|
||||
"textureQueryLOD.frag",
|
||||
"atomicCounterARBOps.vert",
|
||||
"GL_EXT_shader_integer_mix.vert",
|
||||
"GL_ARB_draw_instanced.vert",
|
||||
"BestMatchFunction.vert",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ if(BUILD_TESTING)
|
||||
install(TARGETS glslangtests EXPORT glslangtestsTargets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(EXPORT glslangtestsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
||||
endif(ENABLE_GLSLANG_INSTALL)
|
||||
endif()
|
||||
|
||||
set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
|
||||
# Supply a default test root directory, so that manual testing
|
||||
@@ -90,7 +90,7 @@ if(BUILD_TESTING)
|
||||
target_include_directories(glslangtests
|
||||
PRIVATE ${spirv-tools_SOURCE_DIR}/include
|
||||
)
|
||||
endif(ENABLE_OPT)
|
||||
endif()
|
||||
|
||||
set(LIBRARIES
|
||||
glslang OSDependent OGLCompiler glslang
|
||||
@@ -102,7 +102,7 @@ if(BUILD_TESTING)
|
||||
|
||||
if(ENABLE_HLSL)
|
||||
set(LIBRARIES ${LIBRARIES} HLSL)
|
||||
endif(ENABLE_HLSL)
|
||||
endif()
|
||||
target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock)
|
||||
|
||||
add_test(NAME glslang-gtests
|
||||
|
||||
@@ -109,7 +109,50 @@ bool verifyIOMapping(std::string& linkingError, glslang::TProgram& program) {
|
||||
success &= outQualifier.layoutLocation == inQualifier.layoutLocation;
|
||||
}
|
||||
else {
|
||||
success &= false;
|
||||
if (!in.getType()->isStruct()) {
|
||||
bool found = false;
|
||||
for (auto outIt : pipeOut) {
|
||||
if (outIt.second->getType()->isStruct()) {
|
||||
unsigned int baseLoc = outIt.second->getType()->getQualifier().hasLocation() ? outIt.second->getType()->getQualifier().layoutLocation : -1;
|
||||
for (int j = 0; j < outIt.second->getType()->getStruct()->size(); j++) {
|
||||
baseLoc = (*outIt.second->getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
||||
(*outIt.second->getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
||||
if (baseLoc != -1) {
|
||||
if (baseLoc == in.getType()->getQualifier().layoutLocation) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
baseLoc += glslang::TIntermediate::computeTypeLocationSize(*(*outIt.second->getType()->getStruct())[j].type, EShLangVertex);
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
success &= found;
|
||||
}
|
||||
else {
|
||||
unsigned int baseLoc = in.getType()->getQualifier().hasLocation() ? in.getType()->getQualifier().layoutLocation : -1;
|
||||
for (int j = 0; j < in.getType()->getStruct()->size(); j++) {
|
||||
baseLoc = (*in.getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
||||
(*in.getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
||||
if (baseLoc != -1) {
|
||||
bool isMemberFound = false;
|
||||
for (auto outIt : pipeOut) {
|
||||
if (baseLoc == outIt.second->getType()->getQualifier().layoutLocation) {
|
||||
isMemberFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isMemberFound) {
|
||||
success &= false;
|
||||
break;
|
||||
}
|
||||
baseLoc += glslang::TIntermediate::computeTypeLocationSize(*(*in.getType()->getStruct())[j].type, EShLangVertex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,6 +338,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::ValuesIn(std::vector<IoMapData>({
|
||||
{{"iomap.crossStage.vert", "iomap.crossStage.frag" }, Semantics::OpenGL},
|
||||
{{"iomap.crossStage.2.vert", "iomap.crossStage.2.geom", "iomap.crossStage.2.frag" }, Semantics::OpenGL},
|
||||
{{"iomap.blockOutVariableIn.vert", "iomap.blockOutVariableIn.frag"}, Semantics::OpenGL},
|
||||
{{"iomap.variableOutBlockIn.vert", "iomap.variableOutBlockIn.frag"}, Semantics::OpenGL},
|
||||
{{"iomap.blockOutVariableIn.2.vert", "iomap.blockOutVariableIn.geom"}, Semantics::OpenGL},
|
||||
{{"iomap.variableOutBlockIn.2.vert", "iomap.variableOutBlockIn.geom"}, Semantics::OpenGL},
|
||||
// vulkan semantics
|
||||
{{"iomap.crossStage.vk.vert", "iomap.crossStage.vk.geom", "iomap.crossStage.vk.frag" }, Semantics::Vulkan},
|
||||
}))
|
||||
|
||||
@@ -385,6 +385,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
{"hlsl.structbuffer.fn2.comp", "main"},
|
||||
{"hlsl.structbuffer.rw.frag", "main"},
|
||||
{"hlsl.structbuffer.rwbyte.frag", "main"},
|
||||
{"hlsl.structbuffer.rwbyte2.comp", "main"},
|
||||
{"hlsl.structin.vert", "main"},
|
||||
{"hlsl.structIoFourWay.frag", "main"},
|
||||
{"hlsl.structStructName.frag", "main"},
|
||||
|
||||
@@ -106,6 +106,9 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
{"link.multiAnonBlocksValid.0.0.vert", "link.multiAnonBlocksValid.0.1.vert"},
|
||||
{"link.multiBlocksInvalid.0.0.vert", "link.multiBlocksInvalid.0.1.vert"},
|
||||
{"link.multiBlocksValid.1.0.vert", "link.multiBlocksValid.1.1.vert"},
|
||||
{"link.tesselation.vert", "link.tesselation.frag"},
|
||||
{"link.tesselation.tese", "link.tesselation.tesc"},
|
||||
{"link.redeclareBuiltin.vert", "link.redeclareBuiltin.geom"},
|
||||
}))
|
||||
);
|
||||
// clang-format on
|
||||
|
||||
@@ -77,6 +77,7 @@ using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
|
||||
@@ -204,6 +205,13 @@ TEST_P(CompileVulkanToSpirvTestNV, FromFile)
|
||||
Target::Spv);
|
||||
}
|
||||
|
||||
TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
|
||||
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
|
||||
Target::Spv);
|
||||
}
|
||||
|
||||
TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
|
||||
{
|
||||
loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
|
||||
@@ -364,6 +372,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
"spv.intrinsicsSpirvLiteral.vert",
|
||||
"spv.intrinsicsSpirvStorageClass.rchit",
|
||||
"spv.intrinsicsSpirvType.rgen",
|
||||
"spv.intrinsicsSpirvTypeLocalVar.vert",
|
||||
"spv.invariantAll.vert",
|
||||
"spv.layer.tese",
|
||||
"spv.layoutNested.vert",
|
||||
"spv.length.frag",
|
||||
@@ -764,6 +774,17 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Glsl, CompileVulkanToSpirv14TestNV,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
"spv.RayGenShaderMotion.rgen",
|
||||
"spv.IntersectShaderMotion.rint",
|
||||
"spv.AnyHitShaderMotion.rahit",
|
||||
"spv.ClosestHitShaderMotion.rchit",
|
||||
"spv.MissShaderMotion.rmiss",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
|
||||
Reference in New Issue
Block a user