mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
pvr: Add PBE accum format size in bytes.
This will be used later on to implement vkCmdClearAttachments() where we'll need to pick the appropriate clear color shader based on the dwords used. Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19218>
This commit is contained in:
parent
87eb4f4f4f
commit
81a90c1e48
2 changed files with 37 additions and 0 deletions
|
|
@ -245,6 +245,42 @@ uint32_t pvr_get_pbe_accum_format(VkFormat vk_format)
|
|||
return PVR_PBE_ACCUM_FORMAT_INVALID;
|
||||
}
|
||||
|
||||
uint32_t pvr_get_pbe_accum_format_size_in_bytes(VkFormat vk_format)
|
||||
{
|
||||
enum pvr_pbe_accum_format pbe_accum_format;
|
||||
uint32_t nr_components;
|
||||
|
||||
pbe_accum_format = pvr_get_pbe_accum_format(vk_format);
|
||||
nr_components = vk_format_get_nr_components(vk_format);
|
||||
|
||||
switch (pbe_accum_format) {
|
||||
case PVR_PBE_ACCUM_FORMAT_U8:
|
||||
case PVR_PBE_ACCUM_FORMAT_S8:
|
||||
case PVR_PBE_ACCUM_FORMAT_UINT8:
|
||||
case PVR_PBE_ACCUM_FORMAT_SINT8:
|
||||
return nr_components * 1;
|
||||
|
||||
case PVR_PBE_ACCUM_FORMAT_U16:
|
||||
case PVR_PBE_ACCUM_FORMAT_S16:
|
||||
case PVR_PBE_ACCUM_FORMAT_F16:
|
||||
case PVR_PBE_ACCUM_FORMAT_UINT16:
|
||||
case PVR_PBE_ACCUM_FORMAT_SINT16:
|
||||
return nr_components * 2;
|
||||
|
||||
case PVR_PBE_ACCUM_FORMAT_F32:
|
||||
case PVR_PBE_ACCUM_FORMAT_UINT32:
|
||||
case PVR_PBE_ACCUM_FORMAT_SINT32:
|
||||
case PVR_PBE_ACCUM_FORMAT_UINT32_MEDP:
|
||||
case PVR_PBE_ACCUM_FORMAT_SINT32_MEDP:
|
||||
case PVR_PBE_ACCUM_FORMAT_U1010102:
|
||||
case PVR_PBE_ACCUM_FORMAT_U24:
|
||||
return nr_components * 4;
|
||||
|
||||
default:
|
||||
unreachable("Unknown pbe accum format. Implementation error");
|
||||
}
|
||||
}
|
||||
|
||||
static VkFormatFeatureFlags
|
||||
pvr_get_image_format_features(const struct pvr_format *pvr_format,
|
||||
VkImageTiling vk_tiling)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ const uint8_t *pvr_get_format_swizzle(VkFormat vk_format);
|
|||
uint32_t pvr_get_tex_format(VkFormat vk_format);
|
||||
uint32_t pvr_get_pbe_packmode(VkFormat vk_format);
|
||||
uint32_t pvr_get_pbe_accum_format(VkFormat vk_format);
|
||||
uint32_t pvr_get_pbe_accum_format_size_in_bytes(VkFormat vk_format);
|
||||
bool pvr_format_is_pbe_downscalable(VkFormat vk_format);
|
||||
|
||||
#endif /* PVR_FORMATS_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue