Stefan Dösinger : wined3d: Honor pbos when downloading a compressed texture.

Alexandre Julliard julliard at winehq.org
Mon Oct 29 08:34:48 CDT 2007


Module: wine
Branch: master
Commit: 58ed14eb52392ee8902863e020d030b9e1bb460b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=58ed14eb52392ee8902863e020d030b9e1bb460b

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Sep 28 14:39:24 2007 +0200

wined3d: Honor pbos when downloading a compressed texture.

---

 dlls/wined3d/surface.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 06d5aa6..43cf3a5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -47,8 +47,17 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
             TRACE("(%p) : Calling glGetCompressedTexImageARB level %d, format %#x, type %#x, data %p\n", This, This->glDescription.level,
                 This->glDescription.glFormat, This->glDescription.glType, This->resource.allocatedMemory);
 
-            GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, This->resource.allocatedMemory));
-            checkGLcall("glGetCompressedTexImageARB()");
+            if(This->Flags & SFLAG_PBO) {
+                GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
+                checkGLcall("glBindBufferARB");
+                GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, NULL));
+                checkGLcall("glGetCompressedTexImageARB()");
+                GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0));
+                checkGLcall("glBindBufferARB");
+            } else {
+                GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, This->resource.allocatedMemory));
+                checkGLcall("glGetCompressedTexImageARB()");
+            }
         }
     } else {
         void *mem;




More information about the wine-cvs mailing list