zink: always pass shader info to ntv

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
This commit is contained in:
Mike Blumenkrantz 2022-01-14 10:58:29 -05:00 committed by Marge Bot
parent 0af2b7740b
commit 60d0a0a8ce
3 changed files with 5 additions and 4 deletions

View file

@ -3781,7 +3781,7 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
}
if (sinfo)
if (sinfo->last_vertex)
emit_so_info(&ctx, sinfo, max_output + 1);
/* we have to reverse iterate to match what's done in zink_compiler.c */
@ -3941,7 +3941,7 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
emit_cf_list(&ctx, &entry->body);
/* vertex/tess shader emits copied xfb outputs at the end of the shader */
if (sinfo && (ctx.stage == MESA_SHADER_VERTEX || ctx.stage == MESA_SHADER_TESS_EVAL))
if (sinfo->last_vertex && (ctx.stage == MESA_SHADER_VERTEX || ctx.stage == MESA_SHADER_TESS_EVAL))
emit_so_outputs(&ctx, sinfo);
spirv_builder_return(&ctx.builder); // doesn't belong here, but whatevz

View file

@ -1086,7 +1086,7 @@ VkShaderModule
zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shader *base_nir, const struct zink_shader_key *key)
{
VkShaderModule mod = VK_NULL_HANDLE;
void *sinfo = NULL;
struct zink_shader_info *sinfo = &zs->sinfo;
nir_shader *nir = nir_shader_clone(NULL, base_nir);
bool need_optimize = false;
bool inlined_uniforms = false;
@ -1129,7 +1129,7 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shad
case MESA_SHADER_GEOMETRY:
if (zink_vs_key_base(key)->last_vertex_stage) {
if (zs->sinfo.have_xfb)
sinfo = &zs->sinfo;
sinfo->last_vertex = true;
if (!zink_vs_key_base(key)->clip_halfz) {
NIR_PASS_V(nir, nir_lower_clip_halfz);

View file

@ -54,6 +54,7 @@ struct tgsi_token;
struct zink_shader_info {
struct pipe_stream_output_info so_info;
unsigned so_info_slots[PIPE_MAX_SO_OUTPUTS];
bool last_vertex;
bool have_xfb;
};