Henri Verbeet : wined3d: Get resource info from the rendertarget view in device_clear_render_targets ().
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Mar 7 08:50:37 CST 2016
Module: wine
Branch: master
Commit: 2d8a1034fa8e90b45cc40987975306edd812a1c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2d8a1034fa8e90b45cc40987975306edd812a1c9
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Sun Mar 6 20:59:47 2016 +0100
wined3d: Get resource info from the rendertarget view in device_clear_render_targets().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/device.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a724659..2305b2c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -320,13 +320,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
* checking all this if the dest surface is in the drawable anyway. */
for (i = 0; i < rt_count; ++i)
{
- struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
- if (rt && rt->resource.format->id != WINED3DFMT_NULL)
+ struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
+ struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(rtv);
+
+ if (rt && rtv->format->id != WINED3DFMT_NULL)
{
if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect))
- surface_load_location(rt, context, rt->container->resource.draw_binding);
+ surface_load_location(rt, context, rtv->resource->draw_binding);
else
- wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding);
+ wined3d_surface_prepare(rt, context, rtv->resource->draw_binding);
}
}
@@ -394,12 +396,13 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
{
for (i = 0; i < rt_count; ++i)
{
- struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
+ struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
+ struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(rtv);
if (rt)
{
- surface_validate_location(rt, rt->container->resource.draw_binding);
- surface_invalidate_location(rt, ~rt->container->resource.draw_binding);
+ surface_validate_location(rt, rtv->resource->draw_binding);
+ surface_invalidate_location(rt, ~rtv->resource->draw_binding);
}
}
More information about the wine-cvs
mailing list