Matteo Bruni : wined3d: Don't consider texture rectangles for buffers.

Alexandre Julliard julliard at winehq.org
Thu Aug 12 16:35:20 CDT 2021


Module: wine
Branch: master
Commit: aaf4ef6e62911e80f5c53ab7f1165ee180d26af6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aaf4ef6e62911e80f5c53ab7f1165ee180d26af6

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Wed Aug 11 19:18:53 2021 +0200

wined3d: Don't consider texture rectangles for buffers.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/resource.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index f37c313e023..6215da8ce0f 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -121,26 +121,26 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
         if (base_type == WINED3D_GL_RES_TYPE_COUNT)
             base_type = gl_type;
 
-        if (type != WINED3D_RTYPE_BUFFER)
+        if (type == WINED3D_RTYPE_BUFFER)
+            break;
+
+        if ((bind_flags & WINED3D_BIND_RENDER_TARGET)
+                && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET))
         {
-            if ((bind_flags & WINED3D_BIND_RENDER_TARGET)
-                    && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET))
-            {
-                WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id));
-                continue;
-            }
-            if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL)
-                    && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL))
-            {
-                WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
-                continue;
-            }
-            if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE)
-                    && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE))
-            {
-                WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id));
-                continue;
-            }
+            WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id));
+            continue;
+        }
+        if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL)
+                && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL))
+        {
+            WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
+            continue;
+        }
+        if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE)
+                && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE))
+        {
+            WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id));
+            continue;
         }
         if (((width & (width - 1)) || (height & (height - 1)))
                 && !d3d_info->texture_npot




More information about the wine-cvs mailing list