wined3d: Return a BOOL from surface_load_location().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-02-22 00:53:19 +01:00 committed by Alexandre Julliard
parent 3d62cd26d1
commit 8de7e5ccef
3 changed files with 10 additions and 17 deletions

View File

@ -2747,11 +2747,10 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
}
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
BOOL surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
{
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
struct wined3d_texture *texture = surface->container;
HRESULT hr;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@ -2760,7 +2759,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
DWORD current = texture->sub_resources[sub_resource_idx].locations;
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
wined3d_debug_location(current), wined3d_debug_location(location));
return WINED3DERR_INVALIDCALL;
return FALSE;
}
switch (location)
@ -2769,31 +2768,25 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
surface_load_sysmem(surface, context, location);
break;
return TRUE;
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, context)))
return hr;
break;
return SUCCEEDED(surface_load_drawable(surface, context));
case WINED3D_LOCATION_RB_RESOLVED:
case WINED3D_LOCATION_RB_MULTISAMPLE:
surface_load_renderbuffer(surface, context, location);
break;
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
case WINED3D_LOCATION_TEXTURE_SRGB:
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
return hr;
break;
return SUCCEEDED(surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB));
default:
ERR("Don't know how to handle location %#x.\n", location);
break;
return FALSE;
}
return WINED3D_OK;
}
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }

View File

@ -1574,7 +1574,7 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int
static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location)
{
return SUCCEEDED(surface_load_location(texture->sub_resources[sub_resource_idx].u.surface, context, location));
return surface_load_location(texture->sub_resources[sub_resource_idx].u.surface, context, location);
}
/* Context activation is done by the caller. */

View File

@ -3024,7 +3024,7 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDD
void wined3d_surface_destroy_dc(struct wined3d_surface *surface) 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,
BOOL surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
const struct wined3d_surface *rt) DECLSPEC_HIDDEN;