Implementation is similar to radeonsi in 5f1cef76
It is used for D3DQUERYTYPE_EVENT in nine.
D3DQUERYTYPE_EVENT