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
7ed116da
Commit
7ed116da
authored
Aug 07, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge the context->current_rt check for rendertarget readback with the code above.
Also update the comments.
parent
0479fb13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
48 deletions
+33
-48
context.c
dlls/wined3d/context.c
+33
-48
No files found.
dlls/wined3d/context.c
View file @
7ed116da
...
...
@@ -1862,59 +1862,44 @@ retry:
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
}
}
}
/* When switching away from an offscreen render target, and we're not using FBOs,
* we have to read the drawable into the texture. This is done via PreLoad(and
* SFLAG_INDRAWABLE set on the surface). There are some things that need care though.
* PreLoad needs a GL context, and FindContext is called before the context is activated.
* It also has to be called with the old rendertarget active, otherwise a wrong drawable
* is read. This leads to these possible situations:
*
* 0) lastActiveRenderTarget == target && oldTid == newTid:
* Nothing to do, we don't even reach this code in this case...
*
* 1) lastActiveRenderTarget != target && oldTid == newTid:
* The currently active context is OK for readback. Call PreLoad, and it
* performs the read
*
* 2) lastActiveRenderTarget == target && oldTid != newTid:
* Nothing to do - the drawable is unchanged
*
* 3) lastActiveRenderTarget != target && oldTid != newTid:
* This is tricky. We have to get a context with the old drawable from somewhere
* before we can switch to the new context. In this case, PreLoad calls
* ActivateContext(lastActiveRenderTarget) from the new(current) thread. This
* is case (2) then. The old drawable is activated for the new thread, and the
* readback can be done. The recursed ActivateContext does *not* call PreLoad again.
* After that, the outer ActivateContext(which calls PreLoad) can activate the new
* target for the new thread
*/
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
old_render_offscreen
&&
context
->
current_rt
&&
context
->
current_rt
!=
target
)
{
BOOL
oldInDraw
=
This
->
isInDraw
;
/* When switching away from an offscreen render target, and we're not
* using FBOs, we have to read the drawable into the texture. This is
* done via PreLoad (and SFLAG_INDRAWABLE set on the surface). There
* are some things that need care though. PreLoad needs a GL context,
* and FindContext is called before the context is activated. It also
* has to be called with the old rendertarget active, otherwise a
* wrong drawable is read. */
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
old_render_offscreen
&&
context
->
current_rt
!=
target
)
{
BOOL
oldInDraw
=
This
->
isInDraw
;
/* PreLoad requires a context to load the texture, thus it will call ActivateContext.
* Set the isInDraw to true to signal PreLoad that it has a context. Will be tricky
* when using offscreen rendering with multithreading
*/
This
->
isInDraw
=
TRUE
;
/* surface_internal_preload() requires a context to load the
* texture, so it will call ActivateContext. Set isInDraw to true
* to signal surface_internal_preload() that it has a context. */
/* Do that before switching the context:
* Read the back buffer of the old drawable into the destination texture
*/
if
(((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
texture_name_srgb
)
{
surface_internal_preload
(
context
->
current_rt
,
SRGB_BOTH
);
}
else
{
surface_internal_preload
(
context
->
current_rt
,
SRGB_RGB
);
}
/* FIXME: This is just broken. There's no guarantee whatsoever
* that the currently active context, if any, is appropriate for
* reading back the render target. We should probably call
* context_set_current(context) here and then rely on
* ActivateContext() doing the right thing. */
This
->
isInDraw
=
TRUE
;
/* Read the back buffer of the old drawable into the destination texture. */
if
(((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
texture_name_srgb
)
{
surface_internal_preload
(
context
->
current_rt
,
SRGB_BOTH
);
}
else
{
surface_internal_preload
(
context
->
current_rt
,
SRGB_RGB
);
}
/* Assume that the drawable will be modified by some other things now */
IWineD3DSurface_ModifyLocation
(
context
->
current_rt
,
SFLAG_INDRAWABLE
,
FALSE
);
IWineD3DSurface_ModifyLocation
(
context
->
current_rt
,
SFLAG_INDRAWABLE
,
FALSE
);
This
->
isInDraw
=
oldInDraw
;
This
->
isInDraw
=
oldInDraw
;
}
}
context
->
draw_buffer_dirty
=
TRUE
;
...
...
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