Mesa (master): dri_interface: add an error-returning version of createImageFromRenderbuffer

Nicolai Hähnle nh at kemper.freedesktop.org
Tue Oct 10 12:03:59 UTC 2017


Module: Mesa
Branch: master
Commit: f12e1c558614156fa1650abe4dc6b4ccec63bada
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f12e1c558614156fa1650abe4dc6b4ccec63bada

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Tue Oct 10 13:58:46 2017 +0200

dri_interface: add an error-returning version of createImageFromRenderbuffer

We ought to be able to distinguish between allocation errors and bad
parameters (non-existent renderbuffer object).

Bumps the version of the DRI Image extension to 17.

Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

---

 include/GL/internal/dri_interface.h | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 783ff1c70d..aefba92c02 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1180,7 +1180,7 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 16
+#define __DRI_IMAGE_VERSION 17
 
 /**
  * These formats correspond to the similarly named MESA_FORMAT_*
@@ -1377,6 +1377,7 @@ struct __DRIimageExtensionRec {
 				       int name, int pitch,
 				       void *loaderPrivate);
 
+    /* Deprecated since version 17; see createImageFromRenderbuffer2 */
     __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
 					       int renderbuffer,
 					       void *loaderPrivate);
@@ -1625,6 +1626,22 @@ struct __DRIimageExtensionRec {
    GLboolean (*queryDmaBufFormatModifierAttribs)(__DRIscreen *screen,
                                                  uint32_t fourcc, uint64_t modifier,
                                                  int attrib, uint64_t *value);
+
+   /**
+    * Create a DRI image from the given renderbuffer.
+    *
+    * \param context       the current DRI context
+    * \param renderbuffer  the GL name of the renderbuffer
+    * \param loaderPrivate for callbacks into the loader related to the image
+    * \param error         will be set to one of __DRI_IMAGE_ERROR_xxx
+    * \return the newly created image on success, or NULL otherwise
+    *
+    * \since 17
+    */
+    __DRIimage *(*createImageFromRenderbuffer2)(__DRIcontext *context,
+                                                int renderbuffer,
+                                                void *loaderPrivate,
+                                                unsigned *error);
 };
 
 




More information about the mesa-commit mailing list