wined3d: Pass a texture and sub-resource index to surface_load_drawable().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-03-06 10:08:29 +03:30 committed by Alexandre Julliard
parent 3b47e108a9
commit 798439ba31
3 changed files with 8 additions and 8 deletions

View File

@ -2106,12 +2106,11 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
}
/* Context activation is done by the caller. */
BOOL surface_load_drawable(struct wined3d_surface *surface,
struct wined3d_context *context)
BOOL texture2d_load_drawable(struct wined3d_texture *texture,
unsigned int sub_resource_idx, struct wined3d_context *context)
{
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
struct wined3d_texture *texture = surface->container;
struct wined3d_surface *restore_rt = NULL;
struct wined3d_surface *surface;
struct wined3d_device *device;
unsigned int level;
RECT r;
@ -2127,11 +2126,12 @@ BOOL surface_load_drawable(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource))
{
ERR("Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n");
ERR("Trying to load offscreen texture into WINED3D_LOCATION_DRAWABLE.\n");
return FALSE;
}
device = texture->resource.device;
surface = texture->sub_resources[sub_resource_idx].u.surface;
restore_rt = context_get_rt_surface(context);
if (restore_rt != surface)
context = context_acquire(device, texture, sub_resource_idx);

View File

@ -1806,7 +1806,7 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in
return texture2d_load_sysmem(texture, sub_resource_idx, context, location);
case WINED3D_LOCATION_DRAWABLE:
return surface_load_drawable(surface, context);
return texture2d_load_drawable(texture, sub_resource_idx, context);
case WINED3D_LOCATION_RB_RESOLVED:
case WINED3D_LOCATION_RB_MULTISAMPLE:

View File

@ -3234,6 +3234,8 @@ static inline unsigned int wined3d_texture_get_level_pow2_height(const struct wi
return max(1, texture->pow2_height >> level);
}
BOOL texture2d_load_drawable(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD dst_location) DECLSPEC_HIDDEN;
@ -3340,8 +3342,6 @@ static inline struct wined3d_texture_sub_resource *surface_get_sub_resource(stru
HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
BOOL surface_load_drawable(struct wined3d_surface *surface,
struct wined3d_context *context) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL surface_load_renderbuffer(struct wined3d_surface *surface,