Original Post
Hi, I'm writing a shader that requires writing a large amount of data to a buffer. As I increase the size of memory allocated for the buffer, the frame rate drops significantly, even though the number of writes do not increase and the geometry rendered and shader code remain exactly the same. I'm using a D3D11_QUERY_EVENT to measure the frame rate by calling ID3D11Device::CreateQuery before the call to ID3D11DeviceContext::DrawIndexed and then immediately calling ID3D11DeviceContext::End. I then have the cpu run in a while loop until the query is no longer S_FALSE. Is this the correct way to measure how much time a draw call requires to finish? Or is it somehow capturing the time it takes to allocate the memory as well? If the timer isn't wrong, then what is causing the reduction in performance? I'm using structured buffers created with D3D11_USAGE_DEFAULT and no CPU access. I have a UAV to these buffers.