Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3b2cf06b
Commit
3b2cf06b
authored
Feb 27, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Extend the FPU setup test.
parent
28a9d632
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
8 deletions
+87
-8
device.c
dlls/d3d8/tests/device.c
+87
-8
No files found.
dlls/d3d8/tests/device.c
View file @
3b2cf06b
...
...
@@ -3023,6 +3023,46 @@ static inline WORD get_fpu_cw(void)
return
cw
;
}
static
WORD
callback_cw
,
callback_set_cw
;
static
DWORD
callback_tid
;
static
HRESULT
WINAPI
dummy_object_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
out
)
{
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dummy_object_AddRef
(
IUnknown
*
iface
)
{
callback_cw
=
get_fpu_cw
();
set_fpu_cw
(
callback_set_cw
);
callback_tid
=
GetCurrentThreadId
();
return
2
;
}
static
ULONG
WINAPI
dummy_object_Release
(
IUnknown
*
iface
)
{
callback_cw
=
get_fpu_cw
();
set_fpu_cw
(
callback_set_cw
);
callback_tid
=
GetCurrentThreadId
();
return
1
;
}
static
const
IUnknownVtbl
dummy_object_vtbl
=
{
dummy_object_QueryInterface
,
dummy_object_AddRef
,
dummy_object_Release
,
};
static
const
GUID
d3d8_private_data_test_guid
=
{
0xfdb37466
,
0x428f
,
0x4edf
,
{
0xa3
,
0x7f
,
0x9b
,
0x1d
,
0xf4
,
0x88
,
0xc5
,
0xfc
}
};
static
void
test_fpu_setup
(
void
)
{
#if defined(D3D8_TEST_SET_FPU_CW) && defined(D3D8_TEST_GET_FPU_CW)
...
...
@@ -3033,6 +3073,8 @@ static void test_fpu_setup(void)
HWND
window
;
HRESULT
hr
;
WORD
cw
;
IDirect3DSurface8
*
surface
;
IUnknown
dummy_object
=
{
&
dummy_object_vtbl
};
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_CAPTION
,
0
,
0
,
registry_mode
.
dmPelsWidth
,
registry_mode
.
dmPelsHeight
,
0
,
0
,
0
,
0
);
...
...
@@ -3062,7 +3104,34 @@ static void test_fpu_setup(void)
cw
=
get_fpu_cw
();
ok
(
cw
==
0x7f
,
"cw is %#x, expected 0x7f.
\n
"
,
cw
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target surface, hr %#x.
\n
"
,
hr
);
callback_set_cw
=
0xf60
;
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
&
dummy_object
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
callback_cw
==
0x7f
,
"Callback cw is %#x, expected 0x7f.
\n
"
,
callback_cw
);
ok
(
callback_tid
==
GetCurrentThreadId
(),
"Got unexpected thread id.
\n
"
);
cw
=
get_fpu_cw
();
ok
(
cw
==
0xf60
,
"cw is %#x, expected 0xf60.
\n
"
,
cw
);
callback_cw
=
0
;
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
&
dummy_object
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
callback_cw
==
0xf60
,
"Callback cw is %#x, expected 0xf60.
\n
"
,
callback_cw
);
ok
(
callback_tid
==
GetCurrentThreadId
(),
"Got unexpected thread id.
\n
"
);
callback_set_cw
=
0x7f
;
set_fpu_cw
(
0x7f
);
IDirect3DSurface8_Release
(
surface
);
callback_cw
=
0
;
IDirect3DDevice8_Release
(
device
);
ok
(
callback_cw
==
0x7f
,
"Callback cw is %#x, expected 0x7f.
\n
"
,
callback_cw
);
ok
(
callback_tid
==
GetCurrentThreadId
(),
"Got unexpected thread id.
\n
"
);
cw
=
get_fpu_cw
();
ok
(
cw
==
0x7f
,
"cw is %#x, expected 0x7f.
\n
"
,
cw
);
...
...
@@ -3076,9 +3145,26 @@ static void test_fpu_setup(void)
cw
=
get_fpu_cw
();
ok
(
cw
==
0xf60
,
"cw is %#x, expected 0xf60.
\n
"
,
cw
);
set_fpu_cw
(
0x37f
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target surface, hr %#x.
\n
"
,
hr
);
callback_cw
=
0
;
callback_set_cw
=
0x37f
;
hr
=
IDirect3DSurface8_SetPrivateData
(
surface
,
&
d3d8_private_data_test_guid
,
&
dummy_object
,
sizeof
(
IUnknown
*
),
D3DSPD_IUNKNOWN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set private data, hr %#x.
\n
"
,
hr
);
ok
(
callback_cw
==
0xf60
,
"Callback cw is %#x, expected 0xf60.
\n
"
,
callback_cw
);
ok
(
callback_tid
==
GetCurrentThreadId
(),
"Got unexpected thread id.
\n
"
);
cw
=
get_fpu_cw
();
ok
(
cw
==
0x37f
,
"cw is %#x, expected 0x37f.
\n
"
,
cw
);
IDirect3DSurface8_Release
(
surface
);
callback_cw
=
0
;
IDirect3DDevice8_Release
(
device
);
ok
(
callback_cw
==
0x37f
,
"Callback cw is %#x, expected 0x37f.
\n
"
,
callback_cw
);
ok
(
callback_tid
==
GetCurrentThreadId
(),
"Got unexpected thread id.
\n
"
);
done:
DestroyWindow
(
window
);
...
...
@@ -4541,13 +4627,6 @@ static void test_private_data(void)
HRESULT
hr
;
DWORD
size
;
DWORD
data
[
4
]
=
{
1
,
2
,
3
,
4
};
static
const
GUID
d3d8_private_data_test_guid
=
{
0xfdb37466
,
0x428f
,
0x4edf
,
{
0xa3
,
0x7f
,
0x9b
,
0x1d
,
0xf4
,
0x88
,
0xc5
,
0xfc
}
};
static
const
GUID
d3d8_private_data_test_guid2
=
{
0x2e5afac2
,
...
...
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