I am implementing some functionality which requires me to implement an API to wait for d3d10 to finish rendering.Basically i am trying to implement synchronize access to a shared texture such that i can update a texture after d3d10 is successfully able to present to backbuffer. By calling this black box api i think this can be achieved and i think it will be something similar like glfinish().I have read we can use ID3D10Query queries for implementing synchronize access.
D3D10_QUERY_DESC queryDesc;
... // Fill out queryDesc structure
ID3D10Query * pQuery;
pDevice->CreateQuery( &queryDesc, &pQuery );
pQuery->Begin();
... // Issue graphis commands, do whatever
pQuery->End();
UINT64 queryData; // This data type is different depending on the query type
while( S_OK != pQuery->GetData( &queryData, sizeof( UINT64 ), 0 ) )
{
}
should i put some dummy command between begin and end this? since i want to expose this functionality as public API something named as waitforgraphiscompletion
what should be a dummy command here?