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
2954d3e4
Commit
2954d3e4
authored
Dec 20, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test uploading the whole mipmap chain in one map.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
parent
e7c46ac6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
visual.c
dlls/d3d9/tests/visual.c
+74
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
2954d3e4
...
...
@@ -287,6 +287,7 @@ static D3DCOLOR check_expected_rt_color(unsigned int line, IDirect3DSurface9 *rt
#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false)
#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true)
#define check_rt_color_todo_if(a, b, c) check_rt_color_(__LINE__, a, b, c)
static
void
check_rt_color_
(
unsigned
int
line
,
IDirect3DSurface9
*
rt
,
D3DCOLOR
expected_color
,
bool
todo
)
{
unsigned
int
color
=
check_expected_rt_color
(
line
,
rt
,
expected_color
);
...
...
@@ -27922,6 +27923,78 @@ static void test_managed_generate_mipmap(void)
release_test_context
(
&
context
);
}
/* Some applications lock a mipmapped texture at level 0, write every level at
* once, and expect it to be uploaded. */
static
void
test_mipmap_upload
(
void
)
{
unsigned
int
i
,
j
,
width
,
level_count
;
struct
d3d9_test_context
context
;
IDirect3DTexture9
*
texture
;
D3DLOCKED_RECT
locked_rect
;
IDirect3DDevice9
*
device
;
unsigned
int
*
mem
;
HRESULT
hr
;
static
const
D3DPOOL
pools
[]
=
{
D3DPOOL_MANAGED
,
D3DPOOL_SYSTEMMEM
,
};
if
(
!
init_test_context
(
&
context
))
return
;
device
=
context
.
device
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
pools
);
++
i
)
{
winetest_push_context
(
"pool %#x"
,
pools
[
i
]);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
32
,
32
,
0
,
0
,
D3DFMT_A8R8G8B8
,
pools
[
i
],
&
texture
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
level_count
=
IDirect3DBaseTexture9_GetLevelCount
(
texture
);
hr
=
IDirect3DTexture9_LockRect
(
texture
,
0
,
&
locked_rect
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
mem
=
locked_rect
.
pBits
;
for
(
j
=
0
;
j
<
level_count
;
++
j
)
{
width
=
32
>>
j
;
memset
(
mem
,
0x11
*
(
j
+
1
),
width
*
width
*
4
);
mem
+=
width
*
width
;
}
hr
=
IDirect3DTexture9_UnlockRect
(
texture
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
level_count
;
++
j
)
{
winetest_push_context
(
"level %u"
,
j
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
0
.
0
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MIPFILTER
,
D3DTEXF_POINT
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MAXMIPLEVEL
,
j
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
draw_textured_quad
(
&
context
,
texture
);
check_rt_color_todo_if
(
context
.
backbuffer
,
0x00111111
*
(
j
+
1
),
j
>
0
);
winetest_pop_context
();
}
IDirect3DTexture9_Release
(
texture
);
winetest_pop_context
();
}
release_test_context
(
&
context
);
}
START_TEST
(
visual
)
{
D3DADAPTER_IDENTIFIER9
identifier
;
...
...
@@ -28075,4 +28148,5 @@ START_TEST(visual)
test_filling_convention
();
test_managed_reset
();
test_managed_generate_mipmap
();
test_mipmap_upload
();
}
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