Просмотр исходного кода

vulkan_device: Reorder Float16Int8 declaration

This variable was going out of scope before its usage in the vulkan device creation, causing a crash on very specific drivers.
ameerj 4 лет назад
Родитель
Сommit
e3c153efa4
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/video_core/vulkan_common/vulkan_device.cpp

+ 2 - 1
src/video_core/vulkan_common/vulkan_device.cpp

@@ -368,8 +368,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
     };
     };
     SetNext(next, demote);
     SetNext(next, demote);
 
 
+    VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8;
     if (is_int8_supported || is_float16_supported) {
     if (is_int8_supported || is_float16_supported) {
-        VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8{
+        float16_int8 = {
             .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR,
             .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR,
             .pNext = nullptr,
             .pNext = nullptr,
             .shaderFloat16 = is_float16_supported,
             .shaderFloat16 = is_float16_supported,