<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa glsl compiler crashes in "tropico 6" game on an assertion"
href="https://bugs.freedesktop.org/show_bug.cgi?id=111286#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa glsl compiler crashes in "tropico 6" game on an assertion"
href="https://bugs.freedesktop.org/show_bug.cgi?id=111286">bug 111286</a>
from <span class="vcard"><a class="email" href="mailto:andrey.simiklit.1989@gmail.com" title="andrii simiklit <andrey.simiklit.1989@gmail.com>"> <span class="fn">andrii simiklit</span></a>
</span></b>
<pre>So shader_test which could reproduce this issue is here:
<a href="https://gitlab.freedesktop.org/mesa/piglit/merge_requests/108">https://gitlab.freedesktop.org/mesa/piglit/merge_requests/108</a>
Suggested mesa fix:
<a href="https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1615">https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1615</a>
The problem happens when shader tries to copy some part of the array of inputs
to some temp array and then uses these temp array elements like here:
[fragment shader]
uniform int idx;
in vec4 vs_data[3];
out vec4 out_put;
void main()
{
vec4 temp[2];
temp[0] = vs_data[0];
temp[1] = vs_data[1];
temp[2] = vs_data[2];
out_put = temp[idx];
}
1. optimization find_array_copies creates a copy_deref for temp[*] = vs_data[*]
regardless that these arrays have different lengths.
2. nir_opt_copy_prop_vars tries to prevent copying and use the original array
instead and crashes here:
"assert(glsl_get_length(parent->type) ==
glsl_get_length(leader_parent->type));"
The crash call stack:
libc.so.6!__GI___assert_fail(...)
nir_build_deref_follower(...)
specialize_wildcards(...)
load_from_deref_entry_value(...)
try_load_from_entry(...)
copy_prop_vars_block(...)
copy_prop_vars_cf_node(...)
copy_prop_vars_cf_node(...)
nir_copy_prop_vars_impl(...)
nir_opt_copy_prop_vars(...)
brw_nir_optimize(...)
brw_preprocess_nir(...)
brw_create_nir(...)
brw_link_shader(...)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>