[Mesa-dev] [PATCH 2/6] mesa/st/glsl_to_tgsi: Correct debug output for indirect access

Gert Wollny gw.fossdev at gmail.com
Tue Oct 10 11:15:32 UTC 2017


> > +   os << "[";
> > +   if (reg.reladdr)
> > +      os << *reg.reladdr << "+";
> > +   if (reg.reladdr2)
> > +      os << *reg.reladdr2 << "+";
> 
> This isn't how that works. reladdr2 is the relative address for 2D 
> register accesses; see has_index2 and index2D.

Actually, I don't like this part of the dump at all: it is not known
from the register information I can access here whether an address 
which address register index goes where and if an address register is
used at all. - and documentation on the issue is also very sparse. From
the code accessing has_index2 I figured that the dump should look
something like this: ? 

template <typename st_reg>
void dump_reg_access(std::ostream& os, const st_reg& reg)
{
   os << tgsi_file_names[reg.file];
   if (reg.file == PROGRAM_ARRAY)
      os << "(" << reg.array_id << ")";

   os << "[";
   if (reg.reladdr)
      os << *reg.reladdr << "+";
   os << reg.index << "]";

   if (reg.has_index2) {
      os << "[";
      if (reg.reladdr2)
         os << *reg.reladdr2 << "+";
      os << reg.index2D << "]";
   }
}


> 
> Besides, you're not actually printing reg.index.
> 
> Same for when you're printing the destination.

This I was already about to fix. 

Many thanks for you comments (also the other ones). 

Best, 
Gert




More information about the mesa-dev mailing list