<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - nir clone test fails"
href="https://bugs.freedesktop.org/show_bug.cgi?id=98840#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - nir clone test fails"
href="https://bugs.freedesktop.org/show_bug.cgi?id=98840">bug 98840</a>
from <span class="vcard"><a class="email" href="mailto:t_arceri@yahoo.com.au" title="Timothy Arceri <t_arceri@yahoo.com.au>"> <span class="fn">Timothy Arceri</span></a>
</span></b>
<pre>(In reply to Jason Ekstrand from <a href="show_bug.cgi?id=98840#c1">comment #1</a>)
<span class="quote">> This is really Tim's bug. The problem occurred when he moved us to using
> nir_gather_info. When we start off, the nir_shader::info field points to
> gl_program::info. However, when the shader gets cloned, we ralloc a copy of
> the shader_info and copy the data into that and nir_shader::info no longer
> points to gl_program::info but points to a copy of the shader_info. With
> NIR_TEST_CLONE=1, nir_shader_gather_info gets run after some cloning has
> been done and so the copied shader_info is what gets filled out and
> gl_program::info gets left alone. One hack solution is to just do
> "prog->info = *nir->info" after we run nir_shader_gather_info, but I don't
> think this is a long-term solution.
>
> After going around in circles a bit, I think the answer is probably to make
> nir_shader::info an embedded struct again and not a pointer. Now that we
> use the same shader_info struct in gl_program as we do in nir_shader, we can
> easily pre-populate the one in nir_shader and, after we're done with our
> early NIR optimization and we've run nir_shader_gather_info, we copy it back.</span >
Wouldn't that just mean we would end up with:
"prog->info = nir->info"
rather than
"prog->info = *nir->info"
How is that any better?
I'll need to take a look at what NIR_TEST_CLONE=true is meant to do this is the
first time I've heard of it.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>