chromium/third_party/angle/src/common/vulkan/vulkan_icd.cpp

//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// vulkan_icd.cpp : Helper for creating vulkan instances & selecting physical device.

#include "common/vulkan/vulkan_icd.h"

#include <functional>
#include <vector>

#include "common/Optional.h"
#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/system_utils.h"

namespace
{
void ResetEnvironmentVar(const char *variableName, const Optional<std::string> &value)
{}
}  // namespace

namespace angle
{

namespace vk
{

namespace
{

[[maybe_unused]] const std::string WrapICDEnvironment(const char *icdEnvironment)
{}

[[maybe_unused]] constexpr char kLoaderLayersPathEnv[] =;
[[maybe_unused]] constexpr char kLayerEnablesEnv[]     =;

constexpr char kLoaderICDFilenamesEnv[]              =;
constexpr char kANGLEPreferredDeviceEnv[]            =;
constexpr char kValidationLayersCustomSTypeListEnv[] =;
constexpr char kNoDeviceSelect[]                     =;

constexpr uint32_t kMockVendorID =;
constexpr uint32_t kMockDeviceID =;
constexpr char kMockDeviceName[] =;

constexpr uint32_t kGoogleVendorID      =;
constexpr uint32_t kSwiftShaderDeviceID =;
constexpr char kSwiftShaderDeviceName[] =;

ICDFilterFunc;

ICDFilterFunc GetFilterForICD(vk::ICD preferredICD)
{}

}  // namespace

// If we're loading the vulkan layers, we could be running from any random directory.
// Change to the executable directory so we can find the layers, then change back to the
// previous directory to be safe we don't disrupt the application.
ScopedVkLoaderEnvironment::ScopedVkLoaderEnvironment(bool enableDebugLayers, vk::ICD icd)
    :{}

ScopedVkLoaderEnvironment::~ScopedVkLoaderEnvironment()
{}

bool ScopedVkLoaderEnvironment::setICDEnvironment(const char *icd)
{}

void ChoosePhysicalDevice(PFN_vkGetPhysicalDeviceProperties pGetPhysicalDeviceProperties,
                          const std::vector<VkPhysicalDevice> &physicalDevices,
                          vk::ICD preferredICD,
                          uint32_t preferredVendorID,
                          uint32_t preferredDeviceID,
                          VkPhysicalDevice *physicalDeviceOut,
                          VkPhysicalDeviceProperties *physicalDevicePropertiesOut)
{}

}  // namespace vk

}  // namespace angle