Mesa (main): pvr: Add support for R32G32B32A32_UINT, R32_UINT and R8_UINT formats.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 7 14:02:37 UTC 2022


Module: Mesa
Branch: main
Commit: ce36859b950c4009b5848dd7611d09488c210736
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce36859b950c4009b5848dd7611d09488c210736

Author: Rajnesh Kanwal <rajnesh.kanwal at imgtec.com>
Date:   Mon May 16 14:27:40 2022 +0100

pvr: Add support for R32G32B32A32_UINT, R32_UINT and R8_UINT formats.

These formats are required by vkCmdCopyBuffer implementation. The
formats in pvr_format_table are exposed to applications as well.
Given these formats are supported for rendering and sampling, there
shouldn't be a problem exposing these to applications.

Co-authored-by: Karmjit Mahil <Karmjit.Mahil at imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal at imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil at imgtec.com>
Reviewed-by: Frank Binns <frank.binns at imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

---

 src/imagination/vulkan/pvr_formats.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/imagination/vulkan/pvr_formats.c b/src/imagination/vulkan/pvr_formats.c
index 33a0a348385..49ea9f14485 100644
--- a/src/imagination/vulkan/pvr_formats.c
+++ b/src/imagination/vulkan/pvr_formats.c
@@ -25,6 +25,7 @@
 
 #include "pvr_formats.h"
 #include "pvr_private.h"
+#include "vk_enum_to_str.h"
 #include "vk_format.h"
 #include "vk_log.h"
 #include "vk_util.h"
@@ -46,7 +47,15 @@ struct pvr_format {
 
 /* TODO: add all supported core formats */
 static const struct pvr_format pvr_format_table[] = {
+   /* VK_FORMAT_R8_UINT = 13. */
+   FORMAT(R8_UINT, U8, U8),
+   /* VK_FORMAT_B8G8R8A8_UNORM = 44. */
    FORMAT(B8G8R8A8_UNORM, U8U8U8U8, U8U8U8U8),
+   /* VK_FORMAT_R32_UINT = 98. */
+   FORMAT(R32_UINT, U32, U32),
+   /* VK_FORMAT_R32G32B32A32_UINT = 107. */
+   FORMAT(R32G32B32A32_UINT, U32U32U32U32, U32U32U32U32),
+   /* VK_FORMAT_D32_SFLOAT = 126. */
    FORMAT(D32_SFLOAT, F32, F32),
 };
 
@@ -59,6 +68,10 @@ static inline const struct pvr_format *pvr_get_format(VkFormat vk_format)
       return &pvr_format_table[vk_format];
    }
 
+   mesa_logd("Format %s(%d) not supported\n",
+             vk_Format_to_str(vk_format),
+             vk_format);
+
    return NULL;
 }
 



More information about the mesa-commit mailing list