Skip to content

Commit cf0c1ad

Browse files
committed
[0.4.11] Avoid regression CORE-14955 "Ddraw fullscreen crashes"
This brings us back to before commit 0.4.10-dev-55-g 7af3969 and therefore downgrades D3D8,D3D9,DDRAW,WINED3D from 3.9 to 3.3 for this rls. This is same versions as we had in 0.4.10rls (I used same revert then) Purpose of this revert is to fix crashes when Ddraw apps switch into fullscreen with VBEMP and inbuilt Mesa. I tested, before: DxDiag crashed when switching to fullscreen, Diablo II crashed immediately, Monster-Truck-Madness 2 demo crashed after main menu Afterwards all of these apps do run. DXTN does still work after that, even with VBEMP and inbuilt Mesa. This will be the interim fix, which I will keep for rls at least until someone manages to fix CORE-14955 properly in master with Wine 3.9. analog to 0.4.10-RC-17-g bb4c55d
1 parent 29f9c04 commit cf0c1ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4675
-5233
lines changed

dll/directx/wine/d3d8/d3d8_private.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,10 @@ struct d3d8_swapchain
166166
LONG refcount;
167167
struct wined3d_swapchain *wined3d_swapchain;
168168
IDirect3DDevice8 *parent_device;
169-
unsigned int swap_interval;
170169
};
171170

172171
HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc,
173-
unsigned int swap_interval, struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN;
172+
struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN;
174173

175174
struct d3d8_surface
176175
{

dll/directx/wine/d3d8/device.c

Lines changed: 45 additions & 156 deletions
Large diffs are not rendered by default.

dll/directx/wine/d3d8/directx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
417417
DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING
418418
| WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
419419
| WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART
420-
| WINED3D_LEGACY_CUBEMAP_FILTERING;
420+
| WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_LIMIT_VIEWPORT;
421421

422422
d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
423423
d3d8->refcount = 1;

dll/directx/wine/d3d8/swapchain.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_swapchain_Present(IDirect3DSwapChai
105105

106106
wined3d_mutex_lock();
107107
hr = wined3d_swapchain_present(swapchain->wined3d_swapchain,
108-
src_rect, dst_rect, dst_window_override, swapchain->swap_interval, 0);
108+
src_rect, dst_rect, dst_window_override, 0, 0);
109109
wined3d_mutex_unlock();
110110

111111
return hr;
@@ -167,13 +167,12 @@ static const struct wined3d_parent_ops d3d8_swapchain_wined3d_parent_ops =
167167
};
168168

169169
static HRESULT swapchain_init(struct d3d8_swapchain *swapchain, struct d3d8_device *device,
170-
struct wined3d_swapchain_desc *desc, unsigned int swap_interval)
170+
struct wined3d_swapchain_desc *desc)
171171
{
172172
HRESULT hr;
173173

174174
swapchain->refcount = 1;
175175
swapchain->IDirect3DSwapChain8_iface.lpVtbl = &d3d8_swapchain_vtbl;
176-
swapchain->swap_interval = swap_interval;
177176

178177
wined3d_mutex_lock();
179178
hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
@@ -193,15 +192,15 @@ static HRESULT swapchain_init(struct d3d8_swapchain *swapchain, struct d3d8_devi
193192
}
194193

195194
HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc,
196-
unsigned int swap_interval, struct d3d8_swapchain **swapchain)
195+
struct d3d8_swapchain **swapchain)
197196
{
198197
struct d3d8_swapchain *object;
199198
HRESULT hr;
200199

201200
if (!(object = heap_alloc_zero(sizeof(*object))))
202201
return E_OUTOFMEMORY;
203202

204-
if (FAILED(hr = swapchain_init(object, device, desc, swap_interval)))
203+
if (FAILED(hr = swapchain_init(object, device, desc)))
205204
{
206205
WARN("Failed to initialize swapchain, hr %#x.\n", hr);
207206
heap_free(object);

dll/directx/wine/d3d9/d3d9_private.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
#define D3D9_TEXTURE_MIPMAP_DIRTY 0x1
4949

50+
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
51+
5052
extern const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops DECLSPEC_HIDDEN;
5153

5254
HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements) DECLSPEC_HIDDEN;
@@ -55,7 +57,7 @@ BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
5557
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
5658
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags) DECLSPEC_HIDDEN;
5759
void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters,
58-
const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval) DECLSPEC_HIDDEN;
60+
const struct wined3d_swapchain_desc *swapchain_desc) DECLSPEC_HIDDEN;
5961
void d3dcaps_from_wined3dcaps(D3DCAPS9 *caps, const WINED3DCAPS *wined3d_caps) DECLSPEC_HIDDEN;
6062

6163
struct d3d9
@@ -99,6 +101,7 @@ struct d3d9_device
99101
UINT index_buffer_size;
100102
UINT index_buffer_pos;
101103

104+
struct d3d9_texture *textures[D3D9_MAX_TEXTURE_UNITS];
102105
struct d3d9_surface *render_targets[D3D_MAX_SIMULTANEOUS_RENDERTARGETS];
103106

104107
LONG device_state;
@@ -148,11 +151,10 @@ struct d3d9_swapchain
148151
LONG refcount;
149152
struct wined3d_swapchain *wined3d_swapchain;
150153
IDirect3DDevice9Ex *parent_device;
151-
unsigned int swap_interval;
152154
};
153155

154156
HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc,
155-
unsigned int swap_interval, struct d3d9_swapchain **swapchain) DECLSPEC_HIDDEN;
157+
struct d3d9_swapchain **swapchain) DECLSPEC_HIDDEN;
156158

157159
struct d3d9_surface
158160
{

0 commit comments

Comments
 (0)