Commit 3e57e349 by Mohan Maiya Committed by Commit Bot

Vulkan: Query application name from the system

While populating VkApplicationInfo::pApplicationName we are hardcoding the value to "ANGLE", instead query the value from the sytem. Bug: angleproject:4955 Change-Id: I222d5d1c0f497bf708389caa048d8b180c1bdecc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2352625 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 5559351c
......@@ -8,8 +8,24 @@
#include "common/system_utils.h"
#include <stdlib.h>
namespace angle
{
std::string GetExecutableName()
{
#if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 21
// Support for "getprogname" function in bionic was introduced in L (API level 21)
const char *executableName = getprogname();
return (executableName) ? std::string(executableName) : "ANGLE";
#else
std::string executableName = GetExecutablePath();
size_t lastPathSepLoc = executableName.find_last_of(GetPathSeparator());
return (lastPathSepLoc > 0 ? executableName.substr(lastPathSepLoc + 1, executableName.length())
: "ANGLE");
#endif // ANGLE_PLATFORM_ANDROID
}
bool PrependPathToEnvironmentVar(const char *variableName, const char *path)
{
std::string oldValue = GetEnvironmentVar(variableName);
......
......@@ -16,6 +16,7 @@
namespace angle
{
std::string GetExecutableName();
std::string GetExecutablePath();
std::string GetExecutableDirectory();
std::string GetHelperExecutableDir();
......
......@@ -684,7 +684,7 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
VkApplicationInfo applicationInfo = {};
applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
applicationInfo.pApplicationName = "ANGLE";
applicationInfo.pApplicationName = angle::GetExecutableName().c_str();
applicationInfo.applicationVersion = 1;
applicationInfo.pEngineName = "ANGLE";
applicationInfo.engineVersion = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment