<div class="gmail_quote">On Fri, Mar 4, 2011 at 7:35 AM, Brian Paul <span dir="ltr"><<a href="mailto:brian.e.paul@gmail.com" target="_blank">brian.e.paul@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
How about:<br>
<br>
format = util_format_linear(format);<br></blockquote><div><br>Yeah, that's nicer, thanks. :) I am going to push this later today if there are no objections.<br><br>Marek<br><br>diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c<br>
index c3c4246..3f98ffd 100644<br>--- a/src/mesa/state_tracker/st_cb_texture.c<br>+++ b/src/mesa/state_tracker/st_cb_texture.c<br>@@ -227,8 +227,15 @@ default_bindings(struct st_context *st, enum pipe_format format)<br> <br>
if (screen->is_format_supported(screen, format, target, 0, bindings, geom))<br> return bindings;<br>- else<br>- return PIPE_BIND_SAMPLER_VIEW;<br>+ else {<br>+ /* Try non-sRGB. */<br>+ format = util_format_linear(format);<br>
+<br>+ if (screen->is_format_supported(screen, format, target, 0, bindings, geom))<br>+ return bindings;<br>+ else<br>+ return PIPE_BIND_SAMPLER_VIEW;<br>+ }<br> }<br><br></div></div>