[PATCH resend] wined3d : Set texture target of WINED3DFMT_NULL to 0

Max Qian public at maxqia.com
Sat Jun 4 19:02:29 CDT 2016


This fixes https://bugs.winehq.org/show_bug.cgi?id=40624
Signed-off-by: Max Qian <public at maxqia.com>
---
 dlls/wined3d/context.c         | 4 ++--
 dlls/wined3d/wined3d_private.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 845ca1d..323e7ac 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -397,14 +397,14 @@ static inline void context_set_fbo_key_for_surface(const struct wined3d_context
         {
             case WINED3D_LOCATION_TEXTURE_RGB:
                 key->objects[idx].object = surface_get_texture_name(surface, context, FALSE);
-                key->objects[idx].target = surface->texture_target;
+                key->objects[idx].target = surface_get_texture_target(surface);
                 key->objects[idx].level = surface->texture_level;
                 key->objects[idx].layer = surface->texture_layer;
                 break;
 
             case WINED3D_LOCATION_TEXTURE_SRGB:
                 key->objects[idx].object = surface_get_texture_name(surface, context, TRUE);
-                key->objects[idx].target = surface->texture_target;
+                key->objects[idx].target = surface_get_texture_target(surface);
                 key->objects[idx].level = surface->texture_level;
                 key->objects[idx].layer = surface->texture_layer;
                 break;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f9a8ffa..00d46c0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3600,6 +3600,11 @@ static inline struct wined3d_surface *context_get_rt_surface(const struct wined3
     return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
 }
 
+static inline GLuint surface_get_texture_target(const struct wined3d_surface *surface)
+{
+    return surface->container->resource.format->id == WINED3DFMT_NULL ? 0 : surface->texture_target;
+}
+
 /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
 #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
 
-- 
2.8.3




More information about the wine-patches mailing list