diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-09-24 13:42:31 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-10-10 17:02:34 +0000 |
commit | 4a495e1a857ba344ec14924cf2247f1124c80e85 (patch) | |
tree | 77b03ed31c19fa5cf34f3b2550ade2dfa0dcc2c3 /src/amd/vulkan | |
parent | 64768111c302014a6ae8db6122dedf0d5e5168cc (diff) |
radv: Unset vk_info in radv_image_create_layout.
For better test coverage of this corner case.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_image.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index baf49c6b65a..9df7dd4ae81 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1348,14 +1348,18 @@ static void radv_image_disable_htile(struct radv_image *image) static VkResult radv_image_create_layout(struct radv_device *device, - const struct radv_image_create_info *create_info, + struct radv_image_create_info create_info, struct radv_image *image) { /* Check that we did not initialize things earlier */ assert(!image->planes[0].surface.surf_size); + /* Clear the pCreateInfo pointer so we catch issues in the delayed case when we test in the + * common internal case. */ + create_info.vk_info = NULL; + struct ac_surf_info image_info = image->info; - VkResult result = radv_patch_image_from_extra_info(device, image, create_info, &image_info); + VkResult result = radv_patch_image_from_extra_info(device, image, &create_info, &image_info); if (result != VK_SUCCESS) return result; @@ -1382,7 +1386,7 @@ radv_image_create_layout(struct radv_device *device, image->planes[plane].format = vk_format_get_plane_format(image->vk_format, plane); } - if (!create_info->no_metadata_planes) { + if (!create_info.no_metadata_planes) { /* Try to enable DCC first. */ if (radv_image_can_enable_dcc(device, image)) { radv_image_alloc_dcc(image); @@ -1488,7 +1492,7 @@ radv_image_create(VkDevice _device, radv_init_surface(device, image, &image->planes[plane].surface, plane, pCreateInfo); } - ASSERTED VkResult result = radv_image_create_layout(device, create_info, image); + ASSERTED VkResult result = radv_image_create_layout(device, *create_info, image); assert(result == VK_SUCCESS); if (image->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) { |