summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2016-06-25 22:06:09 -0400
committerJan Vesely <[email protected]>2016-07-14 16:04:50 -0400
commit489bb5473b96a22ae445107297b66bc38b4701f7 (patch)
treeb5c6815ecb631ad6b28655efc2b6e83263f7b7b3 /src/gallium
parent33eddde4a7823e3f0276cda160bbd8c0b07a4769 (diff)
r600,compute: Reserve vtx 3 for kernel arguments
Using vtx 0 does not work for dynamic offsets. v2: add explanatory comment Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/evergreen_compute.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 6dd6e748a1b..b711786da29 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -369,7 +369,11 @@ static void evergreen_compute_upload_input(struct pipe_context *ctx,
ctx->transfer_unmap(ctx, transfer);
- /* ID=0 is reserved for the parameters */
+ /* ID=0 and ID=3 are reserved for the parameters.
+ * LLVM will preferably use ID=0, but it does not work for dynamic
+ * indices. */
+ evergreen_cs_set_vertex_buffer(rctx, 3, 0,
+ (struct pipe_resource*)shader->kernel_param);
evergreen_cs_set_constant_buffer(rctx, 0, 0, input_size,
(struct pipe_resource*)shader->kernel_param);
}
@@ -615,9 +619,9 @@ static void evergreen_set_compute_resources(struct pipe_context *ctx,
start, count);
for (unsigned i = 0; i < count; i++) {
- /* The First three vertex buffers are reserved for parameters and
+ /* The First four vertex buffers are reserved for parameters and
* global buffers. */
- unsigned vtx_id = 3 + i;
+ unsigned vtx_id = 4 + i;
if (resources[i]) {
struct r600_resource_global *buffer =
(struct r600_resource_global*)