summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-01-08 11:55:31 -0800
committerEric Anholt <[email protected]>2018-01-12 21:55:30 -0800
commit90269ba353333be13e54549ecff3adb8803661db (patch)
tree228c677b3b355ea9e0dee929e6ed8d0afb85dd0c /src/gallium/drivers/vc5/vc5_draw.c
parent86a12b4d5a49c68f4613513d2846c5eb8e56a677 (diff)
broadcom/vc5: Use THRSW to enable multi-threaded shaders.
This is a major performance boost on all of V3D, but is required on V3D 4.x where shaders are always either 2- or 4-threaded.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_draw.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_draw.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c
index 95a857f1abc..39378280823 100644
--- a/src/gallium/drivers/vc5/vc5_draw.c
+++ b/src/gallium/drivers/vc5/vc5_draw.c
@@ -209,9 +209,32 @@ vc5_emit_gl_shader_state(struct vc5_context *vc5,
shader.fragment_shader_uniforms_address = fs_uniforms;
#if V3D_VERSION >= 41
- shader.coordinate_shader_start_in_final_thread_section = true;
- shader.vertex_shader_start_in_final_thread_section = true;
- shader.fragment_shader_start_in_final_thread_section = true;
+ shader.coordinate_shader_4_way_threadable =
+ vc5->prog.cs->prog_data.vs->base.threads == 4;
+ shader.vertex_shader_4_way_threadable =
+ vc5->prog.vs->prog_data.vs->base.threads == 4;
+ shader.fragment_shader_4_way_threadable =
+ vc5->prog.fs->prog_data.fs->base.threads == 4;
+
+ shader.coordinate_shader_start_in_final_thread_section =
+ vc5->prog.cs->prog_data.vs->base.single_seg;
+ shader.vertex_shader_start_in_final_thread_section =
+ vc5->prog.vs->prog_data.vs->base.single_seg;
+ shader.fragment_shader_start_in_final_thread_section =
+ vc5->prog.fs->prog_data.fs->base.single_seg;
+#else
+ shader.coordinate_shader_4_way_threadable =
+ vc5->prog.cs->prog_data.vs->base.threads == 4;
+ shader.coordinate_shader_2_way_threadable =
+ vc5->prog.cs->prog_data.vs->base.threads == 2;
+ shader.vertex_shader_4_way_threadable =
+ vc5->prog.vs->prog_data.vs->base.threads == 4;
+ shader.vertex_shader_2_way_threadable =
+ vc5->prog.vs->prog_data.vs->base.threads == 2;
+ shader.fragment_shader_4_way_threadable =
+ vc5->prog.fs->prog_data.fs->base.threads == 4;
+ shader.fragment_shader_2_way_threadable =
+ vc5->prog.fs->prog_data.fs->base.threads == 2;
#endif
shader.vertex_id_read_by_coordinate_shader =