Skip to content

Commit d2f6963

Browse files
committed
Moved rdc captures functions to IAPIConnection
1 parent 1abb6ae commit d2f6963

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

examples_tests

include/nbl/video/CThreadSafeQueueAdapter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace nbl::video
1010
A thread-safe implementation of IQueue.
1111
Note, that using the same queue as both a threadsafe queue and a normal queue invalidates the safety.
1212
*/
13+
1314
class CThreadSafeQueueAdapter final : public IQueue
1415
{
1516
friend class ILogicalDevice; // to access the destructor

include/nbl/video/CVulkanConnection.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class NBL_API2 CVulkanConnection final : public IAPIConnection
2727

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

30+
bool startCapture() override;
31+
bool endCapture() override;
32+
3033
protected:
3134
explicit inline CVulkanConnection(const VkInstance instance, const SFeatures& enabledFeatures, std::unique_ptr<CVulkanDebugCallback>&& debugCallback, const VkDebugUtilsMessengerEXT vk_debugMessenger)
3235
: IAPIConnection(enabledFeatures), m_vkInstance(instance), m_debugCallback(std::move(debugCallback)), m_vkDebugUtilsMessengerEXT(vk_debugMessenger) {}

include/nbl/video/IAPIConnection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class NBL_API2 IAPIConnection : public core::IReferenceCounted
6262
const SFeatures& getEnabledFeatures() const { return m_enabledFeatures; }
6363

6464
const bool isRunningInRenderdoc() const { return m_rdoc_api; }
65+
virtual bool startCapture() = 0;
66+
virtual bool endCapture() = 0;
6567

6668
protected:
6769
IAPIConnection(const SFeatures& enabledFeatures);

src/nbl/video/CVulkanConnection.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,20 @@ CVulkanConnection::~CVulkanConnection()
321321
vkDestroyInstance(m_vkInstance,nullptr);
322322
}
323323

324+
bool CVulkanConnection::startCapture()
325+
{
326+
if (!isRunningInRenderdoc())
327+
return false;
328+
m_rdoc_api->StartFrameCapture(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(m_vkInstance), NULL);
329+
return true;
330+
}
331+
332+
bool CVulkanConnection::endCapture()
333+
{
334+
if (!isRunningInRenderdoc())
335+
return false;
336+
m_rdoc_api->EndFrameCapture(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(m_vkInstance), NULL);
337+
return true;
338+
}
339+
324340
}

src/nbl/video/CVulkanQueue.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,6 @@ auto CVulkanQueue::waitIdle_impl() const -> RESULT
1111
{
1212
return getResultFrom(static_cast<const CVulkanLogicalDevice*>(m_originDevice)->getFunctionTable()->vk.vkQueueWaitIdle(m_vkQueue));
1313
}
14-
15-
bool CVulkanQueue::startCapture()
16-
{
17-
if (!m_rdoc_api)
18-
return false;
19-
m_rdoc_api->StartFrameCapture(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(m_vkInstance), NULL);
20-
return true;
21-
}
22-
23-
bool CVulkanQueue::endCapture()
24-
{
25-
if (!m_rdoc_api)
26-
return false;
27-
m_rdoc_api->EndFrameCapture(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(m_vkInstance), NULL);
28-
return true;
29-
}
3014

3115
auto CVulkanQueue::submit_impl(const std::span<const IQueue::SSubmitInfo> _submits) -> RESULT
3216
{

src/nbl/video/CVulkanQueue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class CVulkanQueue final : public IQueue
3434
return RESULT::OTHER_ERROR;
3535
}
3636

37-
bool startCapture() override;
38-
bool endCapture() override;
37+
bool startCapture() override { return false; }
38+
bool endCapture() override { return false; }
3939
bool insertDebugMarker(const char* name, const core::vector4df_SIMD& color) override;
4040
bool beginDebugMarker(const char* name, const core::vector4df_SIMD& color) override;
4141
bool endDebugMarker() override;

0 commit comments

Comments
 (0)