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
8912b372
Commit
8912b372
authored
Jan 30, 2010
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Move the vertex buffer alignment test into buffer.c.
parent
1d486a5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
76 deletions
+51
-76
buffer.c
dlls/d3d9/tests/buffer.c
+51
-0
device.c
dlls/d3d9/tests/device.c
+0
-76
No files found.
dlls/d3d9/tests/buffer.c
View file @
8912b372
...
@@ -111,6 +111,56 @@ static void lock_flag_test(IDirect3DDevice9 *device)
...
@@ -111,6 +111,56 @@ static void lock_flag_test(IDirect3DDevice9 *device)
IDirect3DVertexBuffer9_Release
(
buffer
);
IDirect3DVertexBuffer9_Release
(
buffer
);
}
}
static
inline
const
char
*
debug_d3dpool
(
D3DPOOL
pool
)
{
switch
(
pool
)
{
case
D3DPOOL_DEFAULT
:
return
"D3DPOOL_DEFAULT"
;
case
D3DPOOL_SYSTEMMEM
:
return
"D3DPOOL_SYSTEMMEM"
;
case
D3DPOOL_SCRATCH
:
return
"D3DPOOL_SCRATCH"
;
case
D3DPOOL_MANAGED
:
return
"D3DPOOL_MANAGED"
;
default:
return
"unknown pool"
;
}
}
static
void
test_vertex_buffer_alignment
(
IDirect3DDevice9
*
device
)
{
IDirect3DVertexBuffer9
*
buffer
=
NULL
;
HRESULT
hr
;
D3DPOOL
pools
[]
=
{
D3DPOOL_DEFAULT
,
D3DPOOL_SYSTEMMEM
,
D3DPOOL_SCRATCH
,
D3DPOOL_MANAGED
};
DWORD
sizes
[]
=
{
1
,
4
,
16
,
17
,
32
,
33
,
64
,
65
,
1024
,
1025
,
1048576
,
1048577
};
unsigned
int
i
,
j
;
void
*
data
;
for
(
i
=
0
;
i
<
(
sizeof
(
sizes
)
/
sizeof
(
sizes
[
0
]));
i
++
)
{
for
(
j
=
0
;
j
<
(
sizeof
(
pools
)
/
sizeof
(
pools
[
0
]));
j
++
)
{
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
sizes
[
i
],
0
,
0
,
pools
[
j
],
&
buffer
,
NULL
);
if
(
pools
[
j
]
==
D3DPOOL_SCRATCH
)
{
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Creating a D3DPOOL_SCRATCH buffer returned (0x%08x)
\n
"
,
hr
);
}
else
{
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_CreateVertexBuffer failed (0x%08x). Pool = %s, size %d
\n
"
,
hr
,
debug_d3dpool
(
pools
[
j
]),
sizes
[
i
]);
}
if
(
FAILED
(
hr
))
continue
;
hr
=
IDirect3DVertexBuffer9_Lock
(
buffer
,
0
,
0
,
&
data
,
0
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DVertexBuffer9_Lock failed (0x%08x)
\n
"
,
hr
);
ok
(((
DWORD_PTR
)
data
&
31
)
==
0
,
"Vertex buffer start address is not 32 byte aligned(size: %d, pool: %s, data: %p)
\n
"
,
sizes
[
i
],
debug_d3dpool
(
pools
[
j
]),
data
);
hr
=
IDirect3DVertexBuffer9_Unlock
(
buffer
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DVertexBuffer9_Unlock failed (0x%08x)
\n
"
,
hr
);
if
(
buffer
)
IDirect3DVertexBuffer9_Release
(
buffer
);
}
}
}
START_TEST
(
buffer
)
START_TEST
(
buffer
)
{
{
IDirect3DDevice9
*
device_ptr
;
IDirect3DDevice9
*
device_ptr
;
...
@@ -127,6 +177,7 @@ START_TEST(buffer)
...
@@ -127,6 +177,7 @@ START_TEST(buffer)
if
(
!
device_ptr
)
return
;
if
(
!
device_ptr
)
return
;
lock_flag_test
(
device_ptr
);
lock_flag_test
(
device_ptr
);
test_vertex_buffer_alignment
(
device_ptr
);
refcount
=
IDirect3DDevice9_Release
(
device_ptr
);
refcount
=
IDirect3DDevice9_Release
(
device_ptr
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
...
...
dlls/d3d9/tests/device.c
View file @
8912b372
...
@@ -1902,81 +1902,6 @@ cleanup:
...
@@ -1902,81 +1902,6 @@ cleanup:
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
}
static
inline
const
char
*
debug_d3dpool
(
D3DPOOL
pool
)
{
switch
(
pool
)
{
case
D3DPOOL_DEFAULT
:
return
"D3DPOOL_DEFAULT"
;
case
D3DPOOL_SYSTEMMEM
:
return
"D3DPOOL_SYSTEMMEM"
;
case
D3DPOOL_SCRATCH
:
return
"D3DPOOL_SCRATCH"
;
case
D3DPOOL_MANAGED
:
return
"D3DPOOL_MANAGED"
;
default:
return
"unknown pool"
;
}
}
static
void
test_vertex_buffer_alignment
(
void
)
{
IDirect3DVertexBuffer9
*
buffer
=
NULL
;
D3DPRESENT_PARAMETERS
present_parameters
;
IDirect3DDevice9
*
device
=
NULL
;
IDirect3D9
*
d3d9
;
HWND
hwnd
;
HRESULT
hr
;
D3DPOOL
pools
[]
=
{
D3DPOOL_DEFAULT
,
D3DPOOL_SYSTEMMEM
,
D3DPOOL_SCRATCH
,
D3DPOOL_MANAGED
};
DWORD
sizes
[]
=
{
1
,
4
,
16
,
17
,
32
,
33
,
64
,
65
,
1024
,
1025
,
1048576
,
1048577
};
unsigned
int
i
,
j
;
void
*
data
;
d3d9
=
pDirect3DCreate9
(
D3D_SDK_VERSION
);
ok
(
d3d9
!=
NULL
,
"Failed to create IDirect3D9 object
\n
"
);
hwnd
=
CreateWindow
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
160
,
160
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"Failed to create window
\n
"
);
if
(
!
d3d9
||
!
hwnd
)
goto
cleanup
;
ZeroMemory
(
&
present_parameters
,
sizeof
(
present_parameters
));
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
hDeviceWindow
=
hwnd
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hr
=
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
/* no NULLREF here */
,
hwnd
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_NOTAVAILABLE
,
"IDirect3D9_CreateDevice failed with %08x
\n
"
,
hr
);
if
(
!
device
)
{
skip
(
"Failed to create a d3d device
\n
"
);
goto
cleanup
;
}
for
(
i
=
0
;
i
<
(
sizeof
(
sizes
)
/
sizeof
(
sizes
[
0
]));
i
++
)
{
for
(
j
=
0
;
j
<
(
sizeof
(
pools
)
/
sizeof
(
pools
[
0
]));
j
++
)
{
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
sizes
[
i
],
0
,
0
,
pools
[
j
],
&
buffer
,
NULL
);
if
(
pools
[
j
]
==
D3DPOOL_SCRATCH
)
{
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Creating a D3DPOOL_SCRATCH buffer returned (0x%08x)
\n
"
,
hr
);
}
else
{
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_CreateVertexBuffer failed (0x%08x). Pool = %s, size %d
\n
"
,
hr
,
debug_d3dpool
(
pools
[
j
]),
sizes
[
i
]);
}
if
(
FAILED
(
hr
))
continue
;
hr
=
IDirect3DVertexBuffer9_Lock
(
buffer
,
0
,
0
,
&
data
,
0
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DVertexBuffer9_Lock failed (0x%08x)
\n
"
,
hr
);
ok
(((
DWORD_PTR
)
data
&
31
)
==
0
,
"Vertex buffer start address is not 32 byte aligned(size: %d, pool: %s, data: %p)
\n
"
,
sizes
[
i
],
debug_d3dpool
(
pools
[
j
]),
data
);
hr
=
IDirect3DVertexBuffer9_Unlock
(
buffer
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DVertexBuffer9_Unlock failed (0x%08x)
\n
"
,
hr
);
if
(
buffer
)
IDirect3DVertexBuffer9_Release
(
buffer
);
}
}
cleanup:
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
}
static
void
test_lights
(
void
)
static
void
test_lights
(
void
)
{
{
D3DPRESENT_PARAMETERS
present_parameters
;
D3DPRESENT_PARAMETERS
present_parameters
;
...
@@ -2660,7 +2585,6 @@ START_TEST(device)
...
@@ -2660,7 +2585,6 @@ START_TEST(device)
test_depthstenciltest
();
test_depthstenciltest
();
test_draw_indexed
();
test_draw_indexed
();
test_null_stream
();
test_null_stream
();
test_vertex_buffer_alignment
();
test_lights
();
test_lights
();
test_set_stream_source
();
test_set_stream_source
();
test_scissor_size
();
test_scissor_size
();
...
...
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