ntt: remove dead input variables before lowering FS IO

Because for fragment shaders we still use the variables, and
lower_io_to_vector may leave dead variables that duplicate inputs
that are now vectorized, we have to call this pass, because otherwise
we will may hit the assertion

src/gallium/auxiliary/tgsi/tgsi_ureg.c:318:
  ureg_DECL_fs_input_centroid_layout:
   Assertion `(ureg->input[i].usage_mask & usage_mask) == 0'

This is relevant for
  spec@arb_enhanced_layouts@execution@component-layout@*
on r600/ntt

Fixes: a4840e15ab
  r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16130>
This commit is contained in:
Gert Wollny 2022-04-24 17:03:42 +02:00 committed by Marge Bot
parent 47d3f7c69f
commit e9797b648a
2 changed files with 3 additions and 10 deletions

View File

@ -3752,8 +3752,10 @@ const void *nir_to_tgsi_options(struct nir_shader *s,
* corresponding splitting, and virgl depends on TGSI across link boundaries
* having matching declarations.
*/
if (s->info.stage == MESA_SHADER_FRAGMENT)
if (s->info.stage == MESA_SHADER_FRAGMENT) {
NIR_PASS_V(s, nir_lower_indirect_derefs, nir_var_shader_in, UINT32_MAX);
NIR_PASS_V(s, nir_remove_dead_variables, nir_var_shader_in, NULL);
}
NIR_PASS_V(s, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
type_size, (nir_lower_io_options)0);

View File

@ -768,15 +768,6 @@ spec@arb_depth_buffer_float@fbo-clear-formats stencil@GL_DEPTH32F_STENCIL8,Fail
spec@arb_draw_indirect@gl_vertexid used with gldrawarraysindirect,Fail
spec@arb_draw_indirect@gl_vertexid used with gldrawelementsindirect,Fail
# "ureg_DECL_fs_input_centroid_layout: Assertion `(ureg->input[i].usage_mask & usage_mask) == 0' failed."
spec@arb_enhanced_layouts@execution@component-layout@sso-vs-gs-fs-array-interleave,Crash
spec@arb_enhanced_layouts@execution@component-layout@tcs-tes-fs-array-with-non-array-interleave,Crash
spec@arb_enhanced_layouts@execution@component-layout@vs-tcs-tes-fs-array-interleave,Crash
spec@arb_enhanced_layouts@execution@component-layout@vs-tcs-tes-fs-ifc-array-interleave,Crash
spec@arb_enhanced_layouts@execution@component-layout@vs-tcs-tes-fs-patch-array-interleave,Crash
spec@arb_enhanced_layouts@execution@component-layout@vs-to-fs-array-interleave,Crash
# " intrinsic copy_deref (ssa_2, ssa_3) (dst_access=0, src_access=0)
# error: glsl_get_bare_type(dst->type) == glsl_get_bare_type(src->type) (../src/compiler/nir/nir_validate.c:643)"
# since ntt copy-deref optimization, probably.