radeonsi: take compute shader and dispatch indirect memory usage into account
authorMarek Olšák <marek.olsak@amd.com>
Fri, 29 Jul 2016 14:33:50 +0000 (16:33 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 6 Aug 2016 11:56:14 +0000 (13:56 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c

index e75f6bd2333e313aabe9b4f47a66544270860978..c3e8a35ba1d9aa60f8e9b9c2e836685cbf63952a 100644 (file)
@@ -462,6 +462,12 @@ static void si_launch_grid(
 
        si_decompress_compute_textures(sctx);
 
+       /* Add buffer sizes for memory checking in need_cs_space. */
+       r600_context_add_resource_size(ctx, &program->shader.bo->b.b);
+       if (info->indirect)
+               r600_context_add_resource_size(ctx, info->indirect);
+       /* TODO: add the scratch buffer */
+
        si_need_cs_space(sctx);
 
        if (!sctx->cs_shader_state.initialized)