v2: Instead of telling the driver that the window system ancillaries have
been invalidated (when the driver doesn't know which of its buffers
are the window system's!), introduce a method for invalidating
specific surfaces.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
*/
void (*flush_resource)(struct pipe_context *ctx,
struct pipe_resource *resource);
+
+ /**
+ * Invalidate the contents of the resource.
+ *
+ * This is used to implement EGL's semantic of undefined depth/stencil
+ * contenst after a swapbuffers. This allows a tiled renderer (for
+ * example) to not store the depth buffer.
+ */
+ void (*invalidate_resource)(struct pipe_context *ctx,
+ struct pipe_resource *resource);
+
};
}
pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
+
+ if (pipe->invalidate_resource &&
+ (flags & __DRI2_FLUSH_INVALIDATE_ANCILLARY)) {
+ pipe->invalidate_resource(pipe, drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]);
+ pipe->invalidate_resource(pipe, drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL]);
+ }
}
flush_flags = 0;