aboutsummaryrefslogtreecommitdiff
path: root/icd
diff options
context:
space:
mode:
authorTony Barbour <tony@lunarg.com>2023-08-02 13:11:28 -0600
committerTony Barbour <tony@lunarg.com>2023-08-11 11:16:02 -0600
commit300d9bf6b3cf7b237ee5e2c1d0ae10b9236f82d3 (patch)
treecac27c80eba23d87762f7e88387929f30052c302 /icd
parent1d8188a974ccd08caffb5bd7fec58751e0c7d786 (diff)
downloadusermoji-300d9bf6b3cf7b237ee5e2c1d0ae10b9236f82d3.tar.xz
icd: Add support for VK_EXT_host_image_copy
Diffstat (limited to 'icd')
-rw-r--r--icd/generated/function_definitions.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/icd/generated/function_definitions.h b/icd/generated/function_definitions.h
index 9f9155ba..bd4b8476 100644
--- a/icd/generated/function_definitions.h
+++ b/icd/generated/function_definitions.h
@@ -2898,6 +2898,11 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(
feat_bools = (VkBool32*)&blendop_features->advancedBlendCoherentOperations;
SetBoolArrayTrue(feat_bools, num_bools);
}
+ const auto *host_image_copy_features = lvl_find_in_chain<VkPhysicalDeviceHostImageCopyFeaturesEXT>(pFeatures->pNext);
+ if (host_image_copy_features) {
+ feat_bools = (VkBool32*)&host_image_copy_features->hostImageCopy;
+ SetBoolArrayTrue(feat_bools, 1);
+ }
}
static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(
@@ -2993,6 +2998,33 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(
fragment_density_map2_props->maxSubsampledArrayLayers = 2;
fragment_density_map2_props->maxDescriptorSetSubsampledSamplers = 1;
}
+
+ const uint32_t num_copy_layouts = 5;
+ const VkImageLayout HostCopyLayouts[]{
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+ VK_IMAGE_LAYOUT_GENERAL,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL,
+ VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL,
+ VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
+ };
+
+ auto *host_image_copy_props = lvl_find_mod_in_chain< VkPhysicalDeviceHostImageCopyPropertiesEXT>(pProperties->pNext);
+ if (host_image_copy_props){
+ if (host_image_copy_props->pCopyDstLayouts == nullptr) host_image_copy_props->copyDstLayoutCount = num_copy_layouts;
+ else {
+ uint32_t num_layouts = (std::min)(host_image_copy_props->copyDstLayoutCount, num_copy_layouts);
+ for (uint32_t i = 0; i < num_layouts; i++) {
+ host_image_copy_props->pCopyDstLayouts[i] = HostCopyLayouts[i];
+ }
+ }
+ if (host_image_copy_props->pCopySrcLayouts == nullptr) host_image_copy_props->copySrcLayoutCount = num_copy_layouts;
+ else {
+ uint32_t num_layouts = (std::min)(host_image_copy_props->copySrcLayoutCount, num_copy_layouts);
+ for (uint32_t i = 0; i < num_layouts; i++) {
+ host_image_copy_props->pCopySrcLayouts[i] = HostCopyLayouts[i];
+ }
+ }
+ }
}
static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(
@@ -3006,6 +3038,7 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(
props_3->linearTilingFeatures = pFormatProperties->formatProperties.linearTilingFeatures;
props_3->optimalTilingFeatures = pFormatProperties->formatProperties.optimalTilingFeatures;
props_3->bufferFeatures = pFormatProperties->formatProperties.bufferFeatures;
+ props_3->optimalTilingFeatures |= VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT;
}
}