From 0950086376b1c8b7fb89eda81ed7f2f06dee58bc Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 2 Jan 2012 01:13:15 +0100 Subject: gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Please see the diff for further info. This paves the way for moving user buffer uploads out of drivers and should allow to clean up the mess in u_upload_mgr in the meantime. For now only allowed for buffers on r300 and r600. Acked-by: Christian König --- src/gallium/include/pipe/p_defines.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gallium/include/pipe/p_defines.h') diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 3b3940db893..91d8b1e4525 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -225,6 +225,22 @@ enum pipe_transfer_usage { */ PIPE_TRANSFER_MAP_DIRECTLY = (1 << 2), + /** + * The transfer should map the resource storage directly and the GPU should + * be able to see what the CPU has written. Such a storage may stay mapped + * while issuing draw commands which use it. The only allowed usage is + * non-overlapping writes which are suballocated out of a big buffer. + * The minimum allowed alignment of suballocations is 256 bytes (this is + * a subject to change). + * The flag is intended to be used to avoid mapping and unmapping + * resources repeatedly when doing uploads and draws intermixed. + * + * The driver may return NULL if that isn't possible, and the state + * tracker needs to cope with that and use an alternative path + * without this flag. + */ + PIPE_TRANSFER_MAP_PERMANENTLY = (1 << 3), + /** * Discards the memory within the mapped region. * -- cgit v1.2.3