   maximum back buffer size ?
  Hi, in my app I need to perform off screen rendering into back buffer (without calling present) and then saving content in the file.I am using something like thisIDirect3DSurface9 *bb = NULL;hr = d3ddev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &bb);and then calling LockRect on the bb surface, copying the data etc.All this works fine however I typically need to do the rendering on maximum resolution which the used video card can support and I mean maximum resolution of the backbuffer (which is different than max display resolution or max theoretical display resolution which card can support on the best monitor available)Is there some way to detect this ? If I use higher resolution than the video card can handle the resulting image gets messed up (but all returned d3d error codes show S_OK as if there was no error at all). According to my tests different cards have different max backbuffer limits (where my algorithm works) but I still don't know how to be sure what the limit is. Does anyone have a clue about this ? My first suspect is the maximum texture width / height but I couldn't find evidence about it while doing my google search.   
Quote:Original post by appletreeIs there some way to detect this ? If I use higher resolution than the video card can handle the resulting image gets messed up (but all returned d3d error codes show S_OK as if there was no error at all). According to my tests different cards have different max backbuffer limits (where my algorithm works) but I still don't know how to be sure what the limit is. Does anyone have a clue about this ? My first suspect is the maximum texture width / height but I couldn't find evidence about it while doing my google search.Well first of all the backbuffer and frontbuffer must fit into VRAM. So on a 128MB card, the best you could get would be 4096x4096 (Assuming 32-bit). It'll be slightly less than that in reality, since there'll be some overhead and not all memory will be available to you.I don't believe the texture limits apply to the backbuffer; that wouldn't make sense for older cards that only supported 256x256 as the max texture size, since you could have a backbuffer of 640x480 or above.I think the best bet is to have a series of fixed resolutions coded into your app, and try them in succession - highest down to lowest.   ;  I'm not sure if you are using this for personal use, or if you are distributing the program to others, but if you are the only one using it you could use the reference rasterizer to find out the maximum size from the reference implementation (if there is one...) and then use Steve's method of trying to create a backbuffer and then decrementing the size until you find a valid one.   ;  From what you describe, it sounds like you don't want a back buffer. You just want to use a render target surface to render into, and save that. In that case, maximum texture size will be your limit.BTW, I'd suggest using GetRenderTargetData to copy to an offscreen surface, instead of locking, for two reasons. First, to lock you have to define the render target (or back buffer) as lockable, which can make it slower to render to. Secondly, if you're copying everything, accessing a device surface will be much slower than copying it completely and accessing a system surface.   ;  One other option would be to perform tiled rendering, where you modify your projection matrix to render the image in large pieces, then later put then back together when you save your image.  This would allow for hardware accelerated rendering but still allow you to use the 'super-sized' backbuffers.   ;Quote:Original post by Jason ZOne other option would be to perform tiled rendering, where you modify your projection matrix to render the image in large pieces, then later put then back together when you save your image.  This would allow for hardware accelerated rendering but still allow you to use the 'super-sized' backbuffers.Actually, one of the Game programming Gems books (I forget which one) has this as a gem in it - used for producing high resolution renders for magazine articles and suchlike.   ;Quote:Original post by Evil SteveQuote:Original post by Jason ZOne other option would be to perform tiled rendering, where you modify your projection matrix to render the image in large pieces, then later put then back together when you save your image.  This would allow for hardware accelerated rendering but still allow you to use the 'super-sized' backbuffers.Actually, one of the Game programming Gems books (I forget which one) has this as a gem in it - used for producing high resolution renders for magazine articles and suchlike.Yes, it was 1 or 2 - I don't recall which one either.  But they are both available online at Nvidia's website (hint hint [grin]).