Skip to content

Commit 1c06649

Browse files
committed
remove NBL_API2 from the cpp, use argc/argv in vulkaninfo
1 parent 1c1b9c7 commit 1c06649

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

3rdparty/Vulkan-Tools

include/nbl/video/CVulkanConnection.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace nbl::video
1414
{
1515

16-
NBL_API2 int vulkaninfo(const std::span<const std::string_view> args);
16+
NBL_API2 int vulkaninfo(const std::span<char*> args);
1717

1818
class NBL_API2 CVulkanConnection final : public IAPIConnection
1919
{
@@ -23,8 +23,6 @@ class NBL_API2 CVulkanConnection final : public IAPIConnection
2323
core::smart_refctd_ptr<system::ILogger>&& logger, const SFeatures& featuresToEnable
2424
);
2525

26-
static void exportGpuProfiles();
27-
2826
inline VkInstance getInternalObject() const {return m_vkInstance;}
2927

3028
inline E_API_TYPE getAPIType() const override {return EAT_VULKAN;}

smoke/main.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Smoke final : public system::IApplicationFramework
3636
return false;
3737
}
3838

39-
nbl::video::vulkaninfo();
39+
exportGpuProfiles();
4040

4141
return true;
4242
}
@@ -45,7 +45,18 @@ class Smoke final : public system::IApplicationFramework
4545
bool keepRunning() override { return false; }
4646

4747
private:
48-
smart_refctd_ptr<CVulkanConnection> m_api;
48+
static void exportGpuProfiles()
49+
{
50+
for (size_t i = 0;; i++)
51+
{
52+
auto stringifiedIndex = std::to_string(i);
53+
std::array<char*, 2> args = { ("--json=" + stringifiedIndex).data(), ("-o device_" + stringifiedIndex + ".json").data() };
54+
int code = nbl::video::vulkaninfo(args);
55+
56+
if (code != 0)
57+
break;
58+
}
59+
}
4960
};
5061

5162
NBL_MAIN_FUNC(Smoke)

src/nbl/video/CVulkanConnection.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// TODO: move inside `create` and call it LOG_FAIL and return nullptr
88
#define LOG(logger, ...) if (logger) {logger->log(__VA_ARGS__);}
99

10-
extern int vulkaninfo(const std::span<const std::string_view>);
10+
extern int vulkaninfo(int, char**);
1111

1212
namespace nbl::video
1313
{
@@ -375,17 +375,9 @@ bool CVulkanConnection::endCapture()
375375
return true;
376376
}
377377

378-
void CVulkanConnection::exportGpuProfiles()
378+
int vulkaninfo(const std::span<char*> args)
379379
{
380-
for (size_t i = 0;; i++)
381-
{
382-
auto arg = "--json=" + std::to_string(i);
383-
int code = ::vulkaninfo(std::array<const std::string_view, 1>{ arg });
384-
if (code != 0)
385-
break;
386-
}
380+
return ::vulkaninfo(args.size(), args.data());
387381
}
388382

389-
NBL_API2 int vulkaninfo(const std::span<const std::string_view> args) { return ::vulkaninfo(args); }
390-
391383
}

0 commit comments

Comments
 (0)