From e9797b648a0020f1d173ce7b8e483bc158d69a70 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 24 Apr 2022 17:03:42 +0200 Subject: [PATCH] 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: a4840e15ab77b44a72cabd7d503172e8357477eb r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled Signed-off-by: Gert Wollny Reviewed-by: Emma Anholt Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 4 +++- src/gallium/drivers/r600/ci/r600-turks-fails.txt | 9 --------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 8ddbf8a..4c3929e 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -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); diff --git a/src/gallium/drivers/r600/ci/r600-turks-fails.txt b/src/gallium/drivers/r600/ci/r600-turks-fails.txt index 399a4c2..d3a843c 100644 --- a/src/gallium/drivers/r600/ci/r600-turks-fails.txt +++ b/src/gallium/drivers/r600/ci/r600-turks-fails.txt @@ -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. -- 2.7.4