mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
pvr: respect has_pbe_stride_align_1pixel
This makes us either use the rogue-define, or a single pixel. This feature isn't available in any HW we support yet, but that is going to change soon. Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38423>
This commit is contained in:
parent
ba47e03908
commit
b8721b7436
1 changed files with 15 additions and 4 deletions
|
|
@ -65,7 +65,9 @@ static void pvr_image_init_memlayout(struct pvr_image *image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pvr_image_init_physical_extent(struct pvr_image *image)
|
static void
|
||||||
|
pvr_image_init_physical_extent(struct pvr_image *image,
|
||||||
|
unsigned pbe_stride_align)
|
||||||
{
|
{
|
||||||
assert(image->memlayout != PVR_MEMLAYOUT_UNDEFINED);
|
assert(image->memlayout != PVR_MEMLAYOUT_UNDEFINED);
|
||||||
|
|
||||||
|
|
@ -90,8 +92,7 @@ static void pvr_image_init_physical_extent(struct pvr_image *image)
|
||||||
if (image->vk.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
if (image->vk.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
||||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
|
VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
|
||||||
image->physical_extent.width =
|
image->physical_extent.width =
|
||||||
align(image->physical_extent.width,
|
align(image->physical_extent.width, pbe_stride_align);
|
||||||
ROGUE_PBESTATE_REG_WORD0_LINESTRIDE_UNIT_SIZE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -153,6 +154,13 @@ static void pvr_image_setup_mip_levels(struct pvr_image *image)
|
||||||
image->size = image->layer_size * image->vk.array_layers;
|
image->size = image->layer_size * image->vk.array_layers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned
|
||||||
|
get_pbe_stride_align(const struct pvr_device_info *dev_info)
|
||||||
|
{
|
||||||
|
return PVR_HAS_FEATURE(dev_info, pbe_stride_align_1pixel) ?
|
||||||
|
1 : ROGUE_PBESTATE_REG_WORD0_LINESTRIDE_UNIT_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
VkResult pvr_CreateImage(VkDevice _device,
|
VkResult pvr_CreateImage(VkDevice _device,
|
||||||
const VkImageCreateInfo *pCreateInfo,
|
const VkImageCreateInfo *pCreateInfo,
|
||||||
const VkAllocationCallbacks *pAllocator,
|
const VkAllocationCallbacks *pAllocator,
|
||||||
|
|
@ -182,9 +190,12 @@ VkResult pvr_CreateImage(VkDevice _device,
|
||||||
*/
|
*/
|
||||||
image->alignment = 4096U;
|
image->alignment = 4096U;
|
||||||
|
|
||||||
|
unsigned pbe_stride_align =
|
||||||
|
get_pbe_stride_align(&device->pdevice->dev_info);
|
||||||
|
|
||||||
/* Initialize the image using the saved information from pCreateInfo */
|
/* Initialize the image using the saved information from pCreateInfo */
|
||||||
pvr_image_init_memlayout(image);
|
pvr_image_init_memlayout(image);
|
||||||
pvr_image_init_physical_extent(image);
|
pvr_image_init_physical_extent(image, pbe_stride_align);
|
||||||
pvr_image_setup_mip_levels(image);
|
pvr_image_setup_mip_levels(image);
|
||||||
|
|
||||||
*pImage = pvr_image_to_handle(image);
|
*pImage = pvr_image_to_handle(image);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue