Hi!
I wonder if I can achieve the same (not quite optimal) CPU readback of occlusion queries as with DX11.
u64 result = 0;
HRESULT hr = deviceCtx11->GetData(id3d11Query, result, sizeof(u64), D3D11_ASYNC_GETDATA_DONOTFLUSH);
if (S_OK == hr) return "ready"; else "not ready";
This happens on the CPU. I'm able to see if it's ready or not and do other stuff it isn't.
In DX12, ResolveQueryData obviously happens on the GPU. If I put a fence after ResolveQueryData, I can be sure it copied the results into my buffer. However I wonder, if there's any other way then inserting fences after each EndQuery to see if the individual queries already finished. It sounds bad and I guess the fence might do some flushing.
I first want to implement what other platforms in our engine do, before changing all of them to some more sensible batched occlusion query querying model.
Thanks for any remarks.
↧