Logging nbl::video device call failures #684
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Problem
Many device functions return a boolean to indicate a successful call to lower level api (Vulkan) function.
But the return value is often ignored making it hard to debug the cause of the problem.
Even if not ignored, simply returning false on a failure doesn't help much pinpointing the exact cause.
There is also
createXXX
functions that may return nullptr due to reasons such as invalid creation paramsfor example inside
ILogicalDevice::createFramebuffer
may fail due to 30+ reasons specified in vulkan specification and handled manually in
IFramebuffer::SCreationParams::validate
that's why we need to "error log" the exact cause of the failure each time we
return false
on device callsSolution
use
system::logger_opt_ptr m_logger
in ILogicalDevice` to log every possible scenario that fails.The text was updated successfully, but these errors were encountered: