Skip to content

Commit

Permalink
layer: Add screenshot layer workaround for setting compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Sep 4, 2023
1 parent 824cafc commit 87801a6
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/layer/layer_settings_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,25 @@ static std::string GetAndroidProperty(const char *name) {
}
#endif

static bool IsEnvironment(const char *variable) {
#if defined(__ANDROID__)
return !GetAndroidProperty(variable).empty();
#else
return std::getenv(variable) != NULL;
#endif
}

static std::string GetEnvironment(const char *variable) {
#if defined(__ANDROID__)
return GetAndroidProperty(variable);
std::string result = GetAndroidProperty(variable);
// Workaround for screenshot layer backward compatibility
if (result.empty() && std::string(variable) == "debug.vulkan.screenshot.frames") {
result = GetAndroidProperty("debug.vulkan.screenshot");
}
return result;
#else
const char *output = std::getenv(variable);
return output == NULL ? "" : output;
#endif
}

static bool IsEnvironment(const char *variable) {
const std::string& result = GetEnvironment(variable);
return !result.empty();
}

#if defined(WIN32)
// Check for admin rights
static inline bool IsHighIntegrity() {
Expand Down

0 comments on commit 87801a6

Please sign in to comment.