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
a9fe0ccb
Commit
a9fe0ccb
authored
Jul 22, 2010
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Implement additional texture requirement tests.
parent
b5c7675d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
0 deletions
+117
-0
texture.c
dlls/d3dx9_36/tests/texture.c
+117
-0
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
a9fe0ccb
...
...
@@ -25,8 +25,13 @@
static
void
test_D3DXCheckTextureRequirements
(
IDirect3DDevice9
*
device
)
{
UINT
width
,
height
,
mipmaps
;
D3DFORMAT
format
;
D3DCAPS9
caps
;
HRESULT
hr
;
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
/* general tests */
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
...
...
@@ -36,6 +41,118 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
hr
=
D3DXCheckTextureRequirements
(
NULL
,
NULL
,
NULL
,
NULL
,
D3DX_DEFAULT
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
/* width & height */
width
=
height
=
D3DX_DEFAULT
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
256
,
"Returned width %d, expected %d
\n
"
,
width
,
256
);
ok
(
height
==
256
,
"Returned height %d, expected %d
\n
"
,
height
,
256
);
width
=
D3DX_DEFAULT
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
256
,
"Returned width %d, expected %d
\n
"
,
width
,
256
);
if
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_POW2
)
skip
(
"Hardware only supports pow2 textures
\n
"
);
else
{
width
=
62
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
62
,
"Returned width %d, expected %d
\n
"
,
width
,
62
);
width
=
D3DX_DEFAULT
;
height
=
63
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
height
,
"Returned width %d, expected %d
\n
"
,
width
,
height
);
ok
(
height
==
63
,
"Returned height %d, expected %d
\n
"
,
height
,
63
);
}
width
=
D3DX_DEFAULT
;
height
=
0
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
ok
(
height
==
1
,
"Returned height %d, expected %d
\n
"
,
height
,
1
);
width
=
0
;
height
=
0
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
ok
(
height
==
1
,
"Returned height %d, expected %d
\n
"
,
height
,
1
);
width
=
0
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
width
=
D3DX_DEFAULT
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
256
,
"Returned width %d, expected %d
\n
"
,
width
,
256
);
width
=
0xFFFFFFFE
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
caps
.
MaxTextureWidth
,
"Returned width %d, expected %d
\n
"
,
width
,
caps
.
MaxTextureWidth
);
width
=
caps
.
MaxTextureWidth
-
1
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
caps
.
MaxTextureWidth
-
1
,
"Returned width %d, expected %d
\n
"
,
width
,
caps
.
MaxTextureWidth
-
1
);
/* mipmaps */
width
=
64
;
height
=
63
;
mipmaps
=
9
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
7
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
7
);
width
=
284
;
height
=
137
;
mipmaps
=
20
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
9
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
9
);
width
=
height
=
63
;
mipmaps
=
9
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
width
,
&
height
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
6
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
6
);
mipmaps
=
20
;
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
9
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
9
);
mipmaps
=
0
;
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
9
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
9
);
/* usage */
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
D3DUSAGE_WRITEONLY
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements succeeded, but should've failed.
\n
"
);
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
D3DUSAGE_DONOTCLIP
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements succeeded, but should've failed.
\n
"
);
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
D3DUSAGE_POINTS
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements succeeded, but should've failed.
\n
"
);
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
D3DUSAGE_RTPATCHES
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements succeeded, but should've failed.
\n
"
);
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
D3DUSAGE_NPATCHES
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckTextureRequirements succeeded, but should've failed.
\n
"
);
/* format */
format
=
D3DFMT_UNKNOWN
;
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_A8R8G8B8
);
format
=
0
;
hr
=
D3DXCheckTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_A8R8G8B8
);
}
START_TEST
(
texture
)
...
...
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