Henri Verbeet : wined3d: Use the texture dimension helpers in surface_load_location().
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Apr 12 10:20:46 CDT 2016
Module: wine
Branch: master
Commit: 8c30612d9984aed0c883aba3df38502d683468a1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c30612d9984aed0c883aba3df38502d683468a1
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Mon Apr 11 18:34:40 2016 +0200
wined3d: Use the texture dimension helpers in surface_load_location().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/surface.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index af7bf68..b8cb777 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3219,14 +3219,17 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
struct wined3d_texture *texture = surface->container;
struct wined3d_texture_sub_resource *sub_resource;
+ unsigned int surface_w, surface_h;
HRESULT hr;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
+ surface_w = wined3d_texture_get_level_width(texture, surface->texture_level);
+ surface_h = wined3d_texture_get_level_height(texture, surface->texture_level);
+
sub_resource = &texture->sub_resources[sub_resource_idx];
if (sub_resource->locations & location && (!(texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
- || (surface->ds_current_size.cx == surface->resource.width
- && surface->ds_current_size.cy == surface->resource.height)))
+ || (surface->ds_current_size.cx == surface_w && surface->ds_current_size.cy == surface_h)))
{
TRACE("Location (%#x) is already up to date.\n", location);
return WINED3D_OK;
@@ -3306,8 +3309,8 @@ done:
if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
- surface->ds_current_size.cx = surface->resource.width;
- surface->ds_current_size.cy = surface->resource.height;
+ surface->ds_current_size.cx = surface_w;
+ surface->ds_current_size.cy = surface_h;
}
if (location != WINED3D_LOCATION_SYSMEM && (sub_resource->locations & WINED3D_LOCATION_SYSMEM))
More information about the wine-cvs
mailing list