mesa: remove unneeded #include of colormac.h
[mesa.git] / src / mesa / main / format_info.py
index a0eecd309513e8368bf08c7b228eba3a761a0f87..3bae57e54edbb3817e72f0d732705de247e08313 100644 (file)
@@ -58,7 +58,7 @@ def get_gl_base_format(fmat):
    elif fmat.has_channel('i') and fmat.num_channels() == 1:
       return 'GL_INTENSITY'
    else:
-      assert False
+      sys.exit("error, could not determine base format for {0}, check swizzle".format(fmat.name));
 
 def get_gl_data_type(fmat):
    if fmat.is_compressed():
@@ -127,6 +127,9 @@ def get_channel_bits(fmat, chan_name):
 
          bits = 11 if fmat.name.endswith('11_EAC') else 8
          return bits if fmat.has_channel(chan_name) else 0
+      elif fmat.layout == 'bptc':
+         bits = 16 if fmat.name.endswith('_FLOAT') else 8
+         return bits if fmat.has_channel(chan_name) else 0
       else:
          assert False
    else:
@@ -189,6 +192,22 @@ for fmat in formats:
                                        int(fmat.block_size() / 8))
 
    print '      {{ {0} }},'.format(', '.join(map(str, fmat.swizzle)))
+   if fmat.is_array():
+      chan = fmat.array_element()
+      norm = chan.norm or chan.type == parser.FLOAT
+      print '      MESA_ARRAY_FORMAT({0}),'.format(', '.join([
+         str(chan.size / 8),
+         str(int(chan.sign)),
+         str(int(chan.type == parser.FLOAT)),
+         str(int(norm)),
+         str(len(fmat.channels)),
+         str(fmat.swizzle[0]),
+         str(fmat.swizzle[1]),
+         str(fmat.swizzle[2]),
+         str(fmat.swizzle[3]),
+      ]))
+   else:
+      print '      0,'
    print '   },'
 
 print '};'