aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2020-06-17 15:18:06 +0200
committerNeil Roberts <[email protected]>2020-06-22 08:23:06 +0200
commited29b576cbc1da8eb0d1fa3483104bbf61e73ccf (patch)
tree1c32182b0824882fc7088a5a4f4b4b4c31f42a3f /src/broadcom
parent28e3209985fc3c812cb0bd92b70d23abd6409190 (diff)
nir/scheduler: Add an option to specify what stages share memory for I/O
The scheduler has code to handle hardware that shares the same memory for inputs and outputs. Seeing as the specific stages that need this is probably hardware-dependent, this patch makes it a configurable option instead of hard-coding it to everything but fragment shaders. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5561>
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/compiler/vir.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index adfd587d534..4c9e99cfd77 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -1072,10 +1072,20 @@ uint64_t *v3d_compile(const struct v3d_compiler *compiler,
NIR_PASS_V(c->s, nir_lower_bool_to_int32);
NIR_PASS_V(c->s, nir_convert_from_ssa, true);
- /* Schedule for about half our register space, to enable more shaders
- * to hit 4 threads.
- */
- NIR_PASS_V(c->s, nir_schedule, 24);
+ static const struct nir_schedule_options schedule_options = {
+ /* Schedule for about half our register space, to enable more
+ * shaders to hit 4 threads.
+ */
+ .threshold = 24,
+
+ /* Vertex shaders share the same memory for inputs and outputs,
+ * fragement and geometry shaders do not.
+ */
+ .stages_with_shared_io_memory =
+ (((1 << MESA_ALL_SHADER_STAGES) - 1) &
+ ~(1 << MESA_SHADER_FRAGMENT)),
+ };
+ NIR_PASS_V(c->s, nir_schedule, &schedule_options);
v3d_nir_to_vir(c);