gallium: add indirect compute parameters to pipe_grid_info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 18 Jan 2016 15:19:32 +0000 (16:19 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 13 Feb 2016 14:51:17 +0000 (15:51 +0100)
Like indirect draw, we need to store a resource and an offset that
needs to be 4 byte aligned. When indirect is used, the size of the
grid (in blocks) is stored with three 32-bit integers.

Changes from v2:
 - s/most values/block sizes/

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/include/pipe/p_state.h

index 5d0ebca1a3fab57dc2b723c6f7e0471b5b08776d..5209afe4ad61b50d253294ceac5f80ad9a26dca5 100644 (file)
@@ -704,6 +704,18 @@ struct pipe_grid_info
     * Determine the layout of the grid (in block units) to be used.
     */
    uint grid[3];
+
+   /* Indirect compute parameters resource: If not NULL, block sizes are taken
+    * from this buffer instead, which is laid out as follows:
+    *
+    *  struct {
+    *     uint32_t num_blocks_x;
+    *     uint32_t num_blocks_y;
+    *     uint32_t num_blocks_z;
+    *  };
+    */
+   struct pipe_resource *indirect;
+   unsigned indirect_offset; /**< must be 4 byte aligned */
 };
 
 /**