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
5472b8b9
Commit
5472b8b9
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: Add even more tests for misaligned block textures.
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c29f770e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
texture.c
dlls/d3dx9_36/tests/texture.c
+92
-0
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
5472b8b9
...
...
@@ -1583,6 +1583,28 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
0x7fff00ff
,
0x7fff00ff
,
0x7fffff00
,
0x7fffff00
,
0xffffffff
,
0xffffffff
,
0xff000000
,
0xff000000
,
0x7fff00ff
,
0x7fff00ff
,
0x7fffff00
,
0x7fffff00
,
0xffffffff
,
0xffffffff
,
0xff000000
,
0xff000000
,
};
static
const
DWORD
dds_dxt5_8_8_expected_misaligned_1
[]
=
{
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x3fff0000
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0xff000000
,
0xff000000
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0xff000000
,
0xff000000
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0xff000000
,
0xff000000
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0xff000000
,
0xff000000
,
};
static
const
DWORD
dds_dxt5_8_8_expected_misaligned_3
[]
=
{
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x0000ff00
,
0x0000ff00
,
0x3fff0000
,
0x3fff0000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x7fff00ff
,
0x7fff00ff
,
0xff000000
,
0xff000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
0x00000000
,
};
IDirect3DSurface9
*
surface
,
*
uncompressed_surface
;
IDirect3DTexture9
*
texture
;
D3DLOCKED_RECT
lock_rect
;
...
...
@@ -1591,6 +1613,7 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
unsigned
int
i
,
x
,
y
;
DWORD
level_count
;
HRESULT
hr
;
RECT
rect
;
hr
=
D3DXCreateTextureFromFileInMemory
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemory returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
...
...
@@ -1706,6 +1729,75 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
}
hr
=
IDirect3DSurface9_LockRect
(
surface
,
&
lock_rect
,
NULL
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
2
;
++
y
)
memset
(
&
((
BYTE
*
)
lock_rect
.
pBits
)[
y
*
lock_rect
.
Pitch
],
0
,
16
*
2
);
hr
=
IDirect3DSurface9_UnlockRect
(
surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
rect
,
2
,
2
,
6
,
6
);
hr
=
D3DXLoadSurfaceFromMemory
(
surface
,
NULL
,
NULL
,
&
dds_dxt5_8_8
[
128
],
D3DFMT_DXT5
,
16
*
2
,
NULL
,
&
rect
,
D3DX_FILTER_POINT
,
0
);
todo_wine
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3DXLoadSurfaceFromSurface
(
uncompressed_surface
,
NULL
,
NULL
,
surface
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_LockRect
(
uncompressed_surface
,
&
lock_rect
,
NULL
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
8
;
++
y
)
{
for
(
x
=
0
;
x
<
8
;
++
x
)
{
ok
(
compare_color
(((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_1
[
y
*
8
+
x
],
0
),
"Color at position %u, %u is 0x%08x, expected 0x%08x.
\n
"
,
x
,
y
,
((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_1
[
y
*
8
+
x
]);
}
}
hr
=
IDirect3DSurface9_UnlockRect
(
uncompressed_surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
}
hr
=
IDirect3DSurface9_LockRect
(
surface
,
&
lock_rect
,
NULL
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
2
;
++
y
)
memset
(
&
((
BYTE
*
)
lock_rect
.
pBits
)[
y
*
lock_rect
.
Pitch
],
0
,
16
*
2
);
hr
=
IDirect3DSurface9_UnlockRect
(
surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromMemory
(
surface
,
NULL
,
&
rect
,
&
dds_dxt5_8_8
[
128
],
D3DFMT_DXT5
,
16
*
2
,
NULL
,
NULL
,
D3DX_FILTER_POINT
,
0
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromMemory
(
surface
,
NULL
,
&
rect
,
&
dds_dxt5_8_8
[
128
],
D3DFMT_DXT5
,
16
*
2
,
NULL
,
&
rect
,
D3DX_FILTER_POINT
,
0
);
todo_wine
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3DXLoadSurfaceFromSurface
(
uncompressed_surface
,
NULL
,
NULL
,
surface
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_LockRect
(
uncompressed_surface
,
&
lock_rect
,
NULL
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
8
;
++
y
)
{
for
(
x
=
0
;
x
<
8
;
++
x
)
{
ok
(
compare_color
(((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_3
[
y
*
8
+
x
],
0
),
"Color at position %u, %u is 0x%08x, expected 0x%08x.
\n
"
,
x
,
y
,
((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_3
[
y
*
8
+
x
]);
}
}
hr
=
IDirect3DSurface9_UnlockRect
(
uncompressed_surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
}
IDirect3DSurface9_Release
(
uncompressed_surface
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
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