Reviewed-by: Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>><br><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 2:42 AM, <span dir="ltr"><<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">From: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br>
<br>
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float<br>
texture formats before trying the 4-component ones. Before this,<br>
GL_RGB16/32F were treated the same as GL_RGBA16/32F.<br>
---<br>
src/mesa/state_tracker/st_format.c | 23 +++++++++++++++++++++--<br>
1 files changed, 21 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c<br>
index 8e50dbd..4e7bef2 100644<br>
--- a/src/mesa/state_tracker/st_format.c<br>
+++ b/src/mesa/state_tracker/st_format.c<br>
@@ -954,14 +954,24 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,<br>
<br>
/* prefer formats in order of data size, choosing 16-bit ones if equal sized */<br>
case GL_RGBA16F_ARB:<br>
+ {<br>
+ static const enum pipe_format formats[] = {<br>
+ PIPE_FORMAT_R16G16B16A16_FLOAT,<br>
+ PIPE_FORMAT_R32G32B32A32_FLOAT<br>
+ };<br>
+ return find_supported_format(screen, formats, Elements(formats),<br>
+ target, sample_count, bindings);<br>
+ }<br>
case GL_RGB16F_ARB:<br>
{<br>
static const enum pipe_format formats[] = {<br>
+ PIPE_FORMAT_R16G16B16_FLOAT,<br>
PIPE_FORMAT_R16G16B16A16_FLOAT,<br>
+ PIPE_FORMAT_R32G32B32_FLOAT,<br>
PIPE_FORMAT_R32G32B32A32_FLOAT<br>
};<br>
return find_supported_format(screen, formats, Elements(formats),<br>
- target, sample_count, bindings);<br>
+ target, sample_count, bindings);<br>
}<br>
case GL_LUMINANCE_ALPHA16F_ARB:<br>
{<br>
@@ -1040,14 +1050,23 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,<br>
<br>
/* try a 32-bit format if available, otherwise fallback to a 16-bit one */<br>
case GL_RGBA32F_ARB:<br>
+ {<br>
+ static const enum pipe_format formats[] = {<br>
+ PIPE_FORMAT_R32G32B32A32_FLOAT,<br>
+ PIPE_FORMAT_R16G16B16A16_FLOAT<br>
+ };<br>
+ return find_supported_format(screen, formats, Elements(formats),<br>
+ target, sample_count, bindings);<br>
+ }<br>
case GL_RGB32F_ARB:<br>
{<br>
static const enum pipe_format formats[] = {<br>
+ PIPE_FORMAT_R32G32B32_FLOAT,<br>
PIPE_FORMAT_R32G32B32A32_FLOAT,<br>
PIPE_FORMAT_R16G16B16A16_FLOAT<br>
};<br>
return find_supported_format(screen, formats, Elements(formats),<br>
- target, sample_count, bindings);<br>
+ target, sample_count, bindings);<br>
}<br>
case GL_LUMINANCE_ALPHA32F_ARB:<br>
{<br>
<font color="#888888">--<br>
1.7.3.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></blockquote></div><br>