On 24 July 2017 at 16:49, Bas Nieuwenhuizen <[email protected]> wrote:
> On Mon, Jul 24, 2017 at 5:03 AM, Dave Airlie <[email protected]> wrote:
>> From: Dave Airlie <[email protected]>
>>
>> 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 <[email protected]>
>> ---
>>  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.

Dave.
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to