=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Prepare all layers for render target views.

Alexandre Julliard julliard at winehq.org
Wed Apr 19 14:49:37 CDT 2017


Module: wine
Branch: master
Commit: 481999ce44fc919178f7a90dd8fb428cb2029371
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=481999ce44fc919178f7a90dd8fb428cb2029371

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Apr 18 11:24:12 2017 +0200

wined3d: Prepare all layers for render target views.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/drawprim.c        |  5 ++---
 dlls/wined3d/view.c            | 19 +++++++++++++++++++
 dlls/wined3d/wined3d_private.h |  2 ++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 1c324a6..15b3791 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -512,7 +512,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
         }
         else
         {
-            wined3d_texture_prepare_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
+            wined3d_rendertarget_view_prepare_location(rtv, context, rtv->resource->draw_binding);
         }
     }
 
@@ -524,12 +524,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
          * depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
          * that we never copy the stencil data.*/
         DWORD location = context->render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
-        struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(dsv);
 
         if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
             wined3d_rendertarget_view_load_location(dsv, context, location);
         else
-            wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location);
+            wined3d_rendertarget_view_prepare_location(dsv, context, location);
     }
 
     if (!context_apply_draw_state(context, device, state))
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 93788df..e1e1956 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -398,6 +398,25 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg
     }
 }
 
+void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view,
+        struct wined3d_context *context, DWORD location)
+{
+    struct wined3d_resource *resource = view->resource;
+    unsigned int i, sub_resource_idx;
+    struct wined3d_texture *texture;
+
+    if (resource->type == WINED3D_RTYPE_BUFFER)
+    {
+        FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
+        return;
+    }
+
+    texture = texture_from_resource(resource);
+    sub_resource_idx = view->sub_resource_idx;
+    for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
+        wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
+}
+
 void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view,
         struct wined3d_context *context, DWORD location)
 {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 13e375a..ff5b242 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3460,6 +3460,8 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg
         const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
 void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view,
         struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
+void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view,
+        struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
 
 struct wined3d_shader_resource_view
 {




More information about the wine-cvs mailing list