Skip to content

Commit

Permalink
layer: clean up API
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Aug 18, 2023
1 parent 33e1bd1 commit e1c25f7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 88 deletions.
5 changes: 0 additions & 5 deletions include/vulkan/layer/vk_layer_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ VK_DEFINE_HANDLE(VlLayerSettingSet)

typedef void (VKAPI_PTR *VlLayerSettingLogCallback)(const char *pSettingName, const char *pMessage);

#ifdef ENABLE_REGISTER_LAYER_SETTINGS
void vlRegistryLayerSettingsProperties(const char *pLayerName,
uint32_t propertyCount, VkLayerSettingPropertiesEXT *pProperties);
#endif // ENABLE_REGISTER_LAYER_SETTINGS

// Create a layer setting set. If 'pCallback' is set to NULL, the messages are outputed to stderr.
VkResult vlCreateLayerSettingSet(const char *pLayerName, const VkLayerSettingsCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VlLayerSettingLogCallback pCallback,
Expand Down
1 change: 0 additions & 1 deletion src/layer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ target_compile_features(VulkanLayerSettings PRIVATE cxx_std_17)
target_sources(VulkanLayerSettings PRIVATE
vk_layer_settings.cpp
vk_layer_settings_helper.cpp
vk_layer_settings_interface.cpp
layer_settings_manager.cpp
layer_settings_manager.hpp
layer_settings_util.cpp
Expand Down
8 changes: 0 additions & 8 deletions src/layer/vk_layer_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
#include <cstdint>
#include <unordered_map>

#ifdef ENABLE_REGISTER_LAYER_SETTINGS
std::unordered_map<std::string, std::pair<uint32_t, VkLayerSettingPropertiesEXT *> > layer_settings_properties;

void vlRegistryLayerSettingsProperties(const char *pLayerName, uint32_t propertyCount, VkLayerSettingPropertiesEXT *pProperties) {
layer_settings_properties.insert(std::pair(pLayerName, std::pair(propertyCount, pProperties)));
}
#endif//ENABLE_REGISTER_LAYER_SETTINGS

// This is used only for unit tests in test_layer_setting_file
void test_helper_SetLayerSetting(VlLayerSettingSet layerSettingSet, const char *pSettingName, const char *pValue) {
assert(layerSettingSet != VK_NULL_HANDLE);
Expand Down
44 changes: 0 additions & 44 deletions src/layer/vk_layer_settings_interface.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions tests/layer/test_setting_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,6 @@

#include "vulkan/layer/vk_layer_settings.h"

#ifdef ENABLE_REGISTER_LAYER_SETTINGS
TEST(test_layer_setting_api, vkEnumerateInstanceLayerSettingsEXT) {

VkLayerSettingPropertiesEXT properties[] = {
{VK_STRUCTURE_TYPE_LAYER_SETTING_PROPERTIES_EXT, nullptr, "settingA", VK_LAYER_SETTING_TYPE_BOOL32_EXT},
{VK_STRUCTURE_TYPE_LAYER_SETTING_PROPERTIES_EXT, nullptr, "settingB", VK_LAYER_SETTING_TYPE_UINT32_EXT}
};

vlRegistryLayerSettingsProperties("VK_LAYER_LUNARG_test", static_cast<uint32_t>(std::size(properties)), &properties[0]);

uint32_t result_count = 0;
vkEnumerateInstanceLayerSettingsEXT("VK_LAYER_LUNARG_test", &result_count, nullptr);

EXPECT_EQ(static_cast<uint32_t>(std::size(properties)), result_count);

std::vector<VkLayerSettingPropertiesEXT> results(static_cast<std::size_t>(result_count));
vkEnumerateInstanceLayerSettingsEXT("VK_LAYER_LUNARG_test", &result_count, &results[0]);

EXPECT_EQ(properties[0].sType, results[0].sType);
EXPECT_EQ(properties[0].pNext, results[0].pNext);
EXPECT_STREQ(properties[0].key, results[0].key);
EXPECT_EQ(properties[0].type, results[0].type);

EXPECT_EQ(properties[1].sType, results[1].sType);
EXPECT_EQ(properties[1].pNext, results[1].pNext);
EXPECT_STREQ(properties[1].key, results[1].key);
EXPECT_EQ(properties[1].type, results[1].type);
}
#endif // ENABLE_REGISTER_LAYER_SETTINGS

TEST(test_layer_setting_api, vlHasLayerSetting_NotFound) {
VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE;

Expand Down

0 comments on commit e1c25f7

Please sign in to comment.