[Mesa-dev] [PATCH 10/28] radv/image: Implement the wsi "extension"
Jason Ekstrand
jason at jlekstrand.net
Thu Nov 16 21:28:58 UTC 2017
---
src/amd/vulkan/radv_device.c | 2 ++
src/amd/vulkan/radv_image.c | 15 +++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 722c768..58a4604 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2159,6 +2159,8 @@ VkResult radv_alloc_memory(VkDevice _device,
if (dedicate_info) {
mem->image = radv_image_from_handle(dedicate_info->image);
mem->buffer = radv_buffer_from_handle(dedicate_info->buffer);
+ if (mem->image->surface.flags & RADEON_SURF_SCANOUT)
+ flags |= RADEON_FLAG_IMPLICIT_SYNC;
} else {
mem->image = NULL;
mem->buffer = NULL;
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 163d35d..b4abec3 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1113,11 +1113,22 @@ radv_CreateImage(VkDevice device,
const VkAllocationCallbacks *pAllocator,
VkImage *pImage)
{
+ bool scanout = false;
+ vk_foreach_struct_const(s, pCreateInfo->pNext) {
+ switch (s->sType) {
+ case WSI_STRUCTURE_TYPE_IMAGE_CREATE_INFO:
+ scanout = true;
+ break;
+ default:
+ break;
+ }
+ }
+
return radv_image_create(device,
&(struct radv_image_create_info) {
.vk_info = pCreateInfo,
- .scanout = false,
- },
+ .scanout = scanout,
+ },
pAllocator,
pImage);
}
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list