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
e5d9be5e
Commit
e5d9be5e
authored
Feb 18, 2014
by
Matteo Bruni
Committed by
Alexandre Julliard
Feb 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Create A8L8 and DXTn textures instead of plain surfaces.
Creating them as plain surfaces fails on my Nvidia Win7 system.
parent
ab8d8dd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
18 deletions
+37
-18
surface.c
dlls/d3dx9_36/tests/surface.c
+37
-18
No files found.
dlls/d3dx9_36/tests/surface.c
View file @
e5d9be5e
...
@@ -981,11 +981,14 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
...
@@ -981,11 +981,14 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
}
}
/* A8L8 */
/* A8L8 */
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
2
,
2
,
D3DFMT_A8L8
,
D3DPOOL_DEFAULT
,
&
surf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
2
,
2
,
1
,
0
,
D3DFMT_A8L8
,
D3DPOOL_MANAGED
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create A8L8
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create A8L8
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
surf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromMemory
(
surf
,
NULL
,
NULL
,
pixdata_a8r3g3b2
,
hr
=
D3DXLoadSurfaceFromMemory
(
surf
,
NULL
,
NULL
,
pixdata_a8r3g3b2
,
D3DFMT_A8R3G3B2
,
4
,
NULL
,
&
rect
,
D3DX_FILTER_NONE
,
0
);
D3DFMT_A8R3G3B2
,
4
,
NULL
,
&
rect
,
D3DX_FILTER_NONE
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to load surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to load surface, hr %#x.
\n
"
,
hr
);
...
@@ -1070,7 +1073,8 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
...
@@ -1070,7 +1073,8 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr
=
IDirect3DSurface9_UnlockRect
(
surf
);
hr
=
IDirect3DSurface9_UnlockRect
(
surf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
check_release
((
IUnknown
*
)
surf
,
0
);
check_release
((
IUnknown
*
)
surf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
/* DXT1, DXT2, DXT3, DXT4, DXT5 */
/* DXT1, DXT2, DXT3, DXT4, DXT5 */
...
@@ -1082,58 +1086,73 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
...
@@ -1082,58 +1086,73 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr
=
D3DXLoadSurfaceFromFileInMemory
(
surf
,
NULL
,
NULL
,
dds_24bit
,
sizeof
(
dds_24bit
),
NULL
,
D3DX_FILTER_NONE
,
0
,
NULL
);
hr
=
D3DXLoadSurfaceFromFileInMemory
(
surf
,
NULL
,
NULL
,
dds_24bit
,
sizeof
(
dds_24bit
),
NULL
,
D3DX_FILTER_NONE
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to load surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to load surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
4
,
4
,
D3DFMT_DXT2
,
D3DPOOL_SYSTEMMEM
,
&
newsurf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
4
,
4
,
1
,
0
,
D3DFMT_DXT2
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create DXT2
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create DXT2
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT2 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT2 format.
\n
"
);
check_release
((
IUnknown
*
)
newsurf
,
0
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
4
,
4
,
D3DFMT_DXT3
,
D3DPOOL_SYSTEMMEM
,
&
newsurf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
4
,
4
,
1
,
0
,
D3DFMT_DXT3
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create DXT3
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create DXT3
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT3 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT3 format.
\n
"
);
check_release
((
IUnknown
*
)
newsurf
,
0
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
4
,
4
,
D3DFMT_DXT4
,
D3DPOOL_SYSTEMMEM
,
&
newsurf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
4
,
4
,
1
,
0
,
D3DFMT_DXT4
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create DXT4
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create DXT4
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT4 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT4 format.
\n
"
);
check_release
((
IUnknown
*
)
newsurf
,
0
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
4
,
4
,
D3DFMT_DXT5
,
D3DPOOL_SYSTEMMEM
,
&
newsurf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
4
,
4
,
1
,
0
,
D3DFMT_DXT5
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create DXT5
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create DXT5
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT5 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT5 format.
\n
"
);
check_release
((
IUnknown
*
)
newsurf
,
0
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
hr
=
IDirect3DDevice9_Create
OffscreenPlainSurface
(
device
,
4
,
4
,
D3DFMT_DXT1
,
D3DPOOL_SYSTEMMEM
,
&
newsurf
,
NULL
);
hr
=
IDirect3DDevice9_Create
Texture
(
device
,
4
,
4
,
1
,
0
,
D3DFMT_DXT1
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
skip
(
"Failed to create DXT1
surfac
e, hr %#x.
\n
"
,
hr
);
skip
(
"Failed to create DXT1
textur
e, hr %#x.
\n
"
,
hr
);
else
else
{
{
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get the surface, hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
newsurf
,
NULL
,
NULL
,
surf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT1 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels to DXT1 format.
\n
"
);
hr
=
D3DXLoadSurfaceFromSurface
(
surf
,
NULL
,
NULL
,
newsurf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
hr
=
D3DXLoadSurfaceFromSurface
(
surf
,
NULL
,
NULL
,
newsurf
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels from DXT1 format.
\n
"
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to convert pixels from DXT1 format.
\n
"
);
check_release
((
IUnknown
*
)
newsurf
,
0
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
}
}
check_release
((
IUnknown
*
)
surf
,
0
);
check_release
((
IUnknown
*
)
surf
,
0
);
...
...
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