Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Connor Abbott
On Sat, Jun 27, 2015 at 11:39 AM, Rob Clark wrote: > On Sat, Jun 27, 2015 at 12:57 PM, Connor Abbott wrote: >> On Sat, Jun 27, 2015 at 6:48 AM, Rob Clark wrote: >>> I had a quick look at enabling this for freedreno.. although looks >>> like it is going to take some work in tgsi_to_nir and/or nir

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Rob Clark
On Sat, Jun 27, 2015 at 12:57 PM, Connor Abbott wrote: > On Sat, Jun 27, 2015 at 6:48 AM, Rob Clark wrote: >> I had a quick look at enabling this for freedreno.. although looks >> like it is going to take some work in tgsi_to_nir and/or nir.. the >> problem is we end up w/ a register array (rathe

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Connor Abbott
On Sat, Jun 27, 2015 at 6:48 AM, Rob Clark wrote: > I had a quick look at enabling this for freedreno.. although looks > like it is going to take some work in tgsi_to_nir and/or nir.. the > problem is we end up w/ a register array (rather than variable array > like we do for TEMP arrays).. ie. for

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Rob Clark
I had a quick look at enabling this for freedreno.. although looks like it is going to take some work in tgsi_to_nir and/or nir.. the problem is we end up w/ a register array (rather than variable array like we do for TEMP arrays).. ie. for something copying from a TEMP array to an OUT array, we en

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-25 Thread Rob Clark
hmm, well I still think tgsi.rst should get some clarification, if for no other reason than I misunderstood it (and therefore sooner or later I guess someone else will too).. I can take a shot at a doc patch.. BR, -R On Thu, Jun 25, 2015 at 8:00 AM, Marek Olšák wrote: > This documentation was o

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-25 Thread Marek Olšák
This documentation was only written for TEMPs. I agree that TEMP indexing doesn't necessarily need arrays to work, but INPUT and OUTPUT indexing always needs them. Marek On Thu, Jun 25, 2015 at 1:31 AM, Rob Clark wrote: > tgsi.rst currently says: > > > If no ArrayID is specified with an ind

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Marek Olšák
Hi, The ARB asm programs only allow indirect addressing into the constant buffer. Only GLSL allows indirect addressing everywhere and GLSL-to-TGSI already generates proper array declarations, so we should be fine. I think we can just assume that indirect addressing into TEMP, INPUT, or OUTPUT wi

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Rob Clark
I'd be a big fan of letting it go.. if needed for old ARB shader stuff we can give entire IN/OUT file ArrayID==1.. if someone points me in the right direction I don't mind going and poking at it since the whole assuming-the-worst thing if ArrayID==0 is not so nice for register allocation.. BR, -R

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Roland Scheidegger
I thought this was needed by something in the gl state tracker. relative addressing with ARB_vp maybe, can't remember... I dunno if all places where this is used are fixed up it can go. Roland Am 25.06.2015 um 01:31 schrieb Rob Clark: > tgsi.rst currently says: > > > If no ArrayID is speci

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Rob Clark
tgsi.rst currently says: If no ArrayID is specified with an indirect addressing operand the whole register file might be accessed by this operand. This is strongly discouraged and will prevent packing of scalar/vec2 arrays and effective alias analysis. I'd be pretty happy to remove it a

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Marek Olšák
Indirect addressing without the ArrayID is undefined in the general case. You need the ArrayID to be able to tell where the array declaration starts and what its semantic name is. Marek On Wed, Jun 24, 2015 at 8:35 PM, Rob Clark wrote: > On Wed, Jun 24, 2015 at 12:31 PM, Marek Olšák wrote: >> Y

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Rob Clark
On Wed, Jun 24, 2015 at 12:31 PM, Marek Olšák wrote: > Yes, ArrayID != 0 means it's an array, otherwise it's just a compact > way to add declarations. ok.. hmm, I guess tgsi.rst needs an update then.. > I recently added the array support for inputs and outputs, we just > need to enable it on non

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Marek Olšák
Yes, ArrayID != 0 means it's an array, otherwise it's just a compact way to add declarations. I recently added the array support for inputs and outputs, we just need to enable it on non-radeon non-swrast drivers: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6ebe7eabf54936a02acc0968e718e0c264a

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Rob Clark
Ok, I *thought* we didn't get ArrayID on IN/OUT, but only TEMP? If it is safe to assume that we always get ArrayID that makes it much easier. BR, -R On Wed, Jun 24, 2015 at 5:39 AM, Marek Olšák wrote: > It's not an array, because the ArrayID is 0. It's a valid non-array > declaration. If any TG

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-24 Thread Marek Olšák
It's not an array, because the ArrayID is 0. It's a valid non-array declaration. If any TGSI user doesn't understand it, that user should be fixed. Marek On Tue, Jun 23, 2015 at 3:20 PM, Rob Clark wrote: > From: Rob Clark > > Ok, so actually there is a ttn issue here to fix as well.. but it > b