[Mesa-dev] [PATCH V4 2/6] glsl: assign hidden uniforms their slot id earlier

Timothy Arceri t_arceri at yahoo.com.au
Sun Oct 11 00:20:33 PDT 2015


On Sat, 2015-10-10 at 18:06 +0200, Marek Olšák wrote:
> Hi Timothy,
> 
> One of these 3 commits breaks compilation for Talos shaders with
> gallium. My piglit patch "glsl-1.30/sampler-bug: ..." contains a
> minimal test case. I can't say which commit, because Mesa fails to
> build between them.
>  It has something to do with uniforms, structures,
> and samplers.
> 
> commit dcd9cd03837545055ce2a315e7e8840cc3254d1a
> Author: Timothy Arceri <t_arceri at yahoo.com.au>
> Date:   Sun Aug 30 12:50:34 2015 +1000
> 
>     glsl: store uniform slot id in var location field
> 

Hi Marek,

The piglit test passes on my intel based laptop I can't test on
anything else until later this week (as I'm traveling) but my guess is
its something to do with the above patch.

The other two patches shouldn't change anything for gallium drivers
"glsl: assign hidden uniforms their slot id earlier" just assigns
hidden uniforms their slot id earlier and there shouldn't be any
difference once the IR gets to glsl_to_tgsi.

Also "glsl: order indices for samplers inside a struct array" shouldn't
change things either as in your test the sampler are not inside the
struct.

There is some code in the glsl_to_tgsi pass that looks like the
location field would have always been -1 for uniforms other the UBO and
UBO members maybe this has something to do with the problem now that
all uniforms now get a non -1 value.

      case ir_var_uniform:
         entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
                                               var->data.location);
         this->variables.push_tail(entry);
         break;

I hope this helps get you started. If you haven't figured it out by
later in the week than I'll take a look on my desktop once I get home.

Tim

> ...
> commit 9788700caf61ff8beee5fd836f5efd98a931a976
> Author: Timothy Arceri <t_arceri at yahoo.com.au>
> Date:   Wed Sep 2 11:29:11 2015 +1000
> 
>     glsl: assign hidden uniforms their slot id earlier
> 
> ...
> commit 874a0217fd8bba83b0bc2448f5156fdb82f77d7c
> Author: Timothy Arceri <t_arceri at yahoo.com.au>
> Date:   Sun Aug 30 12:49:46 2015 +1000
> 
>     glsl: order indices for samplers inside a struct array
> 
> ...
> 
> Any idea?
> 
> Thanks,
> Marek
> 
> On Tue, Sep 15, 2015 at 9:51 AM, Timothy Arceri <
> t_arceri at yahoo.com.au> wrote:
> > This is required so that the next patch can safely assign the slot
> > id
> > to the var.
> > 
> > The ids are now assigned in the order we want before allocating
> > storage
> > so there is no need to sort the storage array and move things
> > around.
> > 
> > V2: rename variable to make code easier to follow as suggested by
> > Jason
> > 
> > Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
> > ---
> >  src/glsl/link_uniforms.cpp | 90 +++++++++++++++++++++-------------
> > ------------
> >  1 file changed, 41 insertions(+), 49 deletions(-)
> > 


More information about the mesa-dev mailing list