Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/wined3d/surface.c | 13 ------------- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d8bf9ce04e..8db322dec7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -44,19 +44,6 @@ static void get_color_masks(const struct wined3d_format *format, DWORD *masks) masks[2] = ((1u << format->blue_size) - 1) << format->blue_offset; }
-static BOOL texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r) -{ - unsigned int t; - - t = wined3d_texture_get_level_width(texture, level); - if ((r->left && r->right) || abs(r->right - r->left) != t) - return FALSE; - t = wined3d_texture_get_level_height(texture, level); - if ((r->top && r->bottom) || abs(r->bottom - r->top) != t) - return FALSE; - return TRUE; -} - /* See also float_16_to_32() in wined3d_private.h */ static inline unsigned short float_32_to_16(const float *in) { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index e8a92acab9..5a8482d86e 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -48,7 +48,7 @@ struct wined3d_rect_f float b; };
-static bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r) +bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r) { unsigned int t;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9f8c212fbf..75335d09b9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4172,6 +4172,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags, const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r) DECLSPEC_HIDDEN; void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *rect, struct wined3d_blt_info *info) DECLSPEC_HIDDEN; void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
Otherwise things go wrong when texture2d_blt() chooses WINED3D_LOCATION_RB_RESOLVED.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49251 Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/wined3d/glsl_shader.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 7d16f03a21..c8c9656b6c 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13135,6 +13135,11 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli wined3d_texture_load(src_texture, context, FALSE); }
+ if (!texture2d_is_full_rect(dst_texture, dst_sub_resource_idx % dst_texture->level_count, dst_rect)) + wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, dst_location); + else + wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location); + wined3d_context_gl_apply_blit_state(context_gl, device);
if (dst_location == WINED3D_LOCATION_DRAWABLE)
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/wined3d/surface.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 8db322dec7..eaf64cf749 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1459,6 +1459,20 @@ struct wined3d_blitter *wined3d_cpu_blitter_create(void) return blitter; }
+static bool wined3d_is_color_blit(enum wined3d_blit_op blit_op) +{ + switch (blit_op) + { + case WINED3D_BLIT_OP_COLOR_BLIT: + case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST: + case WINED3D_BLIT_OP_COLOR_BLIT_CKEY: + return true; + + default: + return false; + } +} + HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags, const struct wined3d_blt_fx *fx, @@ -1701,7 +1715,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ if (!(dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)) dst_location = dst_texture->resource.map_binding; else if (dst_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE - && (scale || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) + && (scale || convert || !wined3d_is_color_blit(blit_op))) dst_location = WINED3D_LOCATION_RB_RESOLVED; else dst_location = dst_texture->resource.draw_binding;
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/wined3d/surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index eaf64cf749..77362bb428 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1707,7 +1707,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
if (src_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE && ((scale && !context->d3d_info->scaled_resolve) - || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) + || convert || !wined3d_is_color_blit(blit_op))) src_location = WINED3D_LOCATION_RB_RESOLVED; else src_location = src_texture->resource.draw_binding;