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
5fbf895d
Commit
5fbf895d
authored
Jun 11, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the format info to calculate compressed surface pitch in…
wined3d: Use the format info to calculate compressed surface pitch in IWineD3DBaseSurfaceImpl_GetPitch().
parent
da12ac05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
surface_base.c
dlls/wined3d/surface_base.c
+10
-10
No files found.
dlls/wined3d/surface_base.c
View file @
5fbf895d
...
...
@@ -332,19 +332,19 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD
DWORD
WINAPI
IWineD3DBaseSurfaceImpl_GetPitch
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
WINED3DFORMAT
format
=
This
->
resource
.
format_desc
->
format
;
const
struct
GlPixelFormatDesc
*
format_desc
=
This
->
resource
.
format_desc
;
DWORD
ret
;
TRACE
(
"(%p)
\n
"
,
This
);
/* DXTn formats don't have exact pitches as they are to the new row of blocks,
where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt2/3/4/5)
ie pitch = (width/4) * bytes per block */
if
(
format
==
WINED3DFMT_DXT1
)
/* DXT1 is 8 bytes per block
*/
ret
=
((
This
->
currentDesc
.
Width
+
3
)
>>
2
)
<<
3
;
else
if
(
format
==
WINED3DFMT_DXT2
||
format
==
WINED3DFMT_DXT3
||
format
==
WINED3DFMT_DXT4
||
format
==
WINED3DFMT_DXT5
)
/* DXT2/3/4/5 is 16 bytes per block */
ret
=
((
This
->
currentDesc
.
Width
+
3
)
>>
2
)
<<
4
;
else
{
if
(
format_desc
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
/* Since compressed formats are block based, pitch means the amount of
* bytes to the next row of block rather than the next row of pixels.
*/
UINT
row_block_count
=
(
This
->
currentDesc
.
Width
+
format_desc
->
block_width
-
1
)
/
format_desc
->
block_width
;
ret
=
row_block_count
*
format_desc
->
block_byte_count
;
}
else
{
unsigned
char
alignment
=
This
->
resource
.
wineD3DDevice
->
surface_alignment
;
ret
=
This
->
resource
.
format_desc
->
byte_count
*
This
->
currentDesc
.
Width
;
/* Bytes / row */
ret
=
(
ret
+
alignment
-
1
)
&
~
(
alignment
-
1
);
...
...
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