summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_shader_info.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-09-03 18:20:07 +0200
committerSamuel Pitoiset <[email protected]>2019-09-06 15:52:24 +0200
commitf31fb334324b0f586db82df363966e494ddd1a6c (patch)
tree707c74800b2923a0aab437637581269cef24545e /src/amd/vulkan/radv_shader_info.c
parent7fa00e178f871f48972ecb9947e04a2b2db16f81 (diff)
radv: calculate esgs_itemsize in the shader info pass
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_shader_info.c')
-rw-r--r--src/amd/vulkan/radv_shader_info.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c
index 065cec3e0e7..1ff429e63fd 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -753,4 +753,24 @@ radv_nir_shader_info_pass(const struct nir_shader *nir,
info->gs.max_gsvs_emit_size =
info->gs.gsvs_vertex_size * nir->info.gs.vertices_out;
}
+
+ /* Compute the ESGS item size for VS or TES as ES. */
+ if ((nir->info.stage == MESA_SHADER_VERTEX ||
+ nir->info.stage == MESA_SHADER_TESS_EVAL) &&
+ options->key.vs_common_out.as_es) {
+ struct radv_es_output_info *es_info =
+ nir->info.stage == MESA_SHADER_VERTEX ? &info->vs.es_info : &info->tes.es_info;
+ uint32_t max_output_written = 0;
+
+ uint64_t output_mask = nir->info.outputs_written;
+ while (output_mask) {
+ const int i = u_bit_scan64(&output_mask);
+ unsigned param_index = shader_io_get_unique_index(i);
+
+ max_output_written = MAX2(param_index, max_output_written);
+ }
+
+ es_info->esgs_itemsize = (max_output_written + 1) * 16;
+ }
+
}