[Mesa-dev] [PATCH 2/4] gallium: Plumb the swap INVALIDATE_ANCILLARY flag through more layers.
Eric Anholt
eric at anholt.net
Fri Dec 26 10:45:52 PST 2014
---
src/gallium/include/pipe/p_defines.h | 3 ++-
src/gallium/include/state_tracker/st_api.h | 1 +
src/gallium/state_trackers/dri/dri_drawable.c | 2 ++
src/mesa/state_tracker/st_manager.c | 3 +++
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 6c5703a..89f0065 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -322,7 +322,8 @@ enum pipe_transfer_usage {
* Flags for the flush function.
*/
enum pipe_flush_flags {
- PIPE_FLUSH_END_OF_FRAME = (1 << 0)
+ PIPE_FLUSH_END_OF_FRAME = (1 << 0),
+ PIPE_FLUSH_INVALIDATE_ANCILLARY = (1 << 1),
};
/**
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 86fdc69..2b42ac5 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -159,6 +159,7 @@ enum st_context_resource_type {
*/
#define ST_FLUSH_FRONT (1 << 0)
#define ST_FLUSH_END_OF_FRAME (1 << 1)
+#define ST_FLUSH_INVALIDATE_ANCILLARY (1 << 2)
/**
* Value to st_manager->get_param function.
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index b7df053..668cfb8 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -491,6 +491,8 @@ dri_flush(__DRIcontext *cPriv,
flush_flags |= ST_FLUSH_FRONT;
if (reason == __DRI2_THROTTLE_SWAPBUFFER)
flush_flags |= ST_FLUSH_END_OF_FRAME;
+ if (flags & __DRI2_FLUSH_INVALIDATE_ANCILLARY)
+ flush_flags |= ST_FLUSH_INVALIDATE_ANCILLARY;
/* Flush the context and throttle if needed. */
if (dri_screen(ctx->sPriv)->throttling_enabled &&
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 606d678..10839eb 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -499,6 +499,9 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
if (flags & ST_FLUSH_END_OF_FRAME) {
pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
}
+ if (flags & ST_FLUSH_INVALIDATE_ANCILLARY) {
+ pipe_flags |= PIPE_FLUSH_INVALIDATE_ANCILLARY;
+ }
st_flush(st, fence, pipe_flags);
if (flags & ST_FLUSH_FRONT)
--
2.1.3
More information about the mesa-dev
mailing list