r300g: expose ARB_ES2_compatibility by claiming FIXED format support
authorMarek Olšák <maraeo@gmail.com>
Mon, 24 Oct 2011 19:05:38 +0000 (21:05 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 24 Oct 2011 19:05:38 +0000 (21:05 +0200)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_screen.c

index bcb47e0056cd4577ef3b9042e896a2f796c8ae8d..cacad9fbad2529e58ad573ae760d19f5a699a0ca 100644 (file)
@@ -448,6 +448,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
                                        U_VERTEX_FETCH_DWORD_ALIGNED);
     if (!r300->vbuf_mgr)
         goto fail;
+    r300->vbuf_mgr->caps.format_fixed32 = 0;
 
     r300->blitter = util_blitter_create(&r300->context);
     if (r300->blitter == NULL)
index c574a504924589f6222d8d1288d94231aa3b6db5..ab1cec585c44fc9f9153b9ead0049e4ea144b3f1 100644 (file)
@@ -361,6 +361,10 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
                             format == PIPE_FORMAT_R16G16_FLOAT ||
                             format == PIPE_FORMAT_R16G16B16_FLOAT ||
                             format == PIPE_FORMAT_R16G16B16A16_FLOAT;
+    boolean is_fixed = format == PIPE_FORMAT_R32_FIXED ||
+                       format == PIPE_FORMAT_R32G32_FIXED ||
+                       format == PIPE_FORMAT_R32G32B32_FIXED ||
+                       format == PIPE_FORMAT_R32G32B32A32_FIXED;
 
     if (!util_format_is_supported(format, usage))
        return FALSE;
@@ -422,9 +426,10 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
 
     /* Check vertex buffer format support. */
     if (usage & PIPE_BIND_VERTEX_BUFFER &&
-        /* Half float is supported on >= RV350. */
+        /* Half float is supported on >= R400. */
         (is_r400 || is_r500 || !is_half_float) &&
-        r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) {
+        /* We have a fallback for FIXED. */
+        (is_fixed || r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT)) {
         retval |= PIPE_BIND_VERTEX_BUFFER;
     }