diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-27 13:01:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 13:01:46 +0200 |
commit | 57ac63872435010effce42a8fc06958cb9dfea46 (patch) | |
tree | 391293e8b2ff4e1f680412a45fc7512467c2fbb1 /drivers | |
parent | d7a1acd229f5b4b358a6cbdf4557ce6fb478a9fe (diff) | |
parent | 06333fb73223b2735bb6713c2529a5d65991201f (diff) |
Merge pull request #63314 from RandomShaper/validate_vrs_format
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 9abd4780eb..e7e97671ae 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -1834,6 +1834,10 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T if (p_format.usage_bits & TEXTURE_USAGE_STORAGE_ATOMIC_BIT && !(flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT)) { ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as atomic storage image."); } + + if (p_format.usage_bits & TEXTURE_USAGE_VRS_ATTACHMENT_BIT && !(flags & VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as VRS attachment."); + } } //some view validation @@ -3354,6 +3358,10 @@ bool RenderingDeviceVulkan::texture_is_format_supported_for_usage(DataFormat p_f return false; } + if (p_usage & TEXTURE_USAGE_VRS_ATTACHMENT_BIT && !(flags & VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { + return false; + } + return true; } |