Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
09fda3b8
Commit
09fda3b8
authored
Jun 27, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Improve d3d9_device_TestCooperativeLevel().
parent
1b4c55df
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
9 deletions
+65
-9
device.c
dlls/d3d10core/device.c
+6
-0
device.c
dlls/d3d8/device.c
+6
-0
d3d9_private.h
dlls/d3d9/d3d9_private.h
+8
-1
device.c
dlls/d3d9/device.c
+32
-6
device.c
dlls/d3d9/tests/device.c
+2
-2
ddraw.c
dlls/ddraw/ddraw.c
+6
-0
device.c
dlls/wined3d/device.c
+4
-0
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/d3d10core/device.c
View file @
09fda3b8
...
@@ -1935,6 +1935,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
...
@@ -1935,6 +1935,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
}
}
static
void
CDECL
device_parent_activate
(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
)
{
TRACE
(
"device_parent %p, activate %#x.
\n
"
,
device_parent
,
activate
);
}
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
const
struct
wined3d_parent_ops
**
parent_ops
)
...
@@ -2033,6 +2038,7 @@ static const struct wined3d_device_parent_ops d3d10_wined3d_device_parent_ops =
...
@@ -2033,6 +2038,7 @@ static const struct wined3d_device_parent_ops d3d10_wined3d_device_parent_ops =
{
{
device_parent_wined3d_device_created
,
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_surface_created
,
device_parent_surface_created
,
device_parent_volume_created
,
device_parent_volume_created
,
device_parent_create_swapchain_surface
,
device_parent_create_swapchain_surface
,
...
...
dlls/d3d8/device.c
View file @
09fda3b8
...
@@ -2921,6 +2921,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
...
@@ -2921,6 +2921,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
}
}
static
void
CDECL
device_parent_activate
(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
)
{
TRACE
(
"device_parent %p, activate %#x.
\n
"
,
device_parent
,
activate
);
}
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
const
struct
wined3d_parent_ops
**
parent_ops
)
...
@@ -3034,6 +3039,7 @@ static const struct wined3d_device_parent_ops d3d8_wined3d_device_parent_ops =
...
@@ -3034,6 +3039,7 @@ static const struct wined3d_device_parent_ops d3d8_wined3d_device_parent_ops =
{
{
device_parent_wined3d_device_created
,
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_surface_created
,
device_parent_surface_created
,
device_parent_volume_created
,
device_parent_volume_created
,
device_parent_create_swapchain_surface
,
device_parent_create_swapchain_surface
,
...
...
dlls/d3d9/d3d9_private.h
View file @
09fda3b8
...
@@ -139,6 +139,13 @@ struct fvf_declaration
...
@@ -139,6 +139,13 @@ struct fvf_declaration
DWORD
fvf
;
DWORD
fvf
;
};
};
enum
d3d9_device_state
{
D3D9_DEVICE_STATE_OK
,
D3D9_DEVICE_STATE_LOST
,
D3D9_DEVICE_STATE_NOT_RESET
,
};
struct
d3d9_device
struct
d3d9_device
{
{
IDirect3DDevice9Ex
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex
IDirect3DDevice9Ex_iface
;
...
@@ -157,8 +164,8 @@ struct d3d9_device
...
@@ -157,8 +164,8 @@ struct d3d9_device
UINT
index_buffer_size
;
UINT
index_buffer_size
;
UINT
index_buffer_pos
;
UINT
index_buffer_pos
;
LONG
device_state
;
BOOL
in_destruction
;
BOOL
in_destruction
;
BOOL
not_reset
;
BOOL
in_scene
;
BOOL
in_scene
;
};
};
...
...
dlls/d3d9/device.c
View file @
09fda3b8
...
@@ -323,13 +323,21 @@ static HRESULT WINAPI d3d9_device_TestCooperativeLevel(IDirect3DDevice9Ex *iface
...
@@ -323,13 +323,21 @@ static HRESULT WINAPI d3d9_device_TestCooperativeLevel(IDirect3DDevice9Ex *iface
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
device
->
not_reset
)
TRACE
(
"device state: %#x.
\n
"
,
device
->
device_state
);
if
(
device
->
d3d_parent
->
extended
)
return
D3D_OK
;
switch
(
device
->
device_state
)
{
{
TRACE
(
"D3D9 device is marked not reset.
\n
"
);
default:
case
D3D9_DEVICE_STATE_OK
:
return
D3D_OK
;
case
D3D9_DEVICE_STATE_LOST
:
return
D3DERR_DEVICELOST
;
case
D3D9_DEVICE_STATE_NOT_RESET
:
return
D3DERR_DEVICENOTRESET
;
return
D3DERR_DEVICENOTRESET
;
}
}
return
D3D_OK
;
}
}
static
UINT
WINAPI
d3d9_device_GetAvailableTextureMem
(
IDirect3DDevice9Ex
*
iface
)
static
UINT
WINAPI
d3d9_device_GetAvailableTextureMem
(
IDirect3DDevice9Ex
*
iface
)
...
@@ -621,9 +629,9 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset(IDirect3DDevice9Ex *if
...
@@ -621,9 +629,9 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset(IDirect3DDevice9Ex *if
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
reset_enum_callback
,
!
device
->
d3d_parent
->
extended
);
NULL
,
reset_enum_callback
,
!
device
->
d3d_parent
->
extended
);
if
(
FAILED
(
hr
)
&&
!
device
->
d3d_parent
->
extended
)
if
(
FAILED
(
hr
)
&&
!
device
->
d3d_parent
->
extended
)
device
->
not_reset
=
TRUE
;
device
->
device_state
=
D3D9_DEVICE_STATE_NOT_RESET
;
else
else
device
->
not_reset
=
FALSE
;
device
->
device_state
=
D3D9_DEVICE_STATE_OK
;
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
@@ -3414,6 +3422,23 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
...
@@ -3414,6 +3422,23 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
TRACE
(
"device_parent %p.
\n
"
,
device_parent
);
}
}
static
void
CDECL
device_parent_activate
(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
TRACE
(
"device_parent %p, activate %#x.
\n
"
,
device_parent
,
activate
);
if
(
!
device
->
d3d_parent
)
return
;
if
(
!
activate
)
InterlockedCompareExchange
(
&
device
->
device_state
,
D3D9_DEVICE_STATE_LOST
,
D3D9_DEVICE_STATE_OK
);
else
if
(
device
->
d3d_parent
->
extended
)
InterlockedCompareExchange
(
&
device
->
device_state
,
D3D9_DEVICE_STATE_OK
,
D3D9_DEVICE_STATE_LOST
);
else
InterlockedCompareExchange
(
&
device
->
device_state
,
D3D9_DEVICE_STATE_NOT_RESET
,
D3D9_DEVICE_STATE_LOST
);
}
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
const
struct
wined3d_parent_ops
**
parent_ops
)
...
@@ -3531,6 +3556,7 @@ static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops =
...
@@ -3531,6 +3556,7 @@ static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops =
{
{
device_parent_wined3d_device_created
,
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_surface_created
,
device_parent_surface_created
,
device_parent_volume_created
,
device_parent_volume_created
,
device_parent_create_swapchain_surface
,
device_parent_create_swapchain_surface
,
...
...
dlls/d3d9/tests/device.c
View file @
09fda3b8
...
@@ -8930,7 +8930,7 @@ static void test_lost_device(void)
...
@@ -8930,7 +8930,7 @@ static void test_lost_device(void)
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
hr
=
IDirect3DDevice9_TestCooperativeLevel
(
device
);
hr
=
IDirect3DDevice9_TestCooperativeLevel
(
device
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
@@ -8939,7 +8939,7 @@ static void test_lost_device(void)
...
@@ -8939,7 +8939,7 @@ static void test_lost_device(void)
ret
=
SetForegroundWindow
(
window
);
ret
=
SetForegroundWindow
(
window
);
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
hr
=
IDirect3DDevice9_TestCooperativeLevel
(
device
);
hr
=
IDirect3DDevice9_TestCooperativeLevel
(
device
);
todo_wine
ok
(
hr
==
D3DERR_DEVICENOTRESET
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_DEVICENOTRESET
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
...
dlls/ddraw/ddraw.c
View file @
09fda3b8
...
@@ -4722,6 +4722,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
...
@@ -4722,6 +4722,11 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
ERR
(
"Failed to resize window.
\n
"
);
ERR
(
"Failed to resize window.
\n
"
);
}
}
static
void
CDECL
device_parent_activate
(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
)
{
TRACE
(
"device_parent %p, activate %#x.
\n
"
,
device_parent
,
activate
);
}
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
static
HRESULT
CDECL
device_parent_surface_created
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
...
@@ -4846,6 +4851,7 @@ static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops =
...
@@ -4846,6 +4851,7 @@ static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops =
{
{
device_parent_wined3d_device_created
,
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_surface_created
,
device_parent_surface_created
,
device_parent_volume_created
,
device_parent_volume_created
,
device_parent_create_swapchain_surface
,
device_parent_create_swapchain_surface
,
...
...
dlls/wined3d/device.c
View file @
09fda3b8
...
@@ -4775,6 +4775,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
...
@@ -4775,6 +4775,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
{
{
device
->
device_parent
->
ops
->
mode_changed
(
device
->
device_parent
);
device
->
device_parent
->
ops
->
mode_changed
(
device
->
device_parent
);
}
}
else
if
(
message
==
WM_ACTIVATEAPP
)
{
device
->
device_parent
->
ops
->
activate
(
device
->
device_parent
,
wparam
);
}
if
(
unicode
)
if
(
unicode
)
return
CallWindowProcW
(
proc
,
window
,
message
,
wparam
,
lparam
);
return
CallWindowProcW
(
proc
,
window
,
message
,
wparam
,
lparam
);
...
...
include/wine/wined3d.h
View file @
09fda3b8
...
@@ -1981,6 +1981,7 @@ struct wined3d_device_parent_ops
...
@@ -1981,6 +1981,7 @@ struct wined3d_device_parent_ops
{
{
void
(
__cdecl
*
wined3d_device_created
)(
struct
wined3d_device_parent
*
device_parent
,
struct
wined3d_device
*
device
);
void
(
__cdecl
*
wined3d_device_created
)(
struct
wined3d_device_parent
*
device_parent
,
struct
wined3d_device
*
device
);
void
(
__cdecl
*
mode_changed
)(
struct
wined3d_device_parent
*
device_parent
);
void
(
__cdecl
*
mode_changed
)(
struct
wined3d_device_parent
*
device_parent
);
void
(
__cdecl
*
activate
)(
struct
wined3d_device_parent
*
device_parent
,
BOOL
activate
);
HRESULT
(
__cdecl
*
surface_created
)(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
HRESULT
(
__cdecl
*
surface_created
)(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
);
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
);
HRESULT
(
__cdecl
*
volume_created
)(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
HRESULT
(
__cdecl
*
volume_created
)(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment