icd:Limit image properties for linear images
authorTobin Ehlis <tobine@google.com>
Thu, 26 Oct 2017 21:21:51 +0000 (15:21 -0600)
committerTobin Ehlis <tobine@google.com>
Mon, 30 Oct 2017 17:01:05 +0000 (11:01 -0600)
If an image is linear, return max mips, layers, and sample count of 1.

scripts/mock_icd_generator.py

index f959788..e9dda6f 100644 (file)
@@ -599,7 +599,12 @@ CUSTOM_C_INTERCEPTS = {
 ''',
 'vkGetPhysicalDeviceImageFormatProperties': '''
     // TODO: Just hard-coding some values for now
-    *pImageFormatProperties = { { 4096, 4096, 256 }, 12, 256, 0x7F, 4294967296 };
+    // TODO: If tiling is linear, limit the mips, levels, & sample count
+    if (VK_IMAGE_TILING_LINEAR == tiling) {
+        *pImageFormatProperties = { { 4096, 4096, 256 }, 1, 1, VK_SAMPLE_COUNT_1_BIT, 4294967296 };
+    } else {
+        *pImageFormatProperties = { { 4096, 4096, 256 }, 12, 256, 0x7F, 4294967296 };
+    }
     return VK_SUCCESS;
 ''',
 'vkGetPhysicalDeviceImageFormatProperties2KHR': '''