Henri Verbeet : wined3d: Enforce WINED3DUSAGE_RENDERTARGET format restrictions on resource creation .

Alexandre Julliard julliard at winehq.org
Thu Sep 5 13:28:19 CDT 2013


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Sep  5 09:54:40 2013 +0200

wined3d: Enforce WINED3DUSAGE_RENDERTARGET format restrictions on resource creation.

---

 dlls/wined3d/resource.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index ca322b2..6138764 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -85,6 +85,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
 {
     const struct wined3d *d3d = device->wined3d;
 
+    resource_check_usage(usage);
+    if (pool != WINED3D_POOL_SCRATCH)
+    {
+        if ((usage & WINED3DUSAGE_RENDERTARGET) && !(format->flags & WINED3DFMT_FLAG_RENDERTARGET))
+            return WINED3DERR_INVALIDCALL;
+    }
+
     resource->ref = 1;
     resource->device = device;
     resource->type = type;
@@ -106,8 +113,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
     resource->resource_ops = resource_ops;
     list_init(&resource->privateData);
 
-    resource_check_usage(usage);
-
     if (size)
     {
         resource->heap_memory = wined3d_resource_allocate_sysmem(size);




More information about the wine-cvs mailing list