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
bc7b188f
Commit
bc7b188f
authored
Jun 06, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Add tests for D3DLOCK_NO_DIRTY_UPDATE with vertex buffers.
parent
ae05de2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
visual.c
dlls/d3d9/tests/visual.c
+88
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
bc7b188f
...
...
@@ -19815,6 +19815,93 @@ static void add_dirty_rect_test(void)
DestroyWindow
(
window
);
}
static
void
test_buffer_no_dirty_update
(
void
)
{
unsigned
int
refcount
,
colour
;
IDirect3DVertexBuffer9
*
vb
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
HWND
window
;
HRESULT
hr
;
void
*
data
;
static
const
struct
{
struct
vec3
position
;
DWORD
diffuse
;
}
green_quad
[]
=
{
{{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
{{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
{{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
{{
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xff00ff00
},
},
red_quad
[]
=
{
{{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
{{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
{{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
{{
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
0xffff0000
},
};
window
=
create_window
();
d3d
=
Direct3DCreate9
(
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.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
sizeof
(
green_quad
),
0
,
0
,
D3DPOOL_MANAGED
,
&
vb
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DVertexBuffer9_Lock
(
vb
,
0
,
0
,
&
data
,
0
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memcpy
(
data
,
red_quad
,
sizeof
(
red_quad
));
hr
=
IDirect3DVertexBuffer9_Unlock
(
vb
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DVertexBuffer9_Lock
(
vb
,
0
,
0
,
&
data
,
D3DLOCK_NO_DIRTY_UPDATE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memcpy
(
data
,
green_quad
,
sizeof
(
green_quad
));
hr
=
IDirect3DVertexBuffer9_Unlock
(
vb
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZENABLE
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffffffff
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetStreamSource
(
device
,
0
,
vb
,
0
,
sizeof
(
*
green_quad
));
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_DrawPrimitive
(
device
,
D3DPT_TRIANGLELIST
,
0
,
2
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
colour
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
colour
,
0x0000ff00
,
1
),
"Got unexpected colour 0x%09x.
\n
"
,
colour
);
IDirect3DVertexBuffer9_Release
(
vb
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
test_per_stage_constant
(
void
)
{
IDirect3DDevice9
*
device
;
...
...
@@ -27744,6 +27831,7 @@ START_TEST(visual)
volume_srgb_test
();
volume_dxtn_test
();
add_dirty_rect_test
();
test_buffer_no_dirty_update
();
multisampled_depth_buffer_test
();
resz_test
();
stencil_cull_test
();
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