Skip to content

Commit

Permalink
Update tests to use the new iomapper interface
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arcady-lunarg committed Sep 14, 2024
1 parent d081b4d commit 02bc074
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
18 changes: 10 additions & 8 deletions gtests/GlslMapIO.FromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,21 @@ TEST_P(GlslMapIOTest, FromFile)
result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog();

unsigned int stage = 0;
glslang::TIntermediate* firstIntermediate = nullptr;
while (!program.getIntermediate((EShLanguage)stage) && stage < EShLangCount) { stage++; }
firstIntermediate = program.getIntermediate((EShLanguage)stage);

glslang::TDefaultGlslIoResolver resolver(*firstIntermediate);
glslang::TGlslIoMapper ioMapper;
glslang::TIoMapResolver *resolver;
for (unsigned stage = 0; stage < EShLangCount; stage++) {
resolver = program.getGlslIoResolver((EShLanguage)stage);
if (resolver)
break;
}
glslang::TIoMapper *ioMapper = glslang::GetGlslIoMapper();

if (success) {
success &= program.mapIO(&resolver, &ioMapper);
success &= program.mapIO(resolver, ioMapper);
result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog();
}
delete ioMapper;
delete resolver;

success &= verifyIOMapping(result.linkingError, program);
result.validationResult = success;
Expand Down
18 changes: 10 additions & 8 deletions gtests/VkRelaxed.FromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,21 @@ TEST_P(VulkanRelaxedTest, FromFile)
shaders[i]->setResourceSetBinding(resourceSetBindings[i]);
}

unsigned int stage = 0;
glslang::TIntermediate* firstIntermediate = nullptr;
while (!program.getIntermediate((EShLanguage)stage) && stage < EShLangCount) { stage++; }
firstIntermediate = program.getIntermediate((EShLanguage)stage);

glslang::TDefaultGlslIoResolver resolver(*firstIntermediate);
glslang::TGlslIoMapper ioMapper;
glslang::TIoMapResolver *resolver;
for (unsigned stage = 0; stage < EShLangCount; stage++) {
resolver = program.getGlslIoResolver((EShLanguage)stage);
if (resolver)
break;
}
glslang::TIoMapper *ioMapper = glslang::GetGlslIoMapper();

if (success) {
success &= program.mapIO(&resolver, &ioMapper);
success &= program.mapIO(resolver, ioMapper);
result.linkingOutput = program.getInfoLog();
result.linkingError = program.getInfoDebugLog();
}
delete ioMapper;
delete resolver;

success &= verifyIOMapping(result.linkingError, program);
result.validationResult = success;
Expand Down

0 comments on commit 02bc074

Please sign in to comment.