[Mesa-dev] [PATCH] radv: allow buffers to be shareable as well.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Mon Jul 24 07:15:21 UTC 2017
On Mon, Jul 24, 2017 at 9:13 AM, Dave Airlie <airlied at gmail.com> wrote:
> On 24 July 2017 at 16:49, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl> wrote:
>> On Mon, Jul 24, 2017 at 5:03 AM, Dave Airlie <airlied at gmail.com> wrote:
>>> From: Dave Airlie <airlied at redhat.com>
>>>
>>> Buffers should report dedicated flags as well, so report the
>>> same information for them as for images.
>>>
>>> (alternately we can turn dedicated off for buffers maybe?)
>>>
>>> Fixes CTS dEQP-VK.api.external.memory.opaque_fd.dedicated.buffer.info
>>>
>>> Fixes: b70829708a (radv: Implement VK_KHR_external_memory)
>>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>>> ---
>>> src/amd/vulkan/radv_device.c | 5 ++++-
>>> src/amd/vulkan/radv_private.h | 1 +
>>> 2 files changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
>>> index 40b2f34..4b11a4f 100644
>>> --- a/src/amd/vulkan/radv_device.c
>>> +++ b/src/amd/vulkan/radv_device.c
>>> @@ -2389,12 +2389,13 @@ void radv_GetBufferMemoryRequirements2KHR(
>>> radv_GetBufferMemoryRequirements(device, pInfo->buffer,
>>> &pMemoryRequirements->memoryRequirements);
>>>
>>> + RADV_FROM_HANDLE(radv_buffer, buffer, pInfo->buffer);
>>> vk_foreach_struct(ext, pMemoryRequirements->pNext) {
>>> switch (ext->sType) {
>>> case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: {
>>> VkMemoryDedicatedRequirementsKHR *req =
>>> (VkMemoryDedicatedRequirementsKHR *) ext;
>>> - req->requiresDedicatedAllocation = false;
>>> + req->requiresDedicatedAllocation = buffer->shareable;
>>> req->prefersDedicatedAllocation = req->requiresDedicatedAllocation;
>>
>> Just always do false here and ignore the entire shareable thing?
>
> Well that's pretty much what the code does now. Do we want buffers to
> be shareable?
> do they need a dedicated allocation (i.e. can have allocation have
> images and buffers in
> it that the buffers get shared from, I assume this would fail due to
> metadata but probably not).
>
> The other option is to disable the dedicateed flag on buffers.
That is what I meant, just always use requiresDedicatedAllocation = false.
- Bas
>
> Dave.
More information about the mesa-dev
mailing list