Windows ICD driver code (patch 1014800)
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 25 Aug 2004 14:59:45 +0000 (14:59 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 25 Aug 2004 14:59:45 +0000 (14:59 +0000)
Makefile.mgw
src/mesa/Makefile.mgw
src/mesa/drivers/windows/gdi/wgl.c
src/mesa/drivers/windows/icd/icd.c [new file with mode: 0644]
src/mesa/drivers/windows/icd/icdlist.h [new file with mode: 0644]
src/mesa/drivers/windows/icd/mesa.def [new file with mode: 0644]
src/mesa/main/glheader.h

index 2cd5d81cd383e55b08aec03fcac7f7e7b8f8b19d..762b05b7110d295fd78459f76b76016e80e666c9 100644 (file)
@@ -40,6 +40,9 @@
 #                      As a consequence, you'll need the Win32 Glide3
 #                      library to build any application.
 #                      default = no
+#      ICD=1           build the installable client driver interface
+#                      (windows opengl driver interface)
+#                      default = no
 #      X86=1           optimize for x86 (if possible, use MMX, SSE, 3DNow).
 #                      default = no
 #
index accfd1479c46a3a389d5b3f25efc9d43a2d88c1f..fd1e45fd66a16ee81c812bbebf2752072058eb03 100644 (file)
@@ -40,6 +40,9 @@
 #                      As a consequence, you'll need the Win32 Glide3
 #                      library to build any application.
 #                      default = no
+#      ICD=1           build the installable client driver interface
+#                      (windows opengl driver interface)
+#                      default = no
 #      X86=1           optimize for x86 (if possible, use MMX, SSE, 3DNow).
 #                      default = no
 #
 TOP = ../..
 GLIDE ?= $(TOP)/glide3
 LIBDIR = $(TOP)/lib
-GL_DLL = opengl32.dll
-GL_IMP = libopengl32.a
+ifeq ($(ICD),1)
+  GL_DLL = mesa32.dll
+  GL_IMP = libmesa32.a
+else
+  GL_DLL = opengl32.dll
+  GL_IMP = libopengl32.a
+endif
 
 LDLIBS = -lgdi32
 
@@ -66,12 +74,17 @@ CC = mingw32-gcc
 CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_MSC_VER
 CFLAGS += $(INCLUDE_DIRS)
 ifeq ($(FX),1)
-CFLAGS += -I$(GLIDE)/include -DFX
-LDLIBS += -L$(GLIDE)/lib -lglide3x
-GL_DEF = drivers/glide/fxopengl.def
-GL_RES = drivers/glide/fx.rc
+  CFLAGS += -I$(GLIDE)/include -DFX
+  LDLIBS += -L$(GLIDE)/lib -lglide3x
+  GL_DEF = drivers/glide/fxopengl.def
+  GL_RES = drivers/glide/fx.rc
 else
-GL_DEF = drivers/windows/gdi/mesa.def
+  ifeq ($(ICD),1)
+    CFLAGS += -DUSE_MGL_NAMESPACE
+    GL_DEF = drivers/windows/icd/mesa.def
+  else    
+    GL_DEF = drivers/windows/gdi/mesa.def
+  endif
 endif
 
 AR = ar
@@ -100,10 +113,16 @@ DRIVER_SOURCES = \
        $(GLIDE_DRIVER_SOURCES) \
        drivers/glide/fxwgl.c
 else
+ifeq ($(ICD),1)
+DRIVER_SOURCES = \
+       drivers/windows/gdi/wmesa.c \
+       drivers/windows/icd/icd.c
+else
 DRIVER_SOURCES = \
        drivers/windows/gdi/wmesa.c \
        drivers/windows/gdi/wgl.c
 endif
+endif
 
 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
 
@@ -161,5 +180,6 @@ clean:
        -$(call UNLINK,x86/*.o)
        -$(call UNLINK,drivers/common/*.o)
        -$(call UNLINK,drivers/windows/gdi/*.o)
+       -$(call UNLINK,drivers/windows/icd/*.o)
        -$(call UNLINK,drivers/glide/*.o)
        -$(call UNLINK,drivers/glide/*.res)
index cfcf65e67b65e84248913b601828ed199b09b42b..53850d1bdcef7a4e3cc18f48cc4e767b7f8633bf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: wgl.c,v 1.3 2004/01/07 12:34:28 dborca Exp $ */
+/* $Id: wgl.c,v 1.4 2004/08/25 14:59:45 brianp Exp $ */
 
 /*
 * This library is free software; you can redistribute it and/or
@@ -102,7 +102,7 @@ typedef struct {
 static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];
 
 static unsigned ctx_count = 0;
-static unsigned ctx_current = -1;
+static int ctx_current = -1;
 static unsigned curPFD = 0;
 
 WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)
diff --git a/src/mesa/drivers/windows/icd/icd.c b/src/mesa/drivers/windows/icd/icd.c
new file mode 100644 (file)
index 0000000..dfb8025
--- /dev/null
@@ -0,0 +1,332 @@
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version:  6.1\r
+ *\r
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/*\r
+ * File name: icd.c\r
+ * Author:    Gregor Anich <blight@blight.eu.org>\r
+ *\r
+ * ICD (Installable Client Driver) interface.\r
+ * Based on the windows GDI/WGL driver.\r
+ */\r
+\r
+#ifdef WIN32\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <windows.h>\r
+#define GL_GLEXT_PROTOTYPES\r
+#include "GL/gl.h"\r
+#include "GL/glext.h"\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#include <stdio.h>\r
+#include <tchar.h>\r
+#include "../gdi/wmesadef.h"\r
+#include "GL/wmesa.h"\r
+#include "mtypes.h"\r
+#include "glapi.h"\r
+\r
+#define MAX_MESA_ATTRS 20\r
+\r
+\r
+typedef struct _icdTable {\r
+    DWORD size;\r
+    PROC  table[336];\r
+} ICDTABLE, *PICDTABLE;\r
+\r
+static ICDTABLE icdTable = { 336, {\r
+#define ICD_ENTRY(func) (PROC)mgl##func,\r
+#include "icdlist.h"\r
+#undef ICD_ENTRY\r
+} };\r
+\r
+struct __pixelformat__\r
+{\r
+    PIXELFORMATDESCRIPTOR      pfd;\r
+    GLboolean doubleBuffered;\r
+};\r
+\r
+struct __pixelformat__ pix[] =\r
+{\r
+    /* Double Buffer, alpha */\r
+    {  {       sizeof(PIXELFORMATDESCRIPTOR),  1,\r
+        PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,\r
+        PFD_TYPE_RGBA,\r
+        24,    8,      0,      8,      8,      8,      16,     8,      24,\r
+        0,     0,      0,      0,      0,      16,     8,      0,      0,      0,      0,      0,      0 },\r
+        GL_TRUE\r
+    },\r
+    /* Single Buffer, alpha */\r
+    {  {       sizeof(PIXELFORMATDESCRIPTOR),  1,\r
+        PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */\r
+        PFD_TYPE_RGBA,\r
+        24,    8,      0,      8,      8,      8,      16,     8,      24,\r
+        0,     0,      0,      0,      0,      16,     8,      0,      0,      0,      0,      0,      0 },\r
+        GL_FALSE\r
+    },\r
+    /* Double Buffer, no alpha */\r
+    {  {       sizeof(PIXELFORMATDESCRIPTOR),  1,\r
+        PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,\r
+        PFD_TYPE_RGBA,\r
+        24,    8,      0,      8,      8,      8,      16,     0,      0,\r
+        0,     0,      0,      0,      0,      16,     8,      0,      0,      0,      0,      0,      0 },\r
+        GL_TRUE\r
+    },\r
+    /* Single Buffer, no alpha */\r
+    {  {       sizeof(PIXELFORMATDESCRIPTOR),  1,\r
+        PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */\r
+        PFD_TYPE_RGBA,\r
+        24,    8,      0,      8,      8,      8,      16,     0,      0,\r
+        0,     0,      0,      0,      0,      16,     8,      0,      0,      0,      0,      0,      0 },\r
+        GL_FALSE\r
+    },\r
+};\r
+\r
+int qt_pix = sizeof(pix) / sizeof(pix[0]);\r
+\r
+typedef struct {\r
+    WMesaContext ctx;\r
+    HDC hdc;\r
+} MesaWglCtx;\r
+\r
+#define MESAWGL_CTX_MAX_COUNT 20\r
+\r
+static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];\r
+\r
+static unsigned ctx_count = 0;\r
+static int ctx_current = -1;\r
+static unsigned curPFD = 0;\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)\r
+{\r
+    return(FALSE);\r
+}\r
+\r
+WGLAPI HGLRC GLAPIENTRY DrvCreateContext(HDC hdc)\r
+{\r
+    HWND               hWnd;\r
+    int i = 0;\r
+\r
+    if(!(hWnd = WindowFromDC(hdc)))\r
+    {\r
+        SetLastError(0);\r
+        return(NULL);\r
+    }\r
+    if (!ctx_count)\r
+    {\r
+       for(i=0;i<MESAWGL_CTX_MAX_COUNT;i++)\r
+       {\r
+               wgl_ctx[i].ctx = NULL;\r
+               wgl_ctx[i].hdc = NULL;\r
+       }\r
+    }\r
+    for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )\r
+    {\r
+        if ( wgl_ctx[i].ctx == NULL )\r
+        {\r
+            wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE,\r
+                pix[curPFD-1].doubleBuffered, \r
+                pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE);\r
+            if (wgl_ctx[i].ctx == NULL)\r
+                break;\r
+            wgl_ctx[i].hdc = hdc;\r
+            ctx_count++;\r
+            return ((HGLRC)wgl_ctx[i].ctx);\r
+        }\r
+    }\r
+    SetLastError(0);\r
+    return(NULL);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvDeleteContext(HGLRC hglrc)\r
+{\r
+    int i;\r
+    for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )\r
+    {\r
+       if ( wgl_ctx[i].ctx == (PWMC) hglrc )\r
+       {\r
+            WMesaMakeCurrent((PWMC) hglrc);\r
+            WMesaDestroyContext();\r
+            wgl_ctx[i].ctx = NULL;\r
+            wgl_ctx[i].hdc = NULL;\r
+            ctx_count--;\r
+            return(TRUE);\r
+       }\r
+    }\r
+    SetLastError(0);\r
+    return(FALSE);\r
+}\r
+\r
+WGLAPI HGLRC GLAPIENTRY DrvCreateLayerContext(HDC hdc,int iLayerPlane)\r
+{\r
+    if (iLayerPlane == 0)\r
+      return DrvCreateContext(hdc);\r
+    SetLastError(0);\r
+    return(NULL);\r
+}\r
+\r
+WGLAPI PICDTABLE GLAPIENTRY DrvSetContext(HDC hdc,HGLRC hglrc,void *callback)\r
+{\r
+    int i;\r
+\r
+    /* new code suggested by Andy Sy */\r
+    if (!hdc || !hglrc) {\r
+       WMesaMakeCurrent(NULL);\r
+       ctx_current = -1;\r
+       return NULL;\r
+    }\r
+\r
+    for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )\r
+    {\r
+        if ( wgl_ctx[i].ctx == (PWMC) hglrc )\r
+        {\r
+            wgl_ctx[i].hdc = hdc;\r
+            WMesaMakeCurrent( (PWMC) hglrc );\r
+            ctx_current = i;\r
+            return &icdTable;\r
+        }\r
+    }\r
+    return NULL;\r
+}\r
+\r
+WGLAPI void GLAPIENTRY DrvReleaseContext(HGLRC hglrc)\r
+{\r
+    WMesaMakeCurrent(NULL);\r
+    ctx_current = -1;\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvShareLists(HGLRC hglrc1,HGLRC hglrc2)\r
+{\r
+    return(TRUE);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvDescribeLayerPlane(HDC hdc,int iPixelFormat,\r
+                                    int iLayerPlane,UINT nBytes,\r
+                                    LPLAYERPLANEDESCRIPTOR plpd)\r
+{\r
+    SetLastError(0);\r
+    return(FALSE);\r
+}\r
+\r
+WGLAPI int GLAPIENTRY DrvSetLayerPaletteEntries(HDC hdc,int iLayerPlane,\r
+                                       int iStart,int cEntries,\r
+                                       CONST COLORREF *pcr)\r
+{\r
+    SetLastError(0);\r
+    return(0);\r
+}\r
+\r
+WGLAPI int GLAPIENTRY DrvGetLayerPaletteEntries(HDC hdc,int iLayerPlane,\r
+                                       int iStart,int cEntries,\r
+                                       COLORREF *pcr)\r
+{\r
+    SetLastError(0);\r
+    return(0);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize)\r
+{\r
+    SetLastError(0);\r
+    return(FALSE);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvSwapLayerBuffers(HDC hdc,UINT fuPlanes)\r
+{\r
+    if( !hdc )\r
+    {\r
+        WMesaSwapBuffers();\r
+        return(TRUE);\r
+    }\r
+    SetLastError(0);\r
+    return(FALSE);\r
+}\r
+\r
+WGLAPI int GLAPIENTRY DrvDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,\r
+                                    LPPIXELFORMATDESCRIPTOR ppfd)\r
+{\r
+    int                qt_valid_pix;\r
+\r
+    qt_valid_pix = qt_pix;\r
+    if(ppfd == NULL)\r
+       return(qt_valid_pix);\r
+    if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR))\r
+    {\r
+        SetLastError(0);\r
+        return(0);\r
+    }\r
+    *ppfd = pix[iPixelFormat - 1].pfd;\r
+    return(qt_valid_pix);\r
+}\r
+\r
+/*\r
+* GetProcAddress - return the address of an appropriate extension\r
+*/\r
+WGLAPI PROC GLAPIENTRY DrvGetProcAddress(LPCSTR lpszProc)\r
+{\r
+   PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc);\r
+   if (p)\r
+      return p;\r
+\r
+   SetLastError(0);\r
+   return(NULL);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvSetPixelFormat(HDC hdc,int iPixelFormat)\r
+{\r
+    int                qt_valid_pix;\r
+\r
+    qt_valid_pix = qt_pix;\r
+    if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix)\r
+    {\r
+        SetLastError(0);\r
+        return(FALSE);\r
+    }\r
+    curPFD = iPixelFormat;\r
+    return(TRUE);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvSwapBuffers(HDC hdc)\r
+{\r
+   if (ctx_current < 0)\r
+      return FALSE;\r
+\r
+   if(wgl_ctx[ctx_current].ctx == NULL) {\r
+      SetLastError(0);\r
+      return(FALSE);\r
+   }\r
+   WMesaSwapBuffers();\r
+   return(TRUE);\r
+}\r
+\r
+WGLAPI BOOL GLAPIENTRY DrvValidateVersion(DWORD version)\r
+{\r
+    return TRUE;\r
+}\r
+\r
+#endif /* WIN32 */\r
diff --git a/src/mesa/drivers/windows/icd/icdlist.h b/src/mesa/drivers/windows/icd/icdlist.h
new file mode 100644 (file)
index 0000000..1318804
--- /dev/null
@@ -0,0 +1,336 @@
+ICD_ENTRY(NewList)                             /* 0 */
+ICD_ENTRY(EndList)                             /* 1 */
+ICD_ENTRY(CallList)                            /* 2 */
+ICD_ENTRY(CallLists)                           /* 3 */
+ICD_ENTRY(DeleteLists)                 /* 4 */
+ICD_ENTRY(GenLists)                            /* 5 */
+ICD_ENTRY(ListBase)                            /* 6 */
+ICD_ENTRY(Begin)                                       /* 7 */
+ICD_ENTRY(Bitmap)                                      /* 8 */
+ICD_ENTRY(Color3b)                             /* 9 */
+ICD_ENTRY(Color3bv)                            /* 10 */
+ICD_ENTRY(Color3d)                             /* 11 */
+ICD_ENTRY(Color3dv)                            /* 12 */
+ICD_ENTRY(Color3f)                             /* 13 */
+ICD_ENTRY(Color3fv)                            /* 14 */
+ICD_ENTRY(Color3i)                             /* 15 */
+ICD_ENTRY(Color3iv)                            /* 16 */
+ICD_ENTRY(Color3s)                             /* 17 */
+ICD_ENTRY(Color3sv)                            /* 18 */
+ICD_ENTRY(Color3ub)                            /* 19 */
+ICD_ENTRY(Color3ubv)                           /* 20 */
+ICD_ENTRY(Color3ui)                            /* 21 */
+ICD_ENTRY(Color3uiv)                           /* 22 */
+ICD_ENTRY(Color3us)                            /* 23 */
+ICD_ENTRY(Color3usv)                           /* 24 */
+ICD_ENTRY(Color4b)                             /* 25 */
+ICD_ENTRY(Color4bv)                            /* 26 */
+ICD_ENTRY(Color4d)                             /* 27 */
+ICD_ENTRY(Color4dv)                            /* 28 */
+ICD_ENTRY(Color4f)                             /* 29 */
+ICD_ENTRY(Color4fv)                            /* 30 */
+ICD_ENTRY(Color4i)                             /* 31 */
+ICD_ENTRY(Color4iv)                            /* 32 */
+ICD_ENTRY(Color4s)                             /* 33 */
+ICD_ENTRY(Color4sv)                            /* 34 */
+ICD_ENTRY(Color4ub)                            /* 35 */
+ICD_ENTRY(Color4ubv)                           /* 36 */
+ICD_ENTRY(Color4ui)                            /* 37 */
+ICD_ENTRY(Color4uiv)                           /* 38 */
+ICD_ENTRY(Color4us)                            /* 39 */
+ICD_ENTRY(Color4usv)                           /* 40 */
+ICD_ENTRY(EdgeFlag)                            /* 41 */
+ICD_ENTRY(EdgeFlagv)                           /* 42 */
+ICD_ENTRY(End)                                 /* 43 */
+ICD_ENTRY(Indexd)                                      /* 44 */
+ICD_ENTRY(Indexdv)                             /* 45 */
+ICD_ENTRY(Indexf)                                      /* 46 */
+ICD_ENTRY(Indexfv)                             /* 47 */
+ICD_ENTRY(Indexi)                                      /* 48 */
+ICD_ENTRY(Indexiv)                             /* 49 */
+ICD_ENTRY(Indexs)                                      /* 50 */
+ICD_ENTRY(Indexsv)                             /* 51 */
+ICD_ENTRY(Normal3b)                            /* 52 */
+ICD_ENTRY(Normal3bv)                           /* 53 */
+ICD_ENTRY(Normal3d)                            /* 54 */
+ICD_ENTRY(Normal3dv)                           /* 55 */
+ICD_ENTRY(Normal3f)                            /* 56 */
+ICD_ENTRY(Normal3fv)                           /* 57 */
+ICD_ENTRY(Normal3i)                            /* 58 */
+ICD_ENTRY(Normal3iv)                           /* 59 */
+ICD_ENTRY(Normal3s)                            /* 60 */
+ICD_ENTRY(Normal3sv)                           /* 61 */
+ICD_ENTRY(RasterPos2d)                 /* 62 */
+ICD_ENTRY(RasterPos2dv)                        /* 63 */
+ICD_ENTRY(RasterPos2f)                 /* 64 */
+ICD_ENTRY(RasterPos2fv)                        /* 65 */
+ICD_ENTRY(RasterPos2i)                 /* 66 */
+ICD_ENTRY(RasterPos2iv)                        /* 67 */
+ICD_ENTRY(RasterPos2s)                 /* 68 */
+ICD_ENTRY(RasterPos2sv)                        /* 69 */
+ICD_ENTRY(RasterPos3d)                 /* 70 */
+ICD_ENTRY(RasterPos3dv)                        /* 71 */
+ICD_ENTRY(RasterPos3f)                 /* 72 */
+ICD_ENTRY(RasterPos3fv)                        /* 73 */
+ICD_ENTRY(RasterPos3i)                 /* 74 */
+ICD_ENTRY(RasterPos3iv)                        /* 75 */
+ICD_ENTRY(RasterPos3s)                 /* 76 */
+ICD_ENTRY(RasterPos3sv)                        /* 77 */
+ICD_ENTRY(RasterPos4d)                 /* 78 */
+ICD_ENTRY(RasterPos4dv)                        /* 79 */
+ICD_ENTRY(RasterPos4f)                 /* 80 */
+ICD_ENTRY(RasterPos4fv)                        /* 81 */
+ICD_ENTRY(RasterPos4i)                 /* 82 */
+ICD_ENTRY(RasterPos4iv)                        /* 83 */
+ICD_ENTRY(RasterPos4s)                 /* 84 */
+ICD_ENTRY(RasterPos4sv)                        /* 85 */
+ICD_ENTRY(Rectd)                                       /* 86 */
+ICD_ENTRY(Rectdv)                                      /* 87 */
+ICD_ENTRY(Rectf)                                       /* 88 */
+ICD_ENTRY(Rectfv)                                      /* 89 */
+ICD_ENTRY(Recti)                                       /* 90 */
+ICD_ENTRY(Rectiv)                                      /* 91 */
+ICD_ENTRY(Rects)                                       /* 92 */
+ICD_ENTRY(Rectsv)                                      /* 93 */
+ICD_ENTRY(TexCoord1d)                          /* 94 */
+ICD_ENTRY(TexCoord1dv)                 /* 95 */
+ICD_ENTRY(TexCoord1f)                          /* 96 */
+ICD_ENTRY(TexCoord1fv)                 /* 97 */
+ICD_ENTRY(TexCoord1i)                          /* 98 */
+ICD_ENTRY(TexCoord1iv)                 /* 99 */
+ICD_ENTRY(TexCoord1s)                          /* 100 */
+ICD_ENTRY(TexCoord1sv)                 /* 101 */
+ICD_ENTRY(TexCoord2d)                          /* 102 */
+ICD_ENTRY(TexCoord2dv)                 /* 103 */
+ICD_ENTRY(TexCoord2f)                          /* 104 */
+ICD_ENTRY(TexCoord2fv)                 /* 105 */
+ICD_ENTRY(TexCoord2i)                          /* 106 */
+ICD_ENTRY(TexCoord2iv)                 /* 107 */
+ICD_ENTRY(TexCoord2s)                          /* 108 */
+ICD_ENTRY(TexCoord2sv)                 /* 109 */
+ICD_ENTRY(TexCoord3d)                          /* 110 */
+ICD_ENTRY(TexCoord3dv)                 /* 111 */
+ICD_ENTRY(TexCoord3f)                          /* 112 */
+ICD_ENTRY(TexCoord3fv)                 /* 113 */
+ICD_ENTRY(TexCoord3i)                          /* 114 */
+ICD_ENTRY(TexCoord3iv)                 /* 115 */
+ICD_ENTRY(TexCoord3s)                          /* 116 */
+ICD_ENTRY(TexCoord3sv)                 /* 117 */
+ICD_ENTRY(TexCoord4d)                          /* 118 */
+ICD_ENTRY(TexCoord4dv)                 /* 119 */
+ICD_ENTRY(TexCoord4f)                          /* 120 */
+ICD_ENTRY(TexCoord4fv)                 /* 121 */
+ICD_ENTRY(TexCoord4i)                          /* 122 */
+ICD_ENTRY(TexCoord4iv)                 /* 123 */
+ICD_ENTRY(TexCoord4s)                          /* 124 */
+ICD_ENTRY(TexCoord4sv)                 /* 125 */
+ICD_ENTRY(Vertex2d)                            /* 126 */
+ICD_ENTRY(Vertex2dv)                           /* 127 */
+ICD_ENTRY(Vertex2f)                            /* 128 */
+ICD_ENTRY(Vertex2fv)                           /* 129 */
+ICD_ENTRY(Vertex2i)                            /* 130 */
+ICD_ENTRY(Vertex2iv)                           /* 131 */
+ICD_ENTRY(Vertex2s)                            /* 132 */
+ICD_ENTRY(Vertex2sv)                           /* 133 */
+ICD_ENTRY(Vertex3d)                            /* 134 */
+ICD_ENTRY(Vertex3dv)                           /* 135 */
+ICD_ENTRY(Vertex3f)                            /* 136 */
+ICD_ENTRY(Vertex3fv)                           /* 137 */
+ICD_ENTRY(Vertex3i)                            /* 138 */
+ICD_ENTRY(Vertex3iv)                           /* 139 */
+ICD_ENTRY(Vertex3s)                            /* 140 */
+ICD_ENTRY(Vertex3sv)                           /* 141 */
+ICD_ENTRY(Vertex4d)                            /* 142 */
+ICD_ENTRY(Vertex4dv)                           /* 143 */
+ICD_ENTRY(Vertex4f)                            /* 144 */
+ICD_ENTRY(Vertex4fv)                           /* 145 */
+ICD_ENTRY(Vertex4i)                            /* 146 */
+ICD_ENTRY(Vertex4iv)                           /* 147 */
+ICD_ENTRY(Vertex4s)                            /* 148 */
+ICD_ENTRY(Vertex4sv)                           /* 149 */
+ICD_ENTRY(ClipPlane)                           /* 150 */
+ICD_ENTRY(ColorMaterial)                       /* 151 */
+ICD_ENTRY(CullFace)                            /* 152 */
+ICD_ENTRY(Fogf)                                        /* 153 */
+ICD_ENTRY(Fogfv)                                       /* 154 */
+ICD_ENTRY(Fogi)                                        /* 155 */
+ICD_ENTRY(Fogiv)                                       /* 156 */
+ICD_ENTRY(FrontFace)                           /* 157 */
+ICD_ENTRY(Hint)                                        /* 158 */
+ICD_ENTRY(Lightf)                                      /* 159 */
+ICD_ENTRY(Lightfv)                             /* 160 */
+ICD_ENTRY(Lighti)                                      /* 161 */
+ICD_ENTRY(Lightiv)                             /* 162 */
+ICD_ENTRY(LightModelf)                 /* 163 */
+ICD_ENTRY(LightModelfv)                        /* 164 */
+ICD_ENTRY(LightModeli)                 /* 165 */
+ICD_ENTRY(LightModeliv)                        /* 166 */
+ICD_ENTRY(LineStipple)                 /* 167 */
+ICD_ENTRY(LineWidth)                           /* 168 */
+ICD_ENTRY(Materialf)                           /* 169 */
+ICD_ENTRY(Materialfv)                          /* 170 */
+ICD_ENTRY(Materiali)                           /* 171 */
+ICD_ENTRY(Materialiv)                          /* 172 */
+ICD_ENTRY(PointSize)                           /* 173 */
+ICD_ENTRY(PolygonMode)                 /* 174 */
+ICD_ENTRY(PolygonStipple)                      /* 175 */
+ICD_ENTRY(Scissor)                             /* 176 */
+ICD_ENTRY(ShadeModel)                          /* 177 */
+ICD_ENTRY(TexParameterf)                       /* 178 */
+ICD_ENTRY(TexParameterfv)                      /* 179 */
+ICD_ENTRY(TexParameteri)                       /* 180 */
+ICD_ENTRY(TexParameteriv)                      /* 181 */
+ICD_ENTRY(TexImage1D)                          /* 182 */
+ICD_ENTRY(TexImage2D)                          /* 183 */
+ICD_ENTRY(TexEnvf)                             /* 184 */
+ICD_ENTRY(TexEnvfv)                            /* 185 */
+ICD_ENTRY(TexEnvi)                             /* 186 */
+ICD_ENTRY(TexEnviv)                            /* 187 */
+ICD_ENTRY(TexGend)                             /* 188 */
+ICD_ENTRY(TexGendv)                            /* 189 */
+ICD_ENTRY(TexGenf)                             /* 190 */
+ICD_ENTRY(TexGenfv)                            /* 191 */
+ICD_ENTRY(TexGeni)                             /* 192 */
+ICD_ENTRY(TexGeniv)                            /* 193 */
+ICD_ENTRY(FeedbackBuffer)                      /* 194 */
+ICD_ENTRY(SelectBuffer)                        /* 195 */
+ICD_ENTRY(RenderMode)                          /* 196 */
+ICD_ENTRY(InitNames)                           /* 197 */
+ICD_ENTRY(LoadName)                            /* 198 */
+ICD_ENTRY(PassThrough)                 /* 199 */
+ICD_ENTRY(PopName)                             /* 200 */
+ICD_ENTRY(PushName)                            /* 201 */
+ICD_ENTRY(DrawBuffer)                          /* 202 */
+ICD_ENTRY(Clear)                                       /* 203 */
+ICD_ENTRY(ClearAccum)                          /* 204 */
+ICD_ENTRY(ClearIndex)                          /* 205 */
+ICD_ENTRY(ClearColor)                          /* 206 */
+ICD_ENTRY(ClearStencil)                        /* 207 */
+ICD_ENTRY(ClearDepth)                          /* 208 */
+ICD_ENTRY(StencilMask)                 /* 209 */
+ICD_ENTRY(ColorMask)                           /* 210 */
+ICD_ENTRY(DepthMask)                           /* 211 */
+ICD_ENTRY(IndexMask)                           /* 212 */
+ICD_ENTRY(Accum)                                       /* 213 */
+ICD_ENTRY(Disable)                             /* 214 */
+ICD_ENTRY(Enable)                                      /* 215 */
+ICD_ENTRY(Finish)                                      /* 216 */
+ICD_ENTRY(Flush)                                       /* 217 */
+ICD_ENTRY(PopAttrib)                           /* 218 */
+ICD_ENTRY(PushAttrib)                          /* 219 */
+ICD_ENTRY(Map1d)                                       /* 220 */
+ICD_ENTRY(Map1f)                                       /* 221 */
+ICD_ENTRY(Map2d)                                       /* 222 */
+ICD_ENTRY(Map2f)                                       /* 223 */
+ICD_ENTRY(MapGrid1d)                           /* 224 */
+ICD_ENTRY(MapGrid1f)                           /* 225 */
+ICD_ENTRY(MapGrid2d)                           /* 226 */
+ICD_ENTRY(MapGrid2f)                           /* 227 */
+ICD_ENTRY(EvalCoord1d)                 /* 228 */
+ICD_ENTRY(EvalCoord1dv)                        /* 229 */
+ICD_ENTRY(EvalCoord1f)                 /* 230 */
+ICD_ENTRY(EvalCoord1fv)                        /* 231 */
+ICD_ENTRY(EvalCoord2d)                 /* 232 */
+ICD_ENTRY(EvalCoord2dv)                        /* 233 */
+ICD_ENTRY(EvalCoord2f)                 /* 234 */
+ICD_ENTRY(EvalCoord2fv)                        /* 235 */
+ICD_ENTRY(EvalMesh1)                           /* 236 */
+ICD_ENTRY(EvalPoint1)                          /* 237 */
+ICD_ENTRY(EvalMesh2)                           /* 238 */
+ICD_ENTRY(EvalPoint2)                          /* 239 */
+ICD_ENTRY(AlphaFunc)                           /* 240 */
+ICD_ENTRY(BlendFunc)                           /* 241 */
+ICD_ENTRY(LogicOp)                             /* 242 */
+ICD_ENTRY(StencilFunc)                 /* 243 */
+ICD_ENTRY(StencilOp)                           /* 244 */
+ICD_ENTRY(DepthFunc)                           /* 245 */
+ICD_ENTRY(PixelZoom)                           /* 246 */
+ICD_ENTRY(PixelTransferf)                      /* 247 */
+ICD_ENTRY(PixelTransferi)                      /* 248 */
+ICD_ENTRY(PixelStoref)                 /* 249 */
+ICD_ENTRY(PixelStorei)                 /* 250 */
+ICD_ENTRY(PixelMapfv)                          /* 251 */
+ICD_ENTRY(PixelMapuiv)                 /* 252 */
+ICD_ENTRY(PixelMapusv)                 /* 253 */
+ICD_ENTRY(ReadBuffer)                          /* 254 */
+ICD_ENTRY(CopyPixels)                          /* 255 */
+ICD_ENTRY(ReadPixels)                          /* 256 */
+ICD_ENTRY(DrawPixels)                          /* 257 */
+ICD_ENTRY(GetBooleanv)                 /* 258 */
+ICD_ENTRY(GetClipPlane)                        /* 259 */
+ICD_ENTRY(GetDoublev)                          /* 260 */
+ICD_ENTRY(GetError)                            /* 261 */
+ICD_ENTRY(GetFloatv)                           /* 262 */
+ICD_ENTRY(GetIntegerv)                 /* 263 */
+ICD_ENTRY(GetLightfv)                          /* 264 */
+ICD_ENTRY(GetLightiv)                          /* 265 */
+ICD_ENTRY(GetMapdv)                            /* 266 */
+ICD_ENTRY(GetMapfv)                            /* 267 */
+ICD_ENTRY(GetMapiv)                            /* 268 */
+ICD_ENTRY(GetMaterialfv)                       /* 269 */
+ICD_ENTRY(GetMaterialiv)                       /* 270 */
+ICD_ENTRY(GetPixelMapfv)                       /* 271 */
+ICD_ENTRY(GetPixelMapuiv)                      /* 272 */
+ICD_ENTRY(GetPixelMapusv)                      /* 273 */
+ICD_ENTRY(GetPolygonStipple)           /* 274 */
+ICD_ENTRY(GetString)                           /* 275 */
+ICD_ENTRY(GetTexEnvfv)                 /* 276 */
+ICD_ENTRY(GetTexEnviv)                 /* 277 */
+ICD_ENTRY(GetTexGendv)                 /* 278 */
+ICD_ENTRY(GetTexGenfv)                 /* 279 */
+ICD_ENTRY(GetTexGeniv)                 /* 280 */
+ICD_ENTRY(GetTexImage)                 /* 281 */
+ICD_ENTRY(GetTexParameterfv)           /* 282 */
+ICD_ENTRY(GetTexParameteriv)           /* 283 */
+ICD_ENTRY(GetTexLevelParameterfv)      /* 284 */
+ICD_ENTRY(GetTexLevelParameteriv)      /* 285 */
+ICD_ENTRY(IsEnabled)                           /* 286 */
+ICD_ENTRY(IsList)                                      /* 287 */
+ICD_ENTRY(DepthRange)                          /* 288 */
+ICD_ENTRY(Frustum)                             /* 289 */
+ICD_ENTRY(LoadIdentity)                        /* 290 */
+ICD_ENTRY(LoadMatrixf)                 /* 291 */
+ICD_ENTRY(LoadMatrixd)                 /* 292 */
+ICD_ENTRY(MatrixMode)                          /* 293 */
+ICD_ENTRY(MultMatrixf)                 /* 294 */
+ICD_ENTRY(MultMatrixd)                 /* 295 */
+ICD_ENTRY(Ortho)                                       /* 296 */
+ICD_ENTRY(PopMatrix)                           /* 297 */
+ICD_ENTRY(PushMatrix)                          /* 298 */
+ICD_ENTRY(Rotated)                             /* 299 */
+ICD_ENTRY(Rotatef)                             /* 300 */
+ICD_ENTRY(Scaled)                                      /* 301 */
+ICD_ENTRY(Scalef)                                      /* 302 */
+ICD_ENTRY(Translated)                          /* 303 */
+ICD_ENTRY(Translatef)                          /* 304 */
+ICD_ENTRY(Viewport)                            /* 305 */
+ICD_ENTRY(ArrayElement)                        /* 306 */
+ICD_ENTRY(BindTexture)                 /* 307 */
+ICD_ENTRY(ColorPointer)                        /* 308 */
+ICD_ENTRY(DisableClientState)          /* 309 */
+ICD_ENTRY(DrawArrays)                          /* 310 */
+ICD_ENTRY(DrawElements)                        /* 311 */
+ICD_ENTRY(EdgeFlagPointer)             /* 312 */
+ICD_ENTRY(EnableClientState)           /* 313 */
+ICD_ENTRY(IndexPointer)                        /* 314 */
+ICD_ENTRY(Indexub)                             /* 315 */
+ICD_ENTRY(Indexubv)                            /* 316 */
+ICD_ENTRY(InterleavedArrays)           /* 317 */
+ICD_ENTRY(NormalPointer)                       /* 318 */
+ICD_ENTRY(PolygonOffset)                       /* 319 */
+ICD_ENTRY(TexCoordPointer)             /* 320 */
+ICD_ENTRY(VertexPointer)                       /* 321 */
+ICD_ENTRY(AreTexturesResident) /* 322 */
+ICD_ENTRY(CopyTexImage1D)                      /* 323 */
+ICD_ENTRY(CopyTexImage2D)                      /* 324 */
+ICD_ENTRY(CopyTexSubImage1D)           /* 325 */
+ICD_ENTRY(CopyTexSubImage2D)           /* 326 */
+ICD_ENTRY(DeleteTextures)                      /* 327 */
+ICD_ENTRY(GenTextures)                 /* 328 */
+ICD_ENTRY(GetPointerv)                 /* 329 */
+ICD_ENTRY(IsTexture)                           /* 330 */
+ICD_ENTRY(PrioritizeTextures)          /* 331 */
+ICD_ENTRY(TexSubImage1D)                       /* 332 */
+ICD_ENTRY(TexSubImage2D)                       /* 333 */
+ICD_ENTRY(PopClientAttrib)             /* 334 */
+ICD_ENTRY(PushClientAttrib)            /* 335 */
diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def
new file mode 100644 (file)
index 0000000..bbb8245
--- /dev/null
@@ -0,0 +1,109 @@
+DESCRIPTION 'Mesa (OpenGL driver) for Win32'\r
+VERSION 6.1\r
+\r
+EXPORTS\r
+;\r
+; ICD API\r
+       DrvCopyContext\r
+       DrvCreateContext\r
+       DrvCreateLayerContext\r
+       DrvDeleteContext\r
+       DrvDescribeLayerPlane\r
+       DrvDescribePixelFormat\r
+       DrvGetLayerPaletteEntries\r
+       DrvGetProcAddress\r
+       DrvReleaseContext\r
+       DrvRealizeLayerPalette\r
+       DrvSetContext\r
+       DrvSetLayerPaletteEntries\r
+       DrvSetPixelFormat\r
+       DrvShareLists\r
+       DrvSwapBuffers\r
+       DrvSwapLayerBuffers\r
+       DrvValidateVersion\r
+\r
+;\r
+; Mesa internals - mostly for OSMESA\r
+       _ac_CreateContext\r
+       _ac_DestroyContext\r
+       _ac_InvalidateState\r
+       _glapi_get_context\r
+       _glapi_get_proc_address\r
+       _mesa_buffer_data\r
+       _mesa_buffer_map\r
+       _mesa_buffer_subdata\r
+       _mesa_bzero\r
+       _mesa_calloc\r
+       _mesa_choose_tex_format\r
+       _mesa_compressed_texture_size\r
+       _mesa_create_framebuffer\r
+       _mesa_create_visual\r
+       _mesa_delete_buffer_object\r
+       _mesa_delete_texture_object\r
+       _mesa_destroy_framebuffer\r
+       _mesa_destroy_visual\r
+       _mesa_enable_1_3_extensions\r
+       _mesa_enable_1_4_extensions\r
+       _mesa_enable_1_5_extensions\r
+       _mesa_enable_sw_extensions\r
+       _mesa_error\r
+       _mesa_free\r
+       _mesa_free_context_data\r
+       _mesa_get_current_context\r
+       _mesa_init_default_imports\r
+       _mesa_initialize_context\r
+       _mesa_make_current\r
+       _mesa_memcpy\r
+       _mesa_memset\r
+       _mesa_new_buffer_object\r
+       _mesa_new_texture_object\r
+       _mesa_problem\r
+       _mesa_ResizeBuffersMESA\r
+       _mesa_store_compressed_teximage1d\r
+       _mesa_store_compressed_teximage2d\r
+       _mesa_store_compressed_teximage3d\r
+       _mesa_store_compressed_texsubimage1d\r
+       _mesa_store_compressed_texsubimage2d\r
+       _mesa_store_compressed_texsubimage3d\r
+       _mesa_store_teximage1d\r
+       _mesa_store_teximage2d\r
+       _mesa_store_teximage3d\r
+       _mesa_store_texsubimage1d\r
+       _mesa_store_texsubimage2d\r
+       _mesa_store_texsubimage3d\r
+       _mesa_strcmp\r
+       _mesa_test_proxy_teximage\r
+       _mesa_Viewport\r
+       _swrast_Accum\r
+       _swrast_alloc_buffers\r
+       _swrast_Bitmap\r
+       _swrast_CopyPixels\r
+       _swrast_DrawBuffer\r
+       _swrast_DrawPixels\r
+       _swrast_GetDeviceDriverReference\r
+       _swrast_Clear\r
+       _swrast_choose_line\r
+       _swrast_choose_triangle\r
+       _swrast_CopyColorSubTable\r
+       _swrast_CopyColorTable\r
+       _swrast_CopyConvolutionFilter1D\r
+       _swrast_CopyConvolutionFilter2D\r
+       _swrast_copy_teximage1d\r
+       _swrast_copy_teximage2d\r
+       _swrast_copy_texsubimage1d\r
+       _swrast_copy_texsubimage2d\r
+       _swrast_copy_texsubimage3d\r
+       _swrast_CreateContext\r
+       _swrast_DestroyContext\r
+       _swrast_InvalidateState\r
+       _swrast_ReadPixels\r
+       _swrast_zbuffer_address\r
+       _swsetup_Wakeup\r
+       _swsetup_CreateContext\r
+       _swsetup_DestroyContext\r
+       _swsetup_InvalidateState\r
+       _tnl_CreateContext\r
+       _tnl_DestroyContext\r
+       _tnl_InvalidateState\r
+       _tnl_MakeCurrent\r
+       _tnl_run_pipeline\r
index 23956fdcf076ed145f7155307d93232bf49efbb7..c548ed70800d4cb2967c144bb63d320be62791e9 100644 (file)
 #endif
 
 #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
-#  pragma warning( disable : 4068 ) /* unknown pragma */
-#  pragma warning( disable : 4710 ) /* function 'foo' not inlined */
-#  pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
-#  pragma warning( disable : 4127 ) /* conditional expression is constant */
-#  if defined(MESA_MINWARN)
-#    pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
-#    pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
-#    pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
-#    pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
-#    pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
+#  if !defined(__GNUC__) /* mingw environment */
+#    pragma warning( disable : 4068 ) /* unknown pragma */
+#    pragma warning( disable : 4710 ) /* function 'foo' not inlined */
+#    pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
+#    pragma warning( disable : 4127 ) /* conditional expression is constant */
+#    if defined(MESA_MINWARN)
+#      pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
+#      pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
+#      pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
+#      pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
+#      pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
+#    endif
 #  endif
 #  if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
 #    define GLAPI __declspec(dllexport)