diff options
author | Samuel Pitoiset <[email protected]> | 2016-01-12 18:00:00 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2016-02-13 15:51:17 +0100 |
commit | bfd695e1d2975e5dd5363c2e7fcc3084a28457aa (patch) | |
tree | 2947d36a5610ca0686b4e3d1100aa00e145a2045 /src/gallium/include | |
parent | 61ed09c7ea41e559219c772f18ea00942d54d30a (diff) |
gallium: add a new interface for pipe_context::launch_grid()
This introduces pipe_grid_info which contains all information to
describe a launch_grid call. This will be used to implement indirect
compute in the same fashion as indirect draw.
Changes from v2:
- correctly initialize pipe_grid_info for nv50/nvc0
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_context.h | 17 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 27 |
2 files changed, 29 insertions, 15 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 6c95b7b2178..78706f77479 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -48,6 +48,7 @@ struct pipe_constant_buffer; struct pipe_debug_callback; struct pipe_depth_stencil_alpha_state; struct pipe_draw_info; +struct pipe_grid_info; struct pipe_fence_handle; struct pipe_framebuffer_state; struct pipe_image_view; @@ -618,23 +619,9 @@ struct pipe_context { /** * Launch the compute kernel starting from instruction \a pc of the * currently bound compute program. - * - * \a grid_layout and \a block_layout are arrays of size \a - * PIPE_COMPUTE_CAP_GRID_DIMENSION that determine the layout of the - * grid (in block units) and working block (in thread units) to be - * used, respectively. - * - * \a pc For drivers that use PIPE_SHADER_IR_LLVM as their prefered IR, - * this value will be the index of the kernel in the opencl.kernels - * metadata list. - * - * \a input will be used to initialize the INPUT resource, and it - * should point to a buffer of at least - * pipe_compute_state::req_input_mem bytes. */ void (*launch_grid)(struct pipe_context *context, - const uint *block_layout, const uint *grid_layout, - uint32_t pc, const void *input); + const struct pipe_grid_info *info); /*@}*/ /** diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index ed62a33ad72..5d0ebca1a3f 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -678,6 +678,33 @@ struct pipe_blit_info boolean alpha_blend; /* dst.rgb = src.rgb * src.a + dst.rgb * (1 - src.a) */ }; +/** + * Information to describe a launch_grid call. + */ +struct pipe_grid_info +{ + /** + * For drivers that use PIPE_SHADER_IR_LLVM as their prefered IR, this value + * will be the index of the kernel in the opencl.kernels metadata list. + */ + uint32_t pc; + + /** + * Will be used to initialize the INPUT resource, and it should point to a + * buffer of at least pipe_compute_state::req_input_mem bytes. + */ + void *input; + + /** + * Determine the layout of the working block (in thread units) to be used. + */ + uint block[3]; + + /** + * Determine the layout of the grid (in block units) to be used. + */ + uint grid[3]; +}; /** * Structure used as a header for serialized LLVM programs. |