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
346f783c
Commit
346f783c
authored
Dec 01, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Add another test for drawing from a mapped buffer.
parent
e2c373d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
6 deletions
+53
-6
visual.c
dlls/d3d9/tests/visual.c
+53
-6
No files found.
dlls/d3d9/tests/visual.c
View file @
346f783c
...
...
@@ -27360,14 +27360,9 @@ static void test_dynamic_map_synchronization(void)
}
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
200
*
4
*
sizeof
(
struct
dynamic_vb_vertex
),
D3DUSAGE_DYNAMIC
,
D3DFVF_XYZ
,
D3DPOOL_DEFAULT
,
&
buffer
,
NULL
);
D3DUSAGE_DYNAMIC
|
D3DUSAGE_WRITEONLY
,
D3DFVF_XYZ
,
D3DPOOL_DEFAULT
,
&
buffer
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"Failed to clear, hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetStreamSource
(
device
,
0
,
buffer
,
0
,
sizeof
(
struct
dynamic_vb_vertex
));
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
...
...
@@ -27377,6 +27372,12 @@ static void test_dynamic_map_synchronization(void)
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"Failed to clear, hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
200
;
++
y
)
{
hr
=
IDirect3DVertexBuffer9_Lock
(
buffer
,
0
,
0
,
&
data
,
D3DLOCK_DISCARD
);
...
...
@@ -27415,6 +27416,52 @@ static void test_dynamic_map_synchronization(void)
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
IDirect3DVertexBuffer9_Release
(
buffer
);
/* Castlevania: Lords of Shadow 2 locks a vertex and index buffer and keeps
* both mapped for all of the draws in a frame. Test this by doing the same
* draws, but with the buffer mapped the whole time. */
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
200
*
4
*
sizeof
(
struct
dynamic_vb_vertex
),
D3DUSAGE_DYNAMIC
|
D3DUSAGE_WRITEONLY
,
D3DFVF_XYZ
,
D3DPOOL_DEFAULT
,
&
buffer
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetStreamSource
(
device
,
0
,
buffer
,
0
,
sizeof
(
struct
dynamic_vb_vertex
));
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"Failed to clear, hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
200
;
++
y
)
{
hr
=
IDirect3DVertexBuffer9_Lock
(
buffer
,
0
,
0
,
&
data
,
D3DLOCK_DISCARD
);
ok
(
hr
==
D3D_OK
,
"Failed to map buffer, hr %#lx.
\n
"
,
hr
);
fill_dynamic_vb_quad
(
data
,
0
,
y
);
hr
=
IDirect3DDevice9_DrawPrimitive
(
device
,
D3DPT_TRIANGLESTRIP
,
0
,
2
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
for
(
x
=
1
;
x
<
200
;
++
x
)
{
fill_dynamic_vb_quad
((
struct
dynamic_vb_vertex
*
)
data
+
4
*
x
,
x
,
y
);
hr
=
IDirect3DDevice9_DrawPrimitive
(
device
,
D3DPT_TRIANGLESTRIP
,
4
*
x
,
2
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
}
hr
=
IDirect3DVertexBuffer9_Unlock
(
buffer
);
ok
(
hr
==
D3D_OK
,
"Failed to map buffer, hr %#lx.
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetRenderTarget
(
device
,
0
,
&
rt
);
ok
(
hr
==
S_OK
,
"Failed to get render target, hr %#lx.
\n
"
,
hr
);
check_rt_color_todo
(
rt
,
0x0000ff00
);
IDirect3DSurface9_Release
(
rt
);
IDirect3DVertexBuffer9_Release
(
buffer
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
IDirect3D9_Release
(
d3d
);
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