diff options
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index f69811559c1..4babb24a8eb 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3482,6 +3482,22 @@ radv_compute_vertex_input_state(struct radv_pipeline *pipeline, } } +static struct radv_shader_variant * +radv_pipeline_get_streamout_shader(struct radv_pipeline *pipeline) +{ + int i; + + for (i = MESA_SHADER_GEOMETRY; i >= MESA_SHADER_VERTEX; i--) { + struct radv_shader_variant *shader = + radv_get_shader(pipeline, i); + + if (shader && shader->info.info.so.num_outputs > 0) + return shader; + } + + return NULL; +} + static VkResult radv_pipeline_init(struct radv_pipeline *pipeline, struct radv_device *device, @@ -3597,6 +3613,9 @@ radv_pipeline_init(struct radv_pipeline *pipeline, pipeline->graphics.vtx_emit_num = 2; } + /* Find the last vertex shader stage that eventually uses streamout. */ + pipeline->streamout_shader = radv_pipeline_get_streamout_shader(pipeline); + result = radv_pipeline_scratch_init(device, pipeline); radv_pipeline_generate_pm4(pipeline, pCreateInfo, extra, &blend, &tess, &gs, prim, gs_out); |