]> O.S.I.I.S - jp/vkvg.git/commitdiff
check sample count support on device creation
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 22 Jan 2022 13:55:00 +0000 (14:55 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 22 Jan 2022 13:55:00 +0000 (14:55 +0100)
src/vkvg_device.c

index 37a1c94498ae561f2c9c7127cc4c68d349d3f9d6..c893d2bc28a40c025c3fe13fe201ce52f0abbaff 100644 (file)
@@ -60,6 +60,13 @@ VkvgDevice vkvg_device_create(VkSampleCountFlags samples, bool deferredResolve)
                if (!_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
                        pi = phys[0];
 
+       if (!(pi->properties.limits.framebufferColorSampleCounts&samples)) {
+               LOG(VKVG_LOG_ERR, "CREATE Device failed: sample count not supported: %d\n", samples);
+               vkh_app_free_phyinfos (phyCount, phys);
+               vkh_app_destroy (app);
+               return NULL;
+       }
+
        uint32_t qCount = 0;
        float qPriorities[] = {0.0};
        VkDeviceQueueCreateInfo pQueueInfos[] = { {0},{0},{0} };