You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix ubsan reported errors in rendering
This allows the TPS demo to run without an ubsan reports from any of the rendering code.
This commit is contained in:
@@ -1898,10 +1898,10 @@ RDD::TextureID RenderingDeviceDriverVulkan::texture_create_shared(TextureID p_or
|
||||
vkGetPhysicalDeviceFormatProperties(physical_device, RD_TO_VK_FORMAT[p_view.format], &properties);
|
||||
const VkFormatFeatureFlags &supported_flags = owner_tex_info->vk_create_info.tiling == VK_IMAGE_TILING_LINEAR ? properties.linearTilingFeatures : properties.optimalTilingFeatures;
|
||||
if ((usage_info->usage & VK_IMAGE_USAGE_STORAGE_BIT) && !(supported_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)) {
|
||||
usage_info->usage &= ~VK_IMAGE_USAGE_STORAGE_BIT;
|
||||
usage_info->usage &= ~uint32_t(VK_IMAGE_USAGE_STORAGE_BIT);
|
||||
}
|
||||
if ((usage_info->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) && !(supported_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
|
||||
usage_info->usage &= ~VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
usage_info->usage &= ~uint32_t(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user