Stefan Dösinger : wined3d: Store the number of aux buffers in the context.

Alexandre Julliard julliard at winehq.org
Wed Apr 9 05:31:35 CDT 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Apr  8 14:20:27 2008 +0200

wined3d: Store the number of aux buffers in the context.

---

 dlls/wined3d/context.c         |    3 +++
 dlls/wined3d/device.c          |    2 +-
 dlls/wined3d/directx.c         |    4 ----
 dlls/wined3d/surface.c         |    4 ++--
 dlls/wined3d/wined3d_private.h |    1 +
 include/wine/wined3d_gl.h      |    1 -
 6 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index d20f5f2..fb96584 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -362,6 +362,9 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
     }
 
     ENTER_GL();
+
+    glGetIntegerv(GL_AUX_BUFFERS, &ret->aux_buffers);
+
     TRACE("Setting up the screen\n");
     /* Clear the screen */
     glClearColor(1.0, 0.0, 0.0, 0.0);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c594460..8e1e24a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2157,7 +2157,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
 
         case ORM_BACKBUFFER:
         {
-            if(GL_LIMITS(aux_buffers) > 0) {
+            if(This->activeContext->aux_buffers > 0) {
                 TRACE("Using auxilliary buffer for offscreen rendering\n");
                 This->offscreenBuffer = GL_AUX0;
             } else {
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 4a9bbed..320456c 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -724,10 +724,6 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
     gl_info->max_pointsize = gl_floatv[1];
     TRACE_(d3d_caps)("Maximum point size support - max point size=%f\n", gl_floatv[1]);
 
-    glGetIntegerv(GL_AUX_BUFFERS, &gl_max);
-    gl_info->max_aux_buffers = gl_max;
-    TRACE_(d3d_caps)("Offscreen rendering support - number of aux buffers=%d\n", gl_max);
-
     /* Parse the gl supported features, in theory enabling parts of our code appropriately */
     GL_Extensions = (const char *) glGetString(GL_EXTENSIONS);
     TRACE_(d3d_caps)("GL_Extensions reported:\n");
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3eeaaa3..90a05d1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2757,10 +2757,10 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
     /* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring.
      * This way we don't have to wait for the 2nd readback to finish to leave this function.
      */
-    if(GL_LIMITS(aux_buffers) >= 2) {
+    if(myDevice->activeContext->aux_buffers >= 2) {
         /* Got more than one aux buffer? Use the 2nd aux buffer */
         drawBuffer = GL_AUX1;
-    } else if((swapchain || myDevice->offscreenBuffer == GL_BACK) && GL_LIMITS(aux_buffers) >= 1) {
+    } else if((swapchain || myDevice->offscreenBuffer == GL_BACK) && myDevice->activeContext->aux_buffers >= 1) {
         /* Only one aux buffer, but it isn't used (Onscreen rendering, or non-aux orm)? Use it! */
         drawBuffer = GL_AUX0;
     }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 652d86d..19ad58d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -620,6 +620,7 @@ struct WineD3DContext {
     HDC                     hdc;
     HPBUFFERARB             pbuffer;
     BOOL                    isPBuffer;
+    GLint                   aux_buffers;
 };
 
 typedef enum ContextUsage {
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index 43d82e0..02432db 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -3824,7 +3824,6 @@ typedef struct _WineD3D_GL_Info {
   float  max_pointsize, max_pointsizemin;
   UINT   max_blends;
   UINT   max_anisotropy;
-  UINT   max_aux_buffers;
   UINT   max_glsl_varyings;
   float  max_shininess;
 




More information about the wine-cvs mailing list