Commit 8de7e5cc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Return a BOOL from surface_load_location().

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