Skip to content

Commit 38ac5d4

Browse files
committed
update log msgs
1 parent 71774c0 commit 38ac5d4

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

include/nbl/video/ILogicalDevice.h

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,9 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
337337
// Create an ImageView that can actually be used by shaders (@see ICPUImageView)
338338
inline core::smart_refctd_ptr<IGPUImageView> createImageView(IGPUImageView::SCreationParams&& params)
339339
{
340-
if (!params.image->wasCreatedBy(this)) {
341-
m_logger.log("Invalid image was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
340+
if (!params.image->wasCreatedBy(this))
341+
{
342+
m_logger.log("The image was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
342343
return nullptr;
343344
}
344345
// TODO: @Cyprian validation of params against the device's limits (sample counts, etc.) see vkCreateImage
@@ -646,20 +647,24 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
646647
core::smart_refctd_ptr<IGPUDescriptorSetLayout>&& _layout2=nullptr, core::smart_refctd_ptr<IGPUDescriptorSetLayout>&& _layout3=nullptr
647648
)
648649
{
649-
if ((_layout0 && !_layout0->wasCreatedBy(this))) {
650-
m_logger.log("Invalid layout was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
650+
if ((_layout0 && !_layout0->wasCreatedBy(this)))
651+
{
652+
m_logger.log("layout was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
651653
return nullptr;
652654
}
653-
if (_layout1 && !_layout1->wasCreatedBy(this)) {
654-
m_logger.log("Invalid layout was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
655+
if (_layout1 && !_layout1->wasCreatedBy(this))
656+
{
657+
m_logger.log("layout was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
655658
return nullptr;
656659
}
657-
if (_layout2 && !_layout2->wasCreatedBy(this)) {
658-
m_logger.log("Invalid layout was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
660+
if (_layout2 && !_layout2->wasCreatedBy(this))
661+
{
662+
m_logger.log("layout was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
659663
return nullptr;
660664
}
661-
if (_layout3 && !_layout3->wasCreatedBy(this)) {
662-
m_logger.log("Invalid layout was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
665+
if (_layout3 && !_layout3->wasCreatedBy(this))
666+
{
667+
m_logger.log("layout was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
663668
return nullptr;
664669
}
665670
// sanity check
@@ -755,8 +760,9 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
755760
return nullptr;
756761
}
757762

758-
if (!params.renderpass->wasCreatedBy(this)) {
759-
m_logger.log("Invalid renderpass was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
763+
if (!params.renderpass->wasCreatedBy(this))
764+
{
765+
m_logger.log("The renderpass was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
760766
return nullptr;
761767
}
762768

@@ -816,7 +822,7 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
816822
{
817823
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPipelineShaderStageCreateInfo.html#VUID-VkPipelineShaderStageCreateInfo-stage-08771
818824
if (!info.shader->wasCreatedBy(this)) {
819-
m_logger.log("Invalid shader was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
825+
m_logger.log("The shader was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
820826
return false;
821827
}
822828
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPipelineShaderStageCreateInfo.html#VUID-VkPipelineShaderStageCreateInfo-pNext-02755
@@ -883,7 +889,7 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
883889
inline bool getQueryPoolResults(const IQueryPool* const queryPool, const uint32_t firstQuery, const uint32_t queryCount, void* const pData, const size_t stride, const core::bitflag<IQueryPool::RESULTS_FLAGS> flags)
884890
{
885891
if (!queryPool || !queryPool->wasCreatedBy(this)) {
886-
m_logger.log("Invalid query pool was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
892+
m_logger.log("The queryPool was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
887893
return false;
888894
}
889895
if (firstQuery + queryCount >= queryPool->getCreationParameters().queryCount) {
@@ -1030,7 +1036,7 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
10301036
inline CreationParams::SSpecializationValidationResult commonCreatePipelines(IGPUPipelineCache* const pipelineCache, const std::span<const CreationParams> params, ExtraLambda&& extra)
10311037
{
10321038
if (pipelineCache && !pipelineCache->wasCreatedBy(this)) {
1033-
m_logger.log("Invalid pipelineCache was given [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
1039+
m_logger.log("The pipelineCache was not created by this device [%s - %s:%d]", system::ILogger::ELL_ERROR, __FUNCTION__, __FILE__, __LINE__);
10341040
return {};
10351041
}
10361042
if (params.empty()) {
@@ -1050,7 +1056,7 @@ class NBL_API2 ILogicalDevice : public core::IReferenceCounted, public IDeviceMe
10501056
}
10511057

10521058
if (!ci.layout->wasCreatedBy(this)) {
1053-
m_logger.log("Invalid layout was given (params[%d]) [%s - %s:%d]", system::ILogger::ELL_ERROR, i, __FUNCTION__, __FILE__, __LINE__);
1059+
m_logger.log("The layout was not created by this device (params[%d]) [%s - %s:%d]", system::ILogger::ELL_ERROR, i, __FUNCTION__, __FILE__, __LINE__);
10541060
return {};
10551061
}
10561062

0 commit comments

Comments
 (0)