From: Elizabeth Figura <zfigura@codeweavers.com> Fixes: 2505de4d1f2ebd105d94d4616a4beea628d14061 --- dlls/d3d11/device.c | 4 ++-- dlls/d3d8/device.c | 2 +- dlls/d3d9/device.c | 2 +- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/stateblock.c | 2 +- dlls/wined3d/texture_gl.c | 22 ++++++++++------------ dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c4e7c55cde3..e1a846698e6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1521,7 +1521,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_ResolveSubresource(ID3D11Devi wined3d_format = wined3dformat_from_dxgi_format(format); wined3d_device_context_resolve_sub_resource(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, - wined3d_src_resource, src_subresource_idx, wined3d_format); + wined3d_src_resource, src_subresource_idx, WINED3D_BLT_RAW, wined3d_format); } static void STDMETHODCALLTYPE d3d11_device_context_ExecuteCommandList(ID3D11DeviceContext4 *iface, @@ -6233,7 +6233,7 @@ static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *ifa wined3d_format = wined3dformat_from_dxgi_format(format); wined3d_device_context_resolve_sub_resource(device->immediate_context.wined3d_context, wined3d_dst_resource, dst_subresource_idx, - wined3d_src_resource, src_subresource_idx, wined3d_format); + wined3d_src_resource, src_subresource_idx, WINED3D_BLT_RAW, wined3d_format); } static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *iface, diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index b5bf370790a..036c60edc37 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1985,7 +1985,7 @@ static void resolve_depth_buffer(struct d3d8_device *device) d3d8_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv); wined3d_device_context_resolve_sub_resource(device->immediate_context, dst_resource, 0, - wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d8_dsv->sub_resource_idx, desc.format); + wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d8_dsv->sub_resource_idx, 0, desc.format); } static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 5f59d10079d..20b7255f52f 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2615,7 +2615,7 @@ static void resolve_depth_buffer(struct d3d9_device *device) d3d9_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv); wined3d_device_context_resolve_sub_resource(device->immediate_context, dst_resource, 0, - wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, desc.format); + wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, 0, desc.format); } static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevice9Ex *iface, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 45f480d693c..e754cc633b7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4441,7 +4441,7 @@ void CDECL wined3d_device_context_update_sub_resource(struct wined3d_device_cont void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, - enum wined3d_format_id format_id) + uint32_t flags, enum wined3d_format_id format_id) { struct wined3d_texture *dst_texture, *src_texture; unsigned int dst_level, src_level; @@ -4485,7 +4485,7 @@ void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_con SetRect(&src_rect, 0, 0, wined3d_texture_get_level_width(src_texture, src_level), wined3d_texture_get_level_height(src_texture, src_level)); wined3d_device_context_blt(context, dst_texture, dst_sub_resource_idx, &dst_rect, - src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT); + src_texture, src_sub_resource_idx, &src_rect, flags, &fx, WINED3D_TEXF_POINT); wined3d_device_context_unlock(context); } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index def9182d9b3..2e7017ec8c4 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2806,7 +2806,7 @@ static void resolve_depth_buffer(struct wined3d_device *device) return; wined3d_device_context_resolve_sub_resource(&device->cs->c, dst_resource, 0, - src_view->resource, src_view->sub_resource_idx, dst_resource->format->id); + src_view->resource, src_view->sub_resource_idx, 0, dst_resource->format->id); } static void wined3d_device_set_render_state(struct wined3d_device *device, diff --git a/dlls/wined3d/texture_gl.c b/dlls/wined3d/texture_gl.c index e93451e2c58..311ee954c23 100644 --- a/dlls/wined3d/texture_gl.c +++ b/dlls/wined3d/texture_gl.c @@ -697,14 +697,14 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win /* Blit between surface locations. Onscreen on different swapchains is not supported. * Depth / stencil is not supported. Context activation is done by the caller. */ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *context, - enum wined3d_texture_filter_type filter, struct wined3d_texture *src_texture, + enum wined3d_blit_op blit_op, enum wined3d_texture_filter_type filter, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, const struct wined3d_format *resolve_format) { struct wined3d_texture *required_texture, *restore_texture, *dst_save_texture = dst_texture; unsigned int restore_idx, dst_save_sub_resource_idx = dst_sub_resource_idx; - bool resolve, scaled_resolve, typeless_resolve, restore_context = false; + bool resolve, scaled_resolve, restore_context = false; struct wined3d_texture *src_staging_texture = NULL; const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; @@ -722,17 +722,14 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont scaled_resolve = resolve && (abs(src_rect->bottom - src_rect->top) != abs(dst_rect->bottom - dst_rect->top) || abs(src_rect->right - src_rect->left) != abs(dst_rect->right - dst_rect->left)); - typeless_resolve = resolve && (wined3d_format_is_typeless(src_texture->resource.format) - || wined3d_format_is_typeless(dst_texture->resource.format)) - && (src_texture->resource.format->typeless_id == dst_texture->resource.format->typeless_id); - if (resolve && !typeless_resolve) + if (resolve && blit_op == WINED3D_BLIT_OP_COLOR_BLIT) { if ((scaled_resolve && !context->d3d_info->scaled_resolve) || src_texture->resource.format->id != dst_texture->resource.format->id) { src_location = WINED3D_LOCATION_RB_RESOLVED; - resolve = scaled_resolve = typeless_resolve = false; + resolve = scaled_resolve = false; } } @@ -1095,7 +1092,7 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit if (blit_op == WINED3D_BLIT_OP_COLOR_BLIT || blit_op == WINED3D_BLIT_OP_RAW_BLIT) { TRACE("Colour blit.\n"); - texture2d_blt_fbo(device, context, filter, src_texture, src_sub_resource_idx, src_location, + texture2d_blt_fbo(device, context, blit_op, filter, src_texture, src_sub_resource_idx, src_location, src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, resolve_format); return dst_location; } @@ -2125,7 +2122,7 @@ static BOOL wined3d_texture_load_renderbuffer(struct wined3d_texture *texture, else /* texture2d_blt_fbo() will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB; - texture2d_blt_fbo(texture->resource.device, context, WINED3D_TEXF_POINT, texture, + texture2d_blt_fbo(texture->resource.device, context, WINED3D_BLIT_OP_COLOR_BLIT, WINED3D_TEXF_POINT, texture, sub_resource_idx, src_location, &rect, texture, sub_resource_idx, dst_location, &rect, NULL); return TRUE; @@ -2159,11 +2156,11 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g SetRect(&src_rect, src_box.left, src_box.top, src_box.right, src_box.bottom); if (srgb) - texture2d_blt_fbo(device, &context_gl->c, WINED3D_TEXF_POINT, + texture2d_blt_fbo(device, &context_gl->c, WINED3D_BLIT_OP_COLOR_BLIT, WINED3D_TEXF_POINT, &texture_gl->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB, &src_rect, &texture_gl->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect, NULL); else - texture2d_blt_fbo(device, &context_gl->c, WINED3D_TEXF_POINT, + texture2d_blt_fbo(device, &context_gl->c, WINED3D_BLIT_OP_COLOR_BLIT, WINED3D_TEXF_POINT, &texture_gl->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect, &texture_gl->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB, &src_rect, NULL); @@ -2181,7 +2178,8 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; if (fbo_blitter_supported(WINED3D_BLIT_OP_COLOR_BLIT, gl_info, &texture_gl->t.resource, src_location, &texture_gl->t.resource, dst_location)) - texture2d_blt_fbo(device, &context_gl->c, WINED3D_TEXF_POINT, &texture_gl->t, sub_resource_idx, + texture2d_blt_fbo(device, &context_gl->c, WINED3D_BLIT_OP_COLOR_BLIT, + WINED3D_TEXF_POINT, &texture_gl->t, sub_resource_idx, src_location, &src_rect, &texture_gl->t, sub_resource_idx, dst_location, &src_rect, NULL); return TRUE; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index dc86887c251..e08dd089521 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -141,7 +141,7 @@ @ cdecl wined3d_device_context_issue_query(ptr ptr long) @ cdecl wined3d_device_context_map(ptr ptr long ptr ptr long) @ cdecl wined3d_device_context_reset_state(ptr) -@ cdecl wined3d_device_context_resolve_sub_resource(ptr ptr long ptr long long) +@ cdecl wined3d_device_context_resolve_sub_resource(ptr ptr long ptr long long long) @ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long) @ cdecl wined3d_device_context_set_constant_buffers(ptr long long long ptr) @ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9918ac68838..cfb098adfb0 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2565,7 +2565,8 @@ HRESULT __cdecl wined3d_device_context_map(struct wined3d_device_context *contex void __cdecl wined3d_device_context_reset_state(struct wined3d_device_context *context); void __cdecl wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, - struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, enum wined3d_format_id format_id); + struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, + uint32_t flags, enum wined3d_format_id format_id); void __cdecl wined3d_device_context_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask); void __cdecl wined3d_device_context_set_constant_buffers(struct wined3d_device_context *context, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10465