Mesa (master): r300g: expose ARB_ES2_compatibility by claiming FIXED format support

Marek Olšák mareko at kemper.freedesktop.org
Mon Oct 24 12:09:19 PDT 2011


Module: Mesa
Branch: master
Commit: cdaf9b89e4497a93b889f5ac4502323b53627f82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cdaf9b89e4497a93b889f5ac4502323b53627f82

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Oct 24 21:05:38 2011 +0200

r300g: expose ARB_ES2_compatibility by claiming FIXED format support

---

 src/gallium/drivers/r300/r300_context.c |    1 +
 src/gallium/drivers/r300/r300_screen.c  |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index bcb47e0..cacad9f 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -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)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index c574a50..ab1cec5 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -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;
     }
 



More information about the mesa-commit mailing list