[PATCH] winex11: Implement WGL_ARB_create_context_no_error.

Henri Verbeet hverbeet at codeweavers.com
Wed Jan 24 10:33:22 CST 2018


Mostly because it's easy, and we'd like to use this from wined3d at some
point.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
Note that this requires an update of the OpenGL extension list to build.
---
 dlls/opengl32/make_opengl |  1 +
 dlls/winex11.drv/opengl.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl
index d5d614b6138..ebdca671757 100755
--- a/dlls/opengl32/make_opengl
+++ b/dlls/opengl32/make_opengl
@@ -369,6 +369,7 @@ my %remapped_wgl_functions =
 my %supported_wgl_extensions =
    (
     "WGL_ARB_create_context" => 1,
+    "WGL_ARB_create_context_no_error" => 1,
     "WGL_ARB_create_context_profile" => 1,
     "WGL_ARB_extensions_string" => 1,
     "WGL_ARB_make_current_read" => 1,
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index e6652867800..e976ad7067b 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -163,6 +163,8 @@ typedef XID GLXPbuffer;
 #define GLX_CONTEXT_MAJOR_VERSION_ARB     0x2091
 #define GLX_CONTEXT_MINOR_VERSION_ARB     0x2092
 #define GLX_CONTEXT_FLAGS_ARB             0x2094
+/** GLX_ARB_create_context_no_error */
+#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB   0x31B3
 /** GLX_ARB_create_context_profile */
 #define GLX_CONTEXT_PROFILE_MASK_ARB      0x9126
 /** GLX_ATI_pixel_format_float */
@@ -2118,6 +2120,12 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg
                     pContextAttribList += 2;
                     ret->numAttribs++;
                     break;
+                case WGL_CONTEXT_OPENGL_NO_ERROR_ARB:
+                    pContextAttribList[0] = GLX_CONTEXT_OPENGL_NO_ERROR_ARB;
+                    pContextAttribList[1] = attribList[1];
+                    pContextAttribList += 2;
+                    ret->numAttribs++;
+                    break;
                 case WGL_CONTEXT_PROFILE_MASK_ARB:
                     pContextAttribList[0] = GLX_CONTEXT_PROFILE_MASK_ARB;
                     pContextAttribList[1] = attribList[1];
@@ -3179,6 +3187,8 @@ static void X11DRV_WineGL_LoadExtensions(void)
         register_extension( "WGL_ARB_create_context" );
         opengl_funcs.ext.p_wglCreateContextAttribsARB = X11DRV_wglCreateContextAttribsARB;
 
+        if (has_extension( WineGLInfo.glxExtensions, "GLX_ARB_create_context_no_error" ))
+            register_extension( "WGL_ARB_create_context_no_error" );
         if (has_extension( WineGLInfo.glxExtensions, "GLX_ARB_create_context_profile"))
             register_extension("WGL_ARB_create_context_profile");
     }
-- 
2.11.0




More information about the wine-devel mailing list