Added virtual function to enable extension based on extension list from physical device
This commit is contained in:
parent
44c95211aa
commit
727d351b42
2 changed files with 8 additions and 0 deletions
|
|
@ -1017,6 +1017,10 @@ bool VulkanExampleBase::initVulkan()
|
|||
// This is handled by a separate class that gets a logical device representation
|
||||
// and encapsulates functions related to a device
|
||||
vulkanDevice = new vks::VulkanDevice(physicalDevice);
|
||||
|
||||
// Derived examples can enable extensions based on the list of supported extensions read from the physical device
|
||||
getEnabledExtensions();
|
||||
|
||||
VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledDeviceExtensions, deviceCreatepNextChain);
|
||||
if (res != VK_SUCCESS) {
|
||||
vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), res);
|
||||
|
|
@ -2798,6 +2802,8 @@ void VulkanExampleBase::setupRenderPass()
|
|||
|
||||
void VulkanExampleBase::getEnabledFeatures() {}
|
||||
|
||||
void VulkanExampleBase::getEnabledExtensions() {}
|
||||
|
||||
void VulkanExampleBase::windowResize()
|
||||
{
|
||||
if (!prepared)
|
||||
|
|
|
|||
|
|
@ -386,6 +386,8 @@ public:
|
|||
virtual void setupRenderPass();
|
||||
/** @brief (Virtual) Called after the physical device features have been read, can be used to set features to enable on the device */
|
||||
virtual void getEnabledFeatures();
|
||||
/** @brief (Virtual) Called after the physical device extensions have been read, can be used to enable extensions based on the supported extension listing*/
|
||||
virtual void getEnabledExtensions();
|
||||
|
||||
/** @brief Prepares all Vulkan resources and functions required to run the sample */
|
||||
virtual void prepare();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue