Update tests to use the new iomapper interface

This updates the test to use the new public GetGlslIoMapper() and
TProgram::getGlslIoResolver() entry points, instead of depending on
internal points that are not available in shared library builds.
This commit is contained in:
Arcady Goldmints-Orlov 2024-09-13 13:31:45 -07:00 committed by arcady-lunarg
parent d081b4d8c6
commit 02bc074ac4
2 changed files with 20 additions and 16 deletions

View file

@ -285,19 +285,21 @@ TEST_P(GlslMapIOTest, FromFile)
result.linkingOutput = program.getInfoLog(); result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog(); result.linkingError = program.getInfoDebugLog();
unsigned int stage = 0; glslang::TIoMapResolver *resolver;
glslang::TIntermediate* firstIntermediate = nullptr; for (unsigned stage = 0; stage < EShLangCount; stage++) {
while (!program.getIntermediate((EShLanguage)stage) && stage < EShLangCount) { stage++; } resolver = program.getGlslIoResolver((EShLanguage)stage);
firstIntermediate = program.getIntermediate((EShLanguage)stage); if (resolver)
break;
glslang::TDefaultGlslIoResolver resolver(*firstIntermediate); }
glslang::TGlslIoMapper ioMapper; glslang::TIoMapper *ioMapper = glslang::GetGlslIoMapper();
if (success) { if (success) {
success &= program.mapIO(&resolver, &ioMapper); success &= program.mapIO(resolver, ioMapper);
result.linkingOutput = program.getInfoLog(); result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog(); result.linkingError = program.getInfoDebugLog();
} }
delete ioMapper;
delete resolver;
success &= verifyIOMapping(result.linkingError, program); success &= verifyIOMapping(result.linkingError, program);
result.validationResult = success; result.validationResult = success;

View file

@ -237,19 +237,21 @@ TEST_P(VulkanRelaxedTest, FromFile)
shaders[i]->setResourceSetBinding(resourceSetBindings[i]); shaders[i]->setResourceSetBinding(resourceSetBindings[i]);
} }
unsigned int stage = 0; glslang::TIoMapResolver *resolver;
glslang::TIntermediate* firstIntermediate = nullptr; for (unsigned stage = 0; stage < EShLangCount; stage++) {
while (!program.getIntermediate((EShLanguage)stage) && stage < EShLangCount) { stage++; } resolver = program.getGlslIoResolver((EShLanguage)stage);
firstIntermediate = program.getIntermediate((EShLanguage)stage); if (resolver)
break;
glslang::TDefaultGlslIoResolver resolver(*firstIntermediate); }
glslang::TGlslIoMapper ioMapper; glslang::TIoMapper *ioMapper = glslang::GetGlslIoMapper();
if (success) { if (success) {
success &= program.mapIO(&resolver, &ioMapper); success &= program.mapIO(resolver, ioMapper);
result.linkingOutput = program.getInfoLog(); result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog(); result.linkingError = program.getInfoDebugLog();
} }
delete ioMapper;
delete resolver;
success &= verifyIOMapping(result.linkingError, program); success &= verifyIOMapping(result.linkingError, program);
result.validationResult = success; result.validationResult = success;