Present Mode: Immediate
Present Mode: Fifo
Present Mode: FifoRelaxed
Did not find preferred swap chain present mode, using first available present mode.
Format:B8G8R8A8Srgb,ColorSpace:SrgbNonLinear
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f
vkCreateSwapchainKHR(): pCreateInfo->imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f
vkCreateSwapchainKHR(): pCreateInfo vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, with following VkImageCreateInfo
format (VK_FORMAT_B8G8R8A8_SRGB)
type (VK_IMAGE_TYPE_2D)
tiling (VK_IMAGE_TILING_OPTIMAL)
usage (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_STORAGE_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
flags (VkImageCreateFlags(0))
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f
vkCreateSwapchainKHR(): pCreateInfo->imageArrayLayers 1, but Maximum value returned by vkGetPhysicalDeviceImageFormatProperties() is 0 for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f
vkCreateSwapchainKHR(): pCreateInfo->imageExtent (width = 800, height = 600), which is bigger than max extent (width = 0, height = 0, depth = 0) returned by vkGetPhysicalDeviceImageFormatProperties() for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL.
The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Мой графический процессор — rx580 8g, драйвер и vulkanSDK — последние, версия Windows 10 — 19045.5965 [code]Present Mode: Immediate Present Mode: Fifo Present Mode: FifoRelaxed Did not find preferred swap chain present mode, using first available present mode. Format:B8G8R8A8Srgb,ColorSpace:SrgbNonLinear Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f vkCreateSwapchainKHR(): pCreateInfo->imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f vkCreateSwapchainKHR(): pCreateInfo vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, with following VkImageCreateInfo format (VK_FORMAT_B8G8R8A8_SRGB) type (VK_IMAGE_TYPE_2D) tiling (VK_IMAGE_TILING_OPTIMAL) usage (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_STORAGE_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) flags (VkImageCreateFlags(0)) The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f vkCreateSwapchainKHR(): pCreateInfo->imageArrayLayers 1, but Maximum value returned by vkGetPhysicalDeviceImageFormatProperties() is 0 for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f vkCreateSwapchainKHR(): pCreateInfo->imageExtent (width = 800, height = 600), which is bigger than max extent (width = 0, height = 0, depth = 0) returned by vkGetPhysicalDeviceImageFormatProperties() for imageFormat VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778) [/code] вот мой код [code]void CreateSwapChain() { VkResult result; result = instanceApi.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(this.physicalDevice, this.windowsurface, out var surfaceCapabilities); if (result != VkResult.Success) { throw new Exception("Failed to get surface capabilities"); } result = instanceApi.vkGetPhysicalDeviceSurfaceFormatsKHR(this.physicalDevice, this.windowsurface, out uint formatCount); if (formatCount == 0 || result != VkResult.Success) { throw new Exception("Failed to get surface format count"); } var swapChainFormats = new VkSurfaceFormatKHR[formatCount]; instanceApi.vkGetPhysicalDeviceSurfaceFormatsKHR(this.physicalDevice, this.windowsurface, swapChainFormats); if (formatCount == 0 || result != VkResult.Success) { throw new Exception("Failed to get surface format count"); }
foreach (var format in swapChainFormats) { Console.WriteLine($"Surface Format: {format.format}, ColorSpace: {format.colorSpace}"); }
result = instanceApi.vkGetPhysicalDeviceSurfacePresentModesKHR(this.physicalDevice, this.windowsurface, out uint presentModeCount); if (presentModeCount == 0 || result != VkResult.Success) { throw new Exception("Failed to get present mode count"); } var swapChainPresentModes = new VkPresentModeKHR[presentModeCount]; instanceApi.vkGetPhysicalDeviceSurfacePresentModesKHR(this.physicalDevice, this.windowsurface, swapChainPresentModes);
foreach (var presentMode in swapChainPresentModes) { Console.WriteLine($"Present Mode: {presentMode}"); } var swapChainFormatwithcheck = ChooseSwapSurfaceFormat(swapChainFormats); if (swapChainFormatwithcheck.findformat != true) { Console.WriteLine("Did not find preferred swap chain format, using first available format."); } this.swapChainFormat = swapChainFormatwithcheck.Item1; var swapChainPresentModewithcheck = ChooseSwapPresentMode(swapChainPresentModes); if (swapChainPresentModewithcheck.findpresent != true) { Console.WriteLine("Did not find preferred swap chain present mode, using first available present mode."); } this.swapChainPresentMode = swapChainPresentModewithcheck.Item1; var swapChainExtentwithcheck = ChooseSwapExtent(surfaceCapabilities); if (swapChainExtentwithcheck.success != true) { Console.WriteLine("Swap chain extent is not current, using window size."); } this.swapChainExtent = swapChainExtentwithcheck.Item1; var minImageCount = Math.Max(3u, surfaceCapabilities.minImageCount); minImageCount = (surfaceCapabilities.maxImageCount > 0 && minImageCount > surfaceCapabilities.maxImageCount) ? surfaceCapabilities.maxImageCount : minImageCount; uint imageCount = surfaceCapabilities.minImageCount + 1; if (surfaceCapabilities.maxImageCount > 0 && imageCount > surfaceCapabilities.maxImageCount) { imageCount = surfaceCapabilities.maxImageCount; }
swapchainCreateInfoKHR.pQueueFamilyIndices = pQueueFamilyIndices; } else { swapchainCreateInfoKHR.imageSharingMode = VkSharingMode.Exclusive; swapchainCreateInfoKHR.queueFamilyIndexCount = 0; // Optional swapchainCreateInfoKHR.pQueueFamilyIndices = null; // Optional } result = deviceApi.vkCreateSwapchainKHR(this.device, &swapchainCreateInfoKHR, null, out this.swapchain); if (result != VkResult.Success) { throw new Exception("Failed to create swap chain"); } result = deviceApi.vkGetSwapchainImagesKHR(this.device, this.swapchain, out uint swapchainImageCount); if (result != VkResult.Success || swapchainImageCount == 0) { throw new Exception("Failed to get swap chain image count"); } this.swapChainImages = new VkImage[swapchainImageCount]; } Span swapchainImages = swapChainImages; result = deviceApi.vkGetSwapchainImagesKHR(this.device, this.swapchain, swapchainImages); if (result != VkResult.Success) { throw new Exception("Failed to get swap chain images"); } } [/code] как видите, я не прошел [code]VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_STORAGE_BIT [/code] Я перехожу на Linux, все возвращается в норму. Также я пытаюсь использовать c api в C++, но результат тот же vkcube работает Я сделал ссылку https://docs.vulkan.org/tutorial/latest/03_Drawing_a_triangle/01_Presentation/01_Swap_chain.html#_creating_the_swap_chain
Может ли кто-нибудь сказать мне, как правильно с этим справиться?