[PATCH 4/4] wined3d: Get rid of context_invalidate_active_texture().

Henri Verbeet hverbeet at codeweavers.com
Thu Apr 16 04:26:36 CDT 2015


Calling wined3d_texture_bind() + context_invalidate_active_texture() is
equivalent to just calling wined3d_texture_bind_and_dirtify().
---
 dlls/wined3d/surface.c         |    4 +---
 dlls/wined3d/wined3d_private.h |    7 -------
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 2838004..77a0eae 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1638,7 +1638,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
         wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
     else
         surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
-    wined3d_texture_bind(dst_surface->container, context, FALSE);
+    wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
 
     surface_get_memory(src_surface, &data, src_surface->locations);
     src_pitch = wined3d_surface_get_pitch(src_surface);
@@ -1646,8 +1646,6 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
     wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
             src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
 
-    context_invalidate_active_texture(context);
-
     context_release(context);
 
     surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index acac299..9b9973c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2090,13 +2090,6 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD sta
     return context->isStateDirty[idx] & (1 << shift);
 }
 
-static inline void context_invalidate_active_texture(struct wined3d_context *context)
-{
-    DWORD sampler = context->rev_tex_unit_map[context->active_texture];
-    if (sampler != WINED3D_UNMAPPED_STAGE)
-        context_invalidate_state(context, STATE_SAMPLER(sampler));
-}
-
 #define WINED3D_RESOURCE_ACCESS_GPU     0x1
 #define WINED3D_RESOURCE_ACCESS_CPU     0x2
 
-- 
1.7.10.4




More information about the wine-patches mailing list