Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Torge Matthies
wine
Commits
7ed116da
Commit
7ed116da
authored
15 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wined3d: Merge the context->current_rt check for rendertarget readback with the code above.
Also update the comments.
parent
0479fb13
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wined3d/context.c
+33
-48
33 additions, 48 deletions
dlls/wined3d/context.c
with
33 additions
and
48 deletions
dlls/wined3d/context.c
+
33
−
48
View file @
7ed116da
...
@@ -1862,59 +1862,44 @@ retry:
...
@@ -1862,59 +1862,44 @@ retry:
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
}
}
}
}
}
/* When switching away from an offscreen render target, and we're not using FBOs,
/* When switching away from an offscreen render target, and we're not
* we have to read the drawable into the texture. This is done via PreLoad(and
* using FBOs, we have to read the drawable into the texture. This is
* SFLAG_INDRAWABLE set on the surface). There are some things that need care though.
* done via PreLoad (and SFLAG_INDRAWABLE set on the surface). There
* PreLoad needs a GL context, and FindContext is called before the context is activated.
* are some things that need care though. PreLoad needs a GL context,
* It also has to be called with the old rendertarget active, otherwise a wrong drawable
* and FindContext is called before the context is activated. It also
* is read. This leads to these possible situations:
* has to be called with the old rendertarget active, otherwise a
*
* wrong drawable is read. */
* 0) lastActiveRenderTarget == target && oldTid == newTid:
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
* Nothing to do, we don't even reach this code in this case...
&&
old_render_offscreen
&&
context
->
current_rt
!=
target
)
*
{
* 1) lastActiveRenderTarget != target && oldTid == newTid:
BOOL
oldInDraw
=
This
->
isInDraw
;
* 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
;
/* PreLoad requires a context to load the texture, thus it will call ActivateContext.
/* surface_internal_preload() requires a context to load the
* Set the isInDraw to true to signal PreLoad that it has a context. Will be tricky
* texture, so it will call ActivateContext. Set isInDraw to true
* when using offscreen rendering with multithreading
* to signal surface_internal_preload() that it has a context. */
*/
This
->
isInDraw
=
TRUE
;
/* Do that before switching the context:
/* FIXME: This is just broken. There's no guarantee whatsoever
* Read the back buffer of the old drawable into the destination texture
* that the currently active context, if any, is appropriate for
*/
* reading back the render target. We should probably call
if
(((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
texture_name_srgb
)
* context_set_current(context) here and then rely on
{
* ActivateContext() doing the right thing. */
surface_internal_preload
(
context
->
current_rt
,
SRGB_BOTH
);
This
->
isInDraw
=
TRUE
;
}
else
{
surface_internal_preload
(
context
->
current_rt
,
SRGB_RGB
);
/* 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
;
context
->
draw_buffer_dirty
=
TRUE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment