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
0b61e22f
Commit
0b61e22f
authored
Jul 08, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add a test for SetPriority and GetPriority.
parent
509c49bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
device.c
dlls/d3d8/tests/device.c
+90
-0
No files found.
dlls/d3d8/tests/device.c
View file @
0b61e22f
...
...
@@ -6336,6 +6336,95 @@ done:
DestroyWindow
(
window
);
}
static
void
test_resource_priority
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3DTexture8
*
texture
;
IDirect3DVertexBuffer8
*
buffer
;
IDirect3D8
*
d3d
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
D3DPOOL
pool
;
const
char
*
name
;
BOOL
can_set_priority
;
}
test_data
[]
=
{
{
D3DPOOL_DEFAULT
,
"D3DPOOL_DEFAULT"
,
FALSE
},
{
D3DPOOL_SYSTEMMEM
,
"D3DPOOL_SYSTEMMEM"
,
FALSE
},
{
D3DPOOL_MANAGED
,
"D3DPOOL_MANAGED"
,
TRUE
},
{
D3DPOOL_SCRATCH
,
"D3DPOOL_SCRATCH"
,
FALSE
}
};
unsigned
int
i
;
DWORD
priority
;
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
;
}
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
i
++
)
{
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
16
,
16
,
0
,
0
,
D3DFMT_X8R8G8B8
,
test_data
[
i
].
pool
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create texture, hr %#x, pool %s.
\n
"
,
hr
,
test_data
[
i
].
name
);
priority
=
IDirect3DTexture8_GetPriority
(
texture
);
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DTexture8_SetPriority
(
texture
,
1
);
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DTexture8_GetPriority
(
texture
);
if
(
test_data
[
i
].
can_set_priority
)
{
ok
(
priority
==
1
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DTexture8_SetPriority
(
texture
,
0
);
ok
(
priority
==
1
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
}
else
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
IDirect3DTexture8_Release
(
texture
);
if
(
test_data
[
i
].
pool
!=
D3DPOOL_SCRATCH
)
{
hr
=
IDirect3DDevice8_CreateVertexBuffer
(
device
,
256
,
0
,
0
,
test_data
[
i
].
pool
,
&
buffer
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create buffer, hr %#x, pool %s.
\n
"
,
hr
,
test_data
[
i
].
name
);
priority
=
IDirect3DVertexBuffer8_GetPriority
(
buffer
);
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DVertexBuffer8_SetPriority
(
buffer
,
1
);
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DVertexBuffer8_GetPriority
(
buffer
);
if
(
test_data
[
i
].
can_set_priority
)
{
ok
(
priority
==
1
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
priority
=
IDirect3DVertexBuffer8_SetPriority
(
buffer
,
0
);
ok
(
priority
==
1
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
}
else
ok
(
priority
==
0
,
"Got unexpected priority %u, pool %s.
\n
"
,
priority
,
test_data
[
i
].
name
);
IDirect3DVertexBuffer8_Release
(
buffer
);
}
}
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"
);
...
...
@@ -6422,6 +6511,7 @@ START_TEST(device)
test_mipmap_lock
();
test_writeonly_resource
();
test_lost_device
();
test_resource_priority
();
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