aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Giessen <charles@lunarg.com>2020-04-27 14:23:28 -0600
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2020-05-20 13:31:44 -0600
commit0c4ea014bf289e8b0a8501c3e89c8bc4ecf9f0a4 (patch)
tree5ab49e1bb33df78e5516f4f317b60b6cefefc38c
parent897f5bfd73af36649f06e5d12bb6a1c48e051d99 (diff)
downloadusermoji-0c4ea014bf289e8b0a8501c3e89c8bc4ecf9f0a4.tar.xz
vulkaninfo: correct memory for linear tiled images
Previously vulkaninfo would always add the VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT for linearly tiled images, which is not supported by the spec. Vulkaninfo will now not query support for linear tiled images that are of the color format and no longer adds the aformentioned image usage flag, instead using the VK_IMAGE_USAGE_TRANSFER_SRC_BIT. Change-Id: Ida71b738060e893b7e270005e358d51622ee0c4f
-rw-r--r--vulkaninfo/vulkaninfo.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h
index 5b5e0872..c83691b4 100644
--- a/vulkaninfo/vulkaninfo.h
+++ b/vulkaninfo/vulkaninfo.h
@@ -1454,12 +1454,23 @@ struct AppGpu {
GetImageCreateInfo(format, tiling, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, 0);
VkImageCreateInfo image_ci_sparse = GetImageCreateInfo(format, tiling, 0, VK_IMAGE_CREATE_SPARSE_BINDING_BIT);
- if (format == color_format) {
- image_ci_regular.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
- image_ci_transient.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ if (tiling == VK_IMAGE_TILING_LINEAR) {
+ if (format == color_format) {
+ image_ci_regular.usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ image_ci_transient.usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ } else {
+ // linear tiling is only applicable to color image types
+ continue;
+ }
} else {
- image_ci_regular.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
- image_ci_transient.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ if (format == color_format) {
+ image_ci_regular.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ image_ci_transient.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+
+ } else {
+ image_ci_regular.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ image_ci_transient.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ }
}
auto image_ts_regular =