-
I want to enable a device extension, so I am calling traits->deviceExtensionNames.push_back(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); before creating my window. This works, but I want to check for support first so VSG doesn't throw an exception. I found What's the canonical way to go about this? Do I have to manually create the device first? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Figured it out: auto window = vsg::Window::create(traits);
auto pd = window->getOrCreatePhysicalDevice();
if (pd->supportsDeviceExtension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME))
{
traits->deviceExtensionNames.push_back(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME);
} I was confusing |
Beta Was this translation helpful? Give feedback.
Figured it out:
I was confusing
PhysicalDevice::supportsDeviceExtension
(which says whether the device supports it) andDevice::supportsDeviceExtension
(which says whether you have tried to enabled it).