[Mesa-dev] [PATCH v2 118.5/133] nir/tex_instr_create: Initialize all 4 sources

Connor Abbott cwabbott0 at gmail.com
Fri Jan 9 14:48:28 PST 2015


On Fri, Jan 9, 2015 at 5:41 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
>
> On Fri, Jan 9, 2015 at 11:34 AM, Connor Abbott <cwabbott0 at gmail.com> wrote:
>>
>> BTW, now that we're adding an extra possible source, do we need to
>> expand the size of the source array?
>
>
> I don't know that we've added anything that wasn't there before.  Then
> again, it's not documented how you came to the number 4.  Also, I came to
> the conclusion that I don't like this patch anyway, so I'll probably drop it
> in favor of just memsetting the source to 0.

Yeah, I don't remember where the 4 came from unfortunately... since I
made this mess, I'll do some digging to see how many sources we
actually need.

>
>>
>>
>> Anyways,
>> Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
>>
>> On Wed, Jan 7, 2015 at 9:03 PM, Jason Ekstrand <jason at jlekstrand.net>
>> wrote:
>> > This helps a lot with things like lowering passes that may need to add
>> > sources.
>> > ---
>> >  src/glsl/nir/nir.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
>> > index 9b99c9e..c8d354d 100644
>> > --- a/src/glsl/nir/nir.c
>> > +++ b/src/glsl/nir/nir.c
>> > @@ -458,7 +458,7 @@ nir_tex_instr_create(void *mem_ctx, unsigned
>> > num_srcs)
>> >     dest_init(&instr->dest);
>> >
>> >     instr->num_srcs = num_srcs;
>> > -   for (unsigned i = 0; i < num_srcs; i++)
>> > +   for (unsigned i = 0; i < 4; i++)
>> >        src_init(&instr->src[i]);
>> >
>> >     instr->has_predicate = false;
>> > --
>> > 2.2.0
>> >
>> > _______________________________________________
>> > mesa-dev mailing list
>> > mesa-dev at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>


More information about the mesa-dev mailing list