r600g: remove unused variable
[mesa.git] / src / gallium / drivers / r600 / r600_formats.h
index c9af631da418cfc748918b7ed752aa9df0bdb9cb..b822cba9293a8d38a6a6c02345227de2853fce57 100644 (file)
@@ -54,6 +54,9 @@
 #define     FMT_BC3                         0x00000033
 #define     FMT_BC4                         0x00000034
 #define     FMT_BC5                         0x00000035
+#define     FMT_BC6                         0x00000036
+#define     FMT_BC7                         0x00000037
+#define     FMT_32_AS_32_32_32_32           0x00000038
 
 #define     ENDIAN_NONE                     0
 #define     ENDIAN_8IN16                    1
@@ -78,4 +81,35 @@ static INLINE unsigned r600_endian_swap(unsigned size)
        }
 }
 
+static INLINE bool r600_is_vertex_format_supported(enum pipe_format format)
+{
+       const struct util_format_description *desc = util_format_description(format);
+       unsigned i;
+
+       if (!desc)
+               return false;
+
+       /* Find the first non-VOID channel. */
+       for (i = 0; i < 4; i++) {
+               if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID)
+                       break;
+       }
+       if (i == 4)
+               return false;
+
+       /* No fixed, no double. */
+       if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN ||
+           (desc->channel[i].size == 64 &&
+            desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT))
+               return false;
+
+       /* No scaled/norm formats with 32 bits per channel. */
+       if (desc->channel[i].size == 32 &&
+           (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED ||
+            desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED))
+               return false;
+
+       return true;
+}
+
 #endif