Skip to content

Commit e42df7c

Browse files
committed
Log failure cases in validateWrite.
1 parent 133dd64 commit e42df7c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/nbl/video/IGPUDescriptorSet.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,26 @@ bool IGPUDescriptorSet::validateWrite(const IGPUDescriptorSet::SWriteDescriptorS
6060
{
6161
#ifdef _NBL_DEBUG
6262
if (m_layout->getImmutableSamplerRedirect().getCount(IGPUDescriptorSetLayout::CBindingRedirect::binding_number_t{ write.binding }) != 0)
63+
{
64+
if (debugName)
65+
m_pool->m_logger.log("Descriptor set (%s, %p) doesn't allow immutable samplers at binding %u, but immutable samplers found.", system::ILogger::ELL_ERROR, debugName, this, write.binding);
66+
else
67+
m_pool->m_logger.log("Descriptor set (%p) doesn't allow immutable samplers at binding %u, but immutable samplers found.", system::ILogger::ELL_ERROR, this, write.binding);
6368
return false;
69+
}
6470

6571
for (uint32_t i = 0; i < write.count; ++i)
6672
{
67-
if (!write.info[i].info.image.sampler || !write.info[i].info.image.sampler->isCompatibleDevicewise(write.dstSet))
73+
auto* sampler = write.info[i].info.image.sampler.get();
74+
if (!sampler || !sampler->isCompatibleDevicewise(write.dstSet))
75+
{
76+
const char* samplerDebugName = sampler->getDebugName();
77+
if (samplerDebugName && debugName)
78+
m_pool->m_logger.log("Sampler (%s, %p) does not exist or is not device-compatible with descriptor set (%s, %p).", system::ILogger::ELL_ERROR, samplerDebugName, sampler, debugName, write.dstSet);
79+
else
80+
m_pool->m_logger.log("Sampler (%p) does not exist or is not device-compatible with descriptor set (%p).", system::ILogger::ELL_ERROR, sampler, write.dstSet);
6881
return false;
82+
}
6983
}
7084
#endif
7185
mutableSamplers = getMutableSamplers(write.binding);

0 commit comments

Comments
 (0)