Add dri2::{Allocate,Release}Buffer extension
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 4 Feb 2011 10:59:12 +0000 (11:59 +0100)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Mon, 7 Feb 2011 12:52:28 +0000 (13:52 +0100)
include/GL/internal/dri_interface.h
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h

index 03515267733cf77e2f606e0ffe6a5e66f9032cda..2fb729afcdfca68ed37513336f033af79783a14f 100644 (file)
@@ -786,6 +786,14 @@ struct __DRIdri2ExtensionRec {
                                           const __DRIconfig *config,
                                           __DRIcontext *shared,
                                           void *data);
+
+   __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+                                 unsigned int attachment,
+                                 unsigned int format,
+                                 int width,
+                                 int height);
+   void (*releaseBuffer)(__DRIscreen *screen,
+                        __DRIbuffer *buffer);
 };
 
 
index bf8cf6eec07e312529346b5a6790293d33771943..82638fa72079a06f0990f9d017448cc652248e00 100644 (file)
@@ -481,6 +481,22 @@ dri2CreateNewDrawable(__DRIscreen *screen,
     return pdraw;
 }
 
+static __DRIbuffer *
+dri2AllocateBuffer(__DRIscreen *screen,
+                  unsigned int attachment, unsigned int format,
+                  int width, int height)
+{
+    return (*screen->DriverAPI.AllocateBuffer)(screen, attachment, format,
+                                              width, height);
+}
+
+static void
+dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+{
+   (*screen->DriverAPI.ReleaseBuffer)(screen, buffer);
+}
+
+
 static int
 dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
 {
@@ -930,7 +946,9 @@ const __DRIdri2Extension driDRI2Extension = {
     dri2CreateNewDrawable,
     dri2CreateNewContext,
     dri2GetAPIMask,
-    dri2CreateNewContextForAPI
+    dri2CreateNewContextForAPI,
+    dri2AllocateBuffer,
+    dri2ReleaseBuffer
 };
 
 const __DRI2configQueryExtension dri2ConfigQueryExtension = {
index ffffb99b30147802bdf20320dcbbf0fff08690d2..3d3d5c9cd24267f816bf2988d6cd67cb69554b0a 100644 (file)
@@ -223,6 +223,12 @@ struct __DriverAPIRec {
 
     /* DRI2 Entry point */
     const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
+
+    __DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
+                                   unsigned int attachment,
+                                   unsigned int format,
+                                   int width, int height);
+    void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
 };
 
 extern const struct __DriverAPIRec driDriverAPI;