| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "../igpuinfo.h" |
| 7 | #include "core/idatasource.h" |
| 8 | #include <cstddef> |
| 9 | #include <memory> |
| 10 | #include <string> |
| 11 | #include <string_view> |
| 12 | |
| 13 | class GPUInfoVulkan final : public IGPUInfo::IProvider |
| 14 | { |
| 15 | public: |
| 16 | struct Keys |
| 17 | { |
| 18 | static constexpr std::string_view apiVersion{"vkapiv"}; |
| 19 | }; |
| 20 | |
| 21 | GPUInfoVulkan(std::unique_ptr<IDataSource<std::string>> &&dataSource) noexcept; |
| 22 | |
| 23 | std::vector<std::pair<std::string, std::string>> |
| 24 | provideInfo(Vendor vendor, int gpuIndex, IGPUInfo::Path const &path, |
| 25 | IHWIDTranslator const &hwIDTranslator) const override; |
| 26 | |
| 27 | std::vector<std::string> |
| 28 | provideCapabilities(Vendor vendor, int, |
| 29 | IGPUInfo::Path const &path) const override; |
| 30 | |
| 31 | private: |
| 32 | std::string parseApiVersion(std::string const &src, size_t pos) const; |
| 33 | |
| 34 | std::unique_ptr<IDataSource<std::string>> const dataSource_; |
| 35 | static bool registered_; |
| 36 | }; |