wined3d: Use wined3d_texture_load_location() in context_validate_onscreen_formats().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-08-02 12:26:29 +02:00 committed by Alexandre Julliard
parent cad279449c
commit 3160eabf24
3 changed files with 6 additions and 4 deletions

View File

@ -2455,7 +2455,6 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
{
/* Onscreen surfaces are always in a swapchain */
struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain;
struct wined3d_surface *surface;
if (context->render_offscreen || !depth_stencil) return;
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return;
@ -2466,8 +2465,9 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
surface = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
if (!(wined3d_texture_load_location(context->current_rt.texture, context->current_rt.sub_resource_idx,
context, WINED3D_LOCATION_TEXTURE_RGB)))
ERR("Failed to load location.\n");
swapchain->render_to_fbo = TRUE;
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);

View File

@ -176,7 +176,7 @@ void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
/* Context activation is done by the caller. Context may be NULL in
* WINED3D_NO3D mode. */
static BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
{
return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);

View File

@ -2760,6 +2760,8 @@ void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size_t size,
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,