summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-12 18:00:00 +0100
committerSamuel Pitoiset <[email protected]>2016-02-13 15:51:17 +0100
commitbfd695e1d2975e5dd5363c2e7fcc3084a28457aa (patch)
tree2947d36a5610ca0686b4e3d1100aa00e145a2045 /src/gallium/state_trackers/clover
parent61ed09c7ea41e559219c772f18ea00942d54d30a (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/state_trackers/clover')
-rw-r--r--src/gallium/state_trackers/clover/core/kernel.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index a226ec1a752..41b38521474 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -55,6 +55,7 @@ kernel::launch(command_queue &q,
const auto reduced_grid_size =
map(divides(), grid_size, block_size);
void *st = exec.bind(&q, grid_offset);
+ struct pipe_grid_info info;
// The handles are created during exec_context::bind(), so we need make
// sure to call exec_context::bind() before retrieving them.
@@ -74,11 +75,13 @@ kernel::launch(command_queue &q,
q.pipe->set_global_binding(q.pipe, 0, exec.g_buffers.size(),
exec.g_buffers.data(), g_handles.data());
- q.pipe->launch_grid(q.pipe,
- pad_vector(q, block_size, 1).data(),
- pad_vector(q, reduced_grid_size, 1).data(),
- find(name_equals(_name), m.syms).offset,
- exec.input.data());
+ // Fill information for the launch_grid() call.
+ info.block = pad_vector(q, block_size, 1).data(),
+ info.grid = pad_vector(q, reduced_grid_size, 1).data(),
+ info.pc = find(name_equals(_name), m.sysm).offset;
+ info.input = exec.input.data();
+
+ q.pipe->launch_grid(q.pipe, &info);
q.pipe->set_global_binding(q.pipe, 0, exec.g_buffers.size(), NULL, NULL);
q.pipe->set_compute_resources(q.pipe, 0, exec.resources.size(), NULL);