diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:38:48 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-03 19:39:31 +0100 |
commit | a92d76e9e09bf6cef477255abc197b147f4359b5 (patch) | |
tree | efa220779b56996af8405fc9efd3953550a380a2 | |
parent | 12d8f2d15903c84c64e880918e731dc94aa55696 (diff) |
gallium: add PIPE_FLUSH_{TOP,BOTTOM}_OF_PIPE bits
These bits are intended to be used by the ddebug hang detection and are
named in analogy to the Vulkan stage bits (and the corresponding Radeon
pipeline event).
Hang detection needs fences on the granularity of individual commands,
which nothing else really covers. The closest alternative would have
been PIPE_QUERY_GPU_FINISHED, but (a) queries are a per-context object
and we really want a per-screen object, (b) queries don't offer a
wait with timeout, and (c) in any case, PIPE_QUERY_GPU_FINISHED is
meant to imply that GPU caches are flushed, which the new bits
explicitly aren't.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/gallium/docs/source/context.rst | 14 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index 8182220372..8aee21b2ed 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -530,6 +530,20 @@ which use this flag must implement pipe_context::fence_server_sync. PIPE_FLUSH_HINT_FINISH: Hints to the driver that the caller will immediately wait for the returned fence. +Additional flags may be set together with ``PIPE_FLUSH_DEFERRED`` for even +finer-grained fences. Note that as a general rule, GPU caches may not have been +flushed yet when these fences are signaled. Drivers are free to ignore these +flags and create normal fences instead. At most one of the following flags can +be specified: + +PIPE_FLUSH_TOP_OF_PIPE: The fence should be signaled as soon as the next +command is ready to start executing at the top of the pipeline, before any of +its data is actually read (including indirect draw parameters). + +PIPE_FLUSH_BOTTOM_OF_PIPE: The fence should be signaled as soon as the previous +command has finished executing on the GPU entirely (but data written by the +command may still be in caches and inaccessible to the CPU). + ``flush_resource`` diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 70af2878d3..09ee71aaa3 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -354,6 +354,8 @@ enum pipe_flush_flags PIPE_FLUSH_FENCE_FD = (1 << 2), PIPE_FLUSH_ASYNC = (1 << 3), PIPE_FLUSH_HINT_FINISH = (1 << 4), + PIPE_FLUSH_TOP_OF_PIPE = (1 << 5), + PIPE_FLUSH_BOTTOM_OF_PIPE = (1 << 6), }; /** |