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
d2f3fc03
Commit
d2f3fc03
authored
Sep 26, 2019
by
Matteo Bruni
Committed by
Alexandre Julliard
Sep 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Improve tests to check for DXTn fallback formats.
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
37618206
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
20 deletions
+49
-20
texture.c
dlls/d3dx9_36/tests/texture.c
+49
-20
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
d2f3fc03
...
...
@@ -25,7 +25,7 @@
#include "d3dx9tex.h"
#include "resources.h"
static
int
has_2d_dxt3
,
has_2d_dxt5
,
has_cube_dxt5
,
has_3d_dxt3
;
static
int
has_2d_dxt
1
,
has_2d_dxt
3
,
has_2d_dxt5
,
has_cube_dxt5
,
has_3d_dxt3
;
/* 2x2 16-bit dds, no mipmaps */
static
const
unsigned
char
dds_16bit
[]
=
{
...
...
@@ -419,30 +419,57 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
ok
(
format
==
expected
,
"Returned format %u, expected %u
\n
"
,
format
,
expected
);
/* Block-based texture formats and size < block size. */
if
(
has_2d_dxt5
)
format
=
D3DFMT_DXT1
;
width
=
2
;
height
=
2
;
mipmaps
=
1
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
mipmaps
==
1
,
"Got unexpected level count %u.
\n
"
,
mipmaps
);
if
(
has_2d_dxt1
)
{
format
=
D3DFMT_DXT5
;
width
=
2
;
height
=
2
;
mipmaps
=
1
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
4
,
"Returned width %d, expected %d
\n
"
,
width
,
4
);
ok
(
height
==
4
,
"Returned height %d, expected %d
\n
"
,
height
,
4
);
ok
(
mipmaps
==
1
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
1
);
ok
(
format
==
D3DFMT_DXT5
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_DXT5
);
ok
(
width
==
4
,
"Got unexpected width %d.
\n
"
,
width
);
ok
(
height
==
4
,
"Got unexpected height %d.
\n
"
,
height
);
ok
(
format
==
D3DFMT_DXT1
,
"Got unexpected format %u.
\n
"
,
format
);
}
else
{
ok
(
width
==
2
,
"Got unexpected width %d.
\n
"
,
width
);
ok
(
height
==
2
,
"Got unexpected height %d.
\n
"
,
height
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Got unexpected format %u.
\n
"
,
format
);
}
width
=
4
;
height
=
2
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
width
==
4
,
"Got unexpected width %u.
\n
"
,
width
);
format
=
D3DFMT_DXT5
;
width
=
2
;
height
=
2
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
mipmaps
==
1
,
"Got unexpected level count %u.
\n
"
,
mipmaps
);
if
(
has_2d_dxt5
)
{
ok
(
width
==
4
,
"Got unexpected width %d.
\n
"
,
width
);
ok
(
height
==
4
,
"Got unexpected height %d.
\n
"
,
height
);
ok
(
format
==
D3DFMT_DXT5
,
"Got unexpected format %u.
\n
"
,
format
);
}
else
{
ok
(
width
==
2
,
"Got unexpected width %d.
\n
"
,
width
);
ok
(
height
==
2
,
"Got unexpected height %d.
\n
"
,
height
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Got unexpected format %u.
\n
"
,
format
);
}
width
=
4
;
height
=
2
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
width
==
4
,
"Got unexpected width %u.
\n
"
,
width
);
ok
(
mipmaps
==
1
,
"Got unexpected level count %u.
\n
"
,
mipmaps
);
if
(
has_2d_dxt5
)
{
ok
(
height
==
4
,
"Got unexpected height %u.
\n
"
,
height
);
ok
(
mipmaps
==
1
,
"Got unexpected mipmap level count %u.
\n
"
,
mipmaps
);
ok
(
format
==
D3DFMT_DXT5
,
"Got unexpected format %u.
\n
"
,
format
);
}
else
{
skip
(
"D3DFMT_DXT5 textures are not supported, skipping a test.
\n
"
);
ok
(
height
==
2
,
"Got unexpected height %u.
\n
"
,
height
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Got unexpected format %u.
\n
"
,
format
);
}
IDirect3D9_Release
(
d3d
);
...
...
@@ -2511,6 +2538,8 @@ START_TEST(texture)
}
/* Check whether DXTn textures are supported. */
has_2d_dxt1
=
SUCCEEDED
(
IDirect3D9_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_TEXTURE
,
D3DFMT_DXT1
));
has_2d_dxt3
=
SUCCEEDED
(
IDirect3D9_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_TEXTURE
,
D3DFMT_DXT3
));
has_2d_dxt5
=
SUCCEEDED
(
IDirect3D9_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
...
...
@@ -2519,8 +2548,8 @@ START_TEST(texture)
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_CUBETEXTURE
,
D3DFMT_DXT5
));
has_3d_dxt3
=
SUCCEEDED
(
IDirect3D9_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_VOLUMETEXTURE
,
D3DFMT_DXT3
));
trace
(
"DXTn texture support: 2D DXT3 %#x, 2D DXT5 %#x, cube DXT5 %#x, 3D dxt3 %#x.
\n
"
,
has_2d_dxt3
,
has_2d_dxt5
,
has_cube_dxt5
,
has_3d_dxt3
);
trace
(
"DXTn texture support: 2D DXT
1 %#x, 2D DXT
3 %#x, 2D DXT5 %#x, cube DXT5 %#x, 3D dxt3 %#x.
\n
"
,
has_2d_dxt
1
,
has_2d_dxt
3
,
has_2d_dxt5
,
has_cube_dxt5
,
has_3d_dxt3
);
test_D3DXCheckTextureRequirements
(
device
);
test_D3DXCheckCubeTextureRequirements
(
device
);
...
...
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