From: Connor Abbott Date: Tue, 14 Feb 2017 17:23:59 +0000 (-0500) Subject: anv: fix Get*MemoryRequirements for !LLC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6319bfc2a6497d708ead536b9a6d5d5a00c1f2f3;p=mesa.git 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 Reviewed-by: Jason Ekstrand Cc: "17.0" --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 46b83a3617e..57d70b625c1 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1554,11 +1554,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: * @@ -1567,20 +1568,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: * @@ -1589,9 +1591,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;