Re: IDirect3DDevice->Present most overhead?
From: Jack Hoxley (Jack.Hoxley_at_F1CM.co.uk)
Date: 11/30/04
- Next message: Phil Taylor: "Re: D3DPOOL_MANAGED bug in CreateVertexBuffer?"
- Previous message: Bilbao: "RE: What functions for intersection?"
- In reply to: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Next in thread: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Reply: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Reply: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Nov 2004 15:42:32 +0000
Bilbao wrote:
> Thanks for your hints Sean and Minh.
>
> Minh these are the parameters I am using when creating the device:
> MultiSampleQuality = 0;
> MultiSampleType = D3DMULTISAMPLE_NONE;
> PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
> SwapEffect = D3DSWAPEFFECT_DISCARD;
>
> It is a windowed application using MFC.
I'd be more inclined to go with what Sean said... One of the MVP's (I
think) had a discussion of how to profile D3D calls on their website (or
it might just be a general site somewhere - i forget).
Basically, when you make calls to D3D it will do them in the correct
order (such that you get the correct visual results) however it does not
necessarily do it as soon as you ask it to.
Drivers (and D3D) have a complex set of optimizations to maximise
parallelism between the CPU and GPU, one of the common ones being
command queuing (as Sean explained).
Often it's the Present() and the Lock() type calls that force the driver
to execute any pending operations, now, if the GPU is ahead of the CPU
when the call is made it'll be done very quickly (no command queue to
process). If the GPU is behind the CPU (commands exist in the queue),
then the CPU must stall until the GPU has caught up and can honour the
lock/present command.
So, timing apparently identical code from 1 frame to the other can
generate wildly different results depending on the current GPU and CPU
loads.
I've never seen any need to profile D3D's internals manually, PIX is a
far better tool for the job :-)
I believe you'll find this sort of strategy to be very common in
multi-processing/multi-programming environments (databases and
transaction servers are other good examples).
hth
Jack
- Next message: Phil Taylor: "Re: D3DPOOL_MANAGED bug in CreateVertexBuffer?"
- Previous message: Bilbao: "RE: What functions for intersection?"
- In reply to: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Next in thread: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Reply: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Reply: Bilbao: "Re: IDirect3DDevice->Present most overhead?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|