radv: do not remove PSIZ for streamout shaders

It might still be read later from the streamout buffer.

Fixes a regression with
ext_transform_feedback-builtin-varyings gl_PointSize and Zink.

Fixes: 92e1981a80 ("radv: Remove PSIZ output when it isn't needed.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13413>
This commit is contained in:
Samuel Pitoiset
2021-10-18 17:30:46 +02:00
committed by Marge Bot
parent 60b7c3a0f4
commit 19c91a120d

View File

@@ -2285,6 +2285,16 @@ get_vs_output_info(const struct radv_pipeline *pipeline)
return &pipeline->shaders[MESA_SHADER_VERTEX]->info.vs.outinfo; return &pipeline->shaders[MESA_SHADER_VERTEX]->info.vs.outinfo;
} }
static bool
radv_nir_stage_uses_xfb(const nir_shader *nir)
{
nir_xfb_info *xfb = nir_gather_xfb_info(nir, NULL);
bool uses_xfb = !!xfb;
ralloc_free(xfb);
return uses_xfb;
}
static void static void
radv_link_shaders(struct radv_pipeline *pipeline, radv_link_shaders(struct radv_pipeline *pipeline,
const struct radv_pipeline_key *pipeline_key, const struct radv_pipeline_key *pipeline_key,
@@ -2372,7 +2382,9 @@ radv_link_shaders(struct radv_pipeline *pipeline,
} }
} }
if (!optimize_conservatively) { bool uses_xfb = pipeline->graphics.last_vgt_api_stage != -1 &&
radv_nir_stage_uses_xfb(shaders[pipeline->graphics.last_vgt_api_stage]);
if (!uses_xfb && !optimize_conservatively) {
/* Remove PSIZ from shaders when it's not needed. /* Remove PSIZ from shaders when it's not needed.
* This is typically produced by translation layers like Zink or D9VK. * This is typically produced by translation layers like Zink or D9VK.
*/ */
@@ -2703,16 +2715,6 @@ radv_generate_graphics_pipeline_key(const struct radv_pipeline *pipeline,
return key; return key;
} }
static bool
radv_nir_stage_uses_xfb(const nir_shader *nir)
{
nir_xfb_info *xfb = nir_gather_xfb_info(nir, NULL);
bool uses_xfb = !!xfb;
ralloc_free(xfb);
return uses_xfb;
}
static uint8_t static uint8_t
radv_get_wave_size(struct radv_device *device, const VkPipelineShaderStageCreateInfo *pStage, radv_get_wave_size(struct radv_device *device, const VkPipelineShaderStageCreateInfo *pStage,
gl_shader_stage stage, const struct radv_shader_info *info) gl_shader_stage stage, const struct radv_shader_info *info)