wined3d: Pass a texture and sub-resource index to wined3d_surface_blt().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
70a68144c1
commit
991b1b77c8
|
@ -2048,15 +2048,8 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
|
||||||
}
|
}
|
||||||
else if (op->dst_resource->type == WINED3D_RTYPE_TEXTURE_2D)
|
else if (op->dst_resource->type == WINED3D_RTYPE_TEXTURE_2D)
|
||||||
{
|
{
|
||||||
struct wined3d_surface *dst_surface, *src_surface;
|
if (FAILED(texture2d_blt(texture_from_resource(op->dst_resource), op->dst_sub_resource_idx,
|
||||||
struct wined3d_texture *dst_texture, *src_texture;
|
&op->dst_box, texture_from_resource(op->src_resource), op->src_sub_resource_idx,
|
||||||
|
|
||||||
dst_texture = texture_from_resource(op->dst_resource);
|
|
||||||
src_texture = texture_from_resource(op->src_resource);
|
|
||||||
dst_surface = dst_texture->sub_resources[op->dst_sub_resource_idx].u.surface;
|
|
||||||
src_surface = src_texture->sub_resources[op->src_sub_resource_idx].u.surface;
|
|
||||||
|
|
||||||
if (FAILED(wined3d_surface_blt(dst_surface, &op->dst_box, src_surface,
|
|
||||||
&op->src_box, op->flags, &op->fx, op->filter)))
|
&op->src_box, op->flags, &op->fx, op->filter)))
|
||||||
FIXME("Blit failed.\n");
|
FIXME("Blit failed.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3681,15 +3681,12 @@ struct wined3d_blitter *wined3d_cpu_blitter_create(void)
|
||||||
return blitter;
|
return blitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const struct wined3d_box *dst_box,
|
HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx,
|
||||||
struct wined3d_surface *src_surface, const struct wined3d_box *src_box, DWORD flags,
|
const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx,
|
||||||
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
|
const struct wined3d_box *src_box, DWORD flags, const struct wined3d_blt_fx *fx,
|
||||||
|
enum wined3d_texture_filter_type filter)
|
||||||
{
|
{
|
||||||
unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface);
|
|
||||||
unsigned int src_sub_resource_idx = surface_get_sub_resource_idx(src_surface);
|
|
||||||
struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
|
struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
|
||||||
struct wined3d_texture *dst_texture = dst_surface->container;
|
|
||||||
struct wined3d_texture *src_texture = src_surface->container;
|
|
||||||
struct wined3d_device *device = dst_texture->resource.device;
|
struct wined3d_device *device = dst_texture->resource.device;
|
||||||
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
|
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
|
||||||
const struct wined3d_color_key *colour_key = NULL;
|
const struct wined3d_color_key *colour_key = NULL;
|
||||||
|
@ -3705,9 +3702,10 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const struct wi
|
||||||
| WINED3D_BLT_ALPHA_TEST
|
| WINED3D_BLT_ALPHA_TEST
|
||||||
| WINED3D_BLT_RAW;
|
| WINED3D_BLT_RAW;
|
||||||
|
|
||||||
TRACE("dst_surface %p, dst_box %s, src_surface %p, src_box %s, flags %#x, fx %p, filter %s.\n",
|
TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
|
||||||
dst_surface, debug_box(dst_box), src_surface, debug_box(src_box),
|
"src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
|
||||||
flags, fx, debug_d3dtexturefiltertype(filter));
|
dst_texture, dst_sub_resource_idx, debug_box(dst_box), src_texture, src_sub_resource_idx,
|
||||||
|
debug_box(src_box), flags, fx, debug_d3dtexturefiltertype(filter));
|
||||||
TRACE("Usage is %s.\n", debug_d3dusage(dst_texture->resource.usage));
|
TRACE("Usage is %s.\n", debug_d3dusage(dst_texture->resource.usage));
|
||||||
|
|
||||||
if (fx)
|
if (fx)
|
||||||
|
|
|
@ -3238,6 +3238,10 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx,
|
||||||
|
const struct wined3d_box *dst_box, struct wined3d_texture *src_texture,
|
||||||
|
unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags,
|
||||||
|
const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
|
||||||
BOOL texture2d_load_drawable(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
BOOL texture2d_load_drawable(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||||
struct wined3d_context *context) DECLSPEC_HIDDEN;
|
struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||||
void texture2d_load_fb_texture(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
void texture2d_load_fb_texture(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||||
|
@ -3344,9 +3348,6 @@ static inline unsigned int surface_get_sub_resource_idx(const struct wined3d_sur
|
||||||
return surface->texture_layer * surface->container->level_count + surface->texture_level;
|
return surface->texture_layer * surface->container->level_count + surface->texture_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const struct wined3d_box *dst_box,
|
|
||||||
struct wined3d_surface *src_surface, const struct wined3d_box *src_box, DWORD flags,
|
|
||||||
const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
|
|
||||||
void wined3d_surface_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
void wined3d_surface_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||||
const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect,
|
const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect,
|
||||||
unsigned int src_pitch, const POINT *dst_point, BOOL srgb,
|
unsigned int src_pitch, const POINT *dst_point, BOOL srgb,
|
||||||
|
|
Loading…
Reference in New Issue