turnip: Populate tu_pipeline.active_stages
authorBrian Ho <brian@brkho.com>
Mon, 6 Apr 2020 20:38:04 +0000 (13:38 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Apr 2020 14:13:20 +0000 (14:13 +0000)
This can be used to determine if the pipeline has a specific shader
stage (e.g. geometry shader).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4436>

src/freedreno/vulkan/tu_pipeline.c

index ac02e66590b348d4fde38f1655326705537a68d1..816b3de5c324b1bef08e505b19a637740690aae3 100644 (file)
@@ -1980,6 +1980,12 @@ tu_pipeline_builder_parse_shader_stages(struct tu_pipeline_builder *builder,
    pipeline->program.binning_state_ib =
       tu_cs_end_sub_stream(&pipeline->cs, &prog_cs);
 
+   VkShaderStageFlags stages = 0;
+   for (unsigned i = 0; i < builder->create_info->stageCount; i++) {
+      stages |= builder->create_info->pStages[i].stage;
+   }
+   pipeline->active_stages = stages;
+
    for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
       if (!builder->shaders[i])
          continue;