aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorTimur Kristóf <[email protected]>2020-02-27 20:05:16 +0100
committerMarge Bot <[email protected]>2020-03-11 08:34:11 +0000
commit4fe5eadfaeef515af11007d070df785be8831363 (patch)
tree322e526336b686fab9a0aed15b924d6b9e6e7a94 /src/amd/vulkan
parent926bdfae7dcc8bb0c3f5748b5563fb417cd6b5fe (diff)
radv: Enable ACO for TES when there is no GS.
Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_pipeline.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 2814798bff6..680cf932573 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2730,10 +2730,11 @@ void radv_stop_feedback(VkPipelineCreationFeedbackEXT *feedback, bool cache_hit)
}
static
-bool radv_aco_supported_stage(gl_shader_stage stage, bool has_ts)
+bool radv_aco_supported_stage(gl_shader_stage stage, bool has_ts, bool has_gs)
{
return stage == MESA_SHADER_VERTEX ||
stage == MESA_SHADER_TESS_CTRL ||
+ (stage == MESA_SHADER_TESS_EVAL && !has_gs) ||
(stage == MESA_SHADER_GEOMETRY && !has_ts) ||
stage == MESA_SHADER_FRAGMENT ||
stage == MESA_SHADER_COMPUTE;
@@ -2800,6 +2801,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
}
bool has_ts = modules[MESA_SHADER_TESS_CTRL] || modules[MESA_SHADER_TESS_EVAL];
+ bool has_gs = modules[MESA_SHADER_GEOMETRY];
bool use_aco = device->physical_device->use_aco;
for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) {
@@ -2810,7 +2812,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
radv_start_feedback(stage_feedbacks[i]);
- bool aco = use_aco && radv_aco_supported_stage(i, has_ts);
+ bool aco = use_aco && radv_aco_supported_stage(i, has_ts, has_gs);
nir[i] = radv_shader_compile_to_nir(device, modules[i],
stage ? stage->pName : "main", i,
stage ? stage->pSpecializationInfo : NULL,
@@ -2842,7 +2844,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
nir_lower_non_uniform_texture_access |
nir_lower_non_uniform_image_access);
- bool aco = use_aco && radv_aco_supported_stage(i, has_ts);
+ bool aco = use_aco && radv_aco_supported_stage(i, has_ts, has_gs);
if (!aco)
NIR_PASS_V(nir[i], nir_lower_bool_to_int32);
}
@@ -2922,7 +2924,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
if (!pipeline->shaders[MESA_SHADER_FRAGMENT]) {
radv_start_feedback(stage_feedbacks[MESA_SHADER_FRAGMENT]);
- bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_FRAGMENT, has_ts);
+ bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_FRAGMENT, has_ts, has_gs);
pipeline->shaders[MESA_SHADER_FRAGMENT] =
radv_shader_variant_compile(device, modules[MESA_SHADER_FRAGMENT], &nir[MESA_SHADER_FRAGMENT], 1,
pipeline->layout, keys + MESA_SHADER_FRAGMENT,
@@ -2942,7 +2944,7 @@ 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);
+ bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_TESS_CTRL, has_ts, has_gs);
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,
@@ -2962,7 +2964,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
radv_start_feedback(stage_feedbacks[MESA_SHADER_GEOMETRY]);
- bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_GEOMETRY, has_ts);
+ bool aco = use_aco && radv_aco_supported_stage(MESA_SHADER_GEOMETRY, has_ts, has_gs);
pipeline->shaders[MESA_SHADER_GEOMETRY] = radv_shader_variant_compile(device, modules[MESA_SHADER_GEOMETRY], combined_nir, 2,
pipeline->layout,
&keys[pre_stage], &infos[MESA_SHADER_GEOMETRY], keep_executable_info,
@@ -2985,7 +2987,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
radv_start_feedback(stage_feedbacks[i]);
- bool aco = use_aco && radv_aco_supported_stage(i, has_ts);
+ bool aco = use_aco && radv_aco_supported_stage(i, has_ts, has_gs);
pipeline->shaders[i] = radv_shader_variant_compile(device, modules[i], &nir[i], 1,
pipeline->layout,
keys + i, infos + i,keep_executable_info,