From a038bcbaf66dafba0749e1f715d7caaf3edb5617 Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Mon, 22 Mar 2004 21:46:25 +0000 Subject: [PATCH] Fixed the sluggishness with LoadSurfaceFromSurface. The filter flag needs to be set to none. --- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 35f88524dd..03d14e23dd 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -3190,7 +3190,10 @@ copy_texture(Texture *tex, const DisplayRegion *dr) { // now copy from fb to tex //hr = _pD3DDevice->UpdateSurface(pCurRenderTarget,&SrcRect,pTexSurfaceLev0,NULL); - hr = D3DXLoadSurfaceFromSurface(pTexSurfaceLev0, NULL, NULL, pCurRenderTarget, NULL, &SrcRect, D3DX_DEFAULT, 0); + // the following call does what we want. Interesting though, why Dx9 took out the + // functionality of copying from VRAM to VRAM and put it in D3DX library. Perhaps + // to promote D3DX!? + hr = D3DXLoadSurfaceFromSurface(pTexSurfaceLev0, NULL, NULL, pCurRenderTarget, NULL, &SrcRect, D3DX_FILTER_NONE, 0); if(FAILED(hr)) { dxgsg9_cat.error() << "UpdateSurface failed in copy_texture" << D3DERRORSTRING(hr);