Skip to content

Commit

Permalink
install gfxr layer for testing in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
beau-lunarg committed Jan 23, 2025
1 parent 1bfb7e5 commit 1621412
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ if (NOT DEFINED ENV{GFXRECON_NO_TEST_APPS})
install(TARGETS gfxrecon-convert RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR})
if (APPLE)
install(PROGRAMS run-tests_macos.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d LIBRARY DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
elseif (UNIX)
install(PROGRAMS run-tests.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
Expand Down
2 changes: 1 addition & 1 deletion test/run-tests_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ DISPLAY=:0 \
GFXRECON_TESTAPP_HEADLESS=true \
GFXRECON_TESTAPP_MOCK_ICD="$PWD/test_apps/libVkICD_mock_icd.dylib" \
GFXRECON_LOG_LEVEL="info" \
VK_LOADER_DEBUG="all" \
VK_LOADER_DEBUG="layer" \
./gfxrecon-testapp-runner
14 changes: 0 additions & 14 deletions test/test_apps/common/test_app_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ class VulkanFunctions
#if defined(__linux__)
if (library_path != nullptr)
{
std::cout << "looking in " << library_path << std::endl;
library = dlopen(library_path, RTLD_NOW | RTLD_LOCAL);
std::cout << "found it? : " << (library != nullptr) << std::endl;
}
if (!library)
library = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
Expand All @@ -181,11 +179,8 @@ class VulkanFunctions
#elif defined(__APPLE__)
if (library_path != nullptr)
{
std::cout << "looking in " << library_path << std::endl;
library = dlopen(library_path, RTLD_NOW | RTLD_LOCAL);
std::cout << "found it? : " << (library != nullptr) << std::endl;
}
std::cout << "looking for apple libvulkan" << std::endl;
if (!library)
library = dlopen("libvulkan.dylib", RTLD_NOW | RTLD_LOCAL);
if (!library)
Expand All @@ -195,9 +190,7 @@ class VulkanFunctions
#elif defined(_WIN32)
if (library_path != nullptr)
{
std::cout << "looking in " << library_path << std::endl;
library = LoadLibrary(library_path);
std::cout << "found it? : " << (library != nullptr) << std::endl;
}
if (!library)
library = LoadLibrary(TEXT("vulkan-1.dll"));
Expand All @@ -206,7 +199,6 @@ class VulkanFunctions
#endif
if (!library)
{
std::cout << "did not find libvulkan" << std::endl;
return false;
}
load_func(ptr_vkGetInstanceProcAddr, "vkGetInstanceProcAddr");
Expand Down Expand Up @@ -2858,7 +2850,6 @@ std::exception sdl_exception()

void device_initialization_phase_1(const std::string& window_name, InitInfo& init)
{
std::cout << "phase 1" << std::endl;
if (std::getenv("GFXRECON_TESTAPP_HEADLESS") == nullptr)
{
init.window = create_window_sdl(window_name.data(), true, 1024, 1024);
Expand All @@ -2867,7 +2858,6 @@ void device_initialization_phase_1(const std::string& window_name, InitInfo& ini

void device_initialization_phase_2(InstanceBuilder const& instance_builder, InitInfo& init)
{
std::cout << "phase 2" << std::endl;
init.instance = instance_builder.build();

init.inst_disp = init.instance.make_table();
Expand All @@ -2884,21 +2874,18 @@ void device_initialization_phase_2(InstanceBuilder const& instance_builder, Init

PhysicalDevice device_initialization_phase_3(PhysicalDeviceSelector& phys_device_selector, InitInfo& init)
{
std::cout << "phase 3" << std::endl;
return phys_device_selector.set_surface(init.surface).select();
}

void device_initialization_phase_4(DeviceBuilder const& device_builder, InitInfo& init)
{
std::cout << "phase 4" << std::endl;
init.device = device_builder.build();

init.disp = init.device.make_table();
}

void device_initialization_phase_5(SwapchainBuilder& swapchain_builder, InitInfo& init)
{
std::cout << "phase 5" << std::endl;
create_swapchain(swapchain_builder, init.swapchain);

init.swapchain_images = init.swapchain.get_images();
Expand Down Expand Up @@ -2944,7 +2931,6 @@ InitInfo device_initialization(const std::string& window_name)

device_initialization_phase_1(window_name, init);

std::cout << "loading test config" << std::endl;
init.test_config = try_load_test_config();

InstanceBuilder instance_builder;
Expand Down

0 comments on commit 1621412

Please sign in to comment.