mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 18:10:11 +01:00
panvk: Base memoryTypeBits on phys_dev->type_count
Stop hard-coding 1 and just advertise everything on the physical device. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36385>
This commit is contained in:
parent
ba293b1e49
commit
2afef24d3f
3 changed files with 14 additions and 3 deletions
|
|
@ -37,6 +37,8 @@ panvk_GetDeviceBufferMemoryRequirements(VkDevice _device,
|
|||
VkMemoryRequirements2 *pMemoryRequirements)
|
||||
{
|
||||
VK_FROM_HANDLE(panvk_device, device, _device);
|
||||
struct panvk_physical_device *phys_dev =
|
||||
to_panvk_physical_device(device->vk.physical);
|
||||
|
||||
/* For sparse resources alignment specifies binding granularity, rather than
|
||||
* the alignment requirement. It's up to us to satisfy the alignment
|
||||
|
|
@ -48,7 +50,8 @@ panvk_GetDeviceBufferMemoryRequirements(VkDevice _device,
|
|||
: 64;
|
||||
const uint64_t size = align64(pInfo->pCreateInfo->size, align);
|
||||
|
||||
pMemoryRequirements->memoryRequirements.memoryTypeBits = 1;
|
||||
pMemoryRequirements->memoryRequirements.memoryTypeBits =
|
||||
BITFIELD_MASK(phys_dev->memory.type_count);
|
||||
pMemoryRequirements->memoryRequirements.alignment = align;
|
||||
pMemoryRequirements->memoryRequirements.size = size;
|
||||
|
||||
|
|
|
|||
|
|
@ -396,8 +396,13 @@ panvk_GetMemoryFdPropertiesKHR(VkDevice _device,
|
|||
int fd,
|
||||
VkMemoryFdPropertiesKHR *pMemoryFdProperties)
|
||||
{
|
||||
VK_FROM_HANDLE(panvk_device, device, _device);
|
||||
const struct panvk_physical_device *phys_dev =
|
||||
to_panvk_physical_device(device->vk.physical);
|
||||
|
||||
assert(handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
|
||||
pMemoryFdProperties->memoryTypeBits = 1;
|
||||
pMemoryFdProperties->memoryTypeBits =
|
||||
BITFIELD_MASK(phys_dev->memory.type_count);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -817,6 +817,8 @@ panvk_GetImageMemoryRequirements2(VkDevice device,
|
|||
VkMemoryRequirements2 *pMemoryRequirements)
|
||||
{
|
||||
VK_FROM_HANDLE(panvk_image, image, pInfo->image);
|
||||
struct panvk_physical_device *phys_dev =
|
||||
to_panvk_physical_device(image->vk.base.device->physical);
|
||||
|
||||
/* For sparse resources alignment specifies binding granularity, rather than
|
||||
* the alignment requirement. It's up to us to satisfy the alignment
|
||||
|
|
@ -840,7 +842,8 @@ panvk_GetImageMemoryRequirements2(VkDevice device,
|
|||
? align64(size_non_sparse, alignment)
|
||||
: size_non_sparse;
|
||||
|
||||
pMemoryRequirements->memoryRequirements.memoryTypeBits = 1;
|
||||
pMemoryRequirements->memoryRequirements.memoryTypeBits =
|
||||
BITFIELD_MASK(phys_dev->memory.type_count);
|
||||
pMemoryRequirements->memoryRequirements.alignment = alignment;
|
||||
pMemoryRequirements->memoryRequirements.size = size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue