wined3d: Get rid of wined3d_texture_ops.texture_sub_resource_load().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2016-04-06 19:12:07 +02:00 committed by Alexandre Julliard
parent d85706381c
commit 7d23c8a4d8
4 changed files with 3 additions and 49 deletions

View File

@ -1422,27 +1422,6 @@ void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const
checkGLcall("set_compatible_renderbuffer");
}
/* Context activation is done by the caller. */
void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb)
{
DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
TRACE("surface %p, srgb %#x.\n", surface, srgb);
if (surface->container->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n");
if (surface_get_sub_resource(surface)->locations & location)
{
TRACE("surface is already in texture\n");
return;
}
TRACE("Reloading because surface is dirty.\n");
surface_load_location(surface, context, location);
surface_evict_sysmem(surface);
}
/* See also float_16_to_32() in wined3d_private.h */
static inline unsigned short float_32_to_16(const float *in)
{

View File

@ -663,7 +663,9 @@ void wined3d_texture_load(struct wined3d_texture *texture,
/* Reload the surfaces if the texture is marked dirty. */
for (i = 0; i < sub_count; ++i)
{
texture->texture_ops->texture_sub_resource_load(texture->sub_resources[i].resource, context, srgb);
if (!texture->texture_ops->texture_load_location(texture, i, context,
srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB))
ERR("Failed to load location (srgb %#x).\n", srgb);
}
texture->flags |= flag;
}
@ -1087,12 +1089,6 @@ static HRESULT wined3d_texture_upload_data(struct wined3d_texture *texture,
return WINED3D_OK;
}
static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource,
struct wined3d_context *context, BOOL srgb)
{
surface_load(surface_from_resource(sub_resource), context, srgb);
}
static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource,
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
{
@ -1203,7 +1199,6 @@ static void texture2d_cleanup_sub_resources(struct wined3d_texture *texture)
static const struct wined3d_texture_ops texture2d_ops =
{
texture2d_sub_resource_load,
texture2d_sub_resource_upload_data,
texture2d_load_location,
texture2d_prepare_location,
@ -1689,12 +1684,6 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
return WINED3D_OK;
}
static void texture3d_sub_resource_load(struct wined3d_resource *sub_resource,
struct wined3d_context *context, BOOL srgb)
{
wined3d_volume_load(volume_from_resource(sub_resource), context, srgb);
}
static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource,
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
{
@ -1766,7 +1755,6 @@ static void texture3d_cleanup_sub_resources(struct wined3d_texture *texture)
static const struct wined3d_texture_ops texture3d_ops =
{
texture3d_sub_resource_load,
texture3d_sub_resource_upload_data,
texture3d_load_location,
texture3d_prepare_location,

View File

@ -355,14 +355,6 @@ done:
return TRUE;
}
/* Context activation is done by the caller. */
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode)
{
wined3d_texture_prepare_texture(volume->container, context, srgb_mode);
wined3d_volume_load_location(volume, context,
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
}
void wined3d_volume_cleanup(struct wined3d_volume *volume)
{
TRACE("volume %p.\n", volume);

View File

@ -2416,8 +2416,6 @@ struct gl_texture
struct wined3d_texture_ops
{
void (*texture_sub_resource_load)(struct wined3d_resource *sub_resource,
struct wined3d_context *context, BOOL srgb);
void (*texture_sub_resource_upload_data)(struct wined3d_resource *sub_resource,
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data);
BOOL (*texture_load_location)(struct wined3d_texture *texture, unsigned int sub_resource_idx,
@ -2580,8 +2578,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
void wined3d_volume_cleanup(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
HRESULT wined3d_volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
const struct wined3d_resource_desc *desc, UINT level) DECLSPEC_HIDDEN;
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
BOOL srgb_mode) DECLSPEC_HIDDEN;
BOOL wined3d_volume_load_location(struct wined3d_volume *volume,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_volume_prepare_location(struct wined3d_volume *volume,
@ -2698,7 +2694,6 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
HRESULT wined3d_surface_init(struct wined3d_surface *surface,
struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
GLenum target, unsigned int level, unsigned int layer, DWORD flags) DECLSPEC_HIDDEN;
void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN;
HRESULT surface_load_location(struct wined3d_surface *surface,