Skip to content

Commit acebe70

Browse files
committed
logger in utils
1 parent 426e5a1 commit acebe70

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

include/nbl/video/utilities/IUtilities.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ class NBL_API IUtilities : public core::IReferenceCounted
2424
uint32_t m_allocationAlignment = 0u;
2525
uint32_t m_allocationAlignmentForBufferImageCopy = 0u;
2626

27+
nbl::system::logger_opt_smart_ptr m_logger;
28+
2729
public:
28-
IUtilities(core::smart_refctd_ptr<ILogicalDevice>&& device, const uint32_t downstreamSize = 0x4000000u, const uint32_t upstreamSize = 0x4000000u) : m_device(std::move(device))
30+
IUtilities(core::smart_refctd_ptr<ILogicalDevice>&& device, nbl::system::logger_opt_smart_ptr&& logger = nullptr, const uint32_t downstreamSize = 0x4000000u, const uint32_t upstreamSize = 0x4000000u)
31+
: m_device(std::move(device))
32+
, m_logger(std::move(logger))
2933
{
3034
auto physicalDevice = m_device->getPhysicalDevice();
3135
const auto& limits = physicalDevice->getLimits();

src/nbl/video/utilities/IUtilities.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ IGPUQueue::SSubmitInfo IUtilities::updateImageViaStagingBuffer(
1010
{
1111
if(!intendedNextSubmit.isValid() || intendedNextSubmit.commandBufferCount <= 0u)
1212
{
13-
// TODO: log error -> intendedNextSubmit is invalid
13+
m_logger.log("intendedNextSubmit is invalid.", nbl::system::ILogger::ELL_ERROR);
1414
assert(false);
1515
return intendedNextSubmit;
1616
}
@@ -169,7 +169,7 @@ void IUtilities::updateImageViaStagingBufferAutoSubmit(
169169
{
170170
if(!submitInfo.isValid())
171171
{
172-
// TODO: log error
172+
m_logger.log("submitInfo is invalid.", nbl::system::ILogger::ELL_ERROR);
173173
assert(false);
174174
return;
175175
}
@@ -190,7 +190,7 @@ void IUtilities::updateImageViaStagingBufferAutoSubmit(
190190
{
191191
if(!submitInfo.isValid())
192192
{
193-
// TODO: log error
193+
m_logger.log("submitInfo is invalid.", nbl::system::ILogger::ELL_ERROR);
194194
assert(false);
195195
return;
196196
}

0 commit comments

Comments
 (0)