From: Steve Schnepp steve.schnepp@pwkf.org
--- dlls/ddraw/device.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index b34ad56b4dc..e36a7207ada 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1572,6 +1572,11 @@ static HRESULT WINAPI d3d_device1_BeginScene(IDirect3DDevice *iface) return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface); }
+/* static counters. No need to protect them too much, it's just for basics stats + * therefore their performance is much more important than accurary */ +static unsigned int buffer_adds = 0; +static unsigned int buffer_flushs = 0; + /* Flushing the buffer if it isn't empty. * * It will delegate to a single call to wined3d with the correct parameters, @@ -1581,6 +1586,9 @@ HRESULT ddraw_buffer_flush(struct d3d_device *device) {
TRACE("device %p primitive_type %#x vertex_count %05u\n", device, device->vertex_batch.primitive_type, device->vertex_batch.vertex_count);
+ buffer_flushs ++; + TRACE_(d3d_perf)("vertex_count %05u hit_ratio %d/%d (%d%%)\n", device->vertex_batch.vertex_count, buffer_flushs, buffer_adds, (100-100*buffer_flushs/buffer_adds)); + /* Calling wined3d directly */ wined3d_streaming_buffer_unmap(&device->vertex_buffer); wined3d_mutex_lock(); @@ -1664,6 +1672,7 @@ static HRESULT ddraw_buffer_add(struct d3d_device *device, D3DPRIMITIVETYPE prim
TRACE("device %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, flags %#lx, stride %u.\n", device, primitive_type, fvf, vertices, vertex_count, flags, stride); + buffer_adds ++;
if (device->vertex_batch.vertex_count) { /* if already-buffered vertexes do not match the one that we want to add, flush. */