From 33e9ad7116ca5771e31e37f7ef3fce515a74691e Mon Sep 17 00:00:00 2001 From: Christophe Date: Tue, 29 Aug 2023 16:23:51 +0200 Subject: [PATCH] layer: remove VK_LAYER_SETTING_TYPE_FRAMESET_EXT After VK_EXT_layer_settings spec review, this new type was judge unnecessary because it could be express by three uint32. However, it still remains useful for the layer settings library to correctly interpret formated strings that represent "framesets". --- include/vulkan/layer/vk_layer_settings.h | 29 +++- include/vulkan/layer/vk_layer_settings.hpp | 6 +- include/vulkan/layer/vk_layer_settings_ext.h | 9 +- src/layer/layer_settings_util.cpp | 10 +- src/layer/layer_settings_util.hpp | 6 +- src/layer/vk_layer_settings.cpp | 139 +++++++++++++------ src/layer/vk_layer_settings_helper.cpp | 64 ++++----- tests/layer/test_setting_api.cpp | 74 +++++----- tests/layer/test_setting_cast.cpp | 51 ++++--- tests/layer/test_setting_cpp.cpp | 14 +- tests/layer/test_setting_env.cpp | 56 ++++---- tests/layer/test_setting_file.cpp | 56 ++++---- tests/layer/test_setting_util.cpp | 26 ++-- 13 files changed, 310 insertions(+), 230 deletions(-) diff --git a/include/vulkan/layer/vk_layer_settings.h b/include/vulkan/layer/vk_layer_settings.h index 7859f5c..9cc1642 100644 --- a/include/vulkan/layer/vk_layer_settings.h +++ b/include/vulkan/layer/vk_layer_settings.h @@ -15,8 +15,35 @@ extern "C" { #include "vk_layer_settings_ext.h" +typedef enum VlLayerSettingType { + VL_LAYER_SETTING_TYPE_BOOL32 = VK_LAYER_SETTING_TYPE_BOOL32_EXT, + VL_LAYER_SETTING_TYPE_INT32 = VK_LAYER_SETTING_TYPE_INT32_EXT, + VL_LAYER_SETTING_TYPE_INT64 = VK_LAYER_SETTING_TYPE_INT64_EXT, + VL_LAYER_SETTING_TYPE_UINT32 = VK_LAYER_SETTING_TYPE_UINT32_EXT, + VL_LAYER_SETTING_TYPE_UINT64 = VK_LAYER_SETTING_TYPE_UINT64_EXT, + VL_LAYER_SETTING_TYPE_FLOAT32 = VK_LAYER_SETTING_TYPE_FLOAT32_EXT, + VL_LAYER_SETTING_TYPE_FLOAT64 = VK_LAYER_SETTING_TYPE_FLOAT64_EXT, + VL_LAYER_SETTING_TYPE_STRING = VK_LAYER_SETTING_TYPE_STRING_EXT, + VL_LAYER_SETTING_TYPE_FRAMESET, + VL_LAYER_SETTING_TYPE_FRAMESET_STRING +} VlLayerSettingType; + VK_DEFINE_HANDLE(VlLayerSettingSet) +// - `first` is an integer related to the first frame to be processed. +// The frame numbering is 0-based. +// - `count` is an integer related to the number of frames to be +// processed. A count of zero represents every frame after the start of the range. +// - `step` is an integer related to the interval between frames. A step of zero +// represent no frame to be processed. +// between frames to be processed. + +typedef struct VlFrameset { + uint32_t first; + uint32_t count; + uint32_t step; +} VlFrameset; + typedef void (VKAPI_PTR *VlLayerSettingLogCallback)(const char *pSettingName, const char *pMessage); // Create a layer setting set. If 'pCallback' is set to NULL, the messages are outputed to stderr. @@ -30,7 +57,7 @@ void vlDestroyLayerSettingSet(VlLayerSettingSet layerSettingSet, const VkAllocat VkBool32 vlHasLayerSetting(VlLayerSettingSet layerSettingSet, const char *pSettingName); // Query setting values -VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, VkLayerSettingTypeEXT type, +VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, VlLayerSettingType type, uint32_t *pValueCount, void *pValues); const VkLayerSettingsCreateInfoEXT *vlFindLayerSettingsCreateInfo(const VkInstanceCreateInfo *pCreateInfo); diff --git a/include/vulkan/layer/vk_layer_settings.hpp b/include/vulkan/layer/vk_layer_settings.hpp index bed8239..8cd3e2f 100644 --- a/include/vulkan/layer/vk_layer_settings.hpp +++ b/include/vulkan/layer/vk_layer_settings.hpp @@ -62,10 +62,10 @@ void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues); void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, - const char *pSettingName, VkFramesetEXT &settingValue); + const char *pSettingName, VlFrameset &settingValue); -void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, - std::vector &settingValues); +void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, + const char *pSettingName, std::vector &settingValues); // Required by vk_safe_struct typedef std::pair VlCustomSTypeInfo; diff --git a/include/vulkan/layer/vk_layer_settings_ext.h b/include/vulkan/layer/vk_layer_settings_ext.h index 3485770..384e4a2 100644 --- a/include/vulkan/layer/vk_layer_settings_ext.h +++ b/include/vulkan/layer/vk_layer_settings_ext.h @@ -31,16 +31,9 @@ typedef enum VkLayerSettingTypeEXT { VK_LAYER_SETTING_TYPE_UINT64_EXT, VK_LAYER_SETTING_TYPE_FLOAT32_EXT, VK_LAYER_SETTING_TYPE_FLOAT64_EXT, - VK_LAYER_SETTING_TYPE_STRING_EXT, - VK_LAYER_SETTING_TYPE_FRAMESET_EXT + VK_LAYER_SETTING_TYPE_STRING_EXT } VkLayerSettingTypeEXT; -typedef struct VkFramesetEXT { - uint32_t first; - uint32_t count; - uint32_t step; -} VkFramesetEXT; - typedef struct VkLayerSettingEXT { const char *pLayerName; const char *pSettingName; diff --git a/src/layer/layer_settings_util.cpp b/src/layer/layer_settings_util.cpp index 1b8226d..d475406 100644 --- a/src/layer/layer_settings_util.cpp +++ b/src/layer/layer_settings_util.cpp @@ -198,10 +198,10 @@ int64_t ToInt64(const std::string &token) { return int_id; } -VkFramesetEXT ToFrameSet(const std::string &s) { +VlFrameset ToFrameSet(const std::string &s) { assert(IsFrameSets(s)); - VkFramesetEXT frameset{0, 1, 1}; + VlFrameset frameset{0, 1, 1}; const std::vector &frameset_split = vl::Split(s, '-'); if (frameset_split.size() >= 1) { @@ -217,10 +217,10 @@ VkFramesetEXT ToFrameSet(const std::string &s) { return frameset; } -std::vector ToFrameSets(const std::string &s) { +std::vector ToFrameSets(const std::string &s) { std::vector tokens = Split(s, FindDelimiter(s)); - std::vector results; + std::vector results; results.resize(tokens.size()); for (std::size_t i = 0, n = tokens.size(); i < n; ++i) { results[i] = ToFrameSet(tokens[i]); @@ -247,7 +247,7 @@ bool IsFloat(const std::string &s) { return std::regex_search(s, FRAME_REGEX); } -std::string Format(const char *message, ...) { +std::string FormatString(const char *message, ...) { std::size_t const STRING_BUFFER(4096); assert(message != nullptr); diff --git a/src/layer/layer_settings_util.hpp b/src/layer/layer_settings_util.hpp index 6211106..ba91022 100644 --- a/src/layer/layer_settings_util.hpp +++ b/src/layer/layer_settings_util.hpp @@ -62,14 +62,14 @@ namespace vl { bool IsFrameSets(const std::string &s); - VkFramesetEXT ToFrameSet(const std::string &s); + VlFrameset ToFrameSet(const std::string &s); - std::vector ToFrameSets(const std::string &s); + std::vector ToFrameSets(const std::string &s); bool IsInteger(const std::string &s); bool IsFloat(const std::string &s); - std::string Format(const char *message, ...); + std::string FormatString(const char *message, ...); } // namespace vl diff --git a/src/layer/vk_layer_settings.cpp b/src/layer/vk_layer_settings.cpp index 2e60f3e..698b4a5 100644 --- a/src/layer/vk_layer_settings.cpp +++ b/src/layer/vk_layer_settings.cpp @@ -62,7 +62,7 @@ VkBool32 vlHasLayerSetting(VlLayerSettingSet layerSettingSet, const char *pSetti return (has_env_setting || has_file_setting || has_api_setting) ? VK_TRUE : VK_FALSE; } -VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, VkLayerSettingTypeEXT type, +VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, VlLayerSettingType type, uint32_t *pValueCount, void *pValues) { assert(pValueCount != nullptr); @@ -104,11 +104,11 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * switch (type) { default: { - const std::string& message = vl::Format("Unknown VkLayerSettingTypeEXT `type` value: %d.", type); + const std::string &message = vl::FormatString("Unknown VkLayerSettingTypeEXT `type` value: %d.", type); layer_setting_set->Log(pSettingName, message.c_str()); return VK_ERROR_UNKNOWN; } - case VK_LAYER_SETTING_TYPE_BOOL32_EXT: { + case VL_LAYER_SETTING_TYPE_BOOL32: { std::vector values; VkResult result = VK_SUCCESS; @@ -127,7 +127,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = (setting_value == "true") ? VK_TRUE : VK_FALSE; } else { const std::string &message = - vl::Format("The data provided (%s) is not a boolean value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not a boolean value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -135,7 +135,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -155,7 +155,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_INT32_EXT: { + case VL_LAYER_SETTING_TYPE_INT32: { std::vector values; VkResult result = VK_SUCCESS; @@ -172,7 +172,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atoi(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not an integer value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not an integer value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -180,7 +180,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -200,7 +200,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_INT64_EXT: { + case VL_LAYER_SETTING_TYPE_INT64: { std::vector values; VkResult result = VK_SUCCESS; @@ -217,7 +217,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atoll(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not an integer value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not an integer value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -225,7 +225,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -245,7 +245,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_UINT32_EXT: { + case VL_LAYER_SETTING_TYPE_UINT32: { std::vector values; VkResult result = VK_SUCCESS; @@ -262,7 +262,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atoi(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not an integer value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not an integer value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -270,7 +270,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -290,7 +290,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_UINT64_EXT: { + case VL_LAYER_SETTING_TYPE_UINT64: { std::vector values; VkResult result = VK_SUCCESS; @@ -307,7 +307,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atoll(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not an integer value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not an integer value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -315,7 +315,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -335,7 +335,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_FLOAT32_EXT: { + case VL_LAYER_SETTING_TYPE_FLOAT32: { std::vector values; VkResult result = VK_SUCCESS; @@ -352,7 +352,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atof(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not a floating-point value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not a floating-point value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -360,7 +360,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -380,7 +380,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_FLOAT64_EXT: { + case VL_LAYER_SETTING_TYPE_FLOAT64: { std::vector values; VkResult result = VK_SUCCESS; @@ -397,7 +397,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = std::atof(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not a floating-point value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not a floating-point value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -405,7 +405,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + if (static_cast(api_setting->type) != type) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { if (*pValueCount < api_setting->count) { @@ -425,8 +425,8 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return result; } - case VK_LAYER_SETTING_TYPE_FRAMESET_EXT: { - std::vector values; + case VL_LAYER_SETTING_TYPE_FRAMESET: { + std::vector values; VkResult result = VK_SUCCESS; if (!settings.empty()) { // From env variable or setting file @@ -442,7 +442,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * values[i] = vl::ToFrameSet(setting_value.c_str()); } else { const std::string &message = - vl::Format("The data provided (%s) is not a FrameSet value.", setting_value.c_str()); + vl::FormatString("The data provided (%s) is not a FrameSet value.", setting_value.c_str()); layer_setting_set->Log(pSettingName, message.c_str()); } } @@ -450,27 +450,28 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * *pValueCount = static_cast(settings.size()); } } else if (api_setting != nullptr) { // From Vulkan Layer Setting API - if (api_setting->type != type) { + const uint32_t frameset_count = static_cast(api_setting->count / (sizeof(VlFrameset) / sizeof(VlFrameset::count))); + if (api_setting->type != VK_LAYER_SETTING_TYPE_UINT32_EXT) { result = VK_ERROR_FORMAT_NOT_SUPPORTED; } else if (copy_values) { - if (*pValueCount < api_setting->count) { + if (*pValueCount < frameset_count) { result = VK_INCOMPLETE; } - const std::uint32_t size = std::min(*pValueCount, api_setting->count); - const VkFramesetEXT *data = static_cast(api_setting->pValues); - values.assign(data, data + size); + const std::uint32_t count = std::min(*pValueCount, frameset_count); + const VlFrameset *data = static_cast(api_setting->pValues); + values.assign(data, data + count); } else { - *pValueCount = api_setting->count; + *pValueCount = frameset_count; } } if (copy_values) { - std::copy(values.begin(), values.end(), reinterpret_cast(pValues)); + std::copy(values.begin(), values.end(), reinterpret_cast(pValues)); } return result; } - case VK_LAYER_SETTING_TYPE_STRING_EXT: { + case VL_LAYER_SETTING_TYPE_STRING: { VkResult result = VK_SUCCESS; std::vector &settings_cache = layer_setting_set->GetSettingCache(pSettingName); @@ -507,38 +508,88 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * break; case VK_LAYER_SETTING_TYPE_INT32_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%d", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%d", static_cast(api_setting->pValues)[i]); } break; case VK_LAYER_SETTING_TYPE_INT64_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%lld", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%lld", static_cast(api_setting->pValues)[i]); } break; case VK_LAYER_SETTING_TYPE_UINT32_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%u", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%u", static_cast(api_setting->pValues)[i]); } break; case VK_LAYER_SETTING_TYPE_UINT64_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%llu", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%llu", static_cast(api_setting->pValues)[i]); } break; case VK_LAYER_SETTING_TYPE_FLOAT32_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%f", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%f", static_cast(api_setting->pValues)[i]); } break; case VK_LAYER_SETTING_TYPE_FLOAT64_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - settings_cache[i] = vl::Format("%f", static_cast(api_setting->pValues)[i]); + settings_cache[i] = vl::FormatString("%f", static_cast(api_setting->pValues)[i]); } break; - case VK_LAYER_SETTING_TYPE_FRAMESET_EXT: + default: + result = VK_ERROR_FORMAT_NOT_SUPPORTED; + break; + } + } else { + *pValueCount = api_setting->count; + } + } + + if (copy_values) { + for (std::size_t i = 0, n = std::min(static_cast(*pValueCount), settings_cache.size()); i < n; ++i) { + reinterpret_cast(pValues)[i] = settings_cache[i].c_str(); + } + } + + return result; + } + case VL_LAYER_SETTING_TYPE_FRAMESET_STRING: { + VkResult result = VK_SUCCESS; + + std::vector &settings_cache = layer_setting_set->GetSettingCache(pSettingName); + + if (!settings.empty()) { // From env variable or setting file + settings_cache = settings; + + if (copy_values) { + if (static_cast(*pValueCount) < settings_cache.size()) { + result = VK_INCOMPLETE; + } + } else { + *pValueCount = static_cast(settings_cache.size()); + } + } else if (api_setting != nullptr) { // From Vulkan Layer Setting API + const std::uint32_t frameset_count = + static_cast(api_setting->count / (sizeof(VlFrameset) / sizeof(VlFrameset::count))); + + if (copy_values) { + if (*pValueCount < frameset_count) { + result = VK_INCOMPLETE; + } + const std::uint32_t size = std::min(*pValueCount, frameset_count); + settings_cache.resize(size); + + switch (api_setting->type) { + case VK_LAYER_SETTING_TYPE_STRING_EXT: + for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { + settings_cache[i] = reinterpret_cast(api_setting->pValues)[i]; + } + break; + case VK_LAYER_SETTING_TYPE_UINT32_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - const VkFramesetEXT* asFramesets = static_cast(api_setting->pValues); - settings_cache[i] = vl::Format("%d-%d-%d", asFramesets[i].first, asFramesets[i].count, asFramesets[i].step); + const VlFrameset *asFramesets = static_cast(api_setting->pValues); + settings_cache[i] = vl::FormatString("%d-%d-%d", + asFramesets[i].first, asFramesets[i].count, asFramesets[i].step); } break; default: @@ -546,7 +597,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * break; } } else { - *pValueCount = api_setting->count; + *pValueCount = frameset_count; } } diff --git a/src/layer/vk_layer_settings_helper.cpp b/src/layer/vk_layer_settings_helper.cpp index cd795bb..910cf32 100644 --- a/src/layer/vk_layer_settings_helper.cpp +++ b/src/layer/vk_layer_settings_helper.cpp @@ -24,16 +24,16 @@ static std::string Merge(const std::vector &strings) { void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, bool &settingValue) { uint32_t value_count = 1; VkBool32 pValues; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &pValues); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &pValues); settingValue = pValues == VK_TRUE; } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 0; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); if (value_count > 0) { std::vector values(value_count); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); for (std::size_t i = 0, n = values.size(); i < n; ++i) { settingValues.push_back(values[i] == VK_TRUE); } @@ -42,85 +42,85 @@ void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSet void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, int32_t &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT32, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT32, &value_count, &settingValues[0]); } } void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, int64_t &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT64, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_INT64, &value_count, &settingValues[0]); } } void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, uint32_t &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, &settingValues[0]); } } void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, uint64_t &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT64, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT64, &value_count, &settingValues[0]); } } void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, float &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &settingValues[0]); } } void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, double &settingValue) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &settingValue); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &settingValue); } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); if (value_count > 0) { settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &settingValues[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &settingValues[0]); } } @@ -132,25 +132,25 @@ void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSett void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 0; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); if (value_count > 0) { std::vector values(value_count); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); settingValues.assign(values.begin(), values.end()); } } -void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char* pSettingName, VkFramesetEXT& settingValue) { - uint32_t value_count = 1; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &settingValue); +void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char* pSettingName, VlFrameset& settingValue) { + uint32_t value_count = sizeof(VlFrameset) / sizeof(VlFrameset::count); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, &settingValue); } -void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { +void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 0; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); if (value_count > 0) { - settingValues.resize(static_cast(value_count)); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &settingValues[0]); + settingValues.resize(static_cast(value_count) / (sizeof(VlFrameset) / sizeof(VlFrameset::count))); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_UINT32, &value_count, &settingValues[0]); } } @@ -186,10 +186,10 @@ static void SetCustomStypeInfo(std::vector raw_id_list, std::vecto void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { uint32_t value_count = 0; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); if (value_count > 0) { std::vector values(value_count); - vlGetLayerSettingValues(layerSettingSet, pSettingName, VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); SetCustomStypeInfo(values, settingValues); } } diff --git a/tests/layer/test_setting_api.cpp b/tests/layer/test_setting_api.cpp index 82d2219..eecb9a9 100644 --- a/tests/layer/test_setting_api.cpp +++ b/tests/layer/test_setting_api.cpp @@ -111,13 +111,13 @@ TEST(test_layer_setting_api, vlHasLayerSetting) { setting_double_value.count = 1; settings.push_back(setting_double_value); - VkFramesetEXT value_frameset{76, 100, 10}; + VlFrameset value_frameset{76, 100, 10}; VkLayerSettingEXT setting_frameset_value{}; setting_frameset_value.pLayerName = "VK_LAYER_LUNARG_test"; setting_frameset_value.pSettingName = "frameset_value"; - setting_frameset_value.type = VK_LAYER_SETTING_TYPE_FRAMESET_EXT; + setting_frameset_value.type = VK_LAYER_SETTING_TYPE_UINT32_EXT; setting_frameset_value.pValues = &value_frameset; - setting_frameset_value.count = 1; + setting_frameset_value.count = sizeof(VlFrameset) / sizeof(VlFrameset::count); settings.push_back(setting_frameset_value); VkLayerSettingsCreateInfoEXT layer_settings_create_info; @@ -159,7 +159,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -167,7 +167,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -175,7 +175,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -200,7 +200,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -208,7 +208,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -216,7 +216,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -241,7 +241,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -249,7 +249,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -257,7 +257,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -283,7 +283,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -291,7 +291,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -299,7 +299,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -325,7 +325,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -333,7 +333,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -341,7 +341,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -367,7 +367,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Float) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -375,14 +375,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); @@ -408,7 +408,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -416,14 +416,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); @@ -433,16 +433,18 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { } TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { - std::vector input_values{ + const VlFrameset input_values[] = { {76, 100, 10}, {1, 100, 1} }; + const std::uint32_t frameset_count = + static_cast(std::size(input_values) * (sizeof(VlFrameset) / sizeof(VlFrameset::count))); - std::vector settings{ - {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, static_cast(input_values.size()), &input_values[0]} + const VkLayerSettingEXT settings[] = { + {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, frameset_count, input_values} }; - VkLayerSettingsCreateInfoEXT layer_settings_create_info{ - VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; + const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ + VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(std::size(settings)), settings}; VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); @@ -451,15 +453,15 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); - std::vector values(static_cast(value_count)); + std::vector values(static_cast(value_count)); value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -468,7 +470,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -497,7 +499,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -505,7 +507,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -513,7 +515,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); diff --git a/tests/layer/test_setting_cast.cpp b/tests/layer/test_setting_cast.cpp index 91af1d7..d6d7aa2 100644 --- a/tests/layer/test_setting_cast.cpp +++ b/tests/layer/test_setting_cast.cpp @@ -30,7 +30,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Bool) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_EQ(VK_TRUE, values[0]); @@ -39,7 +39,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Bool) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("true", string_values[0]); @@ -66,7 +66,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int32) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -75,7 +75,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int32) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); @@ -102,7 +102,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int64) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -111,7 +111,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int64) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); @@ -139,7 +139,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint32) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -148,7 +148,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint32) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); @@ -176,7 +176,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint64) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_EQ(76, values[0]); @@ -185,7 +185,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint64) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); @@ -213,7 +213,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Float) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); @@ -222,7 +222,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Float) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::strstr(string_values[0], "76.") != nullptr); @@ -250,7 +250,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); @@ -259,7 +259,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::strstr(string_values[0], "76.") != nullptr); @@ -269,12 +269,14 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { - std::vector input_values{ + const std::size_t frameset_size = (sizeof(VlFrameset) / sizeof(VlFrameset::count)); + + std::vector input_values{ {76, 100, 10}, {1, 100, 1} }; std::vector settings{ - {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, static_cast(input_values.size()), &input_values[0]} + {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, static_cast(input_values.size() * frameset_size), &input_values[0]} }; VkLayerSettingsCreateInfoEXT layer_settings_create_info{ @@ -285,11 +287,11 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); - std::vector values(input_values.size()); + std::vector values(input_values.size()); - uint32_t value_count = 2; + uint32_t value_count = 2 * frameset_size; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -297,12 +299,17 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(1, values[1].first); EXPECT_EQ(100, values[1].count); EXPECT_EQ(1, values[1].step); + EXPECT_EQ(6, value_count); + + value_count = 0; + result_complete = vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, nullptr); EXPECT_EQ(2, value_count); std::vector string_values(input_values.size()); - result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &string_values[0]); + value_count = 2; + result_complete = + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76-100-10", string_values[0]); @@ -329,7 +336,7 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_String) { uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); diff --git a/tests/layer/test_setting_cpp.cpp b/tests/layer/test_setting_cpp.cpp index 143f221..2fbfd1f 100644 --- a/tests/layer/test_setting_cpp.cpp +++ b/tests/layer/test_setting_cpp.cpp @@ -415,9 +415,9 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_String) { } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Frameset) { - const VkFramesetEXT value_data{76, 100, 10}; + const VlFrameset value_data{76, 100, 10}; - const VkLayerSettingEXT setting{"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, 1, &value_data}; + const VkLayerSettingEXT setting{"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, 3, &value_data}; const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; @@ -427,7 +427,7 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Frameset) { EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); - VkFramesetEXT pValues; + VlFrameset pValues; vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); EXPECT_EQ(76, pValues.first); @@ -438,13 +438,13 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Frameset) { } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Frameset) { - const VkFramesetEXT values_data[] = { + const VlFrameset values_data[] = { {76, 100, 10}, {1, 100, 1} }; - const uint32_t value_count = static_cast(std::size(values_data)); + const uint32_t value_count = static_cast(std::size(values_data) * (sizeof(VlFrameset) / sizeof(VlFrameset::count))); const VkLayerSettingEXT settings[] = { - {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, value_count, values_data} + {"VK_LAYER_LUNARG_test", "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, value_count, values_data} }; const uint32_t settings_size = static_cast(std::size(settings)); @@ -456,7 +456,7 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Frameset) { EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); - std::vector values; + std::vector values; vlGetLayerSettingValues(layerSettingSet, "my_setting", values); EXPECT_EQ(76, values[0].first); diff --git a/tests/layer/test_setting_env.cpp b/tests/layer/test_setting_env.cpp index 34a2195..f0a92ba 100644 --- a/tests/layer/test_setting_env.cpp +++ b/tests/layer/test_setting_env.cpp @@ -22,7 +22,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -30,7 +30,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -38,7 +38,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -57,7 +57,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -65,7 +65,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -73,7 +73,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -92,7 +92,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -100,7 +100,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -108,7 +108,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -127,7 +127,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -135,7 +135,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -143,7 +143,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -162,7 +162,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -170,7 +170,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -178,7 +178,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -197,7 +197,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Float) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -205,14 +205,14 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); @@ -231,7 +231,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Double) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -239,14 +239,14 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); @@ -265,15 +265,15 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); - std::vector values(static_cast(value_count)); + std::vector values(static_cast(value_count)); value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -282,7 +282,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -305,7 +305,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -313,7 +313,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -321,7 +321,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); diff --git a/tests/layer/test_setting_file.cpp b/tests/layer/test_setting_file.cpp index 4c37bb1..c6f17fc 100644 --- a/tests/layer/test_setting_file.cpp +++ b/tests/layer/test_setting_file.cpp @@ -23,7 +23,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -31,7 +31,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -39,7 +39,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_BOOL32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -58,7 +58,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -66,7 +66,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -74,7 +74,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -93,7 +93,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -101,7 +101,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -109,7 +109,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_INT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -128,7 +128,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -136,7 +136,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -144,7 +144,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -163,7 +163,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -171,7 +171,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -179,7 +179,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_UINT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -198,7 +198,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Float) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -206,14 +206,14 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT32_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); @@ -232,7 +232,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Double) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -240,14 +240,14 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FLOAT64_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); @@ -266,15 +266,15 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); - std::vector values(static_cast(value_count)); + std::vector values(static_cast(value_count)); value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -283,7 +283,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_FRAMESET_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -306,7 +306,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, nullptr); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -314,7 +314,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -322,7 +322,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VK_LAYER_SETTING_TYPE_STRING_EXT, &value_count, &values[0]); + vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); diff --git a/tests/layer/test_setting_util.cpp b/tests/layer/test_setting_util.cpp index e3dcc12..024dde5 100644 --- a/tests/layer/test_setting_util.cpp +++ b/tests/layer/test_setting_util.cpp @@ -397,7 +397,7 @@ TEST(test_layer_settings_util, is_framesets) { TEST(test_layer_settings_util, to_framesets) { { - std::vector framesets = vl::ToFrameSets("0"); + std::vector framesets = vl::ToFrameSets("0"); EXPECT_EQ(1, framesets.size()); EXPECT_EQ(0, framesets[0].first); @@ -406,7 +406,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("76"); + std::vector framesets = vl::ToFrameSets("76"); EXPECT_EQ(1, framesets.size()); EXPECT_EQ(76, framesets[0].first); @@ -415,7 +415,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("0-2"); + std::vector framesets = vl::ToFrameSets("0-2"); EXPECT_EQ(1, framesets.size()); EXPECT_EQ(0, framesets[0].first); @@ -424,7 +424,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("0-2,6,7"); + std::vector framesets = vl::ToFrameSets("0-2,6,7"); EXPECT_EQ(3, framesets.size()); EXPECT_EQ(0, framesets[0].first); @@ -441,7 +441,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("0-2,6-7"); + std::vector framesets = vl::ToFrameSets("0-2,6-7"); EXPECT_EQ(2, framesets.size()); EXPECT_EQ(0, framesets[0].first); @@ -454,7 +454,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-2,60,70"); + std::vector framesets = vl::ToFrameSets("1-2,60,70"); EXPECT_EQ(3, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -471,7 +471,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("10-20,60,70"); + std::vector framesets = vl::ToFrameSets("10-20,60,70"); EXPECT_EQ(3, framesets.size()); EXPECT_EQ(10, framesets[0].first); @@ -488,7 +488,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-8-2"); + std::vector framesets = vl::ToFrameSets("1-8-2"); EXPECT_EQ(1, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -497,7 +497,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-8-2,0"); + std::vector framesets = vl::ToFrameSets("1-8-2,0"); EXPECT_EQ(2, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -510,7 +510,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-8-2,10-20-5"); + std::vector framesets = vl::ToFrameSets("1-8-2,10-20-5"); EXPECT_EQ(2, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -523,7 +523,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-8,10-20-5"); + std::vector framesets = vl::ToFrameSets("1-8,10-20-5"); EXPECT_EQ(2, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -536,7 +536,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1-8-2,10-20-1"); + std::vector framesets = vl::ToFrameSets("1-8-2,10-20-1"); EXPECT_EQ(2, framesets.size()); EXPECT_EQ(1, framesets[0].first); @@ -549,7 +549,7 @@ TEST(test_layer_settings_util, to_framesets) { } { - std::vector framesets = vl::ToFrameSets("1,2,3,4"); + std::vector framesets = vl::ToFrameSets("1,2,3,4"); EXPECT_EQ(4, framesets.size()); EXPECT_EQ(1, framesets[0].first);