[Mesa-dev] [PATCH v3 2/10] glsl: keep track of ssbo variable being accessed, add access params
Iago Toral
itoral at igalia.com
Sun Jan 24 23:38:52 PST 2016
On Sun, 2016-01-24 at 11:46 -0500, Ilia Mirkin wrote:
> On Thu, Jan 21, 2016 at 3:27 AM, Iago Toral <itoral at igalia.com> wrote:
> >> *offset = new(mem_ctx) ir_constant(0u);
> >> *row_major = is_dereferenced_thing_row_major(deref);
> >> *matrix_columns = 1;
> >> + if (struct_field)
> >> + *struct_field = NULL;
> >
> > Not sure how I feel about this... I think I'd rather initialize
> > struct_field to NULL in lower_ubo_reference and let this function assign
> > a value only if there is one to assign.
>
> I think it's a nice guarantee to make that this function will have set
> the pointer 100% of the time (if provided). However I'm also happy to
> move the assignment into the only call site that passes the
> struct_field in.
I think I would still prefer the initialization in the class constructor
since that ensures that any non-NULL asserts we add for this will be
useful independently of how the code changes in the future, but it is
not a big deal, so feel free to ignore this. If you rather not
initialize this in the constructor then I think I prefer this initilized
inside the function as you have it now.
Iago
More information about the mesa-dev
mailing list