[PATCH 2/4] wined3d: Don't allow 3D depth textures.

Stefan Dösinger stefan at codeweavers.com
Sat May 16 08:29:13 CDT 2015


I ran into this while working on the next patch. Originally the next
patch didn't swallow GL errors, so this was required to prevent them.
Feel free to skip if you think we don't want this check.
---
 dlls/wined3d/utils.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 3090131..94ed858 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1857,13 +1857,19 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
 
         format->flags[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].flags;
         format->flags[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].flags;
-        if (gl_info->supported[EXT_TEXTURE3D])
+        format->flags[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].flags;
+
+        /* GL_ARB_depth_texture does not support 3D textures. It also says "cube textures are
+         * problematic", but doesn't explicitly mandate that an error is generated. */
+        if (gl_info->supported[EXT_TEXTURE3D]
+                && !(format_texture_info[i].flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
             format->flags[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].flags;
+
         if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
             format->flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].flags;
+
         if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
             format->flags[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].flags;
-        format->flags[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].flags;
 
         if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2])
         {
-- 
2.3.6




More information about the wine-patches mailing list