2015-10-12 22:34 GMT+02:00 Stefan Dösinger stefan@codeweavers.com:
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
dlls/wined3d/surface.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f5ee7e1..c70b709 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3850,11 +3850,11 @@ static void surface_load_sysmem(struct wined3d_surface *surface, surface, wined3d_debug_location(surface->locations)); }
+/* Context activation is done by the caller. */ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info)
struct wined3d_context *context)
{ RECT r;
struct wined3d_context *context;
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource))
@@ -3863,12 +3863,10 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, return WINED3DERR_INVALIDCALL; }
context = context_acquire(surface->resource.device, surface); surface_get_rect(surface, NULL, &r); surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
context_release(context);
return WINED3D_OK;
} @@ -4125,7 +4123,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) break;
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, gl_info)))
context = context_acquire(device, NULL);
hr = surface_load_drawable(surface, context);
Doesn't this context_acquire() need to take the surface of the drawable into account (i.e. something like the context_acquire you're removing from surface_load_drawable())? Maybe the context is already guaranteed to be correct? If that's the case though perhaps a comment would help since it's not immediately obvious.
surface_blt_to_drawable should take care of this if the context doesn't match. The newly placed context_acquire call is only temporary, the next set of patches will remove it again and pass a context to surface_load_location.
(This reply is written from memory. I'm on Windows at the moment and don't have the entire patchset to double-check)
2015-10-13 12:30 GMT+02:00 Matteo Bruni matteo.mystral@gmail.com:
2015-10-12 22:34 GMT+02:00 Stefan Dösinger stefan@codeweavers.com:
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
dlls/wined3d/surface.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f5ee7e1..c70b709 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3850,11 +3850,11 @@ static void surface_load_sysmem(struct wined3d_surface *surface, surface, wined3d_debug_location(surface->locations)); }
+/* Context activation is done by the caller. */ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info)
struct wined3d_context *context)
{ RECT r;
struct wined3d_context *context;
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource))
@@ -3863,12 +3863,10 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, return WINED3DERR_INVALIDCALL; }
context = context_acquire(surface->resource.device, surface); surface_get_rect(surface, NULL, &r); surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
context_release(context);
return WINED3D_OK;
} @@ -4125,7 +4123,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) break;
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, gl_info)))
context = context_acquire(device, NULL);
hr = surface_load_drawable(surface, context);
Doesn't this context_acquire() need to take the surface of the drawable into account (i.e. something like the context_acquire you're removing from surface_load_drawable())? Maybe the context is already guaranteed to be correct? If that's the case though perhaps a comment would help since it's not immediately obvious.
2015-10-13 12:56 GMT+02:00 Stefan Dösinger stefandoesinger@gmail.com:
surface_blt_to_drawable should take care of this if the context doesn't match. The newly placed context_acquire call is only temporary, the next set of patches will remove it again and pass a context to surface_load_location.
(This reply is written from memory. I'm on Windows at the moment and don't have the entire patchset to double-check)
You're correct, it does acquire a context. I guess it doesn't matter much then, that only changes the place where the potentially different onscreen context is acquired. I imagine that acquiring a non-specific context in surface_load_location() is actually more similar to how it will work at the end of the whole patchset so I see the point of doing it like this (and I take back my complaint :).