Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/generators/dispatch_table_helper_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def generate(self):
#include <vulkan/vulkan.h>
#include <vulkan/vk_layer.h>
#include <string.h>
#include "vk_layer_dispatch_table.h"
#ifdef VULKANSC
#include "loader/generated-vksc/vk_layer_dispatch_table.h"
#else
#include "loader/generated/vk_layer_dispatch_table.h"
#endif // VULKANSC

''')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include <vulkan/vulkan.h>
#include <vulkan/vk_layer.h>
#include <string.h>
#include "vk_layer_dispatch_table.h"
#ifdef VULKANSC
#include "loader/generated-vksc/vk_layer_dispatch_table.h"
#else
#include "loader/generated/vk_layer_dispatch_table.h"
#endif // VULKANSC

// clang-format off
static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDispatchTable *table, PFN_vkGetDeviceProcAddr gpa) {
Expand Down
6 changes: 5 additions & 1 deletion tests/framework/layer/generated/vk_dispatch_table_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include <vulkan/vulkan.h>
#include <vulkan/vk_layer.h>
#include <string.h>
#include "vk_layer_dispatch_table.h"
#ifdef VULKANSC
#include "loader/generated-vksc/vk_layer_dispatch_table.h"
#else
#include "loader/generated/vk_layer_dispatch_table.h"
#endif // VULKANSC

// clang-format off
static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDispatchTable *table, PFN_vkGetDeviceProcAddr gpa) {
Expand Down
9 changes: 2 additions & 7 deletions tests/framework/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ if(UNIX)
target_compile_options(testing_framework_util PUBLIC -fPIC)
endif()
# Gives access to all headers in this folder, the framework folder, the framework binary folder, and the loader/generated folder
if(VULKANSC)
target_include_directories(testing_framework_util
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/.." "${CMAKE_CURRENT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/loader/generated-vksc")
else()
target_include_directories(testing_framework_util
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/.." "${CMAKE_CURRENT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}")
endif()
target_include_directories(testing_framework_util
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/.." "${CMAKE_CURRENT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}")

if (UNIX)
if (LOADER_ENABLE_ADDRESS_SANITIZER)
Expand Down
6 changes: 4 additions & 2 deletions tests/loader_envvar_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ TEST(EnvVarICDOverrideSetup, TestOnlyDriverEnvVarInFolder) {
EXPECT_FALSE(
env.debug_log.find("Ignoring override VK_ICD_FILENAMES, VK_DRIVER_FILES, and VK_ADD_DRIVER_FILES due to high-integrity"));

// The availability of Get Device Properties 2 and using linux device sort cause duplicately reported devices
#if defined(VULKANSC) // The availability of GPDP2 in Vulkan SC and using linux device sort cause duplicately reported devices
#if TESTING_COMMON_UNIX_PLATFORMS
std::array<VkPhysicalDevice, 9> phys_devs_array;
#else
std::array<VkPhysicalDevice, 5> phys_devs_array;
#endif
#endif // VULKANSC
uint32_t phys_dev_count = 1;
ASSERT_EQ(inst1->vkEnumeratePhysicalDevices(inst1.inst, &phys_dev_count, phys_devs_array.data()), VK_SUCCESS);
ASSERT_EQ(phys_dev_count, 1U);
Expand All @@ -178,7 +179,7 @@ TEST(EnvVarICDOverrideSetup, TestOnlyDriverEnvVarInFolder) {
InstWrapper inst2{env.vulkan_functions};
inst2.CheckCreate();

// The availability of Get Device Properties 2 and using linux device sort cause duplicately reported devices
#if defined(VULKANSC) // The availability of GPDP2 in Vulkan SC and using linux device sort cause duplicately reported devices
#if TESTING_COMMON_UNIX_PLATFORMS
phys_dev_count = 9;
ASSERT_EQ(inst2->vkEnumeratePhysicalDevices(inst2.inst, &phys_dev_count, phys_devs_array.data()), VK_SUCCESS);
Expand All @@ -188,6 +189,7 @@ TEST(EnvVarICDOverrideSetup, TestOnlyDriverEnvVarInFolder) {
ASSERT_EQ(inst2->vkEnumeratePhysicalDevices(inst2.inst, &phys_dev_count, phys_devs_array.data()), VK_SUCCESS);
ASSERT_EQ(phys_dev_count, 5U);
#endif
#endif // VULKANSC
}
// Test VK_DRIVER_FILES environment variable containing a path to a folder with elevated privileges
TEST(EnvVarICDOverrideSetup, TestOnlyDriverEnvVarInFolderWithElevatedPrivileges) {
Expand Down