util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero
The new name make the zero-input behavior more obvious. The next patch adds a new function with different zero-input behavior. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Suggested-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
This commit is contained in:
@@ -638,13 +638,13 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
|
||||
tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
|
||||
}
|
||||
}
|
||||
if (tiled && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
|
||||
if (tiled && util_is_power_of_two_or_zero(vk_format_get_blocksize(format)) && !scaled) {
|
||||
tiled |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
|
||||
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
|
||||
}
|
||||
}
|
||||
|
||||
if (linear && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
|
||||
if (linear && util_is_power_of_two_or_zero(vk_format_get_blocksize(format)) && !scaled) {
|
||||
linear |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
|
||||
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user