From 90269ba353333be13e54549ecff3adb8803661db Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Jan 2018 11:55:31 -0800 Subject: 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. --- src/gallium/drivers/vc5/vc5_draw.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/vc5/vc5_draw.c') 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 = -- cgit v1.2.3