tests: Check color attachment feature before selecting mem types
diff --git a/tests/image_tests.cpp b/tests/image_tests.cpp
index 3597f72..aec9460 100644
--- a/tests/image_tests.cpp
+++ b/tests/image_tests.cpp
@@ -180,10 +180,14 @@
imageCreateInfo.extent.depth = 1;
imageCreateInfo.mipLevels = mipCount;
imageCreateInfo.samples = 1;
- if (image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) {
+ if ((image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) &&
+ (image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
+ {
imageCreateInfo.tiling = VK_IMAGE_TILING_LINEAR;
}
- else if (image_fmt.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) {
+ else if ((image_fmt.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) &&
+ (image_fmt.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
+ {
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
}
else {