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
0047c55e
Commit
0047c55e
authored
Aug 03, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle destruction of a context's current render target.
parent
028b763f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
context.c
dlls/wined3d/context.c
+19
-9
No files found.
dlls/wined3d/context.c
View file @
0047c55e
...
...
@@ -594,6 +594,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
fbo_entry
*
entry
,
*
entry2
;
if
(
context
->
current_rt
==
(
IWineD3DSurface
*
)
resource
)
context
->
current_rt
=
NULL
;
ENTER_GL
();
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
context
->
fbo_list
,
struct
fbo_entry
,
entry
)
...
...
@@ -1716,7 +1718,6 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
struct
WineD3DContext
*
current_context
=
context_get_current
();
BOOL
oldRenderOffscreen
=
This
->
render_offscreen
;
const
struct
StateEntry
*
StateTable
=
This
->
StateTable
;
const
struct
GlPixelFormatDesc
*
old
,
*
new
;
struct
WineD3DContext
*
context
;
if
(
current_context
&&
current_context
->
destroyed
)
current_context
=
NULL
;
...
...
@@ -1724,6 +1725,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
if
(
!
target
)
{
if
(
current_context
&&
current_context
->
current_rt
&&
((
IWineD3DSurfaceImpl
*
)
current_context
->
surface
)
->
resource
.
wineD3DDevice
==
This
)
{
target
=
current_context
->
current_rt
;
...
...
@@ -1833,15 +1835,23 @@ retry:
/* To compensate the lack of format switching with some offscreen rendering methods and on onscreen buffers
* the alpha blend state changes with different render target formats. */
old
=
((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
resource
.
format_desc
;
new
=
((
IWineD3DSurfaceImpl
*
)
target
)
->
resource
.
format_desc
;
if
(
old
->
format
!=
new
->
format
)
if
(
!
context
->
current_rt
)
{
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
}
else
{
/* Disable blending when the alpha mask has changed and when a format doesn't support blending. */
if
((
old
->
alpha_mask
&&
!
new
->
alpha_mask
)
||
(
!
old
->
alpha_mask
&&
new
->
alpha_mask
)
||
!
(
new
->
Flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
const
struct
GlPixelFormatDesc
*
old
=
((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
resource
.
format_desc
;
const
struct
GlPixelFormatDesc
*
new
=
((
IWineD3DSurfaceImpl
*
)
target
)
->
resource
.
format_desc
;
if
(
old
->
format
!=
new
->
format
)
{
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
/* Disable blending when the alpha mask has changed and when a format doesn't support blending. */
if
((
old
->
alpha_mask
&&
!
new
->
alpha_mask
)
||
(
!
old
->
alpha_mask
&&
new
->
alpha_mask
)
||
!
(
new
->
Flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
{
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
}
}
}
...
...
@@ -1871,7 +1881,7 @@ retry:
* After that, the outer ActivateContext(which calls PreLoad) can activate the new
* target for the new thread
*/
if
(
readTexture
&&
context
->
current_rt
!=
target
)
if
(
readTexture
&&
context
->
current_rt
&&
context
->
current_rt
!=
target
)
{
BOOL
oldInDraw
=
This
->
isInDraw
;
...
...
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