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
9dea6f7d
Commit
9dea6f7d
authored
Dec 22, 2008
by
Nick Burns
Committed by
Alexandre Julliard
Dec 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix glReadPixels call from read_from_framebuffer.
parent
72423f5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
surface.c
dlls/wined3d/surface.c
+33
-2
No files found.
dlls/wined3d/surface.c
View file @
9dea6f7d
...
...
@@ -691,6 +691,9 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
BOOL
bpp
;
RECT
local_rect
;
BOOL
srcIsUpsideDown
;
GLint
rowLen
=
0
;
GLint
skipPix
=
0
;
GLint
skipRow
=
0
;
if
(
wined3d_settings
.
rendertargetlock_mode
==
RTL_DISABLE
)
{
static
BOOL
warned
=
FALSE
;
...
...
@@ -786,14 +789,42 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
if
(
This
->
Flags
&
SFLAG_PBO
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_PACK_BUFFER_ARB
,
This
->
pbo
));
checkGLcall
(
"glBindBufferARB"
);
if
(
mem
!=
NULL
)
{
ERR
(
"mem not null for pbo -- unexpected
\n
"
);
mem
=
NULL
;
}
}
glReadPixels
(
local_rect
.
left
,
local_rect
.
top
,
/* Save old pixel store pack state */
glGetIntegerv
(
GL_PACK_ROW_LENGTH
,
&
rowLen
);
checkGLcall
(
"glIntegerv"
);
glGetIntegerv
(
GL_PACK_SKIP_PIXELS
,
&
skipPix
);
checkGLcall
(
"glIntegerv"
);
glGetIntegerv
(
GL_PACK_SKIP_ROWS
,
&
skipRow
);
checkGLcall
(
"glIntegerv"
);
/* Setup pixel store pack state -- to glReadPixels into the correct place */
glPixelStorei
(
GL_PACK_ROW_LENGTH
,
This
->
currentDesc
.
Width
);
checkGLcall
(
"glPixelStorei"
);
glPixelStorei
(
GL_PACK_SKIP_PIXELS
,
local_rect
.
left
);
checkGLcall
(
"glPixelStorei"
);
glPixelStorei
(
GL_PACK_SKIP_ROWS
,
local_rect
.
top
);
checkGLcall
(
"glPixelStorei"
);
glReadPixels
(
local_rect
.
left
,
(
!
srcIsUpsideDown
)
?
(
This
->
currentDesc
.
Height
-
local_rect
.
bottom
)
:
local_rect
.
top
,
local_rect
.
right
-
local_rect
.
left
,
local_rect
.
bottom
-
local_rect
.
top
,
fmt
,
type
,
mem
);
checkGLcall
(
"glReadPixels"
);
/* Reset previous pixel store pack state */
glPixelStorei
(
GL_PACK_ROW_LENGTH
,
rowLen
);
checkGLcall
(
"glPixelStorei"
);
glPixelStorei
(
GL_PACK_SKIP_PIXELS
,
skipPix
);
checkGLcall
(
"glPixelStorei"
);
glPixelStorei
(
GL_PACK_SKIP_ROWS
,
skipRow
);
checkGLcall
(
"glPixelStorei"
);
if
(
This
->
Flags
&
SFLAG_PBO
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_PACK_BUFFER_ARB
,
0
));
checkGLcall
(
"glBindBufferARB"
);
...
...
@@ -828,7 +859,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
}
top
=
mem
+
pitch
*
local_rect
.
top
;
bottom
=
mem
+
pitch
*
(
local_rect
.
bottom
-
local_rect
.
top
-
1
);
bottom
=
mem
+
pitch
*
(
local_rect
.
bottom
-
1
);
for
(
i
=
0
;
i
<
(
local_rect
.
bottom
-
local_rect
.
top
)
/
2
;
i
++
)
{
memcpy
(
row
,
top
+
off
,
len
);
memcpy
(
top
+
off
,
bottom
+
off
,
len
);
...
...
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