diff options
author | Connor Abbott <cwabbott0@gmail.com> | 2017-02-14 12:23:59 -0500 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-03-14 00:13:16 +0000 |
commit | aede9fc7aea6a31f861db426db4b8b211791ef52 (patch) | |
tree | 8cf00aa1d99a99ec177c58edcf8cbc9c52974f2e /src | |
parent | 6e0ad8b73e1f473d791de16c61698bbb9402d18a (diff) |
anv: fix Get*MemoryRequirements for !LLC
Even though we supported both coherent and non-coherent memory types, we
effectively forced apps to use the coherent types by accident. Found by
inspection, only compile tested.
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6319bfc2a6497d708ead536b9a6d5d5a00c1f2f3)
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index fd55c046913..017fbbf27d4 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1412,11 +1412,12 @@ VkResult anv_InvalidateMappedMemoryRanges( } void anv_GetBufferMemoryRequirements( - VkDevice device, + VkDevice _device, VkBuffer _buffer, VkMemoryRequirements* pMemoryRequirements) { ANV_FROM_HANDLE(anv_buffer, buffer, _buffer); + ANV_FROM_HANDLE(anv_device, device, _device); /* The Vulkan spec (git aaed022) says: * @@ -1425,20 +1426,21 @@ void anv_GetBufferMemoryRequirements( * only if the memory type `i` in the VkPhysicalDeviceMemoryProperties * structure for the physical device is supported. * - * We support exactly one memory type. + * We support exactly one memory type on LLC, two on non-LLC. */ - pMemoryRequirements->memoryTypeBits = 1; + pMemoryRequirements->memoryTypeBits = device->info.has_llc ? 1 : 3; pMemoryRequirements->size = buffer->size; pMemoryRequirements->alignment = 16; } void anv_GetImageMemoryRequirements( - VkDevice device, + VkDevice _device, VkImage _image, VkMemoryRequirements* pMemoryRequirements) { ANV_FROM_HANDLE(anv_image, image, _image); + ANV_FROM_HANDLE(anv_device, device, _device); /* The Vulkan spec (git aaed022) says: * @@ -1447,9 +1449,9 @@ void anv_GetImageMemoryRequirements( * only if the memory type `i` in the VkPhysicalDeviceMemoryProperties * structure for the physical device is supported. * - * We support exactly one memory type. + * We support exactly one memory type on LLC, two on non-LLC. */ - pMemoryRequirements->memoryTypeBits = 1; + pMemoryRequirements->memoryTypeBits = device->info.has_llc ? 1 : 3; pMemoryRequirements->size = image->size; pMemoryRequirements->alignment = image->alignment; |