Henri Verbeet : wined3d: Introduce wined3d_texture_load_location().

Alexandre Julliard julliard at winehq.org
Mon Aug 1 16:48:57 CDT 2016


Module: wine
Branch: master
Commit: 3b61af6306361953d6fff924078c9017db397b13
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3b61af6306361953d6fff924078c9017db397b13

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Aug  1 12:49:07 2016 +0200

wined3d: Introduce wined3d_texture_load_location().

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

---

 dlls/wined3d/texture.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 5a59f17..1f0a97a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -174,6 +174,14 @@ void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
                 sub_resource_idx, texture);
 }
 
+/* Context activation is done by the caller. Context may be NULL in
+ * WINED3D_NO3D mode. */
+static BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
+        unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
+{
+    return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
+}
+
 /* Context activation is done by the caller. */
 void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size_t size,
         const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags)
@@ -352,7 +360,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
     for (i = 0; i < sub_count; ++i)
     {
         if (texture->sub_resources[i].locations == texture->resource.map_binding
-                && !texture->texture_ops->texture_load_location(texture, i, context, map_binding))
+                && !wined3d_texture_load_location(texture, i, context, map_binding))
             ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
         if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
             wined3d_texture_remove_buffer_object(texture, i, context->gl_info);
@@ -914,7 +922,7 @@ void wined3d_texture_load(struct wined3d_texture *texture,
         TRACE("Reloading because of color key value change.\n");
         for (i = 0; i < sub_count; i++)
         {
-            if (!texture->texture_ops->texture_load_location(texture, i, context, texture->resource.map_binding))
+            if (!wined3d_texture_load_location(texture, i, context, texture->resource.map_binding))
                 ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
             else
                 wined3d_texture_invalidate_location(texture, i, ~texture->resource.map_binding);
@@ -932,7 +940,7 @@ void wined3d_texture_load(struct wined3d_texture *texture,
     /* Reload the surfaces if the texture is marked dirty. */
     for (i = 0; i < sub_count; ++i)
     {
-        if (!texture->texture_ops->texture_load_location(texture, i, context,
+        if (!wined3d_texture_load_location(texture, i, context,
                 srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB))
             ERR("Failed to load location (srgb %#x).\n", srgb);
     }
@@ -1413,8 +1421,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
         FIXME("Ignoring dirty_region %s.\n", debug_box(dirty_region));
 
     context = context_acquire(texture->resource.device, NULL);
-    if (!texture->texture_ops->texture_load_location(texture, sub_resource_idx,
-            context, texture->resource.map_binding))
+    if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
     {
         ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
         context_release(context);
@@ -1591,7 +1598,7 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
         struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[i];
 
         if (resource->pool != WINED3D_POOL_DEFAULT
-                && texture->texture_ops->texture_load_location(texture, i, context, resource->map_binding))
+                && wined3d_texture_load_location(texture, i, context, resource->map_binding))
         {
             wined3d_texture_invalidate_location(texture, i, ~resource->map_binding);
         }
@@ -1710,8 +1717,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
     {
         if (resource->usage & WINED3DUSAGE_DYNAMIC)
             WARN_(d3d_perf)("Mapping a dynamic texture without WINED3D_MAP_DISCARD.\n");
-        ret = texture->texture_ops->texture_load_location(texture,
-                sub_resource_idx, context, texture->resource.map_binding);
+        ret = wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding);
     }
 
     if (!ret)




More information about the wine-cvs mailing list