diff options
author | Dave Airlie <[email protected]> | 2017-04-18 10:21:59 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-04-19 09:00:43 +1000 |
commit | 25a5ee391d786b6d0b48b2b9aa0553e6972d97a0 (patch) | |
tree | ef9eb964cbe1f7768e0d8d52fe44234e2dabffbd /src/amd/vulkan/radv_pipeline.c | |
parent | d0991b135b90b5ce90da51b6d4db7302ddd65a24 (diff) |
radv/ac: add support for indirect access of descriptor sets.
We want to expose more descriptor sets to the applications,
but currently we have a 1:1 mapping between shader descriptor
sets and 2 user sgprs, limiting us to 4 per stage. This commit
check if we don't have enough user sgprs for the number of
bound sets for this shader, we can ask for them to be indirected.
Two sgprs are then used to point to a buffer or 64-bit pointers
to the number of allocated descriptor sets. All shaders point
to the same buffer.
We can use some user sgprs to inline one or two descriptor sets
in future, but until we have a workload that needs this I don't
think we should spend too much time on it.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index cf11362eade..8e71d59fae7 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2112,6 +2112,12 @@ radv_pipeline_init(struct radv_pipeline *pipeline, calculate_pa_cl_vs_out_cntl(pipeline); calculate_ps_inputs(pipeline); + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (pipeline->shaders[i]) { + pipeline->need_indirect_descriptor_sets |= pipeline->shaders[i]->info.need_indirect_descriptor_sets; + } + } + uint32_t stages = 0; if (radv_pipeline_has_tess(pipeline)) { stages |= S_028B54_LS_EN(V_028B54_LS_STAGE_ON) | @@ -2270,6 +2276,7 @@ static VkResult radv_compute_pipeline_create( pipeline->layout, NULL); + pipeline->need_indirect_descriptor_sets |= pipeline->shaders[MESA_SHADER_COMPUTE]->info.need_indirect_descriptor_sets; result = radv_pipeline_scratch_init(device, pipeline); if (result != VK_SUCCESS) { radv_pipeline_destroy(device, pipeline, pAllocator); |