aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-03-01 16:19:36 -0700
committerMark Lobodzinski <mark@lunarg.com>2017-03-13 16:02:59 -0600
commit51007d5abfdc1ffcd9b66c0019b6cc7c7bedbc79 (patch)
tree64a3e16c27965faa8f6f1ee063d4ce5c45902085
parent5d5fafff2b63795a5e5bdba32183b1b5fccf8e9b (diff)
downloadusermoji-51007d5abfdc1ffcd9b66c0019b6cc7c7bedbc79.tar.xz
layers: Add textureCompressionBC feature check
Change-Id: I4eca8c73a1cc2549402b436f8634fa9e72b9b9ce
-rw-r--r--layers/parameter_validation.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp
index 76c69cd2..3ff9659f 100644
--- a/layers/parameter_validation.cpp
+++ b/layers/parameter_validation.cpp
@@ -2561,6 +2561,15 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI
string_VkFormat(pCreateInfo->format));
}
+ if ((device_data->physical_device_features.textureCompressionBC == false) &&
+ vk_format_is_compressed_BC(pCreateInfo->format)) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+ DEVICE_FEATURE, LayerName,
+ "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionBC feature is "
+ "not enabled: BC compressed formats cannot be used to create images.",
+ string_VkFormat(pCreateInfo->format));
+ }
+
// Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml
if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) {
// If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1