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
da12ac05
Commit
da12ac05
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 size in…
wined3d: Use the format info to calculate compressed surface size in IWineD3DBaseSurfaceImpl_SetFormat().
parent
e255f971
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
surface_base.c
dlls/wined3d/surface_base.c
+9
-8
No files found.
dlls/wined3d/surface_base.c
View file @
da12ac05
...
...
@@ -521,14 +521,15 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3D
TRACE
(
"(%p) : Setting texture format to (%d,%s)
\n
"
,
This
,
format
,
debug_d3dformat
(
format
));
if
(
format
==
WINED3DFMT_UNKNOWN
)
{
This
->
resource
.
size
=
0
;
}
else
if
(
format
==
WINED3DFMT_DXT1
)
{
/* DXT1 is half byte per pixel */
This
->
resource
.
size
=
((
max
(
This
->
pow2Width
,
4
)
*
format_desc
->
byte_count
)
*
max
(
This
->
pow2Height
,
4
))
>>
1
;
}
else
if
(
format
==
WINED3DFMT_DXT2
||
format
==
WINED3DFMT_DXT3
||
format
==
WINED3DFMT_DXT4
||
format
==
WINED3DFMT_DXT5
)
{
This
->
resource
.
size
=
((
max
(
This
->
pow2Width
,
4
)
*
format_desc
->
byte_count
)
*
max
(
This
->
pow2Height
,
4
));
}
else
{
}
else
if
(
format_desc
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
UINT
row_block_count
=
(
This
->
pow2Width
+
format_desc
->
block_width
-
1
)
/
format_desc
->
block_width
;
UINT
row_count
=
(
This
->
pow2Height
+
format_desc
->
block_height
-
1
)
/
format_desc
->
block_height
;
This
->
resource
.
size
=
row_count
*
row_block_count
*
format_desc
->
block_byte_count
;
}
else
{
unsigned
char
alignment
=
This
->
resource
.
wineD3DDevice
->
surface_alignment
;
This
->
resource
.
size
=
((
This
->
pow2Width
*
format_desc
->
byte_count
)
+
alignment
-
1
)
&
~
(
alignment
-
1
);
This
->
resource
.
size
*=
This
->
pow2Height
;
...
...
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