[PATCH 4/8] wined3d: Use renderbuffers if the resource type is RB.

Stefan Dösinger stefan at codeweavers.com
Fri May 22 03:11:24 CDT 2015


Surface_private_setup sets surface->locations = WINED3D_LOCATION_DISCARDED
for depth stencil surfaces, so right now we don't have to worry about
initializing the renderbuffer. Adding a new WINED3D_LOCATION_CLEAR
location or similar that clears the surface in load_location may be an
idea in the long run.
---
 dlls/wined3d/resource.c | 2 ++
 dlls/wined3d/surface.c  | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 2bc1cc1..cd93a02 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -341,6 +341,8 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
         resource->draw_binding = WINED3D_LOCATION_DRAWABLE;
     else if (resource->multisample_type)
         resource->draw_binding = WINED3D_LOCATION_RB_MULTISAMPLE;
+    else if (resource->gl_type == WINED3D_GL_RES_TYPE_RB)
+        resource->draw_binding = WINED3D_LOCATION_RB_RESOLVED;
     else
         resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
 }
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 359db9b..c5bb1cf 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3716,6 +3716,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
             case WINED3D_LOCATION_RB_MULTISAMPLE:
                 surface_prepare_rb(surface, gl_info, TRUE);
                 break;
+            case WINED3D_LOCATION_RB_RESOLVED:
+                surface_prepare_rb(surface, gl_info, FALSE);
+                break;
             case WINED3D_LOCATION_DRAWABLE:
                 /* Nothing to do */
                 break;
-- 
2.3.6




More information about the wine-patches mailing list