diff options
author | Marek Olšák <[email protected]> | 2015-07-25 18:40:59 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-08-26 19:25:18 +0200 |
commit | 0fc21ecfc0891d239f20bf7724e51bc75503570c (patch) | |
tree | 19ffd27a9700601cae150dd229518637e369eb98 /src/gallium/include/pipe | |
parent | 7b5c92391f15533ec02327d617c4e8639a2f8bb4 (diff) |
gallium: add flags parameter to pipe_screen::context_create
This allows creating compute-only and debug contexts.
Reviewed-by: Brian Paul <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 15 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_screen.h | 11 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 4f2aa14e129..88e37e9f056 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -334,6 +334,21 @@ enum pipe_flush_flags #define PIPE_DEBUG_DEVICE_IS_HUNG (1 << 0) /** + * Create a compute-only context. Use in pipe_screen::context_create. + * This disables draw, blit, and clear*, render_condition, and other graphics + * functions. Interop with other graphics contexts is still allowed. + * This allows scheduling jobs on a compute-only hardware command queue that + * can run in parallel with graphics without stalling it. + */ +#define PIPE_CONTEXT_COMPUTE_ONLY (1 << 0) + +/** + * Gather debug information and expect that pipe_context::dump_debug_state + * will be called. Use in pipe_screen::context_create. + */ +#define PIPE_CONTEXT_DEBUG (1 << 1) + +/** * Flags for pipe_context::memory_barrier. */ #define PIPE_BARRIER_MAPPED_BUFFER (1 << 0) diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 0d2658313e5..a7b7b72ac89 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -125,8 +125,15 @@ struct pipe_screen { */ uint64_t (*get_timestamp)(struct pipe_screen *); - struct pipe_context * (*context_create)( struct pipe_screen *, - void *priv ); + /** + * Create a context. + * + * \param screen pipe screen + * \param priv a pointer to set in pipe_context::priv + * \param flags a mask of PIPE_CONTEXT_* flags + */ + struct pipe_context * (*context_create)(struct pipe_screen *screen, + void *priv, unsigned flags); /** * Check if the given pipe_format is supported as a texture or |