Module: wine Branch: master Commit: 3160eabf24613a8608a348330d4877de42958d67 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3160eabf24613a8608a348330d...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Aug 2 12:26:29 2016 +0200
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
---
dlls/wined3d/context.c | 6 +++--- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index bb97fb9..f5311af 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -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); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 865fb4d..098b5d0 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4984ba2..abb950c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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,