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
1e754f5e
Commit
1e754f5e
authored
Mar 16, 2010
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Mar 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test ATI2N pitch and locking offset behaviour.
parent
a7aa4a87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
surface.c
dlls/d3d9/tests/surface.c
+22
-6
No files found.
dlls/d3d9/tests/surface.c
View file @
1e754f5e
...
...
@@ -187,8 +187,10 @@ todo_wine ok(SUCCEEDED(hr), "Double IDirect3DTexture9_UnLockRect failed with %
static
void
test_lockrect_offset
(
IDirect3DDevice9
*
device
)
{
IDirect3DSurface9
*
surface
=
0
;
IDirect3D9
*
d3d
;
const
RECT
rect
=
{
60
,
60
,
68
,
68
};
D3DLOCKED_RECT
locked_rect
;
int
expected_pitch
;
unsigned
int
expected_offset
;
unsigned
int
offset
;
unsigned
int
i
;
...
...
@@ -202,14 +204,24 @@ static void test_lockrect_offset(IDirect3DDevice9 *device)
unsigned
int
block_height
;
unsigned
int
block_size
;
}
dxt_formats
[]
=
{
{
D3DFMT_DXT1
,
"D3DFMT_DXT1"
,
4
,
4
,
8
},
{
D3DFMT_DXT2
,
"D3DFMT_DXT2"
,
4
,
4
,
16
},
{
D3DFMT_DXT3
,
"D3DFMT_DXT3"
,
4
,
4
,
16
},
{
D3DFMT_DXT4
,
"D3DFMT_DXT4"
,
4
,
4
,
16
},
{
D3DFMT_DXT5
,
"D3DFMT_DXT5"
,
4
,
4
,
16
},
{
D3DFMT_DXT1
,
"D3DFMT_DXT1"
,
4
,
4
,
8
},
{
D3DFMT_DXT2
,
"D3DFMT_DXT2"
,
4
,
4
,
16
},
{
D3DFMT_DXT3
,
"D3DFMT_DXT3"
,
4
,
4
,
16
},
{
D3DFMT_DXT4
,
"D3DFMT_DXT4"
,
4
,
4
,
16
},
{
D3DFMT_DXT5
,
"D3DFMT_DXT5"
,
4
,
4
,
16
},
{
MAKEFOURCC
(
'A'
,
'T'
,
'I'
,
'2'
),
"ATI2N"
,
1
,
1
,
1
},
};
hr
=
IDirect3DDevice9_GetDirect3D
(
device
,
&
d3d
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_GetDirect3D failed (%08x)
\n
"
,
hr
);
for
(
i
=
0
;
i
<
(
sizeof
(
dxt_formats
)
/
sizeof
(
*
dxt_formats
));
++
i
)
{
hr
=
IDirect3D9_CheckDeviceFormat
(
d3d
,
0
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_TEXTURE
,
dxt_formats
[
i
].
fmt
);
if
(
FAILED
(
hr
))
{
skip
(
"Format %s not supported, skipping lockrect offset test
\n
"
,
dxt_formats
[
i
].
name
);
continue
;
}
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
128
,
128
,
dxt_formats
[
i
].
fmt
,
D3DPOOL_SCRATCH
,
&
surface
,
0
);
ok
(
SUCCEEDED
(
hr
),
"CreateOffscreenPlainSurface failed (%08x)
\n
"
,
hr
);
...
...
@@ -217,6 +229,9 @@ static void test_lockrect_offset(IDirect3DDevice9 *device)
ok
(
SUCCEEDED
(
hr
),
"LockRect failed (%08x)
\n
"
,
hr
);
base
=
locked_rect
.
pBits
;
expected_pitch
=
(
128
+
dxt_formats
[
i
].
block_height
-
1
)
/
dxt_formats
[
i
].
block_width
*
dxt_formats
[
i
].
block_size
;
ok
(
locked_rect
.
Pitch
==
expected_pitch
,
"Got pitch %d, expected pitch %d for format %s
\n
"
,
locked_rect
.
Pitch
,
expected_pitch
,
dxt_formats
[
i
].
name
);
hr
=
IDirect3DSurface9_UnlockRect
(
surface
);
ok
(
SUCCEEDED
(
hr
),
"UnlockRect failed (%08x)
\n
"
,
hr
);
...
...
@@ -227,7 +242,7 @@ static void test_lockrect_offset(IDirect3DDevice9 *device)
ok
(
SUCCEEDED
(
hr
),
"LockRect failed (%08x)
\n
"
,
hr
);
offset
=
(
BYTE
*
)
locked_rect
.
pBits
-
base
;
expected_offset
=
(
rect
.
top
/
dxt_formats
[
i
].
block_height
)
*
locked_rect
.
P
itch
expected_offset
=
(
rect
.
top
/
dxt_formats
[
i
].
block_height
)
*
expected_p
itch
+
(
rect
.
left
/
dxt_formats
[
i
].
block_width
)
*
dxt_formats
[
i
].
block_size
;
ok
(
offset
==
expected_offset
,
"Got offset %u, expected offset %u for format %s
\n
"
,
offset
,
expected_offset
,
dxt_formats
[
i
].
name
);
...
...
@@ -236,6 +251,7 @@ static void test_lockrect_offset(IDirect3DDevice9 *device)
IDirect3DSurface9_Release
(
surface
);
}
IDirect3D9_Release
(
d3d
);
}
static
void
test_lockrect_invalid
(
IDirect3DDevice9
*
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