[PATCH 4/5] wined3d: Don't use floating point textures without ARB_texture_float.

Henri Verbeet hverbeet at codeweavers.com
Mon Nov 8 04:50:34 CST 2010


The floating point formats from ARB_texture_rg are only defined when
ARB_texture_float is also supported. It would have been nice if the formats
table itself was able to express this, but as far as I'm aware this is only an
issue for ARB_texture_rg, so it's probably not worth changing.
---
 dlls/wined3d/utils.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index f2d6bde..8770f04 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1174,6 +1174,13 @@ static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
         if (!gl_info->supported[format_texture_info[i].extension]) continue;
 
         format = &gl_info->formats[fmt_idx];
+
+        /* ARB_texture_rg defines floating point formats, but only if
+         * ARB_texture_float is also supported. */
+        if (!gl_info->supported[ARB_TEXTURE_FLOAT]
+                && (format->Flags & WINED3DFMT_FLAG_FLOAT))
+            continue;
+
         format->glInternal = format_texture_info[i].gl_internal;
         format->glGammaInternal = format_texture_info[i].gl_srgb_internal;
         format->rtInternal = format_texture_info[i].gl_rt_internal;
-- 
1.7.2.2




More information about the wine-patches mailing list