Skip to content

Commit 8d5e0b0

Browse files
committed
video: improve error logging in IGPUCommandBuffer
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
1 parent 65cd939 commit 8d5e0b0

File tree

2 files changed

+436
-46
lines changed

2 files changed

+436
-46
lines changed

include/nbl/video/IGPUCommandBuffer.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,20 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
737737
if (invalidBufferBinding({range.offset,range.buffer},alignment,usages))
738738
return true;
739739
if ((range.size&(alignment-1)) && range.size!=asset::SBufferRange<IGPUBuffer>::WholeBuffer)
740+
{
741+
m_logger.log("Size %d not aligned to %d for the command!", system::ILogger::ELL_ERROR, range.size, alignment);
740742
return true;
743+
}
741744
return false;
742745
}
743746

744747
inline bool invalidImage(const IGPUImage* image, const IGPUImage::E_USAGE_FLAGS usages) const
745748
{
746749
if (!image || !this->isCompatibleDevicewise(image))
750+
{
751+
m_logger.log("invalid image!", system::ILogger::ELL_ERROR);
747752
return true;
753+
}
748754
if (!image->getCreationParameters().usage.hasFlags(usages))
749755
{
750756
m_logger.log("Incorrect `IGPUImage` usage flags for the command!", system::ILogger::ELL_ERROR);
@@ -762,14 +768,18 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
762768
case IGPUImage::LAYOUT::SHARED_PRESENT:
763769
break;
764770
default:
771+
m_logger.log("invalid destination image layout!", system::ILogger::ELL_ERROR);
765772
return true;
766773
}
767774
if (invalidImage(image,IGPUImage::EUF_TRANSFER_DST_BIT))
768775
return true;
769776
if constexpr (!clear)
770777
{
771778
if (image->getCreationParameters().samples!=IGPUImage::E_SAMPLE_COUNT_FLAGS::ESCF_1_BIT)
779+
{
780+
m_logger.log("destination image sample count must be 1!", system::ILogger::ELL_ERROR);
772781
return true;
782+
}
773783
}
774784
return false;
775785
}
@@ -782,6 +792,7 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
782792
case IGPUImage::LAYOUT::SHARED_PRESENT:
783793
break;
784794
default:
795+
m_logger.log("invalid source image layout!", system::ILogger::ELL_ERROR);
785796
return true;
786797
}
787798
return invalidImage(image,IGPUImage::EUF_TRANSFER_SRC_BIT);

0 commit comments

Comments
 (0)