Henri Verbeet : wined3d: Use wined3d_texture_get_level_box() in texture2d_load_texture().
Alexandre Julliard
julliard at winehq.org
Mon May 20 15:50:48 CDT 2019
Module: wine
Branch: master
Commit: 916bd0e4c290b0ea416df43b69e3fdf9e89efa6a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=916bd0e4c290b0ea416df43b69e3fdf9e89efa6a
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Sun May 19 18:48:47 2019 +0430
wined3d: Use wined3d_texture_get_level_box() in texture2d_load_texture().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/surface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a95b18e..40e8bc1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1548,9 +1548,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
}
level = sub_resource_idx % texture->level_count;
- width = wined3d_texture_get_level_width(texture, level);
- height = wined3d_texture_get_level_height(texture, level);
- wined3d_box_set(&src_box, 0, 0, width, height, 0, 1);
+ wined3d_texture_get_level_box(texture, level, &src_box);
if (!depth && sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
&& (texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
@@ -1560,7 +1558,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
{
RECT src_rect;
- SetRect(&src_rect, 0, 0, width, height);
+ SetRect(&src_rect, src_box.left, src_box.top, src_box.right, src_box.bottom);
if (srgb)
texture2d_blt_fbo(device, context, WINED3D_TEXF_POINT,
texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB, &src_rect,
@@ -1581,7 +1579,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT src_rect;
- SetRect(&src_rect, 0, 0, width, height);
+ SetRect(&src_rect, src_box.left, src_box.top, src_box.right, src_box.bottom);
if (fbo_blitter_supported(WINED3D_BLIT_OP_COLOR_BLIT, gl_info,
&texture->resource, src_location, &texture->resource, dst_location))
texture2d_blt_fbo(device, context, WINED3D_TEXF_POINT, texture, sub_resource_idx,
@@ -1640,6 +1638,8 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
wined3d_texture_get_memory(texture, sub_resource_idx, &data, sub_resource->locations);
if (conversion)
{
+ width = src_box.right - src_box.left;
+ height = src_box.bottom - src_box.top;
wined3d_format_calculate_pitch(format, device->surface_alignment,
width, height, &dst_row_pitch, &dst_slice_pitch);
More information about the wine-cvs
mailing list