Change scope of validationExt and validationLayerName variables
Pointer to a variable declared into a block statement is stored and used outside of the block by vkCreateInstance. This can lead to segmentation fault. Move the declaration of validationExt/validationLayerName outside of the block to fix the crash.
This commit is contained in:
parent
334692a6ef
commit
1b22456d07
3 changed files with 6 additions and 5 deletions
|
|
@ -200,9 +200,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME;
|
||||
if (layersAvailable) {
|
||||
instanceCreateInfo.ppEnabledLayerNames = validationLayers;
|
||||
const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME;
|
||||
instanceCreateInfo.enabledLayerCount = layerCount;
|
||||
instanceCreateInfo.enabledExtensionCount = 1;
|
||||
instanceCreateInfo.ppEnabledExtensionNames = &validationExt;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue