[Mesa-dev] [PATCH 13/13] i965/fs_visitor: do not explicitly set outputs[x].file

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 5 12:24:28 PST 2015


On 5 November 2015 at 19:15, Matt Turner <mattst88 at gmail.com> wrote:
> On Thu, Nov 5, 2015 at 8:18 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> From: Emil Velikov <emil.velikov at collabora.co.uk>
>>
>> This commits partially reverts "i965: Initialize registers' file to
>> BAD_FILE."
>>
>> No longer needed as of commit "i965/fs: properly construct fs_reg" which
>> removes the memset(...0...), and correctly sets BAD_FILE.
>
> I don't think the problem is that the constructors are doing the wrong
> thing by memsetting the object. The problem is that the constructor
> *isn't being called* :)
>
> fs_reg::init() indeed memsets, but it also sets file = BAD_FILE
> (today, and after my series).
>
> So I think the code you're removing is still needed because the
> problem of not calling the constructors remain.
>
> Maybe I've misunderstood something.
Afaict if one declares an array, the default ctor will be called for
each instance in the list.

Thus the BAD_FILE will be set. On the other hand - currently we zero
the whole lot (thanks to memset(this->outputs, 0...). Which might be
the prime suspect of the issue here.

The above is from my humble understanding of C++ plus a quick side
test. I will check if it holds true within mesa in a few minutes.

-Emil


More information about the mesa-dev mailing list