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

wined3d: Move the resource map count field up to wined3d_resource.

parent 8ea086b3
......@@ -1008,7 +1008,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
if (!buffer_add_dirty_area(buffer, offset, size)) return E_OUTOFMEMORY;
}
count = InterlockedIncrement(&buffer->lock_count);
count = ++buffer->resource.map_count;
if (buffer->buffer_object)
{
......@@ -1121,13 +1121,13 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
* number of Map calls, d3d returns always D3D_OK.
* This is also needed to prevent Map from returning garbage on
* the next call (this will happen if the lock_count is < 0). */
if (!buffer->lock_count)
if (!buffer->resource.map_count)
{
WARN("Unmap called without a previous map call.\n");
return;
}
if (InterlockedDecrement(&buffer->lock_count))
if (--buffer->resource.map_count)
{
/* Delay loading the buffer until everything is unlocked */
TRACE("Ignoring unmap.\n");
......
......@@ -1838,6 +1838,7 @@ struct wined3d_resource
{
LONG ref;
LONG bind_count;
LONG map_count;
struct wined3d_device *device;
enum wined3d_resource_type type;
const struct wined3d_format *format;
......@@ -2410,7 +2411,6 @@ struct wined3d_buffer
UINT buffer_object_size;
DWORD flags;
LONG lock_count;
struct wined3d_map_range *maps;
ULONG maps_size, modified_areas;
struct wined3d_event_query *query;
......
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