Vulkan Debug Mode


#1

When building bsExamples in Vulkan Debug mode, I got this error from the log file:

A fatal error occurred and the program has to terminate!
- Error: RenderingAPIException
- Description: ERROR: [Validation] Code 308318213: [ VUID-VkSamplerCreateInfo-flags-zerobitmask ] Object: 
VK_NULL_HANDLE (Type = 0) | vkCreateSampler: parameter pCreateInfo->flags must be 0. The spec valid 
usage text states 'flags must be 0' 

This only happens in Debug mode. Release mode works fine.


#2

What is your Vulkan SDK version?


#3

I use LunarG, 1.1.77.0 for Windows 7, Visual Studio 2017.


#4

Thanks, I’m on 1.1.72 which is likely why I’m not seeing it. I’ll update and check when I get a moment. It’s a weird issue though as that flags value is definitely set to zero.


#5

I’ve tried running with 1.1.77.0 version of the Vulkan SDK and have gotten a validation layer error - however it wasn’t the same error as yours. I have resolved the issue on latest master and Vulkan runs fine for me on 1.1.77.0. If you get a chance see if this perhaps also resolved your issue.


#6

I’ve updated to the latest master but still the same. Here’s the full log:

A fatal error occurred and the program has to terminate!
- Error: RenderingAPIException
- Description: ERROR: [Validation] Code 308318213: [ VUID-VkSamplerCreateInfo-flags-zerobitmask ] Object: VK_NULL_HANDLE (Type = 0) | vkCreateSampler: parameter pCreateInfo->flags must be 0. The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-flags-zerobitmask)

- In function: unsigned int __cdecl bs::ct::debugMsgCallback(unsigned int,enum VkDebugReportObjectTypeEXT,unsigned __int64,unsigned __int64,int,const char *,const char *,void *)
- In file: d:\bsf\source\plugins\bsfvulkanrenderapi\bsvulkanrenderapi.cpp:75

Stack trace: 
bs::CrashHandler::reportCrash() - 0x8790298848870 File[bswin32crashhandler.cpp:468 (0)] Module[bsf.dll]
bs::ct::debugMsgCallback() - 0x8790467989027 File[bsvulkanrenderapi.cpp:75 (156)] Module[bsfVulkanRenderAPI.dll]
debug_log_msg() - 0x8790687372755 File[vk_layer_logging.h:346 (73)] Module[VkLayer_parameter_validation.dll]
log_msg() - 0x8790687380054 File[vk_layer_logging.h:906 (97)] Module[VkLayer_parameter_validation.dll]
parameter_validation::validate_reserved_flags() - 0x8790687434846 File[parameter_validation.h:759 (119)] Module[VkLayer_parameter_validation.dll]
parameter_validation::vkCreateSampler() - 0x8790687641490 File[parameter_validation.cpp:3288 (92)] Module[VkLayer_parameter_validation.dll]
threading::CreateSampler() - 0x8790714864283 File[thread_check.h:1434 (20)] Module[VkLayer_threading.dll]
0x8791282505871 Module[bdcamvk64.dll]
0x8791282496429 Module[bdcamvk64.dll]
0x1779001633 Module[nvoglv64.dll]
0x8791150864607 Module[vulkan-1.dll]
0x8791150951368 Module[vulkan-1.dll]
bs::ct::VulkanDevice::VulkanDevice() - 0x8790468535728 File[bsvulkandevice.cpp:130 (40)] Module[bsfVulkanRenderAPI.dll]
std::_Ref_count_obj_alloc >::_Ref_count_obj_alloc >() - 0x8790467930214 File[memory:1749 (0)] Module[bsfVulkanRenderAPI.dll]
bs::StdAlloc >,bs::GenAlloc>::construct const & __ptr64,VkPhysicalDevice_T * __ptr64 & __ptr64,unsigned int & __ptr64>() - 0x8790467945302 File[bsmemoryallocator.h:430 (166)] Module[bsfVulkanRenderAPI.dll]
std::_Normal_allocator_traits >,bs::GenAlloc> >::_Construct1 >,bs::StdAlloc const & __ptr64,VkPhysicalDevice_T * __ptr64 & __ptr64,unsigned int & __ptr64>() - 0x8790467933725 File[xmemory0:751 (0)] Module[bsfVulkanRenderAPI.dll]
std::_Normal_allocator_traits >,bs::GenAlloc> >::construct >,bs::StdAlloc const & __ptr64,VkPhysicalDevice_T * __ptr64 & __ptr64,unsigned int & __ptr64>() - 0x8790467945920 File[xmemory0:759 (0)] Module[bsfVulkanRenderAPI.dll]
std::allocate_shared,VkPhysicalDevice_T * __ptr64 & __ptr64,unsigned int & __ptr64>() - 0x8790467941550 File[memory:1800 (88)] Module[bsfVulkanRenderAPI.dll]
bs::bs_shared_ptr_new() - 0x8790467944659 File[bsstdheaders.h:203 (63)] Module[bsfVulkanRenderAPI.dll]
bs::ct::VulkanRenderAPI::initialize() - 0x8790467997802 File[bsvulkanrenderapi.cpp:197 (42)] Module[bsfVulkanRenderAPI.dll]
std::_Invoker_pmf_pointer::_Call() - 0x8790307958916 File[type_traits:1790 (68)] Module[bsf.dll]
std::invoke() - 0x8790308007824 File[type_traits:1790 (96)] Module[bsf.dll]
std::_Invoker_ret::_Call() - 0x8790307950960 File[type_traits:1837 (0)] Module[bsf.dll]
std::_Call_binder,std::tuple<> >() - 0x8790307965623 File[functional:914 (0)] Module[bsf.dll]
std::_Binder::operator()<>() - 0x8790307946904 File[functional:969 (136)] Module[bsf.dll]
std::_Invoker_functor::_Call & __ptr64>() - 0x8790307954590 File[type_traits:1790 (62)] Module[bsf.dll]
std::invoke & __ptr64>() - 0x8790308009694 File[type_traits:1790 (62)] Module[bsf.dll]
std::_Invoker_ret::_Call & __ptr64>() - 0x8790307954686 File[type_traits:1816 (0)] Module[bsf.dll]
std::_Func_impl_no_alloc,void>::_Do_call() - 0x8790308059949 File[functional:300 (0)] Module[bsf.dll]
std::_Func_class::operator()() - 0x8790296795721 File[functional:351 (0)] Module[bsf.dll]
bs::CommandQueueBase::playbackWithNotify() - 0x8790299563124 File[bscommandqueue.cpp:127 (0)] Module[bsf.dll]
bs::CoreThread::runCoreThread() - 0x8790299980841 File[bscorethread.cpp:118 (0)] Module[bsf.dll]
std::_Invoker_pmf_pointer::_Call() - 0x8790299870772 File[type_traits:1790 (68)] Module[bsf.dll]
std::invoke() - 0x8790299894784 File[type_traits:1790 (96)] Module[bsf.dll]
std::_Invoker_ret::_Call() - 0x8790299870032 File[type_traits:1837 (0)] Module[bsf.dll]
std::_Call_binder,std::tuple<> >() - 0x8790299871191 File[functional:914 (0)] Module[bsf.dll]
std::_Binder::operator()<>() - 0x8790299868008 File[functional:969 (136)] Module[bsf.dll]
std::_Invoker_functor::_Call & __ptr64>() - 0x8790299870430 File[type_traits:1790 (62)] Module[bsf.dll]
std::invoke & __ptr64>() - 0x8790299895038 File[type_traits:1790 (62)] Module[bsf.dll]
std::_Invoker_ret::_Call & __ptr64>() - 0x8790299870526 File[type_traits:1816 (0)] Module[bsf.dll]
std::_Func_impl_no_alloc,void>::_Do_call() - 0x8790299945005 File[functional:300 (0)] Module[bsf.dll]
std::_Func_class::operator()() - 0x8790296795721 File[functional:351 (0)] Module[bsf.dll]
bs::PooledThread::run() - 0x8790297255991 File[bsthreadpool.cpp:116 (0)] Module[bsf.dll]
std::_Invoker_pmf_pointer::_Call() - 0x8790297222020 File[type_traits:1790 (68)] Module[bsf.dll]
std::invoke() - 0x8790297233264 File[type_traits:1790 (96)] Module[bsf.dll]
std::_Invoker_ret::_Call() - 0x8790297221904 File[type_traits:1837 (0)] Module[bsf.dll]
std::_Call_binder,std::tuple<> >() - 0x8790297222279 File[functional:914 (0)] Module[bsf.dll]
std::_Binder::operator()<>() - 0x8790297221752 File[functional:969 (136)] Module[bsf.dll]
std::_Invoker_functor::_Call >() - 0x8790297222126 File[type_traits:1790 (62)] Module[bsf.dll]
std::invoke >() - 0x8790297233374 File[type_traits:1790 (62)] Module[bsf.dll]
std::_LaunchPad >,std::default_delete > > > >::_Execute<0>() - 0x8790297224506 File[xthread:241 (0)] Module[bsf.dll]
std::_LaunchPad >,std::default_delete > > > >::_Run() - 0x8790297246125 File[xthread:249 (0)] Module[bsf.dll]
std::_LaunchPad >,std::default_delete > > > >::_Go() - 0x8790297243686 File[xthread:233 (0)] Module[bsf.dll]
std::_Pad::_Call_func() - 0x8790297241325 File[xthread:211 (0)] Module[bsf.dll]
0x8791152136680 Module[ucrtbased.dll]
0x8791152135681 Module[ucrtbased.dll]
0x1998543309 Module[kernel32.dll]
0x2000856417 Module[ntdll.dll]

#7

Looking at the log the issue seems to be caused by Bandicam (see the bdcamvk64.dll entry). It seems to hook into bsf when running and then issues an invalid Vulkan call which gets caught by bsf’s debug layer. I suggest disabling or updating it in order to resolve the issue.


#8

yes, after turning off the app the debug mode works perfectly!