Commit 798439ba authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 3b47e108
...@@ -2106,12 +2106,11 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res ...@@ -2106,12 +2106,11 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
BOOL surface_load_drawable(struct wined3d_surface *surface, BOOL texture2d_load_drawable(struct wined3d_texture *texture,
struct wined3d_context *context) 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 *restore_rt = NULL;
struct wined3d_surface *surface;
struct wined3d_device *device; struct wined3d_device *device;
unsigned int level; unsigned int level;
RECT r; RECT r;
...@@ -2127,11 +2126,12 @@ BOOL surface_load_drawable(struct wined3d_surface *surface, ...@@ -2127,11 +2126,12 @@ BOOL surface_load_drawable(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)) && 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; return FALSE;
} }
device = texture->resource.device; device = texture->resource.device;
surface = texture->sub_resources[sub_resource_idx].u.surface;
restore_rt = context_get_rt_surface(context); restore_rt = context_get_rt_surface(context);
if (restore_rt != surface) if (restore_rt != surface)
context = context_acquire(device, texture, sub_resource_idx); context = context_acquire(device, texture, sub_resource_idx);
......
...@@ -1806,7 +1806,7 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in ...@@ -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); return texture2d_load_sysmem(texture, sub_resource_idx, context, location);
case WINED3D_LOCATION_DRAWABLE: 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_RESOLVED:
case WINED3D_LOCATION_RB_MULTISAMPLE: case WINED3D_LOCATION_RB_MULTISAMPLE:
......
...@@ -3234,6 +3234,8 @@ static inline unsigned int wined3d_texture_get_level_pow2_height(const struct wi ...@@ -3234,6 +3234,8 @@ static inline unsigned int wined3d_texture_get_level_pow2_height(const struct wi
return max(1, texture->pow2_height >> level); 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, BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD dst_location) DECLSPEC_HIDDEN; 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 ...@@ -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, HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, 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; 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, void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN; struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL surface_load_renderbuffer(struct wined3d_surface *surface, BOOL surface_load_renderbuffer(struct wined3d_surface *surface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment