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
0b46254b
Commit
0b46254b
authored
Mar 14, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Blitting to offscreen target.
Fix the NULL deref that occured when blitting to offscreen targets and select the proper gl drawing buffer instead.
parent
a66784c7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
device.c
dlls/wined3d/device.c
+1
-1
surface.c
dlls/wined3d/surface.c
+13
-5
No files found.
dlls/wined3d/device.c
View file @
0b46254b
...
...
@@ -690,7 +690,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
object
->
pow2Height
=
pow2Height
;
/* Flags */
object
->
Flags
=
0
;
/* We start without flags set */
object
->
Flags
=
SFLAG_DYNLOCK
;
object
->
Flags
|=
(
pow2Width
!=
Width
||
pow2Height
!=
Height
)
?
SFLAG_NONPOW2
:
0
;
object
->
Flags
|=
Discard
?
SFLAG_DISCARD
:
0
;
object
->
Flags
|=
(
WINED3DFMT_D16_LOCKABLE
==
Format
)
?
SFLAG_LOCKABLE
:
0
;
...
...
dlls/wined3d/surface.c
View file @
0b46254b
...
...
@@ -2637,7 +2637,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
DWORD
oldCKeyFlags
=
Src
->
CKeyFlags
;
DDCOLORKEY
oldBltCKey
=
This
->
SrcBltCKey
;
RECT
SourceRectangle
;
GLint
oldDraw
;
TRACE
(
"Blt from surface %p to rendertarget %p
\n
"
,
Src
,
This
);
...
...
@@ -2687,11 +2686,17 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Activate the destination context, set it up for blitting */
ActivateContext
(
myDevice
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_BLIT
);
glGetIntegerv
(
GL_DRAW_BUFFER
,
&
oldDraw
);
if
(
This
==
(
IWineD3DSurfaceImpl
*
)
dstSwapchain
->
frontBuffer
)
{
if
(
!
dstSwapchain
)
{
TRACE
(
"Drawing to offscreen buffer
\n
"
);
glDrawBuffer
(
myDevice
->
offscreenBuffer
);
}
else
if
(
This
==
(
IWineD3DSurfaceImpl
*
)
dstSwapchain
->
frontBuffer
)
{
TRACE
(
"Drawing to front buffer
\n
"
);
glDrawBuffer
(
GL_FRONT
);
checkGLcall
(
"glDrawBuffer GL_FRONT"
);
}
else
{
TRACE
(
"Drawing to back buffer
\n
"
);
glDrawBuffer
(
GL_BACK
);
checkGLcall
(
"glDrawBuffer GL_BACK"
);
}
/* Bind the texture */
...
...
@@ -2755,8 +2760,11 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
glBindTexture
(
GL_TEXTURE_2D
,
0
);
checkGLcall
(
"glEnable glBindTexture"
);
if
(
This
==
(
IWineD3DSurfaceImpl
*
)
dstSwapchain
->
frontBuffer
&&
oldDraw
==
GL_BACK
)
{
glDrawBuffer
(
oldDraw
);
/* The draw buffer should only need to be restored if we were drawing to the front buffer, and there is a back buffer.
* otherwise the context manager should choose between GL_BACK / offscreenDrawBuffer
*/
if
(
dstSwapchain
&&
This
==
(
IWineD3DSurfaceImpl
*
)
dstSwapchain
->
frontBuffer
&&
dstSwapchain
->
backBuffer
)
{
glDrawBuffer
(
GL_BACK
);
}
/* Restore the color key parameters */
Src
->
CKeyFlags
=
oldCKeyFlags
;
...
...
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