Commit d5ee9a40 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Check for unhandled resource usage flags.

parent 6d310390
...@@ -65,6 +65,19 @@ static DWORD resource_access_from_pool(WINED3DPOOL pool) ...@@ -65,6 +65,19 @@ static DWORD resource_access_from_pool(WINED3DPOOL pool)
} }
} }
static void resource_check_usage(DWORD usage)
{
static const DWORD handled = WINED3DUSAGE_RENDERTARGET
| WINED3DUSAGE_DEPTHSTENCIL
| WINED3DUSAGE_DYNAMIC
| WINED3DUSAGE_AUTOGENMIPMAP
| WINED3DUSAGE_STATICDECL
| WINED3DUSAGE_OVERLAY;
if (usage & ~handled)
FIXME("Unhandled usage flags %#x.\n", usage & ~handled);
}
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
WINED3DRESOURCETYPE resource_type, const struct wined3d_format *format, WINED3DRESOURCETYPE resource_type, const struct wined3d_format *format,
WINED3DMULTISAMPLE_TYPE multisample_type, UINT multisample_quality, WINED3DMULTISAMPLE_TYPE multisample_type, UINT multisample_quality,
...@@ -93,6 +106,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * ...@@ -93,6 +106,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource->resource_ops = resource_ops; resource->resource_ops = resource_ops;
list_init(&resource->privateData); list_init(&resource->privateData);
resource_check_usage(usage);
if (size) if (size)
{ {
resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT); resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment