From 8e8701b43a0fc1997ecdb6a9557dd3e2c1a0d398 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 2 Sep 2020 10:13:16 -0500 Subject: [PATCH] intel/fs: Don't copy-propagate stride=0 sources into ddx/ddy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This can come up if, for instance, the shader does a derivative of a uniform or flat input. Ideally, NIR would use divergence analysis to get rid of the derivative in this case but it doesn't right now. This fixes a crash in F1 2017. Cc: mesa-stable@lists.freedesktop.org Reported-by: Marcin Ślusarz Tested-by: Marcin Ślusarz Reviewed-by: Matt Turner Part-of: --- src/intel/compiler/brw_fs_copy_propagation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index a33043573a5..31e55e64a27 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -524,7 +524,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) */ const unsigned entry_stride = (entry->src.file == FIXED_GRF ? 1 : entry->src.stride); - if (instruction_requires_packed_data(inst) && entry_stride > 1) + if (instruction_requires_packed_data(inst) && entry_stride != 1) return false; /* Bail if the result of composing both strides would exceed the -- 2.30.2