[Mesa-dev] [PATCH 20/21] intel/compiler: Allocate pull_param in assign_constant_locations

Jason Ekstrand jason at jlekstrand.net
Fri Oct 6 17:16:02 UTC 2017


On Fri, Oct 6, 2017 at 9:40 AM, Jordan Justen <jordan.l.justen at intel.com>
wrote:

> On 2017-09-29 14:25:20, Jason Ekstrand wrote:
> > diff --git a/src/intel/compiler/brw_vec4_visitor.cpp
> b/src/intel/compiler/brw_vec4_visitor.cpp
> > index ff5cd2d..ae51619 100644
> > --- a/src/intel/compiler/brw_vec4_visitor.cpp
> > +++ b/src/intel/compiler/brw_vec4_visitor.cpp
> > @@ -1782,6 +1782,11 @@ vec4_visitor::move_uniform_array_access_to_pull_
> constants()
> >        return;
> >     }
> >
> > +   /* Allocate the pull_params array */
> > +   assert(stage_prog_data->nr_pull_params == 0);
> > +   stage_prog_data->pull_param = ralloc_array(mem_ctx, uint32_t,
> > +                                              this->uniforms * 4);
>
> Why allocate this based on this->uniforms if nr_pull_params is 0?
>

At this point in the function nr_pull_params is always 0.  It gets assigned
later on in the function but we know that it will be <= uniforms * 4.

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171006/133b3aa8/attachment-0001.html>


More information about the mesa-dev mailing list