radv: Enable ACO for tessellation control shaders.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 26 Feb 2020 17:31:34 +0000 (18:31 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 08:34:10 +0000 (08:34 +0000)
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>

src/amd/vulkan/radv_pipeline.c

index 8055ee95568e38ae7e629402eda0adcc593ba539..2814798bff6cba89eacd5589b9a344072f1ddba5 100644 (file)
@@ -2732,7 +2732,8 @@ void radv_stop_feedback(VkPipelineCreationFeedbackEXT *feedback, bool cache_hit)
 static
 bool radv_aco_supported_stage(gl_shader_stage stage, bool has_ts)
 {
-       return (stage == MESA_SHADER_VERTEX && !has_ts) ||
+       return stage == MESA_SHADER_VERTEX ||
+              stage == MESA_SHADER_TESS_CTRL ||
               (stage == MESA_SHADER_GEOMETRY && !has_ts) ||
               stage == MESA_SHADER_FRAGMENT ||
               stage == MESA_SHADER_COMPUTE;
@@ -2941,10 +2942,11 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 
                        radv_start_feedback(stage_feedbacks[MESA_SHADER_TESS_CTRL]);
 
+                       bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_TESS_CTRL, has_ts);
                        pipeline->shaders[MESA_SHADER_TESS_CTRL] = radv_shader_variant_compile(device, modules[MESA_SHADER_TESS_CTRL], combined_nir, 2,
                                                                                              pipeline->layout,
                                                                                              &key, &infos[MESA_SHADER_TESS_CTRL], keep_executable_info,
-                                                                                             false, &binaries[MESA_SHADER_TESS_CTRL]);
+                                                                                             aco, &binaries[MESA_SHADER_TESS_CTRL]);
 
                        radv_stop_feedback(stage_feedbacks[MESA_SHADER_TESS_CTRL], false);
                }