1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2022 Imagination Technologies Ltd.
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
5bf215546Sopenharmony_ci * of this software and associated documentation files (the "Software"), to deal
6bf215546Sopenharmony_ci * in the Software without restriction, including without limitation the rights
7bf215546Sopenharmony_ci * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8bf215546Sopenharmony_ci * copies of the Software, and to permit persons to whom the Software is
9bf215546Sopenharmony_ci * furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci *
11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13bf215546Sopenharmony_ci * Software.
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18bf215546Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20bf215546Sopenharmony_ci * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21bf215546Sopenharmony_ci * SOFTWARE.
22bf215546Sopenharmony_ci */
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci#include <stdbool.h>
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ci#include "pvr_formats.h"
27bf215546Sopenharmony_ci#include "pvr_private.h"
28bf215546Sopenharmony_ci#include "vk_enum_to_str.h"
29bf215546Sopenharmony_ci#include "vk_format.h"
30bf215546Sopenharmony_ci#include "vk_log.h"
31bf215546Sopenharmony_ci#include "vk_util.h"
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci#define FORMAT(vk, tex_fmt, pack_mode)                     \
34bf215546Sopenharmony_ci   [VK_FORMAT_##vk] = {                                    \
35bf215546Sopenharmony_ci      .vk_format = VK_FORMAT_##vk,                         \
36bf215546Sopenharmony_ci      .tex_format = ROGUE_TEXSTATE_FORMAT_##tex_fmt,       \
37bf215546Sopenharmony_ci      .pbe_packmode = ROGUE_PBESTATE_PACKMODE_##pack_mode, \
38bf215546Sopenharmony_ci      .supported = true,                                   \
39bf215546Sopenharmony_ci   }
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_cistruct pvr_format {
42bf215546Sopenharmony_ci   VkFormat vk_format;
43bf215546Sopenharmony_ci   uint32_t tex_format;
44bf215546Sopenharmony_ci   uint32_t pbe_packmode;
45bf215546Sopenharmony_ci   bool supported;
46bf215546Sopenharmony_ci};
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_ci/* TODO: add all supported core formats */
49bf215546Sopenharmony_cistatic const struct pvr_format pvr_format_table[] = {
50bf215546Sopenharmony_ci   /* VK_FORMAT_R8_UINT = 13. */
51bf215546Sopenharmony_ci   FORMAT(R8_UINT, U8, U8),
52bf215546Sopenharmony_ci   /* VK_FORMAT_B8G8R8A8_UNORM = 44. */
53bf215546Sopenharmony_ci   FORMAT(B8G8R8A8_UNORM, U8U8U8U8, U8U8U8U8),
54bf215546Sopenharmony_ci   /* VK_FORMAT_R32_UINT = 98. */
55bf215546Sopenharmony_ci   FORMAT(R32_UINT, U32, U32),
56bf215546Sopenharmony_ci   /* VK_FORMAT_R32G32B32A32_UINT = 107. */
57bf215546Sopenharmony_ci   FORMAT(R32G32B32A32_UINT, U32U32U32U32, U32U32U32U32),
58bf215546Sopenharmony_ci   /* VK_FORMAT_R32G32B32A32_SFLOAT = 109. */
59bf215546Sopenharmony_ci   FORMAT(R32G32B32A32_SFLOAT, F32F32F32F32, F32F32F32F32),
60bf215546Sopenharmony_ci   /* VK_FORMAT_D32_SFLOAT = 126. */
61bf215546Sopenharmony_ci   FORMAT(D32_SFLOAT, F32, F32),
62bf215546Sopenharmony_ci};
63bf215546Sopenharmony_ci
64bf215546Sopenharmony_ci#undef FORMAT
65bf215546Sopenharmony_ci
66bf215546Sopenharmony_cistatic inline const struct pvr_format *pvr_get_format(VkFormat vk_format)
67bf215546Sopenharmony_ci{
68bf215546Sopenharmony_ci   if (vk_format < ARRAY_SIZE(pvr_format_table) &&
69bf215546Sopenharmony_ci       pvr_format_table[vk_format].supported) {
70bf215546Sopenharmony_ci      return &pvr_format_table[vk_format];
71bf215546Sopenharmony_ci   }
72bf215546Sopenharmony_ci
73bf215546Sopenharmony_ci   mesa_logd("Format %s(%d) not supported\n",
74bf215546Sopenharmony_ci             vk_Format_to_str(vk_format),
75bf215546Sopenharmony_ci             vk_format);
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_ci   return NULL;
78bf215546Sopenharmony_ci}
79bf215546Sopenharmony_ci
80bf215546Sopenharmony_ciuint32_t pvr_get_tex_format(VkFormat vk_format)
81bf215546Sopenharmony_ci{
82bf215546Sopenharmony_ci   const struct pvr_format *pvr_format = pvr_get_format(vk_format);
83bf215546Sopenharmony_ci   if (pvr_format) {
84bf215546Sopenharmony_ci      return pvr_format->tex_format;
85bf215546Sopenharmony_ci   }
86bf215546Sopenharmony_ci
87bf215546Sopenharmony_ci   return ROGUE_TEXSTATE_FORMAT_INVALID;
88bf215546Sopenharmony_ci}
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ciuint32_t pvr_get_pbe_packmode(VkFormat vk_format)
91bf215546Sopenharmony_ci{
92bf215546Sopenharmony_ci   const struct pvr_format *pvr_format = pvr_get_format(vk_format);
93bf215546Sopenharmony_ci   if (pvr_format)
94bf215546Sopenharmony_ci      return pvr_format->pbe_packmode;
95bf215546Sopenharmony_ci
96bf215546Sopenharmony_ci   return ROGUE_PBESTATE_PACKMODE_INVALID;
97bf215546Sopenharmony_ci}
98bf215546Sopenharmony_ci
99bf215546Sopenharmony_cistatic VkFormatFeatureFlags
100bf215546Sopenharmony_cipvr_get_image_format_features(const struct pvr_format *pvr_format,
101bf215546Sopenharmony_ci                              VkImageTiling vk_tiling)
102bf215546Sopenharmony_ci{
103bf215546Sopenharmony_ci   VkFormatFeatureFlags flags = 0;
104bf215546Sopenharmony_ci   VkImageAspectFlags aspects;
105bf215546Sopenharmony_ci
106bf215546Sopenharmony_ci   if (!pvr_format)
107bf215546Sopenharmony_ci      return 0;
108bf215546Sopenharmony_ci
109bf215546Sopenharmony_ci   aspects = vk_format_aspects(pvr_format->vk_format);
110bf215546Sopenharmony_ci   if (aspects & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
111bf215546Sopenharmony_ci      flags |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
112bf215546Sopenharmony_ci               VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
113bf215546Sopenharmony_ci               VK_FORMAT_FEATURE_BLIT_SRC_BIT;
114bf215546Sopenharmony_ci   }
115bf215546Sopenharmony_ci
116bf215546Sopenharmony_ci   return flags;
117bf215546Sopenharmony_ci}
118bf215546Sopenharmony_ci
119bf215546Sopenharmony_ciconst uint8_t *pvr_get_format_swizzle(VkFormat vk_format)
120bf215546Sopenharmony_ci{
121bf215546Sopenharmony_ci   const struct util_format_description *vf = vk_format_description(vk_format);
122bf215546Sopenharmony_ci
123bf215546Sopenharmony_ci   return vf->swizzle;
124bf215546Sopenharmony_ci}
125bf215546Sopenharmony_ci
126bf215546Sopenharmony_cistatic VkFormatFeatureFlags
127bf215546Sopenharmony_cipvr_get_buffer_format_features(const struct pvr_format *pvr_format)
128bf215546Sopenharmony_ci{
129bf215546Sopenharmony_ci   VkFormatFeatureFlags flags = 0;
130bf215546Sopenharmony_ci
131bf215546Sopenharmony_ci   if (!pvr_format)
132bf215546Sopenharmony_ci      return 0;
133bf215546Sopenharmony_ci
134bf215546Sopenharmony_ci   return flags;
135bf215546Sopenharmony_ci}
136bf215546Sopenharmony_ci
137bf215546Sopenharmony_civoid pvr_GetPhysicalDeviceFormatProperties2(
138bf215546Sopenharmony_ci   VkPhysicalDevice physicalDevice,
139bf215546Sopenharmony_ci   VkFormat format,
140bf215546Sopenharmony_ci   VkFormatProperties2 *pFormatProperties)
141bf215546Sopenharmony_ci{
142bf215546Sopenharmony_ci   const struct pvr_format *pvr_format = pvr_get_format(format);
143bf215546Sopenharmony_ci
144bf215546Sopenharmony_ci   pFormatProperties->formatProperties = (VkFormatProperties){
145bf215546Sopenharmony_ci      .linearTilingFeatures =
146bf215546Sopenharmony_ci         pvr_get_image_format_features(pvr_format, VK_IMAGE_TILING_LINEAR),
147bf215546Sopenharmony_ci      .optimalTilingFeatures =
148bf215546Sopenharmony_ci         pvr_get_image_format_features(pvr_format, VK_IMAGE_TILING_OPTIMAL),
149bf215546Sopenharmony_ci      .bufferFeatures = pvr_get_buffer_format_features(pvr_format),
150bf215546Sopenharmony_ci   };
151bf215546Sopenharmony_ci
152bf215546Sopenharmony_ci   vk_foreach_struct (ext, pFormatProperties->pNext) {
153bf215546Sopenharmony_ci      pvr_debug_ignored_stype(ext->sType);
154bf215546Sopenharmony_ci   }
155bf215546Sopenharmony_ci}
156bf215546Sopenharmony_ci
157bf215546Sopenharmony_cistatic VkResult
158bf215546Sopenharmony_cipvr_get_image_format_properties(struct pvr_physical_device *pdevice,
159bf215546Sopenharmony_ci                                const VkPhysicalDeviceImageFormatInfo2 *info,
160bf215546Sopenharmony_ci                                VkImageFormatProperties *pImageFormatProperties)
161bf215546Sopenharmony_ci{
162bf215546Sopenharmony_ci   assert(!"Unimplemented");
163bf215546Sopenharmony_ci   return VK_SUCCESS;
164bf215546Sopenharmony_ci}
165bf215546Sopenharmony_ci
166bf215546Sopenharmony_ciVkResult pvr_GetPhysicalDeviceImageFormatProperties2(
167bf215546Sopenharmony_ci   VkPhysicalDevice physicalDevice,
168bf215546Sopenharmony_ci   const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo,
169bf215546Sopenharmony_ci   VkImageFormatProperties2 *pImageFormatProperties)
170bf215546Sopenharmony_ci{
171bf215546Sopenharmony_ci   const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
172bf215546Sopenharmony_ci   PVR_FROM_HANDLE(pvr_physical_device, pdevice, physicalDevice);
173bf215546Sopenharmony_ci   VkExternalImageFormatProperties *external_props = NULL;
174bf215546Sopenharmony_ci   VkResult result;
175bf215546Sopenharmony_ci
176bf215546Sopenharmony_ci   result = pvr_get_image_format_properties(
177bf215546Sopenharmony_ci      pdevice,
178bf215546Sopenharmony_ci      pImageFormatInfo,
179bf215546Sopenharmony_ci      &pImageFormatProperties->imageFormatProperties);
180bf215546Sopenharmony_ci   if (result != VK_SUCCESS)
181bf215546Sopenharmony_ci      return result;
182bf215546Sopenharmony_ci
183bf215546Sopenharmony_ci   /* Extract input structs */
184bf215546Sopenharmony_ci   vk_foreach_struct_const (ext, pImageFormatInfo->pNext) {
185bf215546Sopenharmony_ci      switch (ext->sType) {
186bf215546Sopenharmony_ci      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
187bf215546Sopenharmony_ci         external_info = (const void *)ext;
188bf215546Sopenharmony_ci         break;
189bf215546Sopenharmony_ci      default:
190bf215546Sopenharmony_ci         pvr_debug_ignored_stype(ext->sType);
191bf215546Sopenharmony_ci         break;
192bf215546Sopenharmony_ci      }
193bf215546Sopenharmony_ci   }
194bf215546Sopenharmony_ci
195bf215546Sopenharmony_ci   /* Extract output structs */
196bf215546Sopenharmony_ci   vk_foreach_struct (ext, pImageFormatProperties->pNext) {
197bf215546Sopenharmony_ci      switch (ext->sType) {
198bf215546Sopenharmony_ci      case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
199bf215546Sopenharmony_ci         external_props = (void *)ext;
200bf215546Sopenharmony_ci         break;
201bf215546Sopenharmony_ci      default:
202bf215546Sopenharmony_ci         pvr_debug_ignored_stype(ext->sType);
203bf215546Sopenharmony_ci         break;
204bf215546Sopenharmony_ci      }
205bf215546Sopenharmony_ci   }
206bf215546Sopenharmony_ci
207bf215546Sopenharmony_ci   /* From the Vulkan 1.0.42 spec:
208bf215546Sopenharmony_ci    *
209bf215546Sopenharmony_ci    *    If handleType is 0, vkGetPhysicalDeviceImageFormatProperties2 will
210bf215546Sopenharmony_ci    *    behave as if VkPhysicalDeviceExternalImageFormatInfo was not
211bf215546Sopenharmony_ci    *    present and VkExternalImageFormatProperties will be ignored.
212bf215546Sopenharmony_ci    */
213bf215546Sopenharmony_ci   if (external_info && external_info->handleType != 0) {
214bf215546Sopenharmony_ci      switch (external_info->handleType) {
215bf215546Sopenharmony_ci      case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
216bf215546Sopenharmony_ci      case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
217bf215546Sopenharmony_ci         if (!external_props)
218bf215546Sopenharmony_ci            break;
219bf215546Sopenharmony_ci
220bf215546Sopenharmony_ci         external_props->externalMemoryProperties.externalMemoryFeatures =
221bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
222bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT;
223bf215546Sopenharmony_ci         external_props->externalMemoryProperties.compatibleHandleTypes =
224bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
225bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
226bf215546Sopenharmony_ci         external_props->externalMemoryProperties.exportFromImportedHandleTypes =
227bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
228bf215546Sopenharmony_ci            VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
229bf215546Sopenharmony_ci         break;
230bf215546Sopenharmony_ci      default:
231bf215546Sopenharmony_ci         return vk_error(pdevice, VK_ERROR_FORMAT_NOT_SUPPORTED);
232bf215546Sopenharmony_ci      }
233bf215546Sopenharmony_ci   }
234bf215546Sopenharmony_ci
235bf215546Sopenharmony_ci   return VK_SUCCESS;
236bf215546Sopenharmony_ci}
237bf215546Sopenharmony_ci
238bf215546Sopenharmony_civoid pvr_GetPhysicalDeviceSparseImageFormatProperties(
239bf215546Sopenharmony_ci   VkPhysicalDevice physicalDevice,
240bf215546Sopenharmony_ci   VkFormat format,
241bf215546Sopenharmony_ci   VkImageType type,
242bf215546Sopenharmony_ci   uint32_t samples,
243bf215546Sopenharmony_ci   VkImageUsageFlags usage,
244bf215546Sopenharmony_ci   VkImageTiling tiling,
245bf215546Sopenharmony_ci   uint32_t *pNumProperties,
246bf215546Sopenharmony_ci   VkSparseImageFormatProperties *pProperties)
247bf215546Sopenharmony_ci{
248bf215546Sopenharmony_ci   /* Sparse images are not yet supported. */
249bf215546Sopenharmony_ci   *pNumProperties = 0;
250bf215546Sopenharmony_ci}
251bf215546Sopenharmony_ci
252bf215546Sopenharmony_civoid pvr_GetPhysicalDeviceSparseImageFormatProperties2(
253bf215546Sopenharmony_ci   VkPhysicalDevice physicalDevice,
254bf215546Sopenharmony_ci   const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo,
255bf215546Sopenharmony_ci   uint32_t *pPropertyCount,
256bf215546Sopenharmony_ci   VkSparseImageFormatProperties2 *pProperties)
257bf215546Sopenharmony_ci{
258bf215546Sopenharmony_ci   /* Sparse images are not yet supported. */
259bf215546Sopenharmony_ci   *pPropertyCount = 0;
260bf215546Sopenharmony_ci}
261bf215546Sopenharmony_ci
262bf215546Sopenharmony_civoid pvr_GetPhysicalDeviceExternalBufferProperties(
263bf215546Sopenharmony_ci   VkPhysicalDevice physicalDevice,
264bf215546Sopenharmony_ci   const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo,
265bf215546Sopenharmony_ci   VkExternalBufferProperties *pExternalBufferProperties)
266bf215546Sopenharmony_ci{
267bf215546Sopenharmony_ci   /* The Vulkan 1.0.42 spec says "handleType must be a valid
268bf215546Sopenharmony_ci    * VkExternalMemoryHandleTypeFlagBits value" in
269bf215546Sopenharmony_ci    * VkPhysicalDeviceExternalBufferInfo. This differs from
270bf215546Sopenharmony_ci    * VkPhysicalDeviceExternalImageFormatInfo, which surprisingly permits
271bf215546Sopenharmony_ci    * handleType == 0.
272bf215546Sopenharmony_ci    */
273bf215546Sopenharmony_ci   assert(pExternalBufferInfo->handleType != 0);
274bf215546Sopenharmony_ci
275bf215546Sopenharmony_ci   /* All of the current flags are for sparse which we don't support. */
276bf215546Sopenharmony_ci   if (pExternalBufferInfo->flags)
277bf215546Sopenharmony_ci      goto unsupported;
278bf215546Sopenharmony_ci
279bf215546Sopenharmony_ci   switch (pExternalBufferInfo->handleType) {
280bf215546Sopenharmony_ci   case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
281bf215546Sopenharmony_ci   case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
282bf215546Sopenharmony_ci      /* clang-format off */
283bf215546Sopenharmony_ci      pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures =
284bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
285bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT;
286bf215546Sopenharmony_ci      pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes =
287bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
288bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
289bf215546Sopenharmony_ci      pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes =
290bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
291bf215546Sopenharmony_ci         VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
292bf215546Sopenharmony_ci      /* clang-format on */
293bf215546Sopenharmony_ci      return;
294bf215546Sopenharmony_ci   default:
295bf215546Sopenharmony_ci      break;
296bf215546Sopenharmony_ci   }
297bf215546Sopenharmony_ci
298bf215546Sopenharmony_ciunsupported:
299bf215546Sopenharmony_ci   /* From the Vulkan 1.1.113 spec:
300bf215546Sopenharmony_ci    *
301bf215546Sopenharmony_ci    *    compatibleHandleTypes must include at least handleType.
302bf215546Sopenharmony_ci    */
303bf215546Sopenharmony_ci   pExternalBufferProperties->externalMemoryProperties =
304bf215546Sopenharmony_ci      (VkExternalMemoryProperties){
305bf215546Sopenharmony_ci         .compatibleHandleTypes = pExternalBufferInfo->handleType,
306bf215546Sopenharmony_ci      };
307bf215546Sopenharmony_ci}
308bf215546Sopenharmony_ci
309bf215546Sopenharmony_cibool pvr_format_is_pbe_downscalable(VkFormat vk_format)
310bf215546Sopenharmony_ci{
311bf215546Sopenharmony_ci   if (vk_format_is_int(vk_format)) {
312bf215546Sopenharmony_ci      /* PBE downscale behavior for integer formats does not match Vulkan
313bf215546Sopenharmony_ci       * spec. Vulkan requires a single sample to be chosen instead of
314bf215546Sopenharmony_ci       * taking the average sample color.
315bf215546Sopenharmony_ci       */
316bf215546Sopenharmony_ci      return false;
317bf215546Sopenharmony_ci   }
318bf215546Sopenharmony_ci
319bf215546Sopenharmony_ci   switch (pvr_get_pbe_packmode(vk_format)) {
320bf215546Sopenharmony_ci   default:
321bf215546Sopenharmony_ci      return true;
322bf215546Sopenharmony_ci
323bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U16U16U16U16:
324bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S16S16S16S16:
325bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U32U32U32U32:
326bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S32S32S32S32:
327bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_F32F32F32F32:
328bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U16U16U16:
329bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S16S16S16:
330bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U32U32U32:
331bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S32S32S32:
332bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_F32F32F32:
333bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U16U16:
334bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S16S16:
335bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U32U32:
336bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S32S32:
337bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_F32F32:
338bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U24ST8:
339bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_ST8U24:
340bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U16:
341bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S16:
342bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U32:
343bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_S32:
344bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_F32:
345bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_X24U8F32:
346bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_X24X8F32:
347bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_X24G8X32:
348bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_X8U24:
349bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_U8X24:
350bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_PBYTE:
351bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_PWORD:
352bf215546Sopenharmony_ci   case ROGUE_PBESTATE_PACKMODE_INVALID:
353bf215546Sopenharmony_ci      return false;
354bf215546Sopenharmony_ci   }
355bf215546Sopenharmony_ci}
356