PDA

View Full Version : Quiz Question


psorcerer
14-Jul-2007, 07:39
CreateQuery(EVENT)
.....
.....
Issue(END)
Render()
Present()
GetData(Query)
Issue(END)
Render()
Present()
GetData(Query)
Issue(END)
Render()
Present()
GetData(Query)
Issue(END)
Render()
Present()
GetData(Query)
.....
.....

What's this code doing?
And why?
:)

psorcerer
14-Jul-2007, 07:42
Err... wrong section.... I apologize.

Humus
14-Jul-2007, 22:22
It's probably reducing mouse lag by issuing an event query to make sure the GPU doesn't trail the CPU more than for instance one frame.

Davros
15-Jul-2007, 03:50
ooh ooh ive got a code quiz question :D

why would you use the following to clear a z-buffer and why does it work on ati hardware but not nvidia

IDirectDrawSurface::Blt( NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &ddbltfx );

psorcerer
16-Jul-2007, 05:01
It's probably reducing mouse lag by issuing an event query to make sure the GPU doesn't trail the CPU more than for instance one frame.

That's good answer, but I think it's incorrect. Because I can send 0 to the application and it still does not react like something happened, it should re-get the data after some sleep, but it doesn't. :)

RedGuard
16-Jul-2007, 13:24
What do you mean by "send 0 to the application"? Event queries don't have return data - once GetData returns S_OK the application can assume the triangles sent to the driver before the query have finished drawing.

psorcerer
17-Jul-2007, 05:58
Event queries don't have return data - once GetData returns S_OK the application can assume the triangles sent to the driver before the query have finished drawing.

1. Event queries do return data, in the BOOL variable.
2. I send D3DERR_DEVICELOST in the HRESULT and 0 in the BOOL.