mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-26 08:45:59 +00:00
Image: Perform additional sanity checks
These new format features where introduced with VH_KHR_maintenance1.
This commit is contained in:
parent
2a448197cf
commit
7f3b267865
@ -139,6 +139,14 @@ impl UnsafeImage {
|
||||
if usage.input_attachment && (features & (vk::FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | vk::FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) == 0) {
|
||||
return Err(ImageCreationError::UnsupportedUsage);
|
||||
}
|
||||
if device.loaded_extensions().khr_maintenance1 {
|
||||
if usage.transfer_source && (features & vk::FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR == 0) {
|
||||
return Err(ImageCreationError::UnsupportedUsage);
|
||||
}
|
||||
if usage.transfer_dest && (features & vk::FORMAT_FEATURE_TRANSFER_DST_BIT_KHR == 0) {
|
||||
return Err(ImageCreationError::UnsupportedUsage);
|
||||
}
|
||||
}
|
||||
|
||||
features
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user