vc4: Declare what vertex formats we actually support.
authorEric Anholt <eric@anholt.net>
Mon, 11 Aug 2014 23:03:17 +0000 (16:03 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 12 Aug 2014 21:19:49 +0000 (14:19 -0700)
We will support more than this eventually, but for now this makes u_vbuf
format-convert a few things (32-bit snorm and scaled, doubles) for us.

src/gallium/drivers/vc4/vc4_screen.c

index 62c5b2b49721a89114b434846680dad8955e1b8f..4c83db33165b33a9b8a4a986ee9831bddefdde12 100644 (file)
@@ -338,8 +338,13 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
                 return FALSE;
         }
 
-        if (usage & PIPE_BIND_VERTEX_BUFFER)
-                retval |= PIPE_BIND_VERTEX_BUFFER; /* XXX */
+        if (usage & PIPE_BIND_VERTEX_BUFFER &&
+            (format == PIPE_FORMAT_R32G32B32A32_FLOAT ||
+             format == PIPE_FORMAT_R32G32B32_FLOAT ||
+             format == PIPE_FORMAT_R32G32_FLOAT ||
+             format == PIPE_FORMAT_R32_FLOAT)) {
+                retval |= PIPE_BIND_VERTEX_BUFFER;
+        }
 
         if ((usage & PIPE_BIND_RENDER_TARGET) &&
             (format == PIPE_FORMAT_B8G8R8A8_UNORM ||