summaryrefslogtreecommitdiff
path: root/include/GL
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2019-08-12 12:07:05 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2019-08-13 14:40:14 +0200
commitbd08a83b09bf708fe727decb84bd5f5fddc2fab3 (patch)
tree19562c48c3b620d1106aa9e17f3af798b49a59b4 /include/GL
parentb4345da8762e18af16c52465d636021115c041cf (diff)
downloadmesa-bd08a83b09bf708fe727decb84bd5f5fddc2fab3.tar.gz
mesa-bd08a83b09bf708fe727decb84bd5f5fddc2fab3.tar.bz2
mesa-bd08a83b09bf708fe727decb84bd5f5fddc2fab3.zip
dri_interface: add DRI2_BufferDamage interface
Add a new DRI2_BufferDamage interface to support the EGL_KHR_partial_update extension, informing the driver of an overriding scissor region for a particular drawable. Based on a commit originally authored by: Harish Krupo <harish.krupo.kps@intel.com> renamed extension, retargeted at DRI drawable instead of context, rewritten description Signed-off-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Qiang Yu <yuq825@gmail.com> Tested-by: Qiang Yu <yuq825@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'include/GL')
-rw-r--r--include/GL/internal/dri_interface.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index af0ee9c5667..9f5bc7c569e 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -85,6 +85,7 @@ typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
typedef struct __DRI2fenceExtensionRec __DRI2fenceExtension;
typedef struct __DRI2interopExtensionRec __DRI2interopExtension;
typedef struct __DRI2blobExtensionRec __DRI2blobExtension;
+typedef struct __DRI2bufferDamageExtensionRec __DRI2bufferDamageExtension;
typedef struct __DRIimageLoaderExtensionRec __DRIimageLoaderExtension;
typedef struct __DRIimageDriverExtensionRec __DRIimageDriverExtension;
@@ -488,6 +489,48 @@ struct __DRI2interopExtensionRec {
struct mesa_glinterop_export_out *out);
};
+
+/**
+ * Extension for limiting window system back buffer rendering to user-defined
+ * scissor region.
+ */
+
+#define __DRI2_BUFFER_DAMAGE "DRI2_BufferDamage"
+#define __DRI2_BUFFER_DAMAGE_VERSION 1
+
+struct __DRI2bufferDamageExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Provides an array of rectangles representing an overriding scissor region
+ * for rendering operations performed to the specified drawable. These
+ * rectangles do not replace client API scissor regions or draw
+ * co-ordinates, but instead inform the driver of the overall bounds of all
+ * operations which will be issued before the next flush.
+ *
+ * Any rendering operations writing pixels outside this region to the
+ * drawable will have an undefined effect on the entire drawable.
+ *
+ * This entrypoint may only be called after the drawable has either been
+ * newly created or flushed, and before any rendering operations which write
+ * pixels to the drawable. Calling this entrypoint at any other time will
+ * have an undefined effect on the entire drawable.
+ *
+ * Calling this entrypoint with @nrects 0 and @rects NULL will reset the
+ * region to the buffer's full size. This entrypoint may be called once to
+ * reset the region, followed by a second call with a populated region,
+ * before a rendering call is made.
+ *
+ * Used to implement EGL_KHR_partial_update.
+ *
+ * \param drawable affected drawable
+ * \param nrects number of rectangles provided
+ * \param rects the array of rectangles, lower-left origin
+ */
+ void (*set_damage_region)(__DRIdrawable *drawable, unsigned int nrects,
+ int *rects);
+};
+
/*@}*/
/**