Mesa (master): r300g: do not advertise R16F and RG16F on DRM < 2.8.0

Marek Olšák mareko at kemper.freedesktop.org
Thu Apr 7 19:39:41 PDT 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Fri Apr  8 04:37:19 2011 +0200

r300g: do not advertise R16F and RG16F on DRM < 2.8.0

---

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

diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index eb1b452..e1f5a9f 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -328,8 +328,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
                        format == PIPE_FORMAT_RGTC2_SNORM ||
                        format == PIPE_FORMAT_LATC2_UNORM ||
                        format == PIPE_FORMAT_LATC2_SNORM;
-    boolean is_half_float = format == PIPE_FORMAT_R16_FLOAT ||
-                            format == PIPE_FORMAT_R16G16_FLOAT ||
+    boolean is_r16f_rg16f = format == PIPE_FORMAT_R16_FLOAT ||
+                            format == PIPE_FORMAT_R16G16_FLOAT;
+    boolean is_half_float = is_r16f_rg16f ||
                             format == PIPE_FORMAT_R16G16B16_FLOAT ||
                             format == PIPE_FORMAT_R16G16B16A16_FLOAT;
 
@@ -361,6 +362,8 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
         (is_r500 || !is_ati1n) &&
         /* ATI2N is supported on r4xx-r5xx. */
         (is_r400 || is_r500 || !is_ati2n) &&
+        /* R16F and RG16F texture support was added in as late as DRM 2.8.0 */
+        (drm_2_8_0 || !is_r16f_rg16f) &&
         r300_is_sampler_format_supported(format)) {
         retval |= PIPE_BIND_SAMPLER_VIEW;
     }



More information about the mesa-commit mailing list