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
ae05de2c
Commit
ae05de2c
authored
Jun 06, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add tests for D3DLOCK_NO_DIRTY_UPDATE with vertex buffers.
parent
e29dc33a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
visual.c
dlls/d3d8/tests/visual.c
+88
-0
No files found.
dlls/d3d8/tests/visual.c
View file @
ae05de2c
...
...
@@ -5941,6 +5941,93 @@ done:
DestroyWindow
(
window
);
}
static
void
test_buffer_no_dirty_update
(
void
)
{
unsigned
int
refcount
,
colour
;
IDirect3DVertexBuffer8
*
vb
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
HWND
window
;
HRESULT
hr
;
BYTE
*
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
=
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.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_CreateVertexBuffer
(
device
,
sizeof
(
green_quad
),
0
,
0
,
D3DPOOL_MANAGED
,
&
vb
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DVertexBuffer8_Lock
(
vb
,
0
,
0
,
&
data
,
0
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memcpy
(
data
,
red_quad
,
sizeof
(
red_quad
));
hr
=
IDirect3DVertexBuffer8_Unlock
(
vb
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DVertexBuffer8_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
=
IDirect3DVertexBuffer8_Unlock
(
vb
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZENABLE
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffffffff
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetStreamSource
(
device
,
0
,
vb
,
sizeof
(
*
green_quad
));
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitive
(
device
,
D3DPT_TRIANGLELIST
,
0
,
2
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_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%08x.
\n
"
,
colour
);
IDirect3DVertexBuffer8_Release
(
vb
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
test_3dc_formats
(
void
)
{
static
const
char
ati1n_data
[]
=
...
...
@@ -11942,6 +12029,7 @@ START_TEST(visual)
volume_dxtn_test
();
volume_v16u16_test
();
add_dirty_rect_test
();
test_buffer_no_dirty_update
();
test_3dc_formats
();
test_fog_interpolation
();
test_negative_fixedfunction_fog
();
...
...
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