diff options
author | Simon Ser <contact@emersion.fr> | 2022-12-02 10:46:13 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-12-02 16:10:42 +0100 |
commit | bc7f8de842a9525e1be4d0e1716282a956943739 (patch) | |
tree | 2fbf194dcc9606d3b0501c42c27bdc72e8c046f5 /render/vulkan | |
parent | 338a9616bdb5b0067af09c907c61fc608b47dc76 (diff) |
render/vulkan: improve message on format prop error
Use a more appropriate message on
vkGetPhysicalDeviceImageFormatProperties2() error.
Diffstat (limited to 'render/vulkan')
-rw-r--r-- | render/vulkan/pixel_format.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c index 9442ce3e..9362294a 100644 --- a/render/vulkan/pixel_format.c +++ b/render/vulkan/pixel_format.c @@ -220,10 +220,12 @@ static bool query_modifier_usage_support(struct wlr_vk_device *dev, VkFormat vk_ res = vkGetPhysicalDeviceImageFormatProperties2(dev->phdev, &fmti, &ifmtp); if (res != VK_SUCCESS) { - if (res != VK_ERROR_FORMAT_NOT_SUPPORTED) { + if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) { + *errmsg = "unsupported format"; + } else { wlr_vk_error("vkGetPhysicalDeviceImageFormatProperties2", res); + *errmsg = "failed to get format properties"; } - *errmsg = "unsupported format"; return false; } else if (!(emp->externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT)) { *errmsg = "import not supported"; @@ -370,12 +372,12 @@ void vulkan_format_props_query(struct wlr_vk_device *dev, res = vkGetPhysicalDeviceImageFormatProperties2(dev->phdev, &fmti, &ifmtp); if (res != VK_SUCCESS) { - if (res != VK_ERROR_FORMAT_NOT_SUPPORTED) { - wlr_vk_error("vkGetPhysicalDeviceImageFormatProperties2", - res); + if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) { + shm_texture_status = "✗ texture (unsupported format)"; + } else { + wlr_vk_error("vkGetPhysicalDeviceImageFormatProperties2", res); + shm_texture_status = "✗ texture (failed to get format properties)"; } - - shm_texture_status = "✗ texture (unsupported format)"; } else { VkExtent3D me = ifmtp.imageFormatProperties.maxExtent; props.max_extent.width = me.width; @@ -430,4 +432,3 @@ struct wlr_vk_format_modifier_props *vulkan_format_props_find_modifier( return NULL; } - |