On Fri, Mar 4, 2011 at 7:35 AM, Brian Paul <brian.e.p...@gmail.com> wrote:

> How about:
>
>  format = util_format_linear(format);
>

Yeah, that's nicer, thanks. :) I am going to push this later today if there
are no objections.

Marek

diff --git a/src/mesa/state_tracker/st_cb_texture.c
b/src/mesa/state_tracker/st_cb_texture.c
index c3c4246..3f98ffd 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -227,8 +227,15 @@ default_bindings(struct st_context *st, enum
pipe_format format)

    if (screen->is_format_supported(screen, format, target, 0, bindings,
geom))
       return bindings;
-   else
-      return PIPE_BIND_SAMPLER_VIEW;
+   else {
+      /* Try non-sRGB. */
+      format = util_format_linear(format);
+
+      if (screen->is_format_supported(screen, format, target, 0, bindings,
geom))
+         return bindings;
+      else
+         return PIPE_BIND_SAMPLER_VIEW;
+   }
 }
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to