dri2: Add createContextAttribs entry point for DRISW version 3
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 1 Dec 2011 21:56:38 +0000 (13:56 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 23 Dec 2011 16:49:53 +0000 (08:49 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
include/GL/internal/dri_interface.h
src/mesa/drivers/dri/common/drisw_util.c

index add03c72147da2cdced5977f59b678ac64e1f127..b21445f104642f16c9e8dbb1b5913596b440fe63 100644 (file)
@@ -679,7 +679,7 @@ struct __DRIlegacyExtensionRec {
  * conjunction with the core extension.
  */
 #define __DRI_SWRAST "DRI_SWRast"
-#define __DRI_SWRAST_VERSION 2
+#define __DRI_SWRAST_VERSION 3
 
 struct __DRIswrastExtensionRec {
     __DRIextension base;
@@ -699,6 +699,22 @@ struct __DRIswrastExtensionRec {
                                            const __DRIconfig *config,
                                            __DRIcontext *shared,
                                            void *data);
+
+   /**
+    * Create a context for a particular API with a set of attributes
+    *
+    * \since version 3
+    *
+    * \sa __DRIdri2ExtensionRec::createContextAttribs
+    */
+   __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+                                        int api,
+                                        const __DRIconfig *config,
+                                        __DRIcontext *shared,
+                                        unsigned num_attribs,
+                                        const uint32_t *attribs,
+                                        unsigned *error,
+                                        void *loaderPrivate);
 };
 
 /**
@@ -859,6 +875,8 @@ struct __DRIdri2ExtensionRec {
     * Create a context for a particular API with a set of attributes
     *
     * \since version 3
+    *
+    * \sa __DRIswrastExtensionRec::createContextAttribs
     */
    __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
                                         int api,
index 614339eeb422a7347eae8346fed77be01a60b633..a19123f706429943e4aefeb97cd64a1002d11346 100644 (file)
@@ -288,8 +288,12 @@ const __DRIcoreExtension driCoreExtension = {
 };
 
 const __DRIswrastExtension driSWRastExtension = {
-    { __DRI_SWRAST, __DRI_SWRAST_VERSION },
+    /* Force the version to 2 because the underlying driver don't (can't!)
+     * support the extra requirements of CreateContextAttribs.
+     */
+    { __DRI_SWRAST, 2 },
     driCreateNewScreen,
     driCreateNewDrawable,
-    driCreateNewContextForAPI
+    driCreateNewContextForAPI,
+    NULL
 };