wined3d: Store the number of aux buffers in the context.
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 @@
}
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 @@
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 @@
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 @@
/* 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 @@
HDC hdc;
HPBUFFERARB pbuffer;
BOOL isPBuffer;
+ GLint aux_buffers;
};
typedef enum ContextUsage {