glx/dri2: add and use new driver hook flush_with_flags

This commit is contained in:
Marek Olšák
2012-11-23 18:31:42 +01:00
parent 5b7e9b7360
commit 4a486f8bf2
5 changed files with 123 additions and 53 deletions

View File

@@ -267,7 +267,13 @@ struct __DRItexBufferExtensionRec {
* Used by drivers that implement DRI2
*/
#define __DRI2_FLUSH "DRI2_Flush"
#define __DRI2_FLUSH_VERSION 3
#define __DRI2_FLUSH_VERSION 4
#define __DRI2_FLUSH_DRAWABLE (1 << 0) /* the drawable should be flushed. */
#define __DRI2_FLUSH_CONTEXT (1 << 1) /* glFlush should be called */
enum __DRI2throttleReason;
struct __DRI2flushExtensionRec {
__DRIextension base;
void (*flush)(__DRIdrawable *drawable);
@@ -281,6 +287,27 @@ struct __DRI2flushExtensionRec {
* \since 3
*/
void (*invalidate)(__DRIdrawable *drawable);
/**
* This function reduces the number of flushes in the driver by combining
* several operations into one call.
*
* It can:
* - throttle
* - flush a drawable
* - flush a context
*
* \param context the context
* \param drawable the drawable to flush
* \param flags a combination of _DRI2_FLUSH_xxx flags
* \param throttle_reason the reason for throttling, 0 = no throttling
*
* \since 4
*/
void (*flush_with_flags)(__DRIcontext *ctx,
__DRIdrawable *drawable,
unsigned flags,
enum __DRI2throttleReason throttle_reason);
};