summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-11-14 11:13:02 -0800
committerTimothy Arceri <tarceri@itsqueeze.com>2017-03-16 14:14:18 +1100
commite043b2a1a0c5863585b45fa8fe58b90d6445dc0e (patch)
treee696679fccd5f21d7d692435c42aab3facf2a1ec /include
parente1f9e9bafdb6da44c6bd6be8414913e481f8b031 (diff)
dri_interface: Add new marshalling interfaces to dri_interface.h
Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Acked-by: Marek Olšák <maraeo@gmail.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Mike Lothian <mike@fireburn.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/GL/internal/dri_interface.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 53fac6fc3c..86efd1bdc9 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1683,4 +1683,43 @@ struct __DRIimageDriverExtensionRec {
__DRIgetAPIMaskFunc getAPIMask;
};
+/**
+ * Background callable loader extension.
+ *
+ * Loaders expose this extension to indicate to drivers that they are capable
+ * of handling callbacks from the driver's background drawing threads.
+ */
+#define __DRI_BACKGROUND_CALLABLE "DRI_BackgroundCallable"
+#define __DRI_BACKGROUND_CALLABLE_VERSION 1
+
+typedef struct __DRIbackgroundCallableExtensionRec __DRIbackgroundCallableExtension;
+struct __DRIbackgroundCallableExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Indicate that this thread is being used by the driver as a background
+ * drawing thread which may make callbacks to the loader.
+ *
+ * \param loaderPrivate is the value that was passed to to the driver when
+ * the context was created. This can be used by the loader to identify
+ * which context any callbacks are associated with.
+ *
+ * If this function is called more than once from any given thread, each
+ * subsequent call overrides the loaderPrivate data that was passed in the
+ * previous call. The driver can take advantage of this to re-use a
+ * background thread to perform drawing on behalf of multiple contexts.
+ *
+ * It is permissible for the driver to call this function from a
+ * non-background thread (i.e. a thread that has already been bound to a
+ * context using __DRIcoreExtensionRec::bindContext()); when this happens,
+ * the \c loaderPrivate pointer must be equal to the pointer that was
+ * passed to the driver when the currently bound context was created.
+ *
+ * This call should execute quickly enough that the driver can call it with
+ * impunity whenever a background thread starts performing drawing
+ * operations (e.g. it should just set a thread-local variable).
+ */
+ void (*setBackgroundContext)(void *loaderPrivate);
+};
+
#endif