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
ccc1ce9f
Commit
ccc1ce9f
authored
Aug 27, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add a volume texture locking test.
parent
82b6c460
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
device.c
dlls/d3d8/tests/device.c
+85
-0
No files found.
dlls/d3d8/tests/device.c
View file @
ccc1ce9f
...
...
@@ -4891,6 +4891,90 @@ done:
}
static
void
test_volume_locking
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d8
;
HWND
window
;
HRESULT
hr
;
IDirect3DVolumeTexture8
*
texture
;
unsigned
int
i
;
D3DLOCKED_BOX
locked_box
;
ULONG
refcount
;
D3DCAPS8
caps
;
static
const
struct
{
D3DPOOL
pool
;
DWORD
usage
;
HRESULT
create_hr
,
lock_hr
;
}
tests
[]
=
{
{
D3DPOOL_DEFAULT
,
0
,
D3D_OK
,
D3DERR_INVALIDCALL
},
{
D3DPOOL_DEFAULT
,
D3DUSAGE_DYNAMIC
,
D3D_OK
,
D3D_OK
},
{
D3DPOOL_SYSTEMMEM
,
0
,
D3D_OK
,
D3D_OK
},
{
D3DPOOL_SYSTEMMEM
,
D3DUSAGE_DYNAMIC
,
D3D_OK
,
D3D_OK
},
{
D3DPOOL_MANAGED
,
0
,
D3D_OK
,
D3D_OK
},
{
D3DPOOL_MANAGED
,
D3DUSAGE_DYNAMIC
,
D3DERR_INVALIDCALL
,
D3D_OK
},
{
D3DPOOL_SCRATCH
,
0
,
D3D_OK
,
D3D_OK
},
{
D3DPOOL_SCRATCH
,
D3DUSAGE_DYNAMIC
,
D3DERR_INVALIDCALL
,
D3D_OK
},
};
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D8 object, skipping tests.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
d3d8
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get caps, hr %#x.
\n
"
,
hr
);
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_VOLUMEMAP
))
{
skip
(
"Volume textures not supported, skipping test.
\n
"
);
goto
out
;
}
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
*
tests
);
i
++
)
{
hr
=
IDirect3DDevice8_CreateVolumeTexture
(
device
,
4
,
4
,
4
,
1
,
tests
[
i
].
usage
,
D3DFMT_A8R8G8B8
,
tests
[
i
].
pool
,
&
texture
);
ok
(
hr
==
tests
[
i
].
create_hr
,
"Creating volume texture pool=%u, usage=%#x returned %#x, expected %#x.
\n
"
,
tests
[
i
].
pool
,
tests
[
i
].
usage
,
hr
,
tests
[
i
].
create_hr
);
if
(
FAILED
(
hr
))
continue
;
locked_box
.
pBits
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirect3DVolumeTexture8_LockBox
(
texture
,
0
,
&
locked_box
,
NULL
,
0
);
ok
(
hr
==
tests
[
i
].
lock_hr
,
"Lock returned %#x, expected %#x.
\n
"
,
hr
,
tests
[
i
].
lock_hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DVolumeTexture8_UnlockBox
(
texture
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock volume texture, hr %#x.
\n
"
,
hr
);
}
else
{
ok
(
locked_box
.
pBits
==
NULL
,
"Failed lock set pBits = %p, expected NULL.
\n
"
,
locked_box
.
pBits
);
}
IDirect3DVolumeTexture8_Release
(
texture
);
}
out:
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -4968,6 +5052,7 @@ START_TEST(device)
test_swvp_buffer
();
test_rtpatch
();
test_npot_textures
();
test_volume_locking
();
}
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