[PATCH 3/5] wined3d: Require FBO attachability for render targets and depth stencils.

Stefan Dösinger stefan at codeweavers.com
Tue Jun 9 02:28:08 CDT 2015


WINED3DFMT_NULL needs special handling in some form. Alternatively to
the solution I used we can handle it in resource_init or in the if check
that aborts init_format_fbo_compat_info / check_fbo_combat when a zero
internal format is used.
---
 dlls/wined3d/resource.c | 7 +++++++
 dlls/wined3d/utils.c    | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 7818deb..1891165 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -114,6 +114,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
                 WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
                 continue;
             }
+            if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
+                    && usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL)
+                    && !(format->flags[gl_type] & WINED3DFMT_FLAG_FBO_ATTACHABLE))
+            {
+                WARN("Render target or depth stencil is not FBO attachable.\n");
+                continue;
+            }
             if ((usage & WINED3DUSAGE_TEXTURE) && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE))
             {
                 WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id));
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index a3c3def..687d3d7 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1282,7 +1282,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
             ARB_FRAMEBUFFER_OBJECT,     NULL},
     {WINED3DFMT_NULL,                   0,                                0,                                      0,
             GL_RGBA,                    GL_UNSIGNED_INT_8_8_8_8_REV,      0,
-            WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET,
+            WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE,
             ARB_FRAMEBUFFER_OBJECT,     NULL},
 };
 
-- 
2.3.6




More information about the wine-patches mailing list