~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to src/gallium/drivers/zink/zink_format_test.c

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "zink_format.h"
2
 
#include "vk_format.h"
3
 
 
4
 
int
5
 
main(int argc, char *argv[])
6
 
{
7
 
   int ret = 0;
8
 
   for (int i = 0; i < PIPE_FORMAT_COUNT; ++i) {
9
 
      enum pipe_format pipe_fmt = i;
10
 
      VkFormat vk_fmt = zink_pipe_format_to_vk_format(i);
11
 
 
12
 
      /* skip unsupported formats */
13
 
      if (vk_fmt == VK_FORMAT_UNDEFINED)
14
 
         continue;
15
 
 
16
 
      enum pipe_format roundtrip = vk_format_to_pipe_format(vk_fmt);
17
 
      if (roundtrip != pipe_fmt) {
18
 
         fprintf(stderr, "Format does not roundtrip\n"
19
 
                         "\tgot: %s\n"
20
 
                         "\texpected: %s\n",
21
 
                         util_format_name(roundtrip),
22
 
                         util_format_name(pipe_fmt));
23
 
         ret = 1;
24
 
      }
25
 
   }
26
 
   return ret;
27
 
}