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
60ff5906
Commit
60ff5906
authored
Jun 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add a test for resource bindings after reset.
parent
d74a587b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
device.c
dlls/d3d8/tests/device.c
+65
-0
No files found.
dlls/d3d8/tests/device.c
View file @
60ff5906
...
...
@@ -3163,6 +3163,70 @@ done:
if
(
hwnd
)
DestroyWindow
(
hwnd
);
}
static
void
test_reset_resources
(
void
)
{
IDirect3DSurface8
*
surface
,
*
rt
;
IDirect3DTexture8
*
texture
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d8
;
HWND
window
;
HRESULT
hr
;
ULONG
ref
;
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D8 object, skipping tests.
\n
"
);
DestroyWindow
(
window
);
return
;
}
if
(
!
(
device
=
create_device
(
d3d8
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_DEPTHSTENCIL
,
D3DFMT_D24S8
,
D3DPOOL_DEFAULT
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create depth/stencil texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface, hr %#x.
\n
"
,
hr
);
IDirect3DTexture8_Release
(
texture
);
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_A8R8G8B8
,
D3DPOOL_DEFAULT
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create render target texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface, hr %#x.
\n
"
,
hr
);
IDirect3DTexture8_Release
(
texture
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
rt
,
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render target surface, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
rt
);
IDirect3DSurface8_Release
(
surface
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
hr
=
IDirect3DDevice8_GetBackBuffer
(
device
,
0
,
D3DBACKBUFFER_TYPE_MONO
,
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get back buffer, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target surface, hr %#x.
\n
"
,
hr
);
ok
(
surface
==
rt
,
"Got unexpected surface %p for render target.
\n
"
,
surface
);
IDirect3DSurface8_Release
(
surface
);
IDirect3DSurface8_Release
(
rt
);
ref
=
IDirect3DDevice8_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
done:
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -3217,6 +3281,7 @@ START_TEST(device)
test_wrong_shader
();
test_mode_change
();
test_device_window_reset
();
test_reset_resources
();
depth_blit_test
();
}
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
...
...
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