Re: Compressed textures
- From: "John Withe" <a@xxxx>
- Date: Wed, 27 Feb 2008 00:49:56 +0100
Thanks a lot for your very detailed answer. I have mixed my response and aditional questions with the text. I hope it is not looking too messy.
You are right in that I wonder what happens to the bandwidth (pci-e) and why it is so slow. I was previously considering writing a texture in parallel with begin,end,present and as I understand you, that would have improved things.
(note that this blocking call isn't always present()!).That is new for me. Good to know. I was pretty confident I only had to consider blockking there.
Let's include a (discard-mode) lock,
1. lock, copy, unlock
2. beginscene draw endscene
3. present, goto 1
This is exactly what I had until today... and it was slow.
and assume, the dirver is able to create n shadow-instances f the texture object,
I have not been able to find any info on "shadow instances". What do you mean by that? That the object exist in multiple copies behind the scene so I can use one copy for rendering while writing into another?
where n is an integer >= 0. This number n might depend on things like driver configuration,
but also on the runtime situation (memory fragmentation, for example, or simply lazy
realeasing of shadow-instances). Remember noone said that this number n must be
greater then 0, so the driver is always free to choose to ignore the discard-locking-mode.
If n is less then the number of frames, the driver/gpu can fall behind the applicction,
and if the application feeds d3d-tasks fast, the situation would become
almost idetical to the case where n=0 (no dicard-mode).
With two backbuffers, I assume present will block when the gpu rendering falls two frames behind?
I understand the above as that I can not render ahead when I change the object in between render calls.
Keep in mind I an new to this, so I may misunderstand you entirely, but is what you are saying that
1:lock,write tex,unlock
2:begin,end,present
3:lock,write tex,unlock
will actually block in 3 since the gpu maybe still havent come arround to render when was defined in 2, and that rendering needs the texture as it is after 1, so while it has not used the texture in its first state, I can not alter it?
After all, you're probably right in that on your computer it doesn't make
a diffrence for your application, if you lock(discard) a single "upload"
texture object, or lock(discard) just one surface of a circular "upoad"
texture collection.
Well, if it doesnt make a difference, then something else certainly do.
However, if you compare the amount of data you actually upload
(100 MB/s ?) against the available upload bandwidth (AGP8X: 2GB/s)
you'll probably wonder where all that bandwidth is gone, even if
you take some degrading factors (like suboptimal CPU<->AGP bus
coupling/usage and/or CPU-usage for additional processing) into account.
On the system I sit with right now, I can render 280FPS when I read texels to memory and every frame lock,copy,unlock,begin,draw,end,present
If I create a managed texture for every frame and then change to begin,set texture,draw,end,present I get 1400 fps. That is because the entire movie can be in videomemory at once. This indicates to me that the difference is lost on the overhead of transfering data. I actually transfer 464MB every second at 280FPS.
If I understand you correctly, having a managed texture for every frame and letting directx move the data when needed would be a lot better than having one texture and dealing with it as I did before. This way a texture is never modified. Perhaps this could be even better if I asked it to preload a few frames ahead so one or two slow texture loads would not suddenly slow down a few frames and causeme to loose a frame.
Anyway. Thanks a lot for the explanation. I hope I understood it correctly.
.
- Follow-Ups:
- Re: Compressed textures
- From: Jan Bruns
- Re: Compressed textures
- References:
- Compressed textures
- From: John Withe
- Re: Compressed textures
- From: Richard [Microsoft Direct3D MVP]
- Re: Compressed textures
- From: John Withe
- Re: Compressed textures
- From: Richard [Microsoft Direct3D MVP]
- Re: Compressed textures
- From: John Withe
- Re: Compressed textures
- From: Jan Bruns
- Re: Compressed textures
- From: John Withe
- Re: Compressed textures
- From: Jan Bruns
- Compressed textures
- Prev by Date: Re: A noob question
- Next by Date: Re: Render an offscreensurface
- Previous by thread: Re: Compressed textures
- Next by thread: Re: Compressed textures
- Index(es):
Relevant Pages
|