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
eb064db0
Commit
eb064db0
authored
Mar 25, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add support for partial updates of compressed surfaces to…
wined3d: Add support for partial updates of compressed surfaces to IWineD3DDeviceImpl_UpdateSurface().
parent
941c7da0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
11 deletions
+35
-11
device.c
dlls/wined3d/device.c
+35
-11
No files found.
dlls/wined3d/device.c
View file @
eb064db0
...
@@ -5262,21 +5262,45 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
...
@@ -5262,21 +5262,45 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
ENTER_GL
();
ENTER_GL
();
/* TODO: Cube and volume support */
/* TODO: Cube and volume support */
if
(
rowoffset
!=
0
){
if
(
rowoffset
)
/* Not a whole row so we have to do it a line at a time. */
/* not a whole row so we have to do it a line at a time */
{
int
j
;
if
(
dst_format_desc
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
const
unsigned
char
*
data
=
((
const
unsigned
char
*
)
IWineD3DSurface_GetData
(
pSourceSurface
));
UINT
row_length
=
(
srcWidth
/
src_format_desc
->
block_width
)
*
src_format_desc
->
block_byte_count
;
UINT
row_count
=
srcHeight
/
src_format_desc
->
block_height
;
UINT
src_pitch
=
IWineD3DSurface_GetPitch
(
pSourceSurface
);
UINT
y
=
destTop
;
UINT
row
;
/* hopefully using pointer addition will be quicker than using a point + j * rowoffset */
data
+=
(
pSourceRect
->
top
/
src_format_desc
->
block_height
)
*
src_pitch
;
const
unsigned
char
*
data
=
((
const
unsigned
char
*
)
IWineD3DSurface_GetData
(
pSourceSurface
))
+
offse
t
;
data
+=
(
pSourceRect
->
left
/
src_format_desc
->
block_width
)
*
src_format_desc
->
block_byte_coun
t
;
for
(
j
=
destTop
;
j
<
(
srcHeight
+
destTop
);
++
j
)
for
(
row
=
0
;
row
<
row_count
;
++
row
)
{
{
glTexSubImage2D
(
dst_impl
->
texture_target
,
dst_impl
->
texture_level
,
destLeft
,
j
,
GL_EXTCALL
(
glCompressedTexSubImage2DARB
(
dst_impl
->
texture_target
,
dst_impl
->
texture_level
,
srcWidth
,
1
,
dst_format_desc
->
glFormat
,
dst_format_desc
->
glType
,
data
);
destLeft
,
y
,
srcWidth
,
src_format_desc
->
block_height
,
data
+=
rowoffset
;
dst_format_desc
->
glInternal
,
row_length
,
data
));
y
+=
src_format_desc
->
block_height
;
data
+=
src_pitch
;
}
checkGLcall
(
"glCompressedTexSubImage2DARB"
);
}
}
else
{
const
unsigned
char
*
data
=
((
const
unsigned
char
*
)
IWineD3DSurface_GetData
(
pSourceSurface
))
+
offset
;
unsigned
int
j
;
}
else
{
/* Full width, so just write out the whole texture */
for
(
j
=
destTop
;
j
<
(
srcHeight
+
destTop
);
++
j
)
{
glTexSubImage2D
(
dst_impl
->
texture_target
,
dst_impl
->
texture_level
,
destLeft
,
j
,
srcWidth
,
1
,
dst_format_desc
->
glFormat
,
dst_format_desc
->
glType
,
data
);
data
+=
rowoffset
;
}
}
}
else
/* Full width, so just write out the whole texture. */
{
const
unsigned
char
*
data
=
((
const
unsigned
char
*
)
IWineD3DSurface_GetData
(
pSourceSurface
))
+
offset
;
const
unsigned
char
*
data
=
((
const
unsigned
char
*
)
IWineD3DSurface_GetData
(
pSourceSurface
))
+
offset
;
if
(
dst_format_desc
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
dst_format_desc
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
...
...
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