[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 14:48:29 PST 2015


On 5 November 2015 at 22:06, Matt Turner <mattst88 at gmail.com> wrote:
> On Thu, Nov 5, 2015 at 12:24 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> 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.
>
> Ah, yes. I believe you're right.
>
> In that case, the memset is just totally unnecessary, isn't it? Maybe
> I should just remove it in my patch directly?
After having a second look - yes. Removing the memset (and dropping
the BAD_FILE assignment) should work out nicely.
That is obviously only for the case in fs_visitor::init(). The rest
will still need the BAD_FILE treatment.

-Emil


More information about the mesa-dev mailing list