Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d10/effect.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 190ad19a5f1..61b48cdeacb 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -2633,6 +2633,12 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size data_ptr = data + code_offset; read_dword(&data_ptr, &blob_size);
+ if (!require_space(code_offset, 1, sizeof(uint32_t) + blob_size, data_size)) + { + WARN("Invalid offset %#x (data size %#lx).\n", code_offset, (long)data_size); + return E_FAIL; + } + dep.id = id; dep.idx = idx; dep.operation = operation;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- This patch originally included the same typo fixes as those caught by François somewhat recently, so now it's just a slight clarification of the comment. I guess it may still be of some value. --- dlls/wined3d/query.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 864a3b82f0a..6c1ed1d6b5a 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -1681,10 +1681,11 @@ static BOOL wined3d_query_vk_issue(struct wined3d_query *query, uint32_t flags) return false; }
- /* A query needs to either begin and end inside a single render pass, - * or begin and end outside of a render pass. Occlusion queries, if issued - * outside of a render pass, are queued up and only begun when a render - * pass is started, to avoid interrupting it when the query ends. */ + /* A query needs to either begin and end inside a single render pass + * or begin and end outside of a render pass. Occlusion queries, if + * issued outside of a render pass, are queued up and only begun when + * a render pass is started, to avoid interrupting the render pass + * when the query ends. */ if (context_vk->vk_render_pass) { wined3d_query_vk_begin(query_vk, context_vk, vk_command_buffer);
Mostly to avoid triggering the WARN() from wined3d_texture_get_sub_resource_desc() every time this function is called.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ddraw/surface.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 25aa2be41bb..d4fddcc8d06 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5923,7 +5923,8 @@ static HRESULT CDECL ddraw_reset_enum_callback(struct wined3d_resource *resource return DD_OK; }
-static HRESULT ddraw_surface_reserve_memory(struct wined3d_texture *wined3d_texture) +static HRESULT ddraw_surface_reserve_memory(struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_count) { static const unsigned int extra_size = 0x10000;
@@ -5931,9 +5932,8 @@ static HRESULT ddraw_surface_reserve_memory(struct wined3d_texture *wined3d_text struct wined3d_resource_desc resource_desc; struct wined3d_sub_resource_desc desc; unsigned int pitch, slice_pitch; - unsigned int sub_resource_idx; HRESULT hr = WINED3D_OK; - unsigned int offset; + unsigned int offset, i;
wined3d_resource_get_desc(wined3d_texture_get_resource(wined3d_texture), &resource_desc); if (!(texture->texture_memory = heap_alloc_zero(resource_desc.size + extra_size))) @@ -5944,13 +5944,18 @@ static HRESULT ddraw_surface_reserve_memory(struct wined3d_texture *wined3d_text TRACE("texture->texture_memory %p.\n", texture->texture_memory);
offset = 0; - sub_resource_idx = 0; - while (wined3d_texture_get_sub_resource_desc(wined3d_texture, sub_resource_idx, &desc) - == WINED3D_OK) + for (i = 0; i < sub_resource_count; ++i) { - wined3d_texture_get_pitch(wined3d_texture, sub_resource_idx, &pitch, &slice_pitch); + if (FAILED(hr = wined3d_texture_get_sub_resource_desc(wined3d_texture, i, &desc))) + { + ERR("Subresource %u not found.\n", i); + heap_free(texture->texture_memory); + texture->texture_memory = NULL; + return hr; + } + wined3d_texture_get_pitch(wined3d_texture, i, &pitch, &slice_pitch);
- if (FAILED(hr = wined3d_texture_update_desc(wined3d_texture, sub_resource_idx, + if (FAILED(hr = wined3d_texture_update_desc(wined3d_texture, i, desc.width, desc.height, resource_desc.format, desc.multisample_type, desc.multisample_quality, (BYTE *)texture->texture_memory + offset, pitch))) @@ -5959,7 +5964,6 @@ static HRESULT ddraw_surface_reserve_memory(struct wined3d_texture *wined3d_text texture->texture_memory = NULL; break; } - ++sub_resource_idx; offset += desc.size; } return hr; @@ -6641,7 +6645,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ && desc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY && wined3d_display_mode_format.u1.dwRGBBitCount <= 16;
- if (reserve_memory && FAILED(hr = ddraw_surface_reserve_memory(wined3d_texture))) + if (reserve_memory && FAILED(hr = ddraw_surface_reserve_memory(wined3d_texture, layers * levels))) { ERR("Failed to reserve surface memory, hr %#x.\n", hr); goto fail; @@ -6700,7 +6704,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ wined3d_texture_set_color_key(wined3d_texture, DDCKEY_SRCBLT, (struct wined3d_color_key *)&desc->ddckCKSrcBlt);
- if (reserve_memory && FAILED(hr = ddraw_surface_reserve_memory(wined3d_texture))) + if (reserve_memory && FAILED(hr = ddraw_surface_reserve_memory(wined3d_texture, 1))) { hr = hr_ddraw_from_wined3d(hr); goto fail;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103874
Your paranoid android.
=== debiant2 (32 bit report) ===
ddraw: ddraw1.c:14080: Test failed: Expect clip rect (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:14104: Test failed: Expect clip rect (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:14214: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14232: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14239: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14214: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw1.c:14232: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw1.c:14239: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw2.c:2713: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw2.c:2715: Test failed: Expected window extended style 0x100, got 0. ddraw2.c:4346: Test failed: Display mode restored after good ddraw1::SetCooperativeLevel call ddraw2.c:4359: Test failed: Display mode restored after ddraw1::SetCooperativeLevel(SETFOCUSWINDOW) call ddraw2.c:4375: Test failed: Display mode restored after good-bad ddraw1::SetCooperativeLevel() call sequence ddraw2.c:15156: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw2.c:15163: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Christian Costa titan.costa@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48631 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx9_36/surface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 362113386ea..c3f9f84a789 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -895,7 +895,8 @@ static BOOL image_is_argb(IWICBitmapFrameDecode *frame, const D3DXIMAGE_INFO *in BYTE *buffer; HRESULT hr;
- if (info->Format != D3DFMT_X8R8G8B8 || info->ImageFileFormat != D3DXIFF_BMP) + if (info->Format != D3DFMT_X8R8G8B8 || (info->ImageFileFormat != D3DXIFF_BMP + && info->ImageFileFormat != D3DXIFF_TGA)) return FALSE;
size = info->Width * info->Height * 4;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ddraw/surface.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index d4fddcc8d06..09f52b85aed 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -64,6 +64,9 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, BOOL ret; RECT r;
+ TRACE("surface %p, rect %s, read %#x, swap_interval %u.\n", + surface, wine_dbgstr_rect(rect), read, swap_interval); + if (ddraw->flags & DDRAW_SWAPPED && !read) { ddraw->flags &= ~DDRAW_SWAPPED;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103876
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
ddraw: ddraw2.c:15156: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw2.c:15163: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw4.c:2949: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw4.c:2951: Test failed: Expected window extended style 0x100, got 0.
=== debiant2 (32 bit WoW report) ===
ddraw: ddraw4.c:5471: Test failed: Display mode not restored in new ddraw object ddraw4.c:8354: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8357: Test failed: Got unexpected hr 0x8876000a. ddraw4.c:8359: Test failed: Failed to detach surface, hr 0x88760014. ddraw4.c:8362: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8367: Test failed: Failed to detach surface, hr 0x88760014. ddraw4.c:18193: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw4.c:18200: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw7.c:2614: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2616: Test failed: Expected window extended style 0x100, got 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ddraw/surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 09f52b85aed..65e24b0bbcf 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -97,7 +97,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, * while in exclusive mode, since it would get obscured by the popup * window. On the other hand, if the current frontbuffer *is* the GDI * frontbuffer, that's what's supposed to happen; the popup should obscure - * (oart of) the ddraw swapchain window. + * (part of) the ddraw swapchain window. * * This affects the "Deer Hunter" demo, which uses a popup window and GDI * draws to draw part of the user interface. See also the "fswindow"
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103877
Your paranoid android.
=== debiant2 (32 bit WoW report) ===
ddraw: ddraw4.c:8354: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8357: Test failed: Got unexpected hr 0x8876000a. ddraw4.c:8359: Test failed: Failed to detach surface, hr 0x88760014. ddraw4.c:8362: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8367: Test failed: Failed to detach surface, hr 0x88760014. ddraw4.c:18193: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw4.c:18200: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw7.c:2614: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2616: Test failed: Expected window extended style 0x100, got 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
db8169c93c778dafcd35324c1acdc48a9dd99033 accidentally ended up raising the minimum requirements for d2d to feature level 11_0. We are still okay with d3d10-level graphics support though, so restore the previous situation.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d2d1/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 2069eeda0fc..e6b6f9efbea 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -3863,7 +3863,7 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, { 1.0f, -1.0f}, }; static const UINT16 indices[] = {0, 1, 2, 2, 1, 3}; - static const D3D_FEATURE_LEVEL feature_levels = D3D_FEATURE_LEVEL_11_0; + static const D3D_FEATURE_LEVEL feature_levels = D3D_FEATURE_LEVEL_10_0;
render_target->ID2D1DeviceContext_iface.lpVtbl = &d2d_device_context_vtbl; render_target->ID2D1GdiInteropRenderTarget_iface.lpVtbl = &d2d_gdi_interop_render_target_vtbl;
On Fri, Dec 10, 2021 at 8:04 PM Matteo Bruni mbruni@codeweavers.com wrote:
db8169c93c778dafcd35324c1acdc48a9dd99033 accidentally ended up raising the minimum requirements for d2d to feature level 11_0. We are still okay with d3d10-level graphics support though, so restore the previous situation.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/d2d1/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 2069eeda0fc..e6b6f9efbea 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -3863,7 +3863,7 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, { 1.0f, -1.0f}, }; static const UINT16 indices[] = {0, 1, 2, 2, 1, 3};
- static const D3D_FEATURE_LEVEL feature_levels = D3D_FEATURE_LEVEL_11_0;
static const D3D_FEATURE_LEVEL feature_levels = D3D_FEATURE_LEVEL_10_0;
render_target->ID2D1DeviceContext_iface.lpVtbl = &d2d_device_context_vtbl; render_target->ID2D1GdiInteropRenderTarget_iface.lpVtbl = &d2d_gdi_interop_render_target_vtbl;
-- 2.26.3
Please ignore, I totally missed the earlier https://source.winehq.org/patches/data/221902.