wined3d: Acquire front-buffer contexts when blitting to the drawable in texture2d_blt_fbo().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2019-07-29 15:14:47 +04:30 committed by Alexandre Julliard
parent 57d158622f
commit 96a0a54c52
1 changed files with 9 additions and 14 deletions

View File

@ -147,9 +147,9 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
const RECT *dst_rect)
{
struct wined3d_texture *required_texture, *restore_texture;
unsigned int required_idx, restore_idx;
const struct wined3d_gl_info *gl_info;
struct wined3d_context_gl *context_gl;
unsigned int restore_idx;
GLenum gl_filter;
GLenum buffer;
RECT s, d;
@ -192,26 +192,21 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
else
wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location);
/* Acquire a context for the front-buffer, even though we may be blitting
* to/from a back-buffer. Since context_acquire() doesn't take the
* resource location into account, it may consider the back-buffer to be
* offscreen. */
if (src_location == WINED3D_LOCATION_DRAWABLE)
{
required_texture = src_texture;
required_idx = src_sub_resource_idx;
}
required_texture = src_texture->swapchain->front_buffer;
else if (dst_location == WINED3D_LOCATION_DRAWABLE)
{
required_texture = dst_texture;
required_idx = dst_sub_resource_idx;
}
required_texture = dst_texture->swapchain->front_buffer;
else
{
required_texture = NULL;
required_idx = 0;
}
restore_texture = context->current_rt.texture;
restore_idx = context->current_rt.sub_resource_idx;
if (restore_texture != required_texture || restore_idx != required_idx)
context = context_acquire(device, required_texture, required_idx);
if (restore_texture != required_texture)
context = context_acquire(device, required_texture, 0);
else
restore_texture = NULL;