wined3d: Handle client storage in surface_init_sysmem().
This commit is contained in:
parent
b57d1e7c33
commit
317d5406d5
|
@ -3956,13 +3956,21 @@ BOOL surface_init_sysmem(struct wined3d_surface *surface)
|
||||||
{
|
{
|
||||||
if (!surface->resource.allocatedMemory)
|
if (!surface->resource.allocatedMemory)
|
||||||
{
|
{
|
||||||
surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
|
||||||
surface->resource.size + RESOURCE_ALIGNMENT);
|
|
||||||
if (!surface->resource.heapMemory)
|
if (!surface->resource.heapMemory)
|
||||||
{
|
{
|
||||||
ERR("Out of memory\n");
|
if (!(surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
return FALSE;
|
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 =
|
surface->resource.allocatedMemory =
|
||||||
(BYTE *)(((ULONG_PTR)surface->resource.heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1));
|
(BYTE *)(((ULONG_PTR)surface->resource.heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue