From 456543e6d857bccc0165475cd684fed3a69d9bf4 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 19 Sep 2022 14:24:32 +0200 Subject: [PATCH] radv: determine the last VGT api stage from the active_stages bitfield MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With GPL, we can get binaries from libs directly, so this would fail. Signed-off-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Part-of: --- src/amd/vulkan/radv_pipeline.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 3ee8c5f0712..06b925238d9 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3962,12 +3962,13 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout radv_pipeline_load_retained_shaders(pipeline, stages); - for (unsigned s = 0; s < MESA_VULKAN_SHADER_STAGES; s++) { - if (!stages[s].entrypoint) - continue; + if (pipeline->type == RADV_PIPELINE_GRAPHICS) { + struct radv_graphics_pipeline *graphics_pipeline = radv_pipeline_to_graphics(pipeline); - if (stages[s].stage < MESA_SHADER_FRAGMENT || stages[s].stage == MESA_SHADER_MESH) - *last_vgt_api_stage = stages[s].stage; + radv_foreach_stage(s, graphics_pipeline->active_stages) { + if (s < MESA_SHADER_FRAGMENT || s == MESA_SHADER_MESH) + *last_vgt_api_stage = s; + } } ASSERTED bool primitive_shading =