Commit 12066a21 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Add a bunch of d3d_perf traces.

parent 295c577f
...@@ -1128,6 +1128,7 @@ static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data) ...@@ -1128,6 +1128,7 @@ static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data)
{ {
struct wined3d_context *context; struct wined3d_context *context;
TRACE_(d3d_perf)("Flushing adapter.\n");
context = context_acquire(cs->c.device, NULL, 0); context = context_acquire(cs->c.device, NULL, 0);
cs->c.device->adapter->adapter_ops->adapter_flush_context(context); cs->c.device->adapter->adapter_ops->adapter_flush_context(context);
context_release(context); context_release(context);
...@@ -2475,6 +2476,8 @@ HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context, ...@@ -2475,6 +2476,8 @@ HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context,
return WINED3D_OK; return WINED3D_OK;
} }
TRACE_(d3d_perf)("Mapping resource %p (type %u), flags %#x through the CS.\n", resource, resource->type, flags);
wined3d_resource_wait_idle(resource); wined3d_resource_wait_idle(resource);
/* We might end up invalidating the resource on the CS thread. */ /* We might end up invalidating the resource on the CS thread. */
...@@ -2527,6 +2530,8 @@ HRESULT wined3d_device_context_emit_unmap(struct wined3d_device_context *context ...@@ -2527,6 +2530,8 @@ HRESULT wined3d_device_context_emit_unmap(struct wined3d_device_context *context
wined3d_not_from_cs(context->device->cs); wined3d_not_from_cs(context->device->cs);
TRACE_(d3d_perf)("Unmapping resource %p (type %u) through the CS.\n", resource, resource->type);
if (!(op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP))) if (!(op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
op->opcode = WINED3D_CS_OP_UNMAP; op->opcode = WINED3D_CS_OP_UNMAP;
...@@ -3279,7 +3284,7 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size ...@@ -3279,7 +3284,7 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
if (new_pos < tail && new_pos) if (new_pos < tail && new_pos)
break; break;
TRACE("Waiting for free space. Head %lu, tail %lu, packet size %Iu.\n", TRACE_(d3d_perf)("Waiting for free space. Head %lu, tail %lu, packet size %Iu.\n",
head, tail, packet_size); head, tail, packet_size);
} }
...@@ -3307,8 +3312,10 @@ static void wined3d_cs_mt_finish(struct wined3d_device_context *context, enum wi ...@@ -3307,8 +3312,10 @@ static void wined3d_cs_mt_finish(struct wined3d_device_context *context, enum wi
if (cs->thread_id == GetCurrentThreadId()) if (cs->thread_id == GetCurrentThreadId())
return wined3d_cs_st_finish(context, queue_id); return wined3d_cs_st_finish(context, queue_id);
TRACE_(d3d_perf)("Waiting for queue %u to be empty.\n", queue_id);
while (cs->queue[queue_id].head != *(volatile ULONG *)&cs->queue[queue_id].tail) while (cs->queue[queue_id].head != *(volatile ULONG *)&cs->queue[queue_id].tail)
wined3d_pause(&spin_count); wined3d_pause(&spin_count);
TRACE_(d3d_perf)("Queue is now empty.\n");
} }
static const struct wined3d_device_context_ops wined3d_cs_mt_ops = static const struct wined3d_device_context_ops wined3d_cs_mt_ops =
......
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