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
2bf09a15
Commit
2bf09a15
authored
Apr 07, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Test locking of mipmap textures.
parent
9177261a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
device.c
dlls/d3d8/tests/device.c
+72
-0
No files found.
dlls/d3d8/tests/device.c
View file @
2bf09a15
...
...
@@ -6101,6 +6101,77 @@ static void test_resource_type(void)
DestroyWindow
(
window
);
}
static
void
test_mipmap_lock
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3DSurface8
*
surface
,
*
surface2
,
*
surface_dst
,
*
surface_dst2
;
IDirect3DTexture8
*
texture
,
*
texture_dst
;
IDirect3D8
*
d3d
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
D3DLOCKED_RECT
locked_rect
;
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
4
,
4
,
2
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
&
texture_dst
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture_dst
,
0
,
&
surface_dst
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface level, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture_dst
,
1
,
&
surface_dst2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface level, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
4
,
4
,
2
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface level, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
1
,
&
surface2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface level, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_LockRect
(
surface
,
&
locked_rect
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to lock surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_LockRect
(
surface2
,
&
locked_rect
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to lock surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_UnlockRect
(
surface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CopyRects
(
device
,
surface
,
NULL
,
0
,
surface_dst
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to update surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CopyRects
(
device
,
surface2
,
NULL
,
0
,
surface_dst2
,
NULL
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* Apparently there's no validation on the container. */
hr
=
IDirect3DDevice8_UpdateTexture
(
device
,
(
IDirect3DBaseTexture8
*
)
texture
,
(
IDirect3DBaseTexture8
*
)
texture_dst
);
ok
(
SUCCEEDED
(
hr
),
"Failed to update texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface8_UnlockRect
(
surface2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
surface_dst2
);
IDirect3DSurface8_Release
(
surface_dst
);
IDirect3DSurface8_Release
(
surface2
);
IDirect3DSurface8_Release
(
surface
);
IDirect3DTexture8_Release
(
texture_dst
);
IDirect3DTexture8_Release
(
texture
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -6184,6 +6255,7 @@ START_TEST(device)
test_begin_end_state_block
();
test_shader_constant_apply
();
test_resource_type
();
test_mipmap_lock
();
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