Commit 317d5406 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Handle client storage in surface_init_sysmem().

parent b57d1e7c
......@@ -3956,13 +3956,21 @@ BOOL surface_init_sysmem(struct wined3d_surface *surface)
{
if (!surface->resource.allocatedMemory)
{
surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
surface->resource.size + RESOURCE_ALIGNMENT);
if (!surface->resource.heapMemory)
{
ERR("Out of memory\n");
return FALSE;
if (!(surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
surface->resource.size + RESOURCE_ALIGNMENT)))
{
ERR("Failed to allocate memory.\n");
return FALSE;
}
}
else if (!(surface->flags & SFLAG_CLIENT))
{
ERR("Surface %p has heapMemory %p and flags %#x.\n",
surface, surface->resource.heapMemory, surface->flags);
}
surface->resource.allocatedMemory =
(BYTE *)(((ULONG_PTR)surface->resource.heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1));
}
......
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