A few, erm alot of questions.

A few, erm alot of questions.

Post by chris jone » Fri, 04 Jul 2003 09:58:57



To resize my surface in windowed mode i think i should call Reset, is this
correct. It seems pretty expensive to call so is there anything i can do to
speed it up.

What happens if DirectX runs out of video memory, will it start using system
memory where it can?

What happens if the user changes the screen mode? Do i need to reset my
device to the new screen mode? Should i capture mode changes and reset the
dx device?

Should i avoid locking a texture imediatly after using it for drawing? I am
guesing any attemp made to lock/modify the texture will stall untill the dx
renderer has finished with it?

If i have multiple windows do i create one Direc3D8 interface for my whole
app or one for each window?

Is it ok to call beginScene & endScene more than once in a single paint
pass? I mean is ok to have called them(in pairs) a few times in between
calls present()

What is the worst case minimum texture size i can expect on an AGP card?

cheers,

chris

 
 
 

A few, erm alot of questions.

Post by Donavon Keithle » Fri, 04 Jul 2003 13:43:52



Quote:> To resize my surface in windowed mode i think i should call Reset, is this
> correct. It seems pretty expensive to call so is there anything i can do
to
> speed it up.

Yes, the only way to resize the implicit swap chain is to reset the device.
(Or recreate the device.)

There are a couple of ways to get faster resizing.  One is to
CreateAdditionalSwapChain.  On resize you release and recrete the additional
swap chain -- no reset needed.  That will be considerably faster especially
if you have a lot of default pool resources to kill and recreate.

Even faster, use a swap chain larger than the window.  When the window
resizes, you just adjust the viewport to render to only part of the back
buffer and correspondingly you set the source rectangle when presenting.
One disadvantage of this is that it forces you to use D3DSWAPEFFECT_COPY.
And of course it wastes memory.

Quote:> What happens if DirectX runs out of video memory, will it start using
system
> memory where it can?

In some contexts it's up to the driver whether it can/will do this.

Quote:> What happens if the user changes the screen mode? Do i need to reset my
> device to the new screen mode? Should i capture mode changes and reset the
> dx device?

That will cause the device to be lost and you'll have to reset, yes.  But
you're handling lost device anyway, right? :-)  If not, do so.  There are
many ways the device can become lost.

Quote:> Should i avoid locking a texture imediatly after using it for drawing? I
am
> guesing any attemp made to lock/modify the texture will stall untill the
dx
> renderer has finished with it?

Yup.

Quote:> If i have multiple windows do i create one Direc3D8 interface for my whole
> app or one for each window?

No more than one device per adapter per app.  You can create more but it's
strongly discouraged.  The simplest approach is to create an additional swap
chain for each window.  It's also possible to have the windows share a
single swap chain, which is a lot like using the oversized swap chain for
fast resizing.

--
Donavon Keithley

 
 
 

A few, erm alot of questions.

Post by Eyal Tele » Fri, 04 Jul 2003 23:53:20


Quote:> What is the worst case minimum texture size i can expect on an AGP card?

1. Why an AGP card? You shouldn't assume that.
2. 256x256
3. Unless you want to include Voodoo3 and older Voodoo family cards in
your target hardware, you can assume 1024x1024, and 2048x2048 would
work on all current cards.

        Eyal

 
 
 

A few, erm alot of questions.

Post by chris jone » Sat, 05 Jul 2003 03:44:53


very helpfull answers, thankyou :)

chris





> > To resize my surface in windowed mode i think i should call Reset, is
this
> > correct. It seems pretty expensive to call so is there anything i can do
> to
> > speed it up.

> Yes, the only way to resize the implicit swap chain is to reset the
device.
> (Or recreate the device.)

> There are a couple of ways to get faster resizing.  One is to
> CreateAdditionalSwapChain.  On resize you release and recrete the
additional
> swap chain -- no reset needed.  That will be considerably faster
especially
> if you have a lot of default pool resources to kill and recreate.

> Even faster, use a swap chain larger than the window.  When the window
> resizes, you just adjust the viewport to render to only part of the back
> buffer and correspondingly you set the source rectangle when presenting.
> One disadvantage of this is that it forces you to use D3DSWAPEFFECT_COPY.
> And of course it wastes memory.

> > What happens if DirectX runs out of video memory, will it start using
> system
> > memory where it can?

> In some contexts it's up to the driver whether it can/will do this.

> > What happens if the user changes the screen mode? Do i need to reset my
> > device to the new screen mode? Should i capture mode changes and reset
the
> > dx device?

> That will cause the device to be lost and you'll have to reset, yes.  But
> you're handling lost device anyway, right? :-)  If not, do so.  There are
> many ways the device can become lost.

> > Should i avoid locking a texture imediatly after using it for drawing? I
> am
> > guesing any attemp made to lock/modify the texture will stall untill the
> dx
> > renderer has finished with it?

> Yup.

> > If i have multiple windows do i create one Direc3D8 interface for my
whole
> > app or one for each window?

> No more than one device per adapter per app.  You can create more but it's
> strongly discouraged.  The simplest approach is to create an additional
swap
> chain for each window.  It's also possible to have the windows share a
> single swap chain, which is a lot like using the oversized swap chain for
> fast resizing.

> --
> Donavon Keithley