Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
de89a25
add a structure that holds information about vulkan devices
YasInvolved Sep 28, 2025
92fd0f0
small change in naming
YasInvolved Sep 30, 2025
a8f4dbb
store a reference to a coresponding profile in CVulkanPhysicalDevice,…
YasInvolved Sep 30, 2025
a8d9ea3
add vulkan-tools submodule and include it in nabla
YasInvolved Oct 6, 2025
67ee163
update vulkan headers, link vulkaninfo to nabla
YasInvolved Oct 8, 2025
e4207b8
link vulkaninfo as static library
YasInvolved Oct 10, 2025
dd4c7fd
update vulkan-tools
YasInvolved Oct 10, 2025
e645f4f
update vulkan-headers
YasInvolved Oct 10, 2025
824662a
fixed silly mistake in Vulkan-Tools, mimic headers from vulkansdk for…
YasInvolved Oct 10, 2025
0002aef
remove unused stuff
YasInvolved Oct 12, 2025
1361717
make vulkaninfo "callable" from nabla
YasInvolved Oct 12, 2025
9cb542d
update branch and resolve merge conflicts
YasInvolved Oct 15, 2025
6f6420b
link vulkaninfo to nabla again
YasInvolved Oct 15, 2025
471d128
make exportGpuProfile function in CVulkanConnection static
YasInvolved Oct 15, 2025
6e15b42
call exportGpuProfile in smoke
YasInvolved Oct 15, 2025
e2bb3cc
fix nonexistent vulkan-headers library
YasInvolved Oct 16, 2025
e3c34aa
do vulkan-headers stuff as it should be done from the beginning
YasInvolved Oct 18, 2025
2725307
update vulkan-tools
YasInvolved Oct 18, 2025
4c7386b
make vulkaninfo a standalone function and export a profile for all gp…
YasInvolved Oct 19, 2025
e956dca
fix broken submodule
YasInvolved Oct 19, 2025
58bceda
fix git-version-tracking
YasInvolved Oct 19, 2025
211ad29
fix dxc submodule
YasInvolved Oct 19, 2025
1c1b9c7
expose vulkaninfo to clients and parse args properly
YasInvolved Oct 23, 2025
1c06649
remove NBL_API2 from the cpp, use argc/argv in vulkaninfo
YasInvolved Oct 24, 2025
cd267ad
print out file contents
YasInvolved Oct 26, 2025
8ab07a1
remove testing line
YasInvolved Oct 26, 2025
4147b99
add verbose flag to the smoke test
YasInvolved Oct 27, 2025
f4ff861
update vulkaninfo submodule
YasInvolved Oct 27, 2025
c4ba936
fixed arguments, tiny bug, variable naming
YasInvolved Oct 27, 2025
67b1ae6
fix the operator that for some reason I thought was wrong
YasInvolved Oct 27, 2025
998616d
update vulkan-tools
YasInvolved Oct 28, 2025
1e3e3ab
download vulkansdk in ci
YasInvolved Oct 28, 2025
e28ffed
add lavapipe driver, use different action for installing vulkansdk
YasInvolved Oct 29, 2025
4845757
fixed bugs in argument parsing and file reading routine
YasInvolved Oct 29, 2025
272d26d
use const char*
YasInvolved Oct 30, 2025
d1b762d
fix smoke error
YasInvolved Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/nbl/video/CVulkanConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class NBL_API2 CVulkanConnection final : public IAPIConnection
inline E_API_TYPE getAPIType() const override {return EAT_VULKAN;}

inline IDebugCallback* getDebugCallback() const override {return m_debugCallback.get();}

inline const core::vector<core::string>& getVulkanProfiles() const { return m_vulkanProfiles; }

bool startCapture() override;
bool endCapture() override;
Expand All @@ -44,6 +46,7 @@ class NBL_API2 CVulkanConnection final : public IAPIConnection
const VkDebugUtilsMessengerEXT m_vkDebugUtilsMessengerEXT;
const std::unique_ptr<CVulkanDebugCallback> m_debugCallback; // this needs to live longer than VkDebugUtilsMessengerEXT handle above
std::atomic_flag flag;
core::vector<core::string> m_vulkanProfiles;
};

}
Expand Down
5 changes: 4 additions & 1 deletion src/nbl/video/CVulkanConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,18 @@ core::smart_refctd_ptr<CVulkanConnection> CVulkanConnection::create(core::smart_

core::smart_refctd_ptr<CVulkanConnection> api(new CVulkanConnection(vk_instance,enabledFeatures,std::move(debugCallback),vk_debugMessenger),core::dont_grab);
api->m_physicalDevices.reserve(vk_physicalDevices.size());
api->m_vulkanProfiles.reserve(vk_physicalDevices.size());
for (auto vk_physicalDevice : vk_physicalDevices)
{
auto device = CVulkanPhysicalDevice::create(core::smart_refctd_ptr(sys),api.get(),api->m_rdoc_api,vk_physicalDevice);
auto& profile = api->m_vulkanProfiles.emplace_back();
auto device = CVulkanPhysicalDevice::create(core::smart_refctd_ptr(sys),api.get(),api->m_rdoc_api,vk_physicalDevice, profile);
if (!device)
{
LOG(api->getDebugCallback()->getLogger(), "Vulkan device %p found but doesn't meet minimum Nabla requirements. Skipping!", system::ILogger::ELL_WARNING, vk_physicalDevice);
continue;
}
api->m_physicalDevices.emplace_back(std::move(device));
// device enumeration
}
#undef LOF

Expand Down
13 changes: 11 additions & 2 deletions src/nbl/video/CVulkanPhysicalDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "nbl/video/CVulkanPhysicalDevice.h"
#include "nbl/video/CVulkanLogicalDevice.h"

#include "nlohmann/json.hpp" // TODO/FIXME: this is probably a mess making, consult someone how to do it better.

namespace nbl::video
{

Expand All @@ -10,7 +12,7 @@ do { \
return nullptr; \
} while(0)

std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart_refctd_ptr<system::ISystem>&& sys, IAPIConnection* const api, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice)
std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart_refctd_ptr<system::ISystem>&& sys, IAPIConnection* const api, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice, core::string& profile)
{
system::logger_opt_ptr logger = api->getDebugCallback()->getLogger();

Expand All @@ -25,6 +27,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
}
});

using json = nlohmann::json;
json profileObject = { {"$schema", "https://schema.khronos.org/vulkan/profiles-0.8-latest.json"} };

auto& properties = initData.properties;
auto& features = initData.features;
Expand Down Expand Up @@ -263,7 +267,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
assert(VK_SUCCESS==res);

for (const auto& vk_extension : vk_extensions)
{
profileObject["capabilities"]["device"]["extensions"][vk_extension.extensionName] = vk_extension.specVersion;
availableFeatureSet.insert(vk_extension.extensionName);
}
}
auto isExtensionSupported = [&availableFeatureSet](const char* name)->bool
{
Expand Down Expand Up @@ -1366,8 +1373,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
// bufferUsages.opticalFlowCost = anyFlag(bufferFeatures,VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV);
}

profile = profileObject.dump(4); // nicely indented json

success = true;
return std::unique_ptr<CVulkanPhysicalDevice>(new CVulkanPhysicalDevice(std::move(initData),rdoc,vk_physicalDevice,std::move(availableFeatureSet)));
return std::unique_ptr<CVulkanPhysicalDevice>(new CVulkanPhysicalDevice(std::move(initData),rdoc,vk_physicalDevice,std::move(availableFeatureSet),profile));
}

#undef RETURN_NULL_PHYSICAL_DEVICE
Expand Down
9 changes: 6 additions & 3 deletions src/nbl/video/CVulkanPhysicalDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ namespace nbl::video
class CVulkanPhysicalDevice final : public IPhysicalDevice
{
public:
static std::unique_ptr<CVulkanPhysicalDevice> create(core::smart_refctd_ptr<system::ISystem>&& sys, IAPIConnection* const api, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice);
static std::unique_ptr<CVulkanPhysicalDevice> create(core::smart_refctd_ptr<system::ISystem>&& sys, IAPIConnection* const api, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice, core::string& profile);

inline VkPhysicalDevice getInternalObject() const { return m_vkPhysicalDevice; }

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

inline const core::string& getProfile() const { return m_profile; }

protected:
inline CVulkanPhysicalDevice(IPhysicalDevice::SInitData&& _initData, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice, core::unordered_set<std::string>&& _extensions)
: IPhysicalDevice(std::move(_initData)), m_rdoc_api(rdoc), m_vkPhysicalDevice(vk_physicalDevice), m_extensions(std::move(_extensions)) {}
inline CVulkanPhysicalDevice(IPhysicalDevice::SInitData&& _initData, renderdoc_api_t* const rdoc, const VkPhysicalDevice vk_physicalDevice, core::unordered_set<std::string>&& _extensions, core::string& profile)
: IPhysicalDevice(std::move(_initData)), m_rdoc_api(rdoc), m_vkPhysicalDevice(vk_physicalDevice), m_extensions(std::move(_extensions)), m_profile(profile) {}

//! This function makes sure requirements of a requested feature is also set to `true` in SPhysicalDeviceFeatures
//! Note that this will only fix what is exposed, some may require extensions not exposed currently, that will happen later on.
Expand Down Expand Up @@ -115,6 +117,7 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
renderdoc_api_t* const m_rdoc_api;
const VkPhysicalDevice m_vkPhysicalDevice;

core::string& m_profile;
const core::unordered_set<std::string> m_extensions;
};

Expand Down
Loading