MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / GetEnvSettingName

Function GetEnvSettingName

vkconfig_core/vulkan_util.cpp:392–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static std::string GetEnvSettingName(const char *layer_key, const char *requested_prefix, const char *setting_key,
393 TrimMode trim_mode, bool android_sysprop) {
394 std::stringstream result;
395 const std::string prefix =
396 (requested_prefix == nullptr || trim_mode != TRIM_NAMESPACE) ? GetDefaultPrefix(android_sysprop) : requested_prefix;
397
398 if (android_sysprop) {
399 const std::string full_prefix = std::string("debug.") + prefix + ".";
400 switch (trim_mode) {
401 default:
402 case TRIM_NONE: {
403 result << full_prefix << GetFileSettingName(layer_key, setting_key);
404 break;
405 }
406 case TRIM_VENDOR: {
407 result << full_prefix << GetFileSettingName(TrimVendor(layer_key).c_str(), setting_key);
408 break;
409 }
410 case TRIM_NAMESPACE: {
411 result << full_prefix << setting_key;
412 break;
413 }
414 }
415 } else {
416 const std::string full_prefix = std::string("VK_") + (prefix.empty() ? "" : prefix + "_");
417 switch (trim_mode) {
418 default:
419 case TRIM_NONE: {
420 result << full_prefix << ToUpperCase(TrimPrefix(layer_key)) << "_" << ToUpperCase(setting_key);
421 break;
422 }
423 case TRIM_VENDOR: {
424 result << full_prefix << ToUpperCase(TrimVendor(layer_key)) << "_" << ToUpperCase(setting_key);
425 break;
426 }
427 case TRIM_NAMESPACE: {
428 result << full_prefix << ToUpperCase(setting_key);
429 break;
430 }
431 }
432 }
433
434 return result.str();
435}
436
437std::vector<std::string> BuildEnvVariablesList(const char *layer_key, const char *setting_key, bool android_sysprop) {
438 std::vector<std::string> results;

Callers 1

BuildEnvVariablesListFunction · 0.85

Calls 6

GetFileSettingNameFunction · 0.85
TrimVendorFunction · 0.85
ToUpperCaseFunction · 0.85
TrimPrefixFunction · 0.85
strMethod · 0.80
GetDefaultPrefixFunction · 0.70

Tested by

no test coverage detected