Re: Lost Device - Release Timing
- From: "Wessam Bahnassi" <wbahnassi@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 08:16:41 +0300
I don't think there is time better than another.
But I think that detecting loss and releasing at that time might not be the
best thing. Because when your device is lost, usually it's your app being
minimized, or taken away by another fullscreen D3D app. In both cases, I
would stop my app from doing any further processing. It shouldn't be a
lengthy operation to release or D3D resources, but it depends on how you
manage them. YMMV
Personally, I release them just prior to restoring the device, that is, when
my app comes back to live...
Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez
"cadull" <clinton.no@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OxqDfbRTFHA.3308@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> When the device is lost, some resources need releasing before calling
> IDirect3DDevice9::Reset. Are there any restrictions within this time as to
> when they can be released or any advantages to choosing a particular time?
>
> The documentation on lost devices implies that the resources should be
> released after IDirect3DDevice9::TestCooperativeLevel returns
> D3DERR_DEVICENOTRESET:
>
> "If the device can be restored, the application prepares the device by
> destroying all video-memory resources and any swap chains."
>
> The EmptyProject sample says that it frees the resources as soon as the
> device is lost, with the comment near OnLostDevice:
>
> "This callback function will be called immediately after the Direct3D
> device
> has entered a lost state and before IDirect3DDevice9::Reset is called."
>
> However in tracing the code it does seem to wait for D3DERR_DEVICENOTRESET
> first. After looking over a few thousand lines of code I could be mistaken
> though.
>
> Despite this documentation and sample implementation, it would appear that
> the resources can be released earlier. Quoting the documentation again:
>
> "All methods that derive from IUnknown are guaranteed to work after a
> device
> is lost."
>
> The timing would have negligible impact when executed (assuming few
> dynamic
> resources), so I'm mainly interested in what is possible or advisable -
> following which the impact on my engine design will be the main
> consideration.
>
> Regards,
> cadull
>
>
.
- References:
- Lost Device - Release Timing
- From: cadull
- Lost Device - Release Timing
- Prev by Date: Re: Mip-map not generated without D3DUSAGE_AUTOGENMIPMAP
- Next by Date: Re: Need to render to hardware overlay
- Previous by thread: Lost Device - Release Timing
- Next by thread: Need to render to hardware overlay
- Index(es):
Relevant Pages
|