11
11
#include " nbl/video/IGPUCommandPool.h"
12
12
#include " nbl/video/IQueue.h"
13
13
14
+ #include " git_info.h"
15
+ #define NBL_LOG_FUNCTION m_logger.log
16
+ #include " nbl/logging_macros.h"
17
+
14
18
// TODO: remove
15
19
#define VK_NO_PROTOTYPES
16
20
#include < vulkan/vulkan.h>
@@ -721,7 +725,7 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
721
725
return true ;
722
726
if (!buffer->getCreationParams ().usage .hasFlags (usages))
723
727
{
724
- m_logger. log (" Incorrect `IGPUBuffer` usage flags for the command!" , system::ILogger::ELL_ERROR );
728
+ NBL_LOG_ERROR (" Incorrect `IGPUBuffer` usage flags for the command!" );
725
729
return true ;
726
730
}
727
731
return false ;
@@ -732,7 +736,7 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
732
736
return true ;
733
737
if (binding.offset &(alignment-1 ))
734
738
{
735
- m_logger. log (" Offset %d not aligned to %d for the command!" , system::ILogger::ELL_ERROR , binding.offset , alignment);
739
+ NBL_LOG_ERROR (" Offset %d not aligned to %d for the command!" , binding.offset , alignment);
736
740
return true ;
737
741
}
738
742
return false ;
@@ -742,17 +746,23 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
742
746
if (invalidBufferBinding ({range.offset ,range.buffer },alignment,usages))
743
747
return true ;
744
748
if ((range.size &(alignment-1 )) && range.size !=asset::SBufferRange<IGPUBuffer>::WholeBuffer)
749
+ {
750
+ NBL_LOG_ERROR (" Size %d not aligned to %d for the command!" , range.size , alignment);
745
751
return true ;
752
+ }
746
753
return false ;
747
754
}
748
755
749
756
inline bool invalidImage (const IGPUImage* image, const IGPUImage::E_USAGE_FLAGS usages) const
750
757
{
751
758
if (!image || !this ->isCompatibleDevicewise (image))
759
+ {
760
+ NBL_LOG_ERROR (" invalid image!" );
752
761
return true ;
762
+ }
753
763
if (!image->getCreationParameters ().usage .hasFlags (usages))
754
764
{
755
- m_logger. log (" Incorrect `IGPUImage` usage flags for the command!" , system::ILogger::ELL_ERROR );
765
+ NBL_LOG_ERROR (" Incorrect `IGPUImage` usage flags for the command!" );
756
766
return true ;
757
767
}
758
768
return false ;
@@ -767,14 +777,18 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
767
777
case IGPUImage::LAYOUT::SHARED_PRESENT:
768
778
break ;
769
779
default :
780
+ NBL_LOG_ERROR (" invalid destination image layout!" );
770
781
return true ;
771
782
}
772
783
if (invalidImage (image,IGPUImage::EUF_TRANSFER_DST_BIT))
773
784
return true ;
774
785
if constexpr (!clear)
775
786
{
776
787
if (image->getCreationParameters ().samples !=IGPUImage::E_SAMPLE_COUNT_FLAGS::ESCF_1_BIT)
788
+ {
789
+ NBL_LOG_ERROR (" destination image sample count must be 1!" );
777
790
return true ;
791
+ }
778
792
}
779
793
return false ;
780
794
}
@@ -787,6 +801,7 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
787
801
case IGPUImage::LAYOUT::SHARED_PRESENT:
788
802
break ;
789
803
default :
804
+ NBL_LOG_ERROR (" invalid source image layout!" );
790
805
return true ;
791
806
}
792
807
return invalidImage (image,IGPUImage::EUF_TRANSFER_SRC_BIT);
@@ -847,4 +862,5 @@ extern template bool IGPUCommandBuffer::invalidDependency(const SDependencyInfo<
847
862
848
863
}
849
864
865
+ #include " nbl/undef_logging_macros.h"
850
866
#endif
0 commit comments