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
0b962026
Commit
0b962026
authored
Apr 28, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
May 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Fix dst pitch for compressed format in D3DXLoadSurfaceFromMemory().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54901
parent
eff714e3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
surface.c
dlls/d3dx9_36/surface.c
+1
-1
surface.c
dlls/d3dx9_36/tests/surface.c
+24
-0
No files found.
dlls/d3dx9_36/surface.c
View file @
0b962026
...
@@ -2148,7 +2148,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
...
@@ -2148,7 +2148,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
}
tx_compress_dxtn
(
4
,
dst_size_aligned
.
width
,
dst_size_aligned
.
height
,
tx_compress_dxtn
(
4
,
dst_size_aligned
.
width
,
dst_size_aligned
.
height
,
dst_uncompressed
,
gl_format
,
lockrect
.
pBits
,
dst_uncompressed
,
gl_format
,
lockrect
.
pBits
,
lockrect
.
Pitch
*
destformatdesc
->
block_width
/
destformatdesc
->
block_byte_count
);
lockrect
.
Pitch
);
heap_free
(
dst_uncompressed
);
heap_free
(
dst_uncompressed
);
}
}
}
}
...
...
dlls/d3dx9_36/tests/surface.c
View file @
0b962026
...
@@ -847,6 +847,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
...
@@ -847,6 +847,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
static
const
DWORD
pixdata_g16r16
[]
=
{
0x07d23fbe
,
0xdc7f44a4
,
0xe4d8976b
,
0x9a84fe89
};
static
const
DWORD
pixdata_g16r16
[]
=
{
0x07d23fbe
,
0xdc7f44a4
,
0xe4d8976b
,
0x9a84fe89
};
static
const
DWORD
pixdata_a8b8g8r8
[]
=
{
0xc3394cf0
,
0x235ae892
,
0x09b197fd
,
0x8dc32bf6
};
static
const
DWORD
pixdata_a8b8g8r8
[]
=
{
0xc3394cf0
,
0x235ae892
,
0x09b197fd
,
0x8dc32bf6
};
static
const
DWORD
pixdata_a2r10g10b10
[]
=
{
0x57395aff
,
0x5b7668fd
,
0xb0d856b5
,
0xff2c61d6
};
static
const
DWORD
pixdata_a2r10g10b10
[]
=
{
0x57395aff
,
0x5b7668fd
,
0xb0d856b5
,
0xff2c61d6
};
BYTE
buffer
[
4
*
8
*
4
];
hr
=
create_file
(
"testdummy.bmp"
,
noimage
,
sizeof
(
noimage
));
/* invalid image */
hr
=
create_file
(
"testdummy.bmp"
,
noimage
,
sizeof
(
noimage
));
/* invalid image */
testdummy_ok
=
SUCCEEDED
(
hr
);
testdummy_ok
=
SUCCEEDED
(
hr
);
...
@@ -1463,6 +1464,29 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
...
@@ -1463,6 +1464,29 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
check_release
((
IUnknown
*
)
tex
,
0
);
/* Test updating subarea of compressed texture. */
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
32
,
16
,
1
,
0
,
D3DFMT_DXT5
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
tex
,
0
,
&
newsurf
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
SetRect
(
&
destrect
,
0
,
0
,
4
,
8
);
SetRect
(
&
rect
,
0
,
0
,
4
,
8
);
memset
(
buffer
,
0x40
,
sizeof
(
buffer
));
hr
=
D3DXLoadSurfaceFromMemory
(
newsurf
,
NULL
,
&
destrect
,
buffer
,
D3DFMT_A8B8G8R8
,
4
*
4
,
NULL
,
&
rect
,
D3DX_FILTER_NONE
,
0
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_LockRect
(
newsurf
,
&
lockrect
,
&
destrect
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* 2 identical 16 bytes DXT5 blocks. The exact values in blocks may differ from Windows due to
* different compression algorithms. */
ok
(
!
memcmp
(
lockrect
.
pBits
,
(
char
*
)
lockrect
.
pBits
+
lockrect
.
Pitch
,
16
),
"data mismatch.
\n
"
);
hr
=
IDirect3DSurface9_UnlockRect
(
newsurf
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
check_release
((
IUnknown
*
)
newsurf
,
1
);
check_release
((
IUnknown
*
)
tex
,
0
);
/* Test a rect larger than but not an integer multiple of the block size. */
/* Test a rect larger than but not an integer multiple of the block size. */
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
4
,
8
,
1
,
0
,
D3DFMT_DXT5
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
4
,
8
,
1
,
0
,
D3DFMT_DXT5
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
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