Module: wine Branch: master Commit: 97c4ab23ab25d8c943dc1ece4f5637a8a99d4be7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=97c4ab23ab25d8c943dc1ece4f...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Sep 21 15:47:22 2010 +0200
wined3d: Reduce the size of a huge function that takes ages to compile.
---
dlls/wined3d/directx.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index ff41438..e8bbe77 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2188,6 +2188,23 @@ static const struct blit_shader *select_blit_implementation(struct wined3d_adapt else return &ffp_blit; }
+static void load_gl_funcs(struct wined3d_gl_info *gl_info, DWORD gl_version) +{ + DWORD ver; + +#define USE_GL_FUNC(type, pfn, ext, replace) \ + if (gl_info->supported[ext]) gl_info->pfn = (type)pwglGetProcAddress(#pfn); \ + else if ((ver = ver_for_ext(ext)) && ver <= gl_version) gl_info->pfn = (type)pwglGetProcAddress(#replace); \ + else gl_info->pfn = NULL; + + GL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC + +#define USE_GL_FUNC(type, pfn, ext, replace) gl_info->pfn = (type)pwglGetProcAddress(#pfn); + WGL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC +} + /* Context activation is done by the caller. */ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter) { @@ -2322,19 +2339,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter) }
/* Now work out what GL support this card really has */ -#define USE_GL_FUNC(type, pfn, ext, replace) \ -{ \ - DWORD ver = ver_for_ext(ext); \ - if (gl_info->supported[ext]) gl_info->pfn = (type)pwglGetProcAddress(#pfn); \ - else if (ver && ver <= gl_version) gl_info->pfn = (type)pwglGetProcAddress(#replace); \ - else gl_info->pfn = NULL; \ -} - GL_EXT_FUNCS_GEN; -#undef USE_GL_FUNC - -#define USE_GL_FUNC(type, pfn, ext, replace) gl_info->pfn = (type)pwglGetProcAddress(#pfn); - WGL_EXT_FUNCS_GEN; -#undef USE_GL_FUNC + load_gl_funcs( gl_info, gl_version );
ENTER_GL();