aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_glsl_to_nir.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-12-20 13:30:04 -0800
committerEric Anholt <[email protected]>2020-01-21 10:06:23 -0800
commitd5a3971457b8a9d5269050c5aa1d09a6197b5eef (patch)
tree70838a4354f1081225b8549e73ce6e0db7f0ee33 /src/mesa/state_tracker/st_glsl_to_nir.cpp
parent10dc4ac4c5d6dbe3df1f2b75229804e7aa5f86f1 (diff)
gallium: Pack the atomic counters just above the SSBOs.
We carve out half the SSBO space for atomics, and we were just binding them way up there. freedreno was then using a remapping table to map the sparse buffer index back down, since space in the descriptor array is a shared resource that may limit parallelism. That remapping table generated inside of the ir3 compiler is getting thoroughly in the way of implementing vulkan descriptor sets. We will be able to get rid of the freedreno's remapping table, and hopefully save shared resources on other hardware, by packing the atomics tightly above the SSBOs (like i965 does). We already rebind the shader buffers on program change if either the old or new program has SSBOs or ABOs, so this doesn't necessarily increase the program state change cost (the only cost increase I can come up with is if you're using the same atomic counter without rebinding it across changes of programs with varying SSBO counts, meaning it would now bounce around index space). Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3240>
Diffstat (limited to 'src/mesa/state_tracker/st_glsl_to_nir.cpp')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index d19398bd4b9..fadd1b4ba81 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -504,8 +504,7 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog,
nir_remove_dead_variables(nir, mask);
if (!st->has_hw_atomics)
- NIR_PASS_V(nir, nir_lower_atomics_to_ssbo,
- st->ctx->Const.Program[nir->info.stage].MaxShaderStorageBlocks);
+ NIR_PASS_V(nir, nir_lower_atomics_to_ssbo, prog->info.num_ssbos);
st_finalize_nir_before_variants(nir);